Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { // Subject identifies what changed. // By convention, it corresponds to the corresponding GET endpoint of the REST API. Subject string `json:"subject"` // Action describes how the change has to be applied. Action action.Action `json:"action"` // Object contains the data that changed. Object interface{} `json:"object"` }
Event is passed to the listeners of an observable type.
type Implementation ¶
type Implementation struct {
// contains filtered or unexported fields
}
Implementation can be embedded in implementations that are observable.
func (*Implementation) Notify ¶
func (implementation *Implementation) Notify(event Event)
Notify notifies the registered observers about the given event. This method should only be called from the implementation itself.
func (*Implementation) Observe ¶
func (implementation *Implementation) Observe(observer func(Event)) func()
Observe implements observable.Observe.
Click to show internal directories.
Click to hide internal directories.