environment

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventCreate = iota
	EventUpdate
	EventDelete
)

Variables

This section is empty.

Functions

func AddSubscriber

func AddSubscriber(n string, h func(context.Context, BusMessage) error) error

AddSubscriber add the subscriber to handle the changed notification from model.Environment.

func Notify

func Notify(ctx context.Context, mc model.ClientSet, event Event, refers model.Environments) error

Notify notifies the changed model.Environment.

func NotifyIDs

func NotifyIDs(ctx context.Context, mc model.ClientSet, event Event, ids ...object.ID) error

NotifyIDs notifies the changed model.Environment IDs.

Types

type BusMessage

type BusMessage struct {
	// Event holds event type.
	Event Event
	// TransactionalModelClient holds the model.ClientSet of this calling session,
	// it should be a transactional DAO client,
	// please don't keep for long-term using.
	TransactionalModelClient model.ClientSet
	// Refers holds the updating model.Environment list of this calling session.
	Refers model.Environments
}

BusMessage wraps the changed model.Environment as a bus.Message.

type Event

type Event int

Jump to

Keyboard shortcuts

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