mixin

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package mixin contains the mixin package

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidTokenSize is returned when session token size is invalid
	ErrInvalidTokenSize = errors.New("invalid token size")
)

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 BaseMixin

type BaseMixin struct {
	mixin.Schema
}

BaseMixin for all schemas in the graph.

func (BaseMixin) Policy added in v0.1.1

func (BaseMixin) Policy() ent.Policy

Policy defines the privacy policy of the BaseMixin.

type IDMixin

type IDMixin struct {
	mixin.Schema
}

IDMixin holds the schema definition for the ID

func (IDMixin) Fields

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

Fields of the IDMixin.

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