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 Crendential *AuthCredential }
Auth contains the auth infor for event bus
type AuthCredential ¶
AuthCredential host the credential info
type Connection ¶
type Connection interface { Close() error IsClosed() bool Publish(subject string, data []byte) error }
Connection is an interface of event bus driver
type Dependency ¶
Dependency is a struct for dependency info of a sensor
type Driver ¶
type Driver interface { Connect() (Connection, error) // SubscribeEventSources is used to subscribe multiple event source dependencies // Parameter - ctx, context // Parameter - conn, eventbus connection // Parameter - group, NATS Streaming queue group or Kafka consumer group // Parameter - closeCh, channel to indicate to close the subscription // 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 SubscribeEventSources(ctx context.Context, conn Connection, group string, closeCh <-chan struct{}, dependencyExpr string, dependencies []Dependency, filter func(string, cloudevents.Event) bool, action func(map[string]cloudevents.Event)) error // Publish a message Publish(conn Connection, message []byte) error }
Driver is an interface for event bus
func NewNATSStreaming ¶
func NewNATSStreaming(url, clusterID, subject, clientID string, auth *Auth, logger *zap.SugaredLogger) Driver
NewNATSStreaming returns a nats streaming driver
Click to show internal directories.
Click to hide internal directories.