modelchange

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Catalog is the topic for model.Catalog.
	Catalog = topic.Topic(migrate.CatalogsTable.Name)
	// Connector is the topic for model.Connector.
	Connector = topic.Topic(migrate.ConnectorsTable.Name)
	// Resource is the topic for model.Resource.
	Resource = topic.Topic(migrate.ResourcesTable.Name)
	// ResourceComponent is the topic for model.ResourceComponent.
	ResourceComponent = topic.Topic(migrate.ResourceComponentsTable.Name)
	// ResourceState is the topic for model.ResourceState.
	ResourceState = topic.Topic(migrate.ResourceStatesTable.Name)
	// ResourceRun is the topic for model.ResourceRun.
	ResourceRun = topic.Topic(migrate.ResourceRunsTable.Name)
	// Template is the topic for model.Template.
	Template = topic.Topic(migrate.TemplatesTable.Name)
	// Workflow is the topic for model.Workflow.
	Workflow = topic.Topic(migrate.WorkflowsTable.Name)
	// WorkflowExecution is the topic for model.WorkflowExecution.
	WorkflowExecution = topic.Topic(migrate.WorkflowExecutionsTable.Name)
	// ResourceDefinition is the topic for model.ResourceDefinition.
	ResourceDefinition = topic.Topic(migrate.ResourceDefinitionsTable.Name)
)

Available topics, which is used for model change subscription. Do not support relationship tables.

Functions

func Handle

Handle returns an implementation of database.ListenHandler for handling the data changes.

func TableNames

func TableNames() []string

TableNames returns the name list of the interested tables for establishing.

Types

type Event

type Event struct {
	Type EventType
	Data []EventData
}

Event indicates the event of model change, includes Type and changed IDs.

func (Event) EnvironmentIDs added in v0.5.0

func (e Event) EnvironmentIDs() []object.ID

func (Event) IDs

func (e Event) IDs() []object.ID

func (Event) ProjectIDs added in v0.5.0

func (e Event) ProjectIDs() []object.ID

type EventData added in v0.5.0

type EventData struct {
	ID            object.ID
	Name          string
	ProjectID     object.ID
	EnvironmentID object.ID
}

type EventType

type EventType uint8

EventType indicates the type of model change event.

const (
	EventTypeCreate EventType
	EventTypeUpdate
	EventTypeDelete
)

func (EventType) String

func (t EventType) String() string

Jump to

Keyboard shortcuts

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