kring

package module
v0.0.0-...-05ced28 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Options
	Members *Memberlist
}

func NewClient

func NewClient(opts ...OptFunc) (*Client, error)

type Delegate

type Delegate struct {
	HealthChecks []HealthCheck
}

func (*Delegate) GetBroadcasts

func (d *Delegate) GetBroadcasts(overhead, limit int) [][]byte

func (*Delegate) LocalState

func (d *Delegate) LocalState(join bool) []byte

func (*Delegate) MergeRemoteState

func (d *Delegate) MergeRemoteState(buf []byte, join bool)

func (*Delegate) NodeMeta

func (d *Delegate) NodeMeta(limit int) []byte

func (*Delegate) NotifyMsg

func (d *Delegate) NotifyMsg(buf []byte)

type HealthCheck

type HealthCheck struct {
	Name string
	OK   bool
}

type Memberlist

type Memberlist memberlist.Memberlist

func StartGossip

func StartGossip(options *Options) (*Memberlist, error)

type MemberlistConfig

type MemberlistConfig memberlist.Config

type OptFunc

type OptFunc func(*Options)

func WithServiceName

func WithServiceName(serviceName string) OptFunc

type Options

type Options struct {
	// Current nodes name.
	// If not specified defaults to current IP of the pod.
	// If could not detect current IP, it will use hostname
	Name string
	// Open port for broadcasting and advertising.
	// If not specified an available port will be chosen
	Port int
	// Kubernetes headless service config
	KubeHeadlessServiceURL string
	Memberlist             MemberlistConfig
}

Jump to

Keyboard shortcuts

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