sensor

package
v1.9.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type STANTriggerConn

type STANTriggerConn struct {
	*stanbase.STANConnection
	// contains filtered or unexported fields
}

func NewSTANTriggerConn

func NewSTANTriggerConn(conn *stanbase.STANConnection, sensorName string, triggerName string, dependencyExpression string, deps []eventbuscommon.Dependency) *STANTriggerConn

func (*STANTriggerConn) Close added in v1.9.0

func (conn *STANTriggerConn) Close() error

func (*STANTriggerConn) IsClosed added in v1.9.0

func (conn *STANTriggerConn) IsClosed() bool

func (*STANTriggerConn) String

func (n *STANTriggerConn) String() string

func (*STANTriggerConn) Subscribe

func (n *STANTriggerConn) Subscribe(
	ctx context.Context,
	closeCh <-chan struct{},
	resetConditionsCh <-chan struct{},
	lastResetTime time.Time,
	transform func(depName string, event cloudevents.Event) (*cloudevents.Event, error),
	filter func(string, cloudevents.Event) bool,
	action func(map[string]cloudevents.Event),
	defaultSubject *string) error

Subscribe is used to subscribe to multiple event source dependencies Parameter - ctx, context Parameter - conn, eventbus connection Parameter - group, queue group name Parameter - closeCh, channel to indicate to close the subscription Parameter - resetConditionsCh, channel to indicate to reset trigger conditions Parameter - lastResetTime, the last time reset would have occurred, if any Parameter - dependencyExpr, example: "(dep1 || dep2) && dep3" Parameter - dependencies, array of dependencies information Parameter - filter, a function used to filter the message Parameter - action, a function to be triggered after all conditions meet

type SensorSTAN

type SensorSTAN struct {
	*stanbase.STAN
	// contains filtered or unexported fields
}

func NewSensorSTAN

func NewSensorSTAN(url, clusterID, sensorName string, auth *eventbuscommon.Auth, logger *zap.SugaredLogger) *SensorSTAN

func (*SensorSTAN) Connect

func (n *SensorSTAN) Connect(ctx context.Context, triggerName string, dependencyExpression string, deps []eventbuscommon.Dependency, atLeastOnce bool) (eventbuscommon.TriggerConnection, error)

func (*SensorSTAN) Initialize

func (n *SensorSTAN) Initialize() error

Jump to

Keyboard shortcuts

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