clusterconnmanager

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConnNotFound will be returned by GetConnection in case the requested connection is not found.
	ErrConnNotFound = errors.New("clusterconnmanager: cluster connection not found")

	// ErrIncompatibleProtocol will be returned by GetConnection in case the requested connection protocol version
	// is incompatible.
	ErrIncompatibleProtocol = errors.New("clusterconnmanager: incompatible cluster API protocol")
)

Functions

This section is empty.

Types

type ComponentRouter

type ComponentRouter interface {
	Route(ctx context.Context, stanza stravaganza.Stanza, componentHost string) error
}

ComponentRouter defines component router service.

type Conn

type Conn interface {
	LocalRouter() LocalRouter
	ComponentRouter() ComponentRouter
	StreamManagement() StreamManagement
}

Conn defines cluster connection interface.

type LocalRouter

type LocalRouter interface {
	Route(ctx context.Context, stanza stravaganza.Stanza, username, resource string) error
	Disconnect(ctx context.Context, username, resource string, streamErr *streamerror.Error) error
}

LocalRouter defines local router service.

type Manager

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

Manager is the cluster connection manager.

func NewManager

func NewManager(hk *hook.Hooks, logger kitlog.Logger) *Manager

NewManager returns a new initialized cluster connection manager.

func (*Manager) GetConnection

func (m *Manager) GetConnection(instanceID string) (Conn, error)

GetConnection returns the connection associated to a given cluster instance.

func (*Manager) Start

func (m *Manager) Start(_ context.Context) error

Start starts cluster connection manager.

func (*Manager) Stop

func (m *Manager) Stop(_ context.Context) error

Stop stops cluster connection manager.

type StreamManagement added in v0.61.0

type StreamManagement interface {
	TransferQueue(ctx context.Context, queueID string) (*StreamQueue, error)
}

StreamManagement defines a stream management service.

type StreamQueue added in v0.61.0

type StreamQueue struct {
	// Elements contains the queue elements.
	Elements []streamqueue.Element

	// Nonce is the nonce queue byte slice.
	Nonce []byte

	// InH is the queue incoming h value.
	InH uint32

	// OutH is the queue outgoing h value.
	OutH uint32
}

StreamQueue represents a stream managed queue.

Jump to

Keyboard shortcuts

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