internal

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StandaloneConnectorUtilities []StandaloneConnectorUtility

Functions

func ConnectorIDFromContext added in v0.10.0

func ConnectorIDFromContext(ctx context.Context) string

ConnectorIDFromContext fetches the connector ID from the context. If the context does not contain a connector ID it returns an empty string.

func ContextWithConnectorID added in v0.10.0

func ContextWithConnectorID(ctx context.Context, connectorID string) context.Context

ContextWithConnectorID wraps ctx and returns a context that contains the connector ID.

func ContextWithLogLevel added in v0.10.0

func ContextWithLogLevel(ctx context.Context, logLevel string) context.Context

ContextWithLogLevel wraps ctx and returns a context that contains the connector LogLevel.

func Enrich added in v0.10.0

func InitStandaloneConnectorUtilities added in v0.10.0

func InitStandaloneConnectorUtilities(target string) error

func LogLevelFromContext added in v0.10.0

func LogLevelFromContext(ctx context.Context) string

LogLevelFromContext fetches the connector LogLevel from the context. If the context does not contain a connector LogLevel it returns an empty string.

Types

type BatchFn added in v0.7.2

type BatchFn[T any] func([]T, int) error

type BatchResult added in v0.7.2

type BatchResult struct {
	At   time.Time
	Size int
	Err  error
}

type Batcher added in v0.7.2

type Batcher[T any] struct {
	// contains filtered or unexported fields
}

func NewBatcher added in v0.7.2

func NewBatcher[T any](sizeThreshold int, delayThreshold time.Duration, fn BatchFn[T]) *Batcher[T]

func (*Batcher[T]) Enqueue added in v0.7.2

func (b *Batcher[T]) Enqueue(item T, size int) EnqueueStatus

func (*Batcher[T]) Flush added in v0.7.2

func (b *Batcher[T]) Flush() bool

func (*Batcher[T]) Results added in v0.7.2

func (b *Batcher[T]) Results() <-chan BatchResult

type ConnectorState added in v0.8.0

type ConnectorState int
const (
	StateInitial ConnectorState = iota
	StateConfiguring
	StateConfigured
	StateStarting
	StateStarted
	StateInitiatingRun
	StateRunning
	StateInitiatingStop
	StateStopping
	StateStopped
	StateTearingDown
	StateTornDown

	StateErrored ConnectorState = 500
)

func (ConnectorState) String added in v0.8.0

func (i ConnectorState) String() string

type ConnectorStateWatcher added in v0.8.0

type ConnectorStateWatcher csync.ValueWatcher[ConnectorState]

func (*ConnectorStateWatcher) DoWithLock added in v0.8.0

func (w *ConnectorStateWatcher) DoWithLock(
	ctx context.Context,
	opts DoWithLockOptions,
	f func(currentState ConnectorState) error,
) error

func (*ConnectorStateWatcher) Set added in v0.8.0

func (w *ConnectorStateWatcher) Set(newState ConnectorState) bool

type DoWithLockOptions added in v0.8.0

type DoWithLockOptions struct {
	ExpectedStates       []ConnectorState
	StateBefore          ConnectorState
	StateAfter           ConnectorState
	WaitForExpectedState bool
}

type EnqueueStatus added in v0.7.2

type EnqueueStatus int
const (
	Scheduled EnqueueStatus = iota + 1
	Flushed
)

type StandaloneConnectorUtility added in v0.10.0

type StandaloneConnectorUtility interface {
	Init(conn *grpc.ClientConn) error
}

Jump to

Keyboard shortcuts

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