hook

package
v0.0.0-...-5ed2d9f Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 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 mgo常量.OpType, opts ...interface{}) error

根据hType调用特定的方法来处理钩子 如果opts有有效的值,将使用它替换原始的钩子 md5:8a28d86282a2f1cb

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 插入钩子接口定义了插入操作前的钩子函数 md5:d21219ecf0626005

type BeforeQueryHook

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

BeforeQueryHook QueryHook 定义了查询钩子接口 md5:7190d574d8ba3bb9

type BeforeRemoveHook

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

BeforeRemoveHook RemoveHook 定义了移除钩子接口 md5:9c4d45d4f016c9cc

type BeforeUpdateHook

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

BeforeUpdateHook 定义了 Update 钩子接口 md5:5b0bf7445582bfc4

type BeforeUpsertHook

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

BeforeUpsertHook UpsertHook 定义了 Upsert 操作前的钩子接口 md5:745e467bebed93fc

Jump to

Keyboard shortcuts

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