adsa-cms: Index | Files

package audited

import ""

Package audited is used to log last UpdatedBy and CreatedBy for your models



Package Files

audited.go callbacks.go

func RegisterCallbacks Uses

func RegisterCallbacks(db *gorm.DB)

RegisterCallbacks register callback into GORM DB

type AuditedModel Uses

type AuditedModel struct {
    CreatedBy string
    UpdatedBy string

AuditedModel make Model Auditable, embed `audited.AuditedModel` into your model as anonymous field to make the model auditable

type User struct {

func (AuditedModel) GetCreatedBy Uses

func (model AuditedModel) GetCreatedBy() string

GetCreatedBy get created by

func (AuditedModel) GetUpdatedBy Uses

func (model AuditedModel) GetUpdatedBy() string

GetUpdatedBy get updated by

func (*AuditedModel) SetCreatedBy Uses

func (model *AuditedModel) SetCreatedBy(createdBy interface{})

SetCreatedBy set created by

func (*AuditedModel) SetUpdatedBy Uses

func (model *AuditedModel) SetUpdatedBy(updatedBy interface{})

SetUpdatedBy set updated by

Package audited imports 3 packages (graph) and is imported by 3 packages. Updated 2017-06-08. Refresh now. Tools for package owners.