Documentation
¶
Overview ¶
Package mixin contains the mixin package
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuditMixin ¶
AuditMixin provides auditing for all records where enabled. The created_at, created_by, updated_at, and updated_by records are automatically populated when this mixin is enabled.
type IDMixin ¶
type IDMixin struct {
mixin.Schema
// IncludeMappingID to include the mapping ID field to the schema that can be used without exposing the primary ID
// by default, it is not included by default
IncludeMappingID bool
// HumanIdentifierPrefix is the prefix to use for the human identifier, if set a display_id field will be added
// based on the original ID
HumanIdentifierPrefix string
// OverrideDefaultIndex to override the default index set on the display ID
OverrideDefaultIndex string
// SingleFieldIndex to set a single field index on the display ID
SingleFieldIndex bool
// OverrideDisplayID field name lets you customize the display ID field name
OverrideDisplayID string
// DisplayIDLength is the length of the display ID without the prefix, defaults to 6
DisplayIDLength int
}
IDMixin holds the schema definition for the ID
func NewIDMixinWithMappingID ¶ added in v0.4.0
func NewIDMixinWithMappingID() IDMixin
NewIDMixinWithMappingID creates a new IDMixin and includes an additional mapping ID
func NewIDMixinWithPrefixedID ¶ added in v0.4.0
NewIDMixinWithPrefixedID creates a new IDMixin and includes an additional prefixed ID, e.g. TSK-000001
type UnexpectedAuditError ¶
UnexpectedAuditError is returned when an unexpected audit log call is received
func (*UnexpectedAuditError) Error ¶
func (e *UnexpectedAuditError) Error() string
Error returns the UnexpectedAuditError in string format
Click to show internal directories.
Click to hide internal directories.