gossip

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStore added in v1.2.0

type BaseStore[K comparable] struct {
	// contains filtered or unexported fields
}

func (*BaseStore[K]) AddItem added in v1.2.0

func (s *BaseStore[K]) AddItem(item gossip.CommonItem)

AddItem implements the client.KeyRouter interface.

func (*BaseStore[K]) Data added in v1.2.0

func (s *BaseStore[K]) Data(limit int) ([]gossip.CommonItem, int)

Data implements the Module interface.

func (*BaseStore[K]) Target added in v1.2.0

func (s *BaseStore[K]) Target(k K) string

Target implements the client.KeyRouter interface.

type Module added in v1.2.0

type Module interface {
	// Data returns all data that need to send to other nodes.
	// The second return value is the left size of the limit size.
	Data(limit int) ([]gossip.GossipData, int)
}

type Node

type Node struct {
	// contains filtered or unexported fields
}

func NewNode

func NewNode(ctx context.Context, nid string, opts ...Option) (*Node, error)

func (*Node) Create

func (n *Node) Create() error

func (*Node) Created

func (n *Node) Created() bool

func (*Node) DistKeyCacheGetter

func (n *Node) DistKeyCacheGetter() fileservice.KeyRouterFactory[query.CacheKey]

func (*Node) Join

func (n *Node) Join(existing []string) error

func (*Node) Joined

func (n *Node) Joined() bool

func (*Node) Leave

func (n *Node) Leave(timeout time.Duration) error

func (*Node) NumMembers

func (n *Node) NumMembers() int

func (*Node) SetCacheServerAddrFn

func (n *Node) SetCacheServerAddrFn(f func() string)

func (*Node) SetJoined

func (n *Node) SetJoined()

func (*Node) SetListenAddrFn

func (n *Node) SetListenAddrFn(f func() string)

func (*Node) SetServiceAddrFn

func (n *Node) SetServiceAddrFn(f func() string)

func (*Node) StatsKeyRouter added in v1.2.0

func (n *Node) StatsKeyRouter() client.KeyRouter[pb.StatsInfoKey]

func (*Node) UnsetJoined

func (n *Node) UnsetJoined()

type Option

type Option func(*Node)

func WithCacheServerAddrFn

func WithCacheServerAddrFn(f func() string) Option

func WithListenAddrFn

func WithListenAddrFn(f func() string) Option

func WithServiceAddrFn

func WithServiceAddrFn(f func() string) Option

Jump to

Keyboard shortcuts

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