common

package
v1.9.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEventBusError

func NewEventBusError(err error) error

NewEventBusError returns an EventBusError.

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 EventBusError

type EventBusError struct {
	// contains filtered or unexported fields
}

EventBusError is a particular EventBus related error.

func (*EventBusError) Error

func (e *EventBusError) Error() string

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(ctx context.Context,
		triggerName string,
		dependencyExpression string,
		deps []Dependency,
		atLeastOnce bool) (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