hook

package
v0.0.0-...-52c565a Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: GPL-3.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 JiangHuRenFunc

type JiangHuRenFunc func(context.Context, *ent.JiangHuRenMutation) (ent.Value, error)

The JiangHuRenFunc type is an adapter to allow the use of ordinary function as JiangHuRen mutator.

func (JiangHuRenFunc) Mutate

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

Mutate calls f(ctx, m).

type MenPaiFunc

type MenPaiFunc func(context.Context, *ent.MenPaiMutation) (ent.Value, error)

The MenPaiFunc type is an adapter to allow the use of ordinary function as MenPai mutator.

func (MenPaiFunc) Mutate

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

Mutate calls f(ctx, m).

type WeaponFunc

type WeaponFunc func(context.Context, *ent.WeaponMutation) (ent.Value, error)

The WeaponFunc type is an adapter to allow the use of ordinary function as Weapon mutator.

func (WeaponFunc) Mutate

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

Mutate calls f(ctx, m).

type WuGongFunc

type WuGongFunc func(context.Context, *ent.WuGongMutation) (ent.Value, error)

The WuGongFunc type is an adapter to allow the use of ordinary function as WuGong mutator.

func (WuGongFunc) Mutate

func (f WuGongFunc) 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