modelchange

package
v0.3.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 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)
	// Service is the topic for model.Service.
	Service = topic.Topic(migrate.ServicesTable.Name)
	// ServiceResource is the topic for model.ServiceResource.
	ServiceResource = topic.Topic(migrate.ServiceResourcesTable.Name)
	// ServiceRevision is the topic for model.ServiceRevision.
	ServiceRevision = topic.Topic(migrate.ServiceRevisionsTable.Name)
	// Template is the topic for model.Template.
	Template = topic.Topic(migrate.TemplatesTable.Name)
)

Available topics, which is used for model change subscription.

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
	IDs  []object.ID
}

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

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