hook

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(hook interface{}, hType HookType) error

Do call the specific method to handle hook based on hType

Types

type HookType

type HookType string
const (
	BeforeInsert HookType = "beforeInsert"
	AfterInsert  HookType = "afterInsert"
	BeforeUpdate HookType = "beforeUpdate"
	AfterUpdate  HookType = "afterUpdate"
	BeforeQuery  HookType = "beforeQuery"
	AfterQuery   HookType = "afterQuery"
	BeforeRemove HookType = "beforeRemove"
	AfterRemove  HookType = "afterRemove"
)

type InsertHook

type InsertHook interface {
	BeforeInsert() error
	AfterInsert() error
}

InsertHook defines the insert hook interface

type QueryHook

type QueryHook interface {
	BeforeQuery() error
	AfterQuery() error
}

QueryHook defines the query hook interface

type RemoveHook

type RemoveHook interface {
	BeforeRemove() error
	AfterRemove() error
}

RemoveHook defines the remove hook interface

type UpdateHook

type UpdateHook interface {
	BeforeUpdate() error
	AfterUpdate() error
}

UpdateHook defines the Update hook interface

Jump to

Keyboard shortcuts

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