Documentation
¶
Index ¶
- Constants
- func AddAction(tag string, action Action, priority int) bool
- func AddFilter(tag string, filter Filter, priority int) bool
- func ApplyFilter(tag string, data interface{}, params ...interface{}) (interface{}, error)
- func DoAction(tag string, params ...interface{})
- func HasAction(tag string, action Action) ([]int, bool)
- func HasFilter(tag string, filter Filter) ([]int, bool)
- func Instance() *hooks
- func NewInstance() *hooks
- func RemoveAction(tag string, action Action, priority int) bool
- func RemoveAllAction(tag string, priority int) bool
- func RemoveAllFilter(tag string, priority int) bool
- func RemoveFilter(tag string, filter Filter, priority int) bool
- type Action
- type Filter
Constants ¶
View Source
const AllPriority = 0
移除所有 Filter 和 Action 时用到的排序值
View Source
const DefaultPriority = 10
默认排序
Variables ¶
This section is empty.
Functions ¶
func ApplyFilter ¶ added in v0.0.2
执行 Filter
func RemoveAction ¶ added in v0.0.2
移除指定 tag 中指针相同并且排序相同的 Action priority 为 0 则忽略 priority 并移除 tag 下所有匹配的 Action
func RemoveAllAction ¶ added in v0.0.2
移除指定 tag 中 指定 priority 的 Action priority 为 0 则忽略 priority 并移除 tag 下所有匹配的 Action
func RemoveAllFilter ¶ added in v0.0.2
移除指定 tag 中 指定 priority 的 Filter priority 为 0 则忽略 priority 并移除 tag 下所有匹配的 Filter
Types ¶
Click to show internal directories.
Click to hide internal directories.