Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventManager ¶
type EventManager struct {
// contains filtered or unexported fields
}
EventManager is used to subscribe to database events
func NewEventManager ¶
func NewEventManager(dbClient *db.Client) *EventManager
NewEventManager creates a new instance of EventManager
func (*EventManager) Start ¶
func (e *EventManager) Start(ctx context.Context)
Start will start the event loop for listing to database events
func (*EventManager) Subscribe ¶
func (e *EventManager) Subscribe(subscriptions []Subscription) *Subscriber
Subscribe creates a Subscriber that will be notified of database events based on the specified subscriptions
func (*EventManager) Unsubscribe ¶
func (e *EventManager) Unsubscribe(subscriber *Subscriber)
Unsubscribe removes the subscriber
type Subscriber ¶
type Subscriber struct { ID string // contains filtered or unexported fields }
Subscriber is used to subscribe to database events
type Subscription ¶
type Subscription struct { Type SubscriptionType ID string // Optional ID of resource to subscribe to Actions []SubscriptionAction // Empty Actions list will subscribe to all action types }
Subscription includes the model type to subscribe to
type SubscriptionAction ¶
type SubscriptionAction string
SubscriptionAction type represents the available actions that can be subscribed type
const ( CreateAction SubscriptionAction = "INSERT" UpdateAction SubscriptionAction = "UPDATE" DeleteAction SubscriptionAction = "DELETE" )
SubscriptionAction constants
type SubscriptionType ¶
type SubscriptionType string
SubscriptionType specifies the type of subscription
const ( JobSubscription SubscriptionType = "jobs" JobLogSubscription SubscriptionType = "job_log_descriptors" RunSubscription SubscriptionType = "runs" WorkspaceSubscription SubscriptionType = "workspaces" )
SubscriptionType constants
Click to show internal directories.
Click to hide internal directories.