Documentation ¶
Index ¶
- type ConduitFactory
- type Trench
- func (t *Trench) AddConduit(ctx context.Context, cndt *ambassadorAPI.Conduit) (types.Conduit, error)
- func (t *Trench) Delete(ctx context.Context) error
- func (t *Trench) Equals(trench *ambassadorAPI.Trench) bool
- func (t *Trench) GetConduit(conduit *ambassadorAPI.Conduit) types.Conduit
- func (t *Trench) GetConduits() []types.Conduit
- func (t *Trench) GetTrench() *ambassadorAPI.Trench
- func (t *Trench) RemoveConduit(ctx context.Context, cndt *ambassadorAPI.Conduit) error
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) 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 ¶
GetConduits returns all conduits previously added to this trench.
func (*Trench) GetTrench ¶
func (t *Trench) GetTrench() *ambassadorAPI.Trench
func (*Trench) RemoveConduit ¶
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