Documentation
¶
Index ¶
- Variables
- func RegisterCallbacks(db *gorm.DB)
- type CreationAudited
- type DeletionAudited
- type FullAudited
- type ICreationAudited
- type IDeletionAuditable
- type IFullAuditable
- type IModificationAuditable
- type ModificationAudited
- type NanoID
- type TenantID
- func (t TenantID) GormValue(ctx context.Context, db *gorm.DB) (expr clause.Expr)
- func (t TenantID) MarshalJSON() ([]byte, error)
- func (TenantID) QueryClauses(f *schema.Field) []clause.Interface
- func (t *TenantID) Scan(value interface{}) error
- func (t *TenantID) UnmarshalJSON(b []byte) error
- func (t TenantID) Value() (driver.Value, error)
- type TenantIDQueryClause
- type UUID
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrContextNotFound = "invalid context or context missing"
)
Functions ¶
func RegisterCallbacks ¶
RegisterCallbacks register callback into GORM DB
Types ¶
type CreationAudited ¶
func (CreationAudited) GetCreatedBy ¶
func (model CreationAudited) GetCreatedBy() *string
GetCreatedBy get created by
func (*CreationAudited) SetCreatedBy ¶
func (model *CreationAudited) SetCreatedBy(createdBy interface{})
SetCreatedBy set created by
type DeletionAudited ¶
func (DeletionAudited) GetDeletedBy ¶
func (model DeletionAudited) GetDeletedBy() *string
GetDeletedBy get deleted by
func (*DeletionAudited) SetDeletedBy ¶
func (model *DeletionAudited) SetDeletedBy(updatedBy interface{})
SetDeletedBy set deleted by
type FullAudited ¶
type FullAudited struct { CreationAudited ModificationAudited DeletionAudited }
FullAudited make Model Auditable, embed `datatypes.FullAudited` into your model as anonymous field to make the model auditable
type User struct { gorm.Model datatypes.FullAudited }
type ICreationAudited ¶
type ICreationAudited interface { SetCreatedBy(createdBy interface{}) GetCreatedBy() string }
type IDeletionAuditable ¶
type IDeletionAuditable interface { SetDeletedBy(deletedBy interface{}) GetDeletedBy() string }
type IFullAuditable ¶
type IFullAuditable interface { ICreationAudited IModificationAuditable IDeletionAuditable }
type IModificationAuditable ¶
type IModificationAuditable interface { SetUpdatedBy(updatedBy interface{}) GetUpdatedBy() string }
type ModificationAudited ¶
func (ModificationAudited) GetUpdatedBy ¶
func (model ModificationAudited) GetUpdatedBy() *string
GetUpdatedBy get updated by
func (*ModificationAudited) SetUpdatedBy ¶
func (model *ModificationAudited) SetUpdatedBy(updatedBy interface{})
SetUpdatedBy set updated by
type TenantID ¶
type TenantID sql.NullString
func NewTenantId ¶
func (TenantID) MarshalJSON ¶
func (*TenantID) UnmarshalJSON ¶
type TenantIDQueryClause ¶
func (TenantIDQueryClause) Build ¶
func (sd TenantIDQueryClause) Build(clause.Builder)
func (TenantIDQueryClause) MergeClause ¶
func (sd TenantIDQueryClause) MergeClause(*clause.Clause)
func (TenantIDQueryClause) ModifyStatement ¶
func (sd TenantIDQueryClause) ModifyStatement(stmt *gorm.Statement)
func (TenantIDQueryClause) Name ¶
func (sd TenantIDQueryClause) Name() string
Click to show internal directories.
Click to hide internal directories.