README
¶
Gossip Registry
Gossip is a zero dependency registry which uses github.com/hashicorp/memberlist to broadcast registry information via the SWIM protocol.
Usage
Start with the registry flag or env var
MICRO_REGISTRY=gossip go run service.go
On startup you'll see something like
2018/12/06 18:17:48 Registry Listening on 192.168.1.65:56390
To join this gossip ring set the registry address using flag or env var
MICRO_REGISTRY_ADDRESS=192.168.1.65:56390
Documentation
¶
Overview ¶
Package gossip provides a gossip registry based on hashicorp/memberlist
Index ¶
- Variables
- func Address(a string) registry.Option
- func Advertise(a string) registry.Option
- func Config(c *memberlist.Config) registry.Option
- func ConnectRetry(v bool) registry.Option
- func ConnectTimeout(td time.Duration) registry.Option
- func NewRegistry(opts ...registry.Option) registry.Registry
- func Secret(k []byte) registry.Option
Constants ¶
This section is empty.
Variables ¶
var ( // You should change this if using secure DefaultSecret = []byte("micro-gossip-key") // exactly 16 bytes ExpiryTick = time.Second * 1 // needs to be smaller than registry.RegisterTTL MaxPacketSize = 512 )
Functions ¶
func Advertise ¶ added in v1.5.2
The address to advertise for other gossip members to connect to - host:port
func Config ¶ added in v1.5.2
func Config(c *memberlist.Config) registry.Option
Config sets *memberlist.Config for configuring gossip
func ConnectRetry ¶ added in v1.5.2
ConnectRetry enables reconnect to registry then connection closed, use with ConnectTimeout to specify how long retry
func ConnectTimeout ¶ added in v1.5.2
ConnectTimeout sets the registry connect timeout. Use -1 to specify infinite timeout
Types ¶
This section is empty.