hook

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, hook interface{}, opType operator.OpType, opts ...interface{}) error

Do call the specific method to handle hook based on hType If opts has valid value, use it instead of original hook

Types

type AfterInsertHook

type AfterInsertHook interface {
	AfterInsert(ctx context.Context) error
}

type AfterQueryHook

type AfterQueryHook interface {
	AfterQuery(ctx context.Context) error
}

type AfterRemoveHook

type AfterRemoveHook interface {
	AfterRemove(ctx context.Context) error
}

type AfterUpdateHook

type AfterUpdateHook interface {
	AfterUpdate(ctx context.Context) error
}

type AfterUpsertHook

type AfterUpsertHook interface {
	AfterUpsert(ctx context.Context) error
}

type BeforeInsertHook

type BeforeInsertHook interface {
	BeforeInsert(ctx context.Context) error
}

BeforeInsertHook InsertHook defines the insert hook interface

type BeforeQueryHook

type BeforeQueryHook interface {
	BeforeQuery(ctx context.Context) error
}

BeforeQueryHook QueryHook defines the query hook interface

type BeforeRemoveHook

type BeforeRemoveHook interface {
	BeforeRemove(ctx context.Context) error
}

BeforeRemoveHook RemoveHook defines the remove hook interface

type BeforeUpdateHook

type BeforeUpdateHook interface {
	BeforeUpdate(ctx context.Context) error
}

BeforeUpdateHook defines the Update hook interface

type BeforeUpsertHook

type BeforeUpsertHook interface {
	BeforeUpsert(ctx context.Context) error
}

BeforeUpsertHook UpsertHook defines the upsert hook interface

Jump to

Keyboard shortcuts

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