Documentation ¶
Overview ¶
Package linkFilter for Toolkits
Index ¶
- Constants
- func IsTerminated(paths []string) bool
- func LinkTerminator(l *Link)
- func OnlyTerminator(paths []string) bool
- func PathTerminator(paths []string) []string
- type Filter
- type Link
- func (l *Link) AddSub(s *Link)
- func (l *Link) AddSubs(src ...*Link)
- func (l *Link) Contains(paths []string) bool
- func (l *Link) Equal(path string) bool
- func (l *Link) Has(name string) bool
- func (l *Link) HasSubs() bool
- func (l *Link) IsEnd() bool
- func (l *Link) String() string
- func (l *Link) StringList(parent string) []string
- type Linker
- type MethodType
- type Option
- type Setting
Constants ¶
View Source
const ( AnySymbol = "*" Terminator = "*" DefaultDelimiter = ":" )
Variables ¶
This section is empty.
Functions ¶
func IsTerminated ¶
func LinkTerminator ¶
func LinkTerminator(l *Link)
func OnlyTerminator ¶
func PathTerminator ¶
Types ¶
type Filter ¶
type Filter interface { Skip(req *http.Request) bool Denied(method, path string) bool Allowed(method, path string) bool AllowStrings(method string) []string DenyStrings(method string) []string }
func NewStringFilter ¶
type Link ¶
func (*Link) StringList ¶
type MethodType ¶
type MethodType uint8
const ( MethodAny MethodType = iota MethodGet MethodPut MethodDelete MethodConnect MethodHead MethodPost MethodPatch MethodTrace MethodOptions MethodTypeMax )
func MethodIndex ¶
func MethodIndex(method string) MethodType
func (MethodType) String ¶
func (i MethodType) String() string
type Setting ¶
type Setting = func(*Option)
func DisableAllow ¶
func DisableAllow() Setting
func DisableDeny ¶
func DisableDeny() Setting
func SkipAny ¶
func SkipAny() Setting
SkipAny strong rule check. After this function is enabled, wildcard method match check is skipped
func WithAllows ¶
func WithDelimiter ¶
func WithDenies ¶
Click to show internal directories.
Click to hide internal directories.