connection

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInitialInterval = 100 * time.Millisecond
	DefaultMaxInterval     = 10 * time.Second
)

Variables

This section is empty.

Functions

func CreateMockConnection

func CreateMockConnection(ctx api.StreamContext) modules.Connection

func CreateMockErrConnection

func CreateMockErrConnection(ctx api.StreamContext) modules.Connection

func DetachConnection

func DetachConnection(ctx api.StreamContext, conId string) error

func DropNameConnection

func DropNameConnection(ctx api.StreamContext, selId string) error

func InitConnectionManager

func InitConnectionManager()

func InitConnectionManager4Test

func InitConnectionManager4Test() error

func InitMockTest

func InitMockTest()

func NewExponentialBackOff

func NewExponentialBackOff() *backoff.ExponentialBackOff

func ReloadNamedConnection

func ReloadNamedConnection() error

ReloadNamedConnection is called when server starts. It initializes all stored named connections

Types

type ConnWrapper

type ConnWrapper struct {
	ID string
	// contains filtered or unexported fields
}

func CreateNamedConnection

func CreateNamedConnection(ctx api.StreamContext, id, typ string, props map[string]any) (*ConnWrapper, error)

func FetchConnection

func FetchConnection(ctx api.StreamContext, refId, typ string, props map[string]interface{}, sc api.StatusChangeHandler) (*ConnWrapper, error)

FetchConnection is called by source/sink to get or create an anonymous connection instance in the pool

func UpdateConnection

func UpdateConnection(ctx api.StreamContext, id, typ string, props map[string]any) (*ConnWrapper, error)

func (*ConnWrapper) IsInitialized

func (cw *ConnWrapper) IsInitialized() bool

func (*ConnWrapper) Wait

func (cw *ConnWrapper) Wait(connectorCtx api.StreamContext) (modules.Connection, error)

Wait will wait for connection connected or the caller interrupts (like rule exit)

type Manager

type Manager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type Meta

type Meta struct {
	ID    string         `json:"id"`
	Typ   string         `json:"typ"`
	Props map[string]any `json:"props"`
	Named bool           `json:"named"`
	// contains filtered or unexported fields
}

func GetAllConnectionsMeta

func GetAllConnectionsMeta(forceAll bool) []*Meta

func GetConnectionDetail

func GetConnectionDetail(_ api.StreamContext, id string) (*Meta, error)

func (*Meta) AddRef

func (meta *Meta) AddRef(refId string, sc api.StatusChangeHandler)

func (*Meta) DeRef

func (meta *Meta) DeRef(refId string)

func (*Meta) GetRefCount

func (meta *Meta) GetRefCount() int

func (*Meta) GetRefNames

func (meta *Meta) GetRefNames() (result []string)

func (*Meta) GetStatus

func (meta *Meta) GetStatus() (s string, e string)

func (*Meta) NotifyStatus

func (meta *Meta) NotifyStatus(status string, s string)

Jump to

Keyboard shortcuts

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