Documentation ¶
Overview ¶
Package gossip provides a gossip register based on hashicorp/memberlist
Index ¶
- Variables
- func Address(a string) register.Option
- func Advertise(a string) register.Option
- func Config(c *memberlist.Config) register.Option
- func ConnectRetry(v bool) register.Option
- func ConnectTimeout(td time.Duration) register.Option
- func NewRegister(opts ...register.Option) register.Register
- func Secret(k []byte) register.Option
Constants ¶
This section is empty.
Variables ¶
View Source
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 register.RegisterTTL MaxPacketSize = 512 )
View Source
var (
ErrNotConnected = errors.New("register not connected")
)
Functions ¶
func Config ¶
func Config(c *memberlist.Config) register.Option
Config sets *memberlist.Config for configuring gossip
func ConnectRetry ¶
ConnectRetry enables reconnect to register then connection closed, use with ConnectTimeout to specify how long retry
func ConnectTimeout ¶
ConnectTimeout sets the register connect timeout. Use -1 to specify infinite timeout
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.