Versions in this module Expand all Collapse all v1 v1.0.0 Jan 4, 2024 Changes in this version + const ActivityCreate + const ActivityDelete + const ActivityEdit + const ActivityView + const Create + const CreatorContextKey + const DBContextKey + const Delete + const I18nActivityKey + const Update + var DefaultIgnoredFields = []string + var DefaultTypeHandles = map[reflect.Type]TypeHandler + var Messages_en_US = &Messages + var Messages_zh_CN = &Messages + func ContextWithCreator(ctx context.Context, name string) context.Context + func ContextWithDB(ctx context.Context, db *gorm.DB) context.Context + func DiffComponent(diffstr string, req *http.Request) h.HTMLComponent + type ActivityBuilder struct + func New(b *presets.Builder, db *gorm.DB, logModel ...ActivityLogInterface) *ActivityBuilder + func (ab *ActivityBuilder) AddCreateRecord(creator interface{}, v interface{}, db *gorm.DB) error + func (ab *ActivityBuilder) AddCustomizedRecord(action string, diff bool, ctx context.Context, obj interface{}) error + func (ab *ActivityBuilder) AddDeleteRecord(creator interface{}, v interface{}, db *gorm.DB) error + func (ab *ActivityBuilder) AddEditRecord(creator interface{}, now interface{}, db *gorm.DB) error + func (ab *ActivityBuilder) AddEditRecordWithOld(creator interface{}, old, now interface{}, db *gorm.DB) error + func (ab *ActivityBuilder) AddEditRecordWithOldAndContext(ctx context.Context, old, now interface{}) error + func (ab *ActivityBuilder) AddRecords(action string, ctx context.Context, vs ...interface{}) error + func (ab *ActivityBuilder) AddSaveRecord(creator interface{}, now interface{}, db *gorm.DB) error + func (ab *ActivityBuilder) AddViewRecord(creator interface{}, v interface{}, db *gorm.DB) error + func (ab *ActivityBuilder) RegisterModel(m interface{}) (mb *ModelBuilder) + func (ab *ActivityBuilder) RegisterModels(models ...interface{}) *ActivityBuilder + func (ab *ActivityBuilder) SetCreatorContextKey(key interface{}) *ActivityBuilder + func (ab *ActivityBuilder) SetDBContextKey(key interface{}) *ActivityBuilder + func (ab *ActivityBuilder) SetTabHeading(f func(log ActivityLogInterface) string) *ActivityBuilder + func (ab ActivityBuilder) GetActivityLogs(m interface{}, db *gorm.DB) []*ActivityLog + func (ab ActivityBuilder) GetCustomizeActivityLogs(m interface{}, db *gorm.DB) interface{} + func (ab ActivityBuilder) GetModelBuilder(v interface{}) (*ModelBuilder, bool) + func (ab ActivityBuilder) GetModelBuilders() []*ModelBuilder + func (ab ActivityBuilder) GetPresetModelBuilder() *presets.ModelBuilder + func (ab ActivityBuilder) MustGetModelBuilder(v interface{}) *ModelBuilder + func (ab ActivityBuilder) NewLogModelData() interface{} + func (ab ActivityBuilder) NewLogModelSlice() interface{} + type ActivityLog struct + Action string + CreatedAt time.Time + Creator string + ID uint + ModelDiffs string + ModelKeys string + ModelLabel string + ModelLink string + ModelName string + UserID uint + func (al *ActivityLog) GetAction() string + func (al *ActivityLog) GetCreator() string + func (al *ActivityLog) GetModelDiffs() string + func (al *ActivityLog) GetModelKeys() string + func (al *ActivityLog) GetModelLabel() string + func (al *ActivityLog) GetModelLink() string + func (al *ActivityLog) GetModelName() string + func (al *ActivityLog) SetAction(s string) + func (al *ActivityLog) SetCreatedAt(t time.Time) + func (al *ActivityLog) SetCreator(s string) + func (al *ActivityLog) SetModelDiffs(s string) + func (al *ActivityLog) SetModelKeys(s string) + func (al *ActivityLog) SetModelLabel(s string) + func (al *ActivityLog) SetModelLink(s string) + func (al *ActivityLog) SetModelName(s string) + func (al *ActivityLog) SetUserID(id uint) + func (al ActivityLog) GetCreatedAt() time.Time + func (al ActivityLog) GetUserID() uint + type ActivityLogInterface interface + GetAction func() string + GetCreatedAt func() time.Time + GetCreator func() string + GetModelDiffs func() string + GetModelKeys func() string + GetModelLabel func() string + GetModelLink func() string + GetModelName func() string + GetUserID func() uint + SetAction func(string) + SetCreatedAt func(time.Time) + SetCreator func(string) + SetModelDiffs func(string) + SetModelKeys func(string) + SetModelLabel func(string) + SetModelLink func(string) + SetModelName func(string) + SetUserID func(uint) + type CreatorInterface interface + GetID func() uint + GetName func() string + type Diff struct + Field string + Now string + Old string + type DiffBuilder struct + func NewDiffBuilder(mb *ModelBuilder) *DiffBuilder + func (db *DiffBuilder) Diff(old, now interface{}) ([]Diff, error) + type Messages struct + ActionAll string + ActionCreate string + ActionDelete string + ActionEdit string + ActionView string + Activities string + DiffChanges string + DiffDelete string + DiffDetail string + DiffField string + DiffNew string + DiffNow string + DiffOld string + DiffValue string + FilterAction string + FilterCreatedAt string + FilterCreator string + FilterModel string + ModelAction string + ModelCreatedAt string + ModelCreator string + ModelDiffs string + ModelKeys string + ModelLabel string + ModelLink string + ModelName string + ModelUserID string + type ModelBuilder struct + func (mb *ModelBuilder) AddCreateRecord(creator interface{}, v interface{}, db *gorm.DB) error + func (mb *ModelBuilder) AddCustomizedRecord(action string, diff bool, ctx context.Context, obj interface{}) error + func (mb *ModelBuilder) AddDeleteRecord(creator interface{}, v interface{}, db *gorm.DB) error + func (mb *ModelBuilder) AddEditRecord(creator interface{}, now interface{}, db *gorm.DB) error + func (mb *ModelBuilder) AddEditRecordWithOld(creator interface{}, old, now interface{}, db *gorm.DB) error + func (mb *ModelBuilder) AddIgnoredFields(fields ...string) *ModelBuilder + func (mb *ModelBuilder) AddKeys(keys ...string) *ModelBuilder + func (mb *ModelBuilder) AddRecords(action string, ctx context.Context, vs ...interface{}) error + func (mb *ModelBuilder) AddSaveRecord(creator interface{}, now interface{}, db *gorm.DB) error + func (mb *ModelBuilder) AddTypeHanders(v interface{}, f TypeHandler) *ModelBuilder + func (mb *ModelBuilder) AddViewRecord(creator interface{}, v interface{}, db *gorm.DB) error + func (mb *ModelBuilder) Diff(old, now interface{}) ([]Diff, error) + func (mb *ModelBuilder) EnableActivityInfoTab() *ModelBuilder + func (mb *ModelBuilder) GetType() reflect.Type + func (mb *ModelBuilder) KeysValue(v interface{}) string + func (mb *ModelBuilder) SetIgnoredFields(fields ...string) *ModelBuilder + func (mb *ModelBuilder) SetKeys(keys ...string) *ModelBuilder + func (mb *ModelBuilder) SetLink(f func(interface{}) string) *ModelBuilder + func (mb *ModelBuilder) SkipCreate() *ModelBuilder + func (mb *ModelBuilder) SkipDelete() *ModelBuilder + func (mb *ModelBuilder) SkipUpdate() *ModelBuilder + type TypeHandler func(old, now interface{}, prefixField string) []Diff Other modules containing this package github.com/qor5/admin/v3