cluster

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

Cluster ...

func New

func New(opts Opts) (csr *Cluster, err error)

New ...

func (*Cluster) Connect

func (c *Cluster) Connect(opts ...grpc.DialOption) error

Connect ...

func (*Cluster) Get

func (c *Cluster) Get(k int32) (*Node, bool)

Get if possible returns node for a hiven bucket id.

func (*Cluster) GetOther added in v0.10.0

func (c *Cluster) GetOther(accessToken string) (*Node, bool)

GetOther returns node for given access token. Returns false if cluster is nil, has only one element or if node that was found has same listen address as current one.

func (*Cluster) Len

func (c *Cluster) Len() int

Len returns number of nodes.

func (*Cluster) Listen added in v0.10.0

func (c *Cluster) Listen() string

Listen returns address of current node.

func (*Cluster) Nodes

func (c *Cluster) Nodes() []*Node

Nodes returns all available nodes.

type Node

type Node struct {
	Addr   string
	Client mnemosynerpc.SessionManagerClient
}

Node ...

type Opts added in v0.9.5

type Opts struct {
	Listen string
	Seeds  []string
	Logger *zap.Logger
}

Opts ...

Jump to

Keyboard shortcuts

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