Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ToSnakeCase = toSomeCase("_")
Functions ¶
func ToLowerFirst ¶ added in v1.1.1
Types ¶
type ChangeLog ¶
type ChangeLog struct { ID string `gorm:"type:uuid;primary_key;"` CreatedAt time.Time `sql:"DEFAULT:current_timestamp"` Action string ObjectID string `gorm:"index"` ObjectType string `gorm:"index"` RawObject JSONB `sql:"type:JSONB"` RawMeta JSONB `sql:"type:JSONB"` Object interface{} `sql:"-"` Meta interface{} `sql:"-"` }
ChangeLog is a main entity, which used to log changes.
type Interface ¶ added in v1.1.1
type Interface interface { // Meta should return structure, that can be converted to json. Meta() interface{} // contains filtered or unexported methods }
Interface is used to get metadata from your models.
type LoggableModel ¶
type LoggableModel struct{}
LoggableModel is a root structure, which implement Interface. Embed LoggableModel to your model so that Plugin starts tracking changes.
func (LoggableModel) Meta ¶ added in v1.1.1
func (LoggableModel) Meta() interface{}
type Option ¶ added in v1.1.1
type Option func(options *options)
func LazyUpdate ¶ added in v1.1.1
func RegMetaType ¶ added in v1.1.1
func RegObjectType ¶ added in v1.1.1
type Plugin ¶ added in v1.1.1
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) GetLastRecord ¶ added in v1.1.1
Click to show internal directories.
Click to hide internal directories.