common

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Strategy   eventbusv1alpha1.AuthStrategy
	Credential *AuthCredential
}

Auth contains the auth infor for event bus

type AuthCredential

type AuthCredential struct {
	Token    string
	Username string
	Password string
}

AuthCredential host the credential info

type Connection

type Connection interface {
	Close() error

	IsClosed() bool
}

type Dependency

type Dependency struct {
	Name            string
	EventSourceName string
	EventName       string
}

Dependency is a struct for dependency info of a sensor

type EventSourceConnection

type EventSourceConnection interface {
	Connection

	Publish(ctx context.Context, msg Message) error
}

type EventSourceDriver

type EventSourceDriver interface {
	Initialize() error
	Connect(clientID string) (EventSourceConnection, error)
}

type Message

type Message struct {
	MsgHeader
	Body []byte
}

type MsgHeader

type MsgHeader struct {
	EventSourceName string
	EventName       string
	ID              string
}

type SensorDriver

type SensorDriver interface {
	Initialize() error
	Connect(triggerName string, dependencyExpression string, deps []Dependency) (TriggerConnection, error)
}

type TriggerConnection

type TriggerConnection interface {
	Connection

	fmt.Stringer // need to implement String()

	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
}

Jump to

Keyboard shortcuts

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