hook

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func On

func On(hk ent.Hook, op ent.Op) ent.Hook

On executes the given hook only of the given operation.

hook.On(Log, ent.Delete|ent.Create)

func Reject

func Reject(op ent.Op) ent.Hook

Reject returns a hook that rejects all operations that match op.

func (T) Hooks() []ent.Hook {
	return []ent.Hook{
		Reject(ent.Delete|ent.Update),
	}
}

Types

type CardFunc

type CardFunc func(context.Context, *ent.CardMutation) (ent.Value, error)

The CardFunc type is an adapter to allow the use of ordinary function as Card mutator.

func (CardFunc) Mutate

func (f CardFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type CommentFunc

type CommentFunc func(context.Context, *ent.CommentMutation) (ent.Value, error)

The CommentFunc type is an adapter to allow the use of ordinary function as Comment mutator.

func (CommentFunc) Mutate

func (f CommentFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type FieldTypeFunc

type FieldTypeFunc func(context.Context, *ent.FieldTypeMutation) (ent.Value, error)

The FieldTypeFunc type is an adapter to allow the use of ordinary function as FieldType mutator.

func (FieldTypeFunc) Mutate

func (f FieldTypeFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type FileFunc

type FileFunc func(context.Context, *ent.FileMutation) (ent.Value, error)

The FileFunc type is an adapter to allow the use of ordinary function as File mutator.

func (FileFunc) Mutate

func (f FileFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type FileTypeFunc

type FileTypeFunc func(context.Context, *ent.FileTypeMutation) (ent.Value, error)

The FileTypeFunc type is an adapter to allow the use of ordinary function as FileType mutator.

func (FileTypeFunc) Mutate

func (f FileTypeFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type GroupFunc

type GroupFunc func(context.Context, *ent.GroupMutation) (ent.Value, error)

The GroupFunc type is an adapter to allow the use of ordinary function as Group mutator.

func (GroupFunc) Mutate

func (f GroupFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type GroupInfoFunc

type GroupInfoFunc func(context.Context, *ent.GroupInfoMutation) (ent.Value, error)

The GroupInfoFunc type is an adapter to allow the use of ordinary function as GroupInfo mutator.

func (GroupInfoFunc) Mutate

func (f GroupInfoFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type ItemFunc

type ItemFunc func(context.Context, *ent.ItemMutation) (ent.Value, error)

The ItemFunc type is an adapter to allow the use of ordinary function as Item mutator.

func (ItemFunc) Mutate

func (f ItemFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type NodeFunc

type NodeFunc func(context.Context, *ent.NodeMutation) (ent.Value, error)

The NodeFunc type is an adapter to allow the use of ordinary function as Node mutator.

func (NodeFunc) Mutate

func (f NodeFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type PetFunc

type PetFunc func(context.Context, *ent.PetMutation) (ent.Value, error)

The PetFunc type is an adapter to allow the use of ordinary function as Pet mutator.

func (PetFunc) Mutate

func (f PetFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type SpecFunc

type SpecFunc func(context.Context, *ent.SpecMutation) (ent.Value, error)

The SpecFunc type is an adapter to allow the use of ordinary function as Spec mutator.

func (SpecFunc) Mutate

func (f SpecFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

type UserFunc

type UserFunc func(context.Context, *ent.UserMutation) (ent.Value, error)

The UserFunc type is an adapter to allow the use of ordinary function as User mutator.

func (UserFunc) Mutate

func (f UserFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)

Mutate calls f(ctx, m).

Jump to

Keyboard shortcuts

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