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 uuid.UUID `gorm:"primary_key;"` CreatedAt time.Time `sql:"DEFAULT:current_timestamp"` Action string ObjectID string `gorm:"index"` ObjectType string `gorm:"index"` RawObject string `sql:"type:JSON"` RawMeta string `sql:"type:JSON"` 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{} // enable/disable loggable Enable(v bool) // contains filtered or unexported methods }
Interface is used to get metadata from your models.
type LoggableModel ¶
type LoggableModel struct {
Disabled bool `sql:"-"`
}
LoggableModel is a root structure, which implement Interface. Embed LoggableModel to your model so that Plugin starts tracking changes.
func (LoggableModel) Enable ¶ added in v1.1.1
func (l LoggableModel) Enable(v bool)
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.