types

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Connected    = 0
	Disconnected = 1
)
View Source
const (
	Opened = 0
	Closed = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conduit

type Conduit interface {
	// Connect requests the connection to NSM and, if success, open all streams added
	// and confiure the VIPs
	Connect(ctx context.Context) error
	// Disconnect closes the connection from NSM, closes all streams
	// and removes the VIP configuration
	Disconnect(ctx context.Context) error
	// AddStream creates a stream and will open it in background
	AddStream(context.Context, *ambassadorAPI.Stream) error
	// RemoveStream closes and removes the stream (if existing)
	RemoveStream(context.Context, *ambassadorAPI.Stream) error
	GetStreams() []*ambassadorAPI.Stream
	Equals(*ambassadorAPI.Conduit) bool
	GetConduit() *ambassadorAPI.Conduit
}

Responsible for requesting/closing the NSM Connection to the conduit, managing the streams and configuring the VIPs.

type ConduitStatus

type ConduitStatus int

type Stream

type Stream interface {
	// Open the stream in the conduit by generating a identifier and registering
	// the target to the NSP service while avoiding the identifier collisions.
	Open(ctx context.Context, nspStream *nspAPI.Stream) error
	// Close the stream in the conduit by unregistering target from the NSP service.
	Close(ctx context.Context) error
	Equals(*ambassadorAPI.Stream) bool
	GetStream() *ambassadorAPI.Stream
}

Stream is an interface that rate limits items being added to the queue.

type StreamStatus

type StreamStatus int

type Trench

type Trench interface {
	Delete(ctx context.Context) error
	// AddConduit creates a conduit and will connect it in background
	AddConduit(context.Context, *ambassadorAPI.Conduit) (Conduit, error)
	// RemoveConduit disconnects and removes the conduit (if existing).
	RemoveConduit(context.Context, *ambassadorAPI.Conduit) error
	GetConduits() []Conduit
	// GetConduit returns the conduit matching to the one in parameter if it exists.
	GetConduit(*ambassadorAPI.Conduit) Conduit
	Equals(*ambassadorAPI.Trench) bool
	GetTrench() *ambassadorAPI.Trench
}

Responsible for connection/disconnecting the conduits, and providing a NSP connection to the trench.

type Watcher

type Watcher interface {
	Stop()
	ResultChan() <-chan []*ambassadorAPI.StreamStatus
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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