events

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Events contains the data models used in Gofer events. This being a public package allows the parsing of events into concrete types.

Index

Constants

This section is empty.

Variables

Maps the kind type into an empty instance of the detail type. This allows us to quickly get back the correct type for things like json marshalling and unmarshalling. Make sure to keep this map in lockstep with the EventType enum.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID      int64            // Unique identifier for event.
	Type    EventType        // The type of event it is.
	Details EventTypeDetails // A struct of details about the specific event.
	Emitted int64            // Time event was performed in epoch milliseconds.
}

A single event type

func NewEvent

func NewEvent(details EventTypeDetails) *Event

type EventExtensionDisabled

type EventExtensionDisabled struct {
	Name  string `json:"name"`
	Image string `json:"image"`
}

func (EventExtensionDisabled) Kind

type EventExtensionEnabled

type EventExtensionEnabled struct {
	Name  string `json:"name"`
	Image string `json:"image"`
}

func (EventExtensionEnabled) Kind

type EventExtensionInstalled

type EventExtensionInstalled struct {
	Name  string `json:"name"`
	Image string `json:"image"`
}

func (EventExtensionInstalled) Kind

type EventExtensionUninstalled

type EventExtensionUninstalled struct {
	Name  string `json:"name"`
	Image string `json:"image"`
}

func (EventExtensionUninstalled) Kind

type EventNamespaceCreated

type EventNamespaceCreated struct {
	NamespaceID string `json:"namespace_id"`
}

func (EventNamespaceCreated) Kind

type EventNamespaceDeleted

type EventNamespaceDeleted struct {
	NamespaceID string `json:"namespace_id"`
}

func (EventNamespaceDeleted) Kind

type EventPipelineConfigDeleted

type EventPipelineConfigDeleted struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
	Version     int64  `json:"version"`
}

func (EventPipelineConfigDeleted) Kind

type EventPipelineConfigRegistered

type EventPipelineConfigRegistered struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
	Version     int64  `json:"version"`
}

func (EventPipelineConfigRegistered) Kind

type EventPipelineDeleted

type EventPipelineDeleted struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
}

func (EventPipelineDeleted) Kind

type EventPipelineDeployCompleted

type EventPipelineDeployCompleted struct {
	NamespaceID  string `json:"namespace_id"`
	PipelineID   string `json:"pipeline_id"`
	StartVersion int64  `json:"start_version"`
	EndVersion   int64  `json:"end_version"`
}

func (EventPipelineDeployCompleted) Kind

type EventPipelineDeployStarted

type EventPipelineDeployStarted struct {
	NamespaceID  string `json:"namespace_id"`
	PipelineID   string `json:"pipeline_id"`
	StartVersion int64  `json:"start_version"`
	EndVersion   int64  `json:"end_version"`
}

func (EventPipelineDeployStarted) Kind

type EventPipelineDisabled

type EventPipelineDisabled struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
}

func (EventPipelineDisabled) Kind

type EventPipelineEnabled

type EventPipelineEnabled struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
}

func (EventPipelineEnabled) Kind

type EventPipelineExtensionSubscription

type EventPipelineExtensionSubscription struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
	Version     int64  `json:"version"`
	Label       string `json:"label"`
	Name        string `json:"name"`
}

func (EventPipelineExtensionSubscription) Kind

type EventPipelineExtensionUnsubscription

type EventPipelineExtensionUnsubscription struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
	Label       string `json:"label"`
	Name        string `json:"name"`
}

func (EventPipelineExtensionUnsubscription) Kind

type EventPipelineObjectEvicted

type EventPipelineObjectEvicted struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
	Key         string `json:"key"`
}

func (EventPipelineObjectEvicted) Kind

type EventPipelineRegistered

type EventPipelineRegistered struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
}

func (EventPipelineRegistered) Kind

type EventPipelineRegisteredConfig

type EventPipelineRegisteredConfig struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
	Version     int64  `json:"version"`
}

func (EventPipelineRegisteredConfig) Kind

type EventRunCompleted

type EventRunCompleted struct {
	NamespaceID   string `json:"namespace_id"`
	PipelineID    string `json:"pipeline_id"`
	RunID         int64  `json:"run_id"`
	Status        string `json:"status"`
	InitiatorType string `json:"initiator_type"`
	InitiatorName string `json:"initiator_name"`
}

func (EventRunCompleted) Kind

func (e EventRunCompleted) Kind() EventType

type EventRunObjectsExpired

type EventRunObjectsExpired struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
	RunID       int64  `json:"run_id"`
}

func (EventRunObjectsExpired) Kind

type EventRunStarted

type EventRunStarted struct {
	NamespaceID   string `json:"namespace_id"`
	PipelineID    string `json:"pipeline_id"`
	RunID         int64  `json:"run_id"`
	InitiatorType string `json:"initiator_type"`
	InitiatorName string `json:"initiator_name"`
}

func (EventRunStarted) Kind

func (e EventRunStarted) Kind() EventType

type EventTaskRunCompleted

type EventTaskRunCompleted struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
	RunID       int64  `json:"run_id"`
	TaskRunID   string `json:"task_run_id"`
	Status      string `json:"status"`
}

func (EventTaskRunCompleted) Kind

type EventTaskRunCreated

type EventTaskRunCreated struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
	RunID       int64  `json:"run_id"`
	TaskRunID   string `json:"task_run_id"`
}

func (EventTaskRunCreated) Kind

func (e EventTaskRunCreated) Kind() EventType

type EventTaskRunStarted

type EventTaskRunStarted struct {
	NamespaceID string `json:"namespace_id"`
	PipelineID  string `json:"pipeline_id"`
	RunID       int64  `json:"run_id"`
	TaskRunID   string `json:"task_run_id"`
}

func (EventTaskRunStarted) Kind

func (e EventTaskRunStarted) Kind() EventType

type EventType

type EventType string

Make sure to keep changes to these enums in lockstep with EventTypeMap

const (
	// The Any kind is a special event kind that denotes the caller wants to listen for any event.
	// It should not be used as a normal event type(for example do not publish anything with it).
	// It is internal only and not passed back on event streaming.
	EventTypeAny EventType = "ANY"

	// Namespaces
	EventTypeNamespaceCreated EventType = "NAMESPACE_CREATED"
	EventTypeNamespaceDeleted EventType = "NAMESPACE_DELETED"

	// Pipelines
	EventTypePipelineDisabled                EventType = "PIPELINE_DISABLED"
	EventTypePipelineEnabled                 EventType = "PIPELINE_ENABLED"
	EventTypePipelineRegistered              EventType = "PIPELINE_REGISTERED"
	EventTypePipelineDeployStarted           EventType = "PIPELINE_DEPLOY_STARTED"
	EventTypePipelineDeployCompleted         EventType = "PIPELINE_DEPLOY_COMPLETED"
	EventTypePipelineDeleted                 EventType = "PIPELINE_DELETED"
	EventTypePipelineExtensionSubscription   EventType = "PIPELINE_EXTENSION_SUBSCRIPTION"
	EventTypePipelineExtensionUnsubscription EventType = "PIPELINE_EXTENSION_UNSUBSCRIPTION"
	EventTypePipelineObjectEvicted           EventType = "EVICTED_PIPELINE_OBJECT"

	// Pipeline configs
	EventTypePipelineConfigRegistered EventType = "PIPELINE_CONFIG_REGISTERED"
	EventTypePipelineConfigDeleted    EventType = "PIPELINE_CONFIG_DELETED"

	// Runs
	EventTypeRunStarted        EventType = "RUN_STARTED"
	EventTypeRunCompleted      EventType = "RUN_COMPLETED"
	EventTypeRunObjectsExpired EventType = "RUN_OBJECTS_EXPIRED"

	// Task Runs
	EventTypeTaskRunCreated   EventType = "TASKRUN_CREATED"
	EventTypeTaskRunStarted   EventType = "TASKRUN_STARTED"
	EventTypeTaskRunCompleted EventType = "TASKRUN_COMPLETED"

	// Extensions
	EventTypeExtensionInstalled   EventType = "EXTENSION_INSTALLED"
	EventTypeExtensionUninstalled EventType = "EXTENSION_UNINSTALLED"
	EventTypeExtensionEnabled     EventType = "EXTENSION_ENABLED"
	EventTypeExtensionDisabled    EventType = "EXTENSION_DISABLED"
)

type EventTypeDetails

type EventTypeDetails interface {
	Kind() EventType
}

Jump to

Keyboard shortcuts

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