Skip to content

Commit

Permalink
improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Menno Pruijssers committed Dec 14, 2016
1 parent c52f066 commit 38aa51e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,14 @@ func Statter(s log.StatsReporter) Option {
}
}

// Identity is used to specify an identity as this Ringpop instance's identity.
// Since a ringpop instance is by default identified by its hostport, it's not allowed to manually specify a
// hostport as its identity.
// Identity can be used to specify a custom string as the unique identifier for
// this node. The identity should be unique amongst other Ringpop instances; it
// is used in the hashring.
//
// By default, the hostport/address of the node is used as the identity in the
// hashring. An error is thrown if a hostport is manually specified using this
// option, as this would lead to unexpected behaviour. If you want to override
// the node's listening address, use the `Address` option.
func Identity(identity string) Option {
return func(r *Ringpop) error {
if util.HostportPattern.MatchString(identity) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/testpop/testpop.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var (
faultyPeriod = flag.Int("faulty-period", 24*60*60*1000, "The lifetime of a faulty member in ms. After that the member becomes a tombstone.")
tombstonePeriod = flag.Int("tombstone-period", 5000, "The lifetime of a tombstone member in ms. After that the member is removed from the membership.")

identity = flag.String("identity", "", "specify an identity")
identity = flag.String("identity", "", "specify an identity for this node in the hashring.")

hostportPattern = regexp.MustCompile(`^(\d+.\d+.\d+.\d+):\d+$`)
)
Expand Down

0 comments on commit 38aa51e

Please sign in to comment.