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 ¶
- Variables
- type Event
- type EventExtensionDisabled
- type EventExtensionEnabled
- type EventExtensionInstalled
- type EventExtensionUninstalled
- type EventNamespaceCreated
- type EventNamespaceDeleted
- type EventPipelineConfigDeleted
- type EventPipelineConfigRegistered
- type EventPipelineDeleted
- type EventPipelineDeployCompleted
- type EventPipelineDeployStarted
- type EventPipelineDisabled
- type EventPipelineEnabled
- type EventPipelineExtensionSubscription
- type EventPipelineExtensionUnsubscription
- type EventPipelineObjectEvicted
- type EventPipelineRegistered
- type EventPipelineRegisteredConfig
- type EventRunCompleted
- type EventRunObjectsExpired
- type EventRunStarted
- type EventTaskRunCompleted
- type EventTaskRunCreated
- type EventTaskRunStarted
- type EventType
- type EventTypeDetails
Constants ¶
This section is empty.
Variables ¶
View Source
var EventTypeMap = map[EventType]EventTypeDetails{ EventTypeNamespaceCreated: &EventNamespaceCreated{}, EventTypeNamespaceDeleted: &EventNamespaceDeleted{}, EventTypePipelineDisabled: &EventPipelineDisabled{}, EventTypePipelineEnabled: &EventPipelineEnabled{}, EventTypePipelineRegistered: &EventPipelineRegistered{}, EventTypePipelineDeployStarted: &EventPipelineDeployStarted{}, EventTypePipelineDeployCompleted: &EventPipelineDeployCompleted{}, EventTypePipelineExtensionSubscription: &EventPipelineExtensionSubscription{}, EventTypePipelineExtensionUnsubscription: &EventPipelineExtensionUnsubscription{}, EventTypePipelineDeleted: &EventPipelineDeleted{}, EventTypePipelineObjectEvicted: &EventPipelineObjectEvicted{}, EventTypePipelineConfigRegistered: &EventPipelineConfigRegistered{}, EventTypePipelineConfigDeleted: &EventPipelineConfigDeleted{}, EventTypeRunStarted: &EventRunStarted{}, EventTypeRunCompleted: &EventRunCompleted{}, EventTypeRunObjectsExpired: &EventRunObjectsExpired{}, EventTypeTaskRunCreated: &EventTaskRunCreated{}, EventTypeTaskRunStarted: &EventTaskRunStarted{}, EventTypeTaskRunCompleted: &EventTaskRunCompleted{}, EventTypeExtensionInstalled: &EventExtensionInstalled{}, EventTypeExtensionUninstalled: &EventExtensionUninstalled{}, EventTypeExtensionEnabled: &EventExtensionEnabled{}, EventTypeExtensionDisabled: &EventExtensionDisabled{}, }
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 ¶
func (EventExtensionDisabled) Kind ¶
func (e EventExtensionDisabled) Kind() EventType
type EventExtensionEnabled ¶
func (EventExtensionEnabled) Kind ¶
func (e EventExtensionEnabled) Kind() EventType
type EventExtensionInstalled ¶
func (EventExtensionInstalled) Kind ¶
func (e EventExtensionInstalled) Kind() EventType
type EventExtensionUninstalled ¶
func (EventExtensionUninstalled) Kind ¶
func (e EventExtensionUninstalled) Kind() EventType
type EventNamespaceCreated ¶
type EventNamespaceCreated struct {
NamespaceID string `json:"namespace_id"`
}
func (EventNamespaceCreated) Kind ¶
func (e EventNamespaceCreated) Kind() EventType
type EventNamespaceDeleted ¶
type EventNamespaceDeleted struct {
NamespaceID string `json:"namespace_id"`
}
func (EventNamespaceDeleted) Kind ¶
func (e EventNamespaceDeleted) Kind() EventType
type EventPipelineConfigDeleted ¶
type EventPipelineConfigDeleted struct { NamespaceID string `json:"namespace_id"` PipelineID string `json:"pipeline_id"` Version int64 `json:"version"` }
func (EventPipelineConfigDeleted) Kind ¶
func (e EventPipelineConfigDeleted) Kind() EventType
type EventPipelineConfigRegistered ¶
type EventPipelineConfigRegistered struct { NamespaceID string `json:"namespace_id"` PipelineID string `json:"pipeline_id"` Version int64 `json:"version"` }
func (EventPipelineConfigRegistered) Kind ¶
func (e EventPipelineConfigRegistered) Kind() EventType
type EventPipelineDeleted ¶
type EventPipelineDeleted struct { NamespaceID string `json:"namespace_id"` PipelineID string `json:"pipeline_id"` }
func (EventPipelineDeleted) Kind ¶
func (e EventPipelineDeleted) Kind() EventType
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 ¶
func (e EventPipelineDeployCompleted) Kind() EventType
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 ¶
func (e EventPipelineDeployStarted) Kind() EventType
type EventPipelineDisabled ¶
type EventPipelineDisabled struct { NamespaceID string `json:"namespace_id"` PipelineID string `json:"pipeline_id"` }
func (EventPipelineDisabled) Kind ¶
func (e EventPipelineDisabled) Kind() EventType
type EventPipelineEnabled ¶
type EventPipelineEnabled struct { NamespaceID string `json:"namespace_id"` PipelineID string `json:"pipeline_id"` }
func (EventPipelineEnabled) Kind ¶
func (e EventPipelineEnabled) Kind() EventType
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 ¶
func (e EventPipelineExtensionSubscription) Kind() EventType
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 ¶
func (e EventPipelineExtensionUnsubscription) Kind() EventType
type EventPipelineObjectEvicted ¶
type EventPipelineObjectEvicted struct { NamespaceID string `json:"namespace_id"` PipelineID string `json:"pipeline_id"` Key string `json:"key"` }
func (EventPipelineObjectEvicted) Kind ¶
func (e EventPipelineObjectEvicted) Kind() EventType
type EventPipelineRegistered ¶
type EventPipelineRegistered struct { NamespaceID string `json:"namespace_id"` PipelineID string `json:"pipeline_id"` }
func (EventPipelineRegistered) Kind ¶
func (e EventPipelineRegistered) Kind() EventType
type EventPipelineRegisteredConfig ¶
type EventPipelineRegisteredConfig struct { NamespaceID string `json:"namespace_id"` PipelineID string `json:"pipeline_id"` Version int64 `json:"version"` }
func (EventPipelineRegisteredConfig) Kind ¶
func (e EventPipelineRegisteredConfig) Kind() EventType
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 ¶
func (e EventRunObjectsExpired) Kind() EventType
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 ¶
func (e EventTaskRunCompleted) Kind() EventType
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
}
Click to show internal directories.
Click to hide internal directories.