Documentation ¶
Index ¶
Constants ¶
View Source
const ( // EventTypeCreated ... EventTypeCreated = "CREATED" // EventTypeUpdated ... EventTypeUpdated = "UPDATED" // EventTypeDeleted ... EventTypeDeleted = "DELETED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { EventMetadata ID string `json:"id"` Changes []*EventChange `json:"changes"` OldValues map[string]EventDataValue `json:"oldValues"` NewValues map[string]EventDataValue `json:"newValues"` }
Event ...
func (*Event) AddNewValue ¶
func (e *Event) AddNewValue(column string, v EventDataValue)
AddNewValue ...
func (*Event) AddOldValue ¶
func (e *Event) AddOldValue(column string, v EventDataValue)
AddOldValue ...
func (*Event) Change ¶
func (e *Event) Change(column string) (ec *EventChange)
func (Event) ChangedColumns ¶
ChangedColumns returns list of names of changed columns
func (Event) HasChangedColumn ¶
HasChangedColumn check if given event has changes on specific column
type EventChange ¶
type EventChange struct { Name string `json:"name"` OldValue string `json:"oldValue"` NewValue string `json:"newValue"` }
EventChange ...
func (*EventChange) NewValueAs ¶ added in v0.1.11
func (ec *EventChange) NewValueAs(data interface{}) error
func (*EventChange) OldValueAs ¶ added in v0.1.11
func (ec *EventChange) OldValueAs(data interface{}) error
func (*EventChange) SetNewValue ¶ added in v0.1.11
func (ec *EventChange) SetNewValue(value interface{}) error
func (*EventChange) SetOldValue ¶ added in v0.1.11
func (ec *EventChange) SetOldValue(value interface{}) error
type EventDataValue ¶
type EventDataValue interface{}
type EventMetadata ¶
Click to show internal directories.
Click to hide internal directories.