Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PickIndexByWeight ¶
Types ¶
type Filter ¶
Filter interface
func New ¶
New build filter with specified data struct.
items: single filter: [ "$filter-name" // filter name, first item, optional ["$var-name", "$op", "$op-value"], // condition ["$var-name", "$op", "$op-value"], // condition ["$data-key", "$assign", "$assign-value"] // executor, last item ] filter group: [ // filter [ "$filter-name" // filter name, first item, optional ["$var-name", "$op", "$op-value"], // condition ["$var-name", "$op", "$op-value"], // condition ["$data-key", "$assign", "$assign-value"] // executor, last item ], // filter [ "$filter-name" // filter name, first item, optional ["$var-name", "$op", "$op-value"], // condition ["$var-name", "$op", "$op-value"], // condition ["$data-key", "$assign", "$assign-value"] // executor, last item ] ] options: ShortMode(true) // enable short mode, only active in group filter EnableRank(true) // enable rank mode, and set short mode only active in group filter Name("filter-name") // specify filter name
type FilterGroup ¶
type FilterGroup struct {
// contains filtered or unexported fields
}
FilterGroup contains multiple filters
func NewFilterGroup ¶
func NewFilterGroup(options ...Option) *FilterGroup
func (*FilterGroup) Add ¶
func (f *FilterGroup) Add(filter Filter, options ...Option)
func (*FilterGroup) Name ¶
func (f *FilterGroup) Name() string
Directories ¶
Path | Synopsis |
---|---|
ext
|
|
location
Define location variables from client ip So you should import package that defines ip var, e.g.
|
Define location variables from client ip So you should import package that defines ip var, e.g. |
request
Variables in client-server enviroment url : request url, setted with context.WithValue("request-url", "....") ua : client user-agent, setted with context.WithValue("user-agent", "...") ip : client_ip, setted with context.WithValue("client-ip", "...") get.xxx : query value from url.
|
Variables in client-server enviroment url : request url, setted with context.WithValue("request-url", "....") ua : client user-agent, setted with context.WithValue("user-agent", "...") ip : client_ip, setted with context.WithValue("client-ip", "...") get.xxx : query value from url. |
Click to show internal directories.
Click to hide internal directories.