mixin

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mixin contains the mixin package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditHook

func AuditHook(next ent.Mutator) ent.Mutator

AuditHook sets and returns the created_at, updated_at, etc., fields

Types

type AuditMixin

type AuditMixin struct {
	mixin.Schema
}

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.

func (AuditMixin) Fields

func (AuditMixin) Fields() []ent.Field

Fields of the AuditMixin

func (AuditMixin) Hooks

func (AuditMixin) Hooks() []ent.Hook

Hooks of the AuditMixin

type IDMixin

type IDMixin struct {
	mixin.Schema
	// ExcludeMappingID to exclude the mapping ID field to the schema that can be used without exposing the primary ID
	// by default, it is included in any schema that uses this mixin.
	ExcludeMappingID bool
}

IDMixin holds the schema definition for the ID

func (IDMixin) Fields

func (i IDMixin) Fields() []ent.Field

Fields of the IDMixin.

type TagMixin added in v0.1.1

type TagMixin struct {
	mixin.Schema
}

TagMixin holds the schema definition for the tags

func (TagMixin) Fields added in v0.1.1

func (t TagMixin) Fields() []ent.Field

Fields of the TagMixin.

type UnexpectedAuditError

type UnexpectedAuditError struct {
	MutationType ent.Mutation
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL