hook

package
v0.0.0-...-7d6f566 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 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 ClassroomFunc

type ClassroomFunc func(context.Context, *ent.ClassroomMutation) (ent.Value, error)

The ClassroomFunc type is an adapter to allow the use of ordinary function as Classroom mutator.

func (ClassroomFunc) Mutate

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

Mutate calls f(ctx, m).

type CredentialFunc

type CredentialFunc func(context.Context, *ent.CredentialMutation) (ent.Value, error)

The CredentialFunc type is an adapter to allow the use of ordinary function as Credential mutator.

func (CredentialFunc) Mutate

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

Mutate calls f(ctx, m).

type LevelFunc

type LevelFunc func(context.Context, *ent.LevelMutation) (ent.Value, error)

The LevelFunc type is an adapter to allow the use of ordinary function as Level mutator.

func (LevelFunc) Mutate

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

type UserLevelFunc

type UserLevelFunc func(context.Context, *ent.UserLevelMutation) (ent.Value, error)

The UserLevelFunc type is an adapter to allow the use of ordinary function as UserLevel mutator.

func (UserLevelFunc) Mutate

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