Skip to content

Commit

Permalink
Merge pull request #9 from pgermishuys/readme-update
Browse files Browse the repository at this point in the history
Remove Static Endpoint Discoverer
  • Loading branch information
pgermishuys committed Mar 28, 2017
2 parents 244f332 + 111b76a commit d154984
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,29 @@ GOES is an Event Store golang TCP Library for [Go](https://golang.org).

## Create a configuration that will be used to describe how to connect to Event Store
```Go
config := goes.NewConfiguration()
config.Login = "admin"
config.Password = "changeit"
//setup a discoverer for a single node
discoverer := goes.StaticEndpointDiscoverer{
IPAddress: "127.0.0.1",
Port: 1113,
//connect to a single node
config := &goes.Configuration{
ReconnectionDelay: 10000,
MaxReconnects: 10,
MaxOperationRetries: 10,
Address: "127.0.0.1",
Port: 1113,
Login: "admin",
Password: "changeit",
}

//or a cluster via gossip seeds
discoverer = goes.GossipEndpointDiscoverer{
MaxDiscoverAttempts: 10,
GossipSeeds: []string{"http://127.0.0.1:2113", "http://127.0.0.1:1113"},
config := &goes.Configuration{
ReconnectionDelay: 10000,
MaxReconnects: 10,
MaxOperationRetries: 10,
Login: "admin",
Password: "changeit",
EndpointDiscoverer: discoverer = goes.GossipEndpointDiscoverer{
MaxDiscoverAttempts: 10,
GossipSeeds: []string{"http://127.0.0.1:2113", "http://127.0.0.1:1113"},
}
}
config.EndpointDiscoverer = discoverer.Discover
```

## Connect to Event Store
Expand Down

0 comments on commit d154984

Please sign in to comment.