Documentation ¶
Index ¶
Constants ¶
View Source
const ( //ChangeTypeCreate defines create change type ChangeTypeCreate = ChangeType("create") //ChangeTypeUpdate defines update change type ChangeTypeUpdate = ChangeType("update") //ChangeTypeDelete defines delete change type ChangeTypeDelete = ChangeType("delete") )
View Source
const ( //PathKindRoot defines root path kind PathKindRoot = PathKind(iota) //PathKinField defines field path kind PathKinField //PathKindKey defines key path kind PathKindKey //PathKindIndex defines index path kind PathKindIndex )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct { Type ChangeType Path *Path From interface{} To interface{} Error string }
Change represents a change
type ChangeLog ¶
type ChangeLog struct {
Changes []*Change
}
ChangeLog represents a change log
func (*ChangeLog) ToChangeRecords ¶
func (l *ChangeLog) ToChangeRecords(options ...LogOption) []*ChangeRecord
ToChangeRecords converts changeLog to change records
type ChangeRecord ¶
type ChangeRecord struct { Source string `json:",omitempty"` SourceID interface{} `json:",omitempty"` UserID interface{} `json:",omitempty"` Path string Change string From interface{} `json:",omitempty"` To interface{} `json:",omitempty"` Error string `json:",omitempty"` }
ChangeRecord defines a change record
type LogOption ¶
type LogOption func(l *logOptions)
func WithSource ¶
func WithSourceID ¶
func WithSourceID(id interface{}) LogOption
func WithUserID ¶
func WithUserID(userID interface{}) LogOption
Click to show internal directories.
Click to hide internal directories.