clusterconnmanager

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: Apache-2.0 Imports: 17 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
}

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(sonar *sonar.Sonar) *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.

Jump to

Keyboard shortcuts

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