cluster

package
v3.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxGetConnTimeout = 10 * time.Second
)

Variables

View Source
var (
	// ErrClusterClosed returned when requested on a closed cluster.
	ErrClusterClosed = errors.New(fmt.Errorf("cluster closed"))

	// ErrClusterEmpty returned when no connections left in cluster.
	ErrClusterEmpty = errors.New(fmt.Errorf("cluster empty"))
)

Functions

func DiffEndpoints

func DiffEndpoints(curr, next []endpoint.Endpoint, eq, add, del func(i, j int))

func SortEndpoints

func SortEndpoints(es []endpoint.Endpoint)

func WithEndpoint added in v3.7.0

func WithEndpoint(ctx context.Context, endpoint Endpoint) context.Context

func WithoutLock added in v3.11.4

func WithoutLock() crudOption

Types

type Cluster

func New

func New(
	ctx context.Context,
	config config.Config,
	pool conn.Pool,
) Cluster

type Endpoint added in v3.7.0

type Endpoint interface {
	NodeID() uint32
}

func ContextEndpoint added in v3.7.0

func ContextEndpoint(ctx context.Context) (e Endpoint, ok bool)

type Explorer added in v3.10.0

type Explorer interface {
	SetExplorer(repeater repeater.Repeater)
	Force()
}

type Getter added in v3.16.10

type Getter interface {
	// Get gets conn from cluster
	Get(ctx context.Context, opts ...crudOption) (cc conn.Conn, err error)
}

type Inserter added in v3.16.10

type Inserter interface {
	// Insert inserts endpoint to cluster
	Insert(ctx context.Context, endpoint endpoint.Endpoint, opts ...crudOption) conn.Conn
}

type InserterRemoverExplorerLocker added in v3.16.10

type InserterRemoverExplorerLocker interface {
	Inserter
	Remover
	Explorer
	sync.Locker
}

type Remover added in v3.16.10

type Remover interface {
	// Remove removes endpoint from cluster
	Remove(ctx context.Context, endpoint endpoint.Endpoint, opts ...crudOption) conn.Conn
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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