gossip

package
v1.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistKeyCache

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

DistKeyCache keeps the key cache of local set/delete items and key information on remote nodes.

func (*DistKeyCache) AddItem

func (dc *DistKeyCache) AddItem(key cache.CacheKey, operation gossip.Operation)

AddItem implements the fileservice.KeyRouter interface.

func (*DistKeyCache) Target

func (dc *DistKeyCache) Target(k cache.CacheKey) string

Target implements the fileservice.KeyRouter interface.

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

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) 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