mixin

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Prefix string
}

Annotation captures the id prefix for a type.

func (Annotation) Name

func (a Annotation) Name() string

Name implements the ent Annotation interface.

type DatetimeMixin

type DatetimeMixin struct {
	mixin.Schema
}

DatetimeMixin defines an ent Mixin.

func NewDatetime

func NewDatetime() *DatetimeMixin

NewDatetime creates a Mixin that includes created_at and updated_at.

func (DatetimeMixin) Fields

func (m DatetimeMixin) Fields() []ent.Field

Fields provides the created_at and updated_at field.

type UlidMixin

type UlidMixin struct {
	mixin.Schema
	// contains filtered or unexported fields
}

UlidMixin defines an ent Mixin that captures the ULID prefix for a type.

func NewUlid

func NewUlid(prefix string) *UlidMixin

NewUlid creates a Mixin that encodes the provided prefix.

func (UlidMixin) Annotations

func (m UlidMixin) Annotations() []schema.Annotation

Annotations returns the annotations for a Mixin instance.

func (UlidMixin) Fields

func (m UlidMixin) Fields() []ent.Field

Fields provides the id field.

Jump to

Keyboard shortcuts

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