Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntitiesAddEvent ¶
type EntitiesAddEvent []Entity
EntitiesAddEvent is triggered when entities are added
type EntitiesDestroyEvent ¶
type EntitiesDestroyEvent []Entity
EntitiesDestroyEvent is triggered when entities are destroyed
type Entry ¶
type Entry struct { Type reflect.Type Last interface{} CallStart time.Time CallEnd time.Time Handlers []*Handler }
Entry holds the list of handlers for a specific function signature
type Messaging ¶
Messaging thing
func (*Messaging) Handle ¶
Handle registers an handler for the fn input type and returns the registered handler the fn interface must be a function with 1 parameter and no returns (i.e: func(type))
func (*Messaging) Query ¶
func (m *Messaging) Query(fn interface{})
Query will callback if the signature type has a message the fn interface must be a function with 1 parameter and no returns (i.e: func(type))
func (*Messaging) ReflAuto ¶
func (m *Messaging) ReflAuto(s interface{})
ReflAuto registers func handelrs by checking Methods on a struct If method has Handler prefix it will register as an handler If method has Watch prefix it will register as a watcher
func (*Messaging) Trigger ¶
func (m *Messaging) Trigger(v interface{})
Trigger will retrieve handlers for the specific signature type and call each one
XXX: Might be bad to hold a reference to last value while triggering since it can be a huge value, consider creating a new kind of Trigger method for this purpose like `Persist(v interface)`