bus

package
v8.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ErrorEvent            = "error"
	UnlockCoreEvent       = "unlock-core"
	CreateObjectEvent     = "create-object"
	UpdateObjectEvent     = "update-object"
	DeleteObjectEvent     = "delete-object"
	TaskStatusUpdateEvent = "task-status-update"
	TaskLogUpdateEvent    = "task-log-update"
	TenantInviteEvent     = "tenant-invite"
	TenantBanishEvent     = "tenant-banish"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus struct {
	// contains filtered or unexported fields
}

func New

func New(n int) *Bus

func (*Bus) DumpState

func (b *Bus) DumpState() [][]string

func (*Bus) Register

func (b *Bus) Register(queues []string) (chan Event, int, error)

func (*Bus) Send

func (b *Bus) Send(event, typ string, thing interface{}, queues ...string)

func (*Bus) SendError

func (b *Bus) SendError(err error, queues ...string)

func (*Bus) SendEvent

func (b *Bus) SendEvent(queues []string, ev Event)

func (*Bus) Unregister

func (b *Bus) Unregister(idx int) error

type Event

type Event struct {
	Event string      `json:"event"`
	Queue string      `json:"queue"`
	Type  string      `json:"type,omitempty"`
	Data  interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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