events

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSubscriber

func AddSubscriber(ctx context.Context, filter FilterParams, tags []string) (<-chan emitter.Event, error)

AddSubscriber adds a new subscriber to receive job events filtered based on the provided filterParams.

func PublishEvent

func PublishEvent(ctx context.Context, event *JobEvent) chan struct{}

PublishEvent publishes a new event. It returns a channel which can be used to wait for the delivery of the event to all listeners.

func ShutdownSubscribers

func ShutdownSubscribers()

ShutdownSubscribers disconnects all subscribers.

func SubscriberCount

func SubscriberCount() int

SubscriberCount counts the total number of subscribers across all topics.

Types

type Action

type Action string
const (
	ActionCreate           Action = "CREATE"
	ActionDelete           Action = "DELETE"
	ActionAddTags          Action = "ADD_TAGS"
	ActionDeleteTags       Action = "DELETE_TAGS"
	ActionUpdateStatus     Action = "UPDATE_STATUS"
	ActionUpdateDefinition Action = "UPDATE_DEFINITION"
)

type FilterParams

type FilterParams struct {
	JobIDs    []string
	ClientIDs []string
	Workflows []string
}

type JobEvent

type JobEvent struct {
	// Ctime is the time when the event was created
	Ctime  strfmt.DateTime `json:"ctime"`
	Action Action          `json:"action"`
	Job    *model.Job      `json:"job"`
	Tags   []string        `json:"tags"`
}

Jump to

Keyboard shortcuts

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