gossip

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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