mixin

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotateFields added in v0.3.0

func AnnotateFields(m ent.Mixin, annotations ...field.Annotation) ent.Mixin

AnnotateFields adds field annotations to underlying mixin fields.

Types

type CreateTime

type CreateTime struct{ Schema }

CreateTime adds created at time field.

func (CreateTime) Fields

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

Fields of the create time mixin.

type Schema

type Schema struct{}

Schema is the default implementation for the ent.Mixin interface. It should be embedded in end-user mixin as follows:

type M struct {
	mixin.Schema
}

func (Schema) Edges

func (Schema) Edges() []ent.Edge

Edges of the mixin.

func (Schema) Fields

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

Fields of the mixin.

func (Schema) Hooks

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

Hooks of the mixin.

func (Schema) Indexes

func (Schema) Indexes() []ent.Index

Indexes of the mixin.

type Time

type Time struct{ Schema }

Time composes create/update time mixin.

func (Time) Fields

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

Fields of the time mixin.

type UpdateTime

type UpdateTime struct{ Schema }

UpdateTime adds updated at time field.

func (UpdateTime) Fields

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

Fields of the update time mixin.

Source Files

Jump to

Keyboard shortcuts

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