cluster

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisconnectUnauthorized

func DisconnectUnauthorized(ctx context.Context, dm *DownstreamManager, connected, authorized []string) error

DisconnectUnauthorized calls disconnects for all ids which are present in the connected but not in the authorized slice of key ids.

func NewTrackingListener

func NewTrackingListener(ctx context.Context, l net.Listener, m *DownstreamManager) (net.Listener, error)

NewTrackingListener returns a listener which adds all connections made through it to the provided DownstreamManager. The net.Conn returned by Accept is only tracked if it is a *tls.Conn and was created by the nodeenrollment library.

Types

type DownstreamManager

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

DownstreamManager associates downstream worker key identifiers with the connections to a specific server. It is safe to access DownstreamManager concurrently.

func NewDownstreamManager

func NewDownstreamManager() *DownstreamManager

func (*DownstreamManager) Connected

func (m *DownstreamManager) Connected() []string

Connected returns a slice of worker key identifiers for all workers that are currently being tracked by this downstream manager.

func (*DownstreamManager) Disconnect

func (m *DownstreamManager) Disconnect(id string)

Disconnect closes all connections associated with the provided worker key identifier.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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