cluster

package
v0.18.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInternalRequest added in v0.18.0

func IsInternalRequest(ctx context.Context) bool

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(ctx context.Context, opts ...grpc.DialOption) error

Connect ...

func (*Cluster) ExternalNodes added in v0.17.0

func (c *Cluster) ExternalNodes() (res []*Node)

ExternalNodes returns all available nodes except host.

func (*Cluster) Get

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

Get if possible returns node for a given 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) GoString added in v0.18.0

func (c *Cluster) GoString() string

GoString implements fmt GoStringer interface.

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 {
	ID     int
	Addr   string                            `json:"addr"`
	Client mnemosynerpc.SessionManagerClient `json:"-"`
	Health grpc_health_v1.HealthClient       `json:"-"`
}

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