event_bus

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TopicEntities ...
	TopicEntities = "entities"
	// TopicPlugins ...
	TopicPlugins = "plugins"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityState

type EntityState struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	ImageUrl    *string `json:"image_url"`
	Icon        *string `json:"icon"`
}

EntityState ...

type EventAddedActor

type EventAddedActor struct {
	PluginName string          `json:"plugin_name"`
	EntityId   common.EntityId `json:"entity_id"`
	Attributes m.Attributes    `json:"attributes"`
	Settings   m.Attributes    `json:"settings"` //???
}

EventAddedActor ...

type EventBus

type EventBus interface {
	Publish(topic string, args ...interface{})
	Close(topic string)
	Subscribe(topic string, fn interface{}, options ...interface{}) error
	Unsubscribe(topic string, fn interface{}) error
	Stat() (stats message_queue.Stats, err error)
	Purge()
}

EventBus ...

func NewEventBus

func NewEventBus() EventBus

NewEventBus ...

type EventCallAction

type EventCallAction struct {
	PluginName string                 `json:"plugin_name"`
	EntityId   common.EntityId        `json:"entity_id"`
	ActionName string                 `json:"action_name"`
	Args       map[string]interface{} `json:"args"`
}

EventCallAction ...

type EventCallScene

type EventCallScene struct {
	PluginName string                 `json:"type"`
	EntityId   common.EntityId        `json:"entity_id"`
	Args       map[string]interface{} `json:"args"`
}

EventCallScene ...

type EventCreatedEntity added in v0.5.2

type EventCreatedEntity struct {
	Id common.EntityId `json:"id"`
}

EventCreatedEntity ...

type EventDeletedEntity added in v0.5.2

type EventDeletedEntity struct {
	Id common.EntityId `json:"id"`
}

EventDeletedEntity ...

type EventEntityState

type EventEntityState struct {
	EntityId    common.EntityId `json:"entity_id"`
	Value       interface{}     `json:"value"`
	State       *EntityState    `json:"state"`
	Attributes  m.Attributes    `json:"attributes"`
	Settings    m.Attributes    `json:"settings"`
	LastChanged *time.Time      `json:"last_changed"`
	LastUpdated *time.Time      `json:"last_updated"`
}

EventEntityState ...

func (EventEntityState) Compare

func (e1 EventEntityState) Compare(e2 EventEntityState) (ident bool)

Compare ...

type EventLoadedPlugin added in v0.5.1

type EventLoadedPlugin struct {
	PluginName string `json:"plugin_name"`
}

EventLoadedPlugin ...

type EventRemoveActor

type EventRemoveActor struct {
	PluginName string          `json:"plugin_name"`
	EntityId   common.EntityId `json:"entity_id"`
}

EventRemoveActor ...

type EventRequestState

type EventRequestState struct {
	From       common.EntityId `json:"from"`
	To         common.EntityId `json:"to"`
	Attributes m.Attributes    `json:"attributes"`
}

EventRequestState ...

type EventStateChanged

type EventStateChanged struct {
	StorageSave bool             `json:"storage_save"`
	PluginName  string           `json:"plugin_name"`
	EntityId    common.EntityId  `json:"entity_id"`
	OldState    EventEntityState `json:"old_state"`
	NewState    EventEntityState `json:"new_state"`
}

EventStateChanged ...

type EventType

type EventType string

EventType ...

type EventUnloadedPlugin added in v0.5.1

type EventUnloadedPlugin struct {
	PluginName string `json:"plugin_name"`
}

EventUnloadedPlugin ...

type EventUpdatedEntity added in v0.5.2

type EventUpdatedEntity struct {
	Id common.EntityId `json:"id"`
}

EventUpdatedEntity ...

Jump to

Keyboard shortcuts

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