trench

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConduitFactory

type ConduitFactory interface {
	New(*ambassadorAPI.Conduit) (types.Conduit, error)
}

The factory gathers common properties to simplify the instanciation of new conduits. Mostly useful for the tests.

type Trench

type Trench struct {
	Trench *ambassadorAPI.Trench
	// unique name (to be used in the NSM connection IDs)
	TargetName string
	// namespace of the current trench
	Namespace string
	// node the pod is running on
	NodeName                   string
	ConfigurationManagerClient nspAPI.ConfigurationManagerClient
	TargetRegistryClient       nspAPI.TargetRegistryClient
	NetworkServiceClient       networkservice.NetworkServiceClient
	StreamRegistry             types.Registry
	NetUtils                   networking.Utils
	ConduitFactory             ConduitFactory
	// contains filtered or unexported fields
}

Trench implements types.Trench (/pkg/ambassador/tap/types) Responsible for connection/disconnecting the conduits, and providing a NSP connection to the trench.

func New

func New(trench *ambassadorAPI.Trench,
	targetName string,
	namespace string,
	nodeName string,
	networkServiceClient networkservice.NetworkServiceClient,
	streamRegistry types.Registry,
	nspServiceName string,
	nspServicePort int,
	nspEntryTimeout time.Duration,
	netUtils networking.Utils) (*Trench, error)

New is the constructor of Trench. The constructor will create a new conduit factory, connect to the NSP service (Configuration and Target registry).

func (*Trench) AddConduit

func (t *Trench) AddConduit(ctx context.Context, cndt *ambassadorAPI.Conduit) (types.Conduit, error)

AddConduit creates a conduit based on its factory and will connect it (in another goroutine)

func (*Trench) Delete

func (t *Trench) Delete(ctx context.Context) error

func (*Trench) Equals

func (t *Trench) Equals(trench *ambassadorAPI.Trench) bool

Equals checks if the trench is equal to the one in parameter.

func (*Trench) GetConduit

func (t *Trench) GetConduit(conduit *ambassadorAPI.Conduit) types.Conduit

GetConduit returns the conduit corresponding to the one in parameter if it exists.

func (*Trench) GetConduits

func (t *Trench) GetConduits() []types.Conduit

GetConduits returns all conduits previously added to this trench.

func (*Trench) GetTrench

func (t *Trench) GetTrench() *ambassadorAPI.Trench

func (*Trench) RemoveConduit

func (t *Trench) RemoveConduit(ctx context.Context, cndt *ambassadorAPI.Conduit) error

RemoveConduit disconnects and removes the conduit (if existing). TODO: If the conduit still has streams, they will not be removed from stream registry: 1. return an error 2. Remove them

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