gossip

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package gossip provides a gossip registry based on hashicorp/memberlist

Index

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 registry.RegisterTTL
	MaxPacketSize = 512
)

Functions

func Address

func Address(a string) registry.Opt

Address to bind to - host:port

func Advertise(a string) registry.Opt

The address to advertise for other gossip members to connect to - host:port

func Config

func Config(c *memberlist.Config) registry.Opt

Config sets *memberlist.Config for configuring gossip

func ConnectRetry

func ConnectRetry(v bool) registry.Opt

ConnectRetry enables reconnect to registry then connection closed, use with ConnectTimeout to specify how long retry

func ConnectTimeout

func ConnectTimeout(td time.Duration) registry.Opt

ConnectTimeout sets the registry connect timeout. Use -1 to specify infinite timeout

func NewRegistry

func NewRegistry(opts registry.Cfg) registry.Registry

func Secret

func Secret(k []byte) registry.Opt

Secret specifies an encryption key. The value should be either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.

Types

type Cfg added in v0.0.3

type Cfg struct {
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL