stream

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PendingTime = 15 * time.Second
)

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(targetRegistryClient nspAPI.TargetRegistryClient,
	conduit Conduit) *streamFactory

Types

type Conduit

type Conduit interface {
	GetIPs() []string
}

type Stream

type Stream struct {
	Stream         *ambassadorAPI.Stream
	TargetRegistry TargetRegistry
	// Contains Function to get the IPs of the conduit
	Conduit Conduit
	// contains filtered or unexported fields
}

Stream implements types.Stream (/pkg/ambassador/tap/types) has

func New

func New(stream *ambassadorAPI.Stream,
	targetRegistryClient nspAPI.TargetRegistryClient,
	conduit Conduit) (*Stream, error)

New is the constructor of Stream. Can return an error if the stream is invalid.

func (*Stream) Close

func (s *Stream) Close(ctx context.Context) error

Close the stream in the conduit by unregistering target from the NSP service.

func (*Stream) Equals

func (s *Stream) Equals(stream *ambassadorAPI.Stream) bool

Equals checks if the stream is equal to the one in parameter

func (*Stream) GetStream

func (s *Stream) GetStream() *ambassadorAPI.Stream

GetStream returns the current Stream (NSP API struct)

func (*Stream) Open

func (s *Stream) Open(ctx context.Context, nspStream *nspAPI.Stream) error

Open the stream in the conduit by generating a identifier and registering the target to the NSP service while avoiding the identifier collisions. If success, no error will be returned.

type TargetRegistry

type TargetRegistry interface {
	Register(context.Context, *nspAPI.Target) error
	Unregister(context.Context, *nspAPI.Target) error
	GetTargets(context.Context, *nspAPI.Target) ([]*nspAPI.Target, error)
}

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