Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
receive service address from node
  • Loading branch information
fbsdeploy committed Jan 22, 2019
1 parent 15a4422 commit fa5c514
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For using resolving endpoints from your [Hashicorp Consul](https://www.consul.io
For full example see [this section](#example)

## Connection string
`consul://[user:password@]127.0.0.127:8555/my-service?[healthy=]&[wait=]&[near=]&[insecure=]&[limit=]&[tag=]`
`consul://[user:password@]127.0.0.127:8555/my-service?[healthy=]&[wait=]&[near=]&[insecure=]&[limit=]&[tag=]&[token=]`

*Parameters:*

Expand All @@ -24,6 +24,7 @@ For full example see [this section](#example)
| near | string | Sort endpoints by response duration. Can be efficient combine with `limit` parameter default: "_agent" |
| limit | int | Limit number of endpoints for the service. Default: no limit |
| timeout | as in time.ParseDuration | Http-client timeout. Default: 60s |
| token | string | Consul token |

## Example
```go
Expand Down
2 changes: 1 addition & 1 deletion consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func watchConsulService(ctx context.Context, s servicer, tgt target, out chan<-

ee := make([]string, 0, len(ss))
for _, s := range ss {
ee = append(ee, fmt.Sprintf("%s:%d", s.Service.Address, s.Service.Port))
ee = append(ee, fmt.Sprintf("%s:%d", s.Node.Address, s.Service.Port))
}
if tgt.Limit != 0 && len(ee) > tgt.Limit {
ee = ee[:tgt.Limit]
Expand Down

0 comments on commit fa5c514

Please sign in to comment.