Documentation ¶
Index ¶
Constants ¶
const ( // FilteredPassed request can pass to server FilteredPassed = 0 // FilteredFailed request cannot pass to server FilteredFailed = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CircuitBreakerFilter ¶
type CircuitBreakerFilter struct { DefaultFilter CBreaker *cbreaker.Circuits }
CircuitBreakerFilter circuit-breaker filter
func (*CircuitBreakerFilter) AsBegin ¶
func (c *CircuitBreakerFilter) AsBegin(ctx Context) Response
AsBegin execute at the beginning
func (*CircuitBreakerFilter) AsEnd ¶
func (c *CircuitBreakerFilter) AsEnd(ctx Context) Response
AsEnd execute at the end
func (*CircuitBreakerFilter) Init ¶
func (c *CircuitBreakerFilter) Init(config string) error
Init filter initialization
func (*CircuitBreakerFilter) Name ¶
func (c *CircuitBreakerFilter) Name() string
Name returns CircuitBreakerFilter's name
type Context ¶
type Context interface { StartAt() time.Time EndAt() time.Time SetAttr(key string, value interface{}) GetAttr(key string) interface{} HTTPRequest() *http.Request }
Context filter context interface
type CookieAuth ¶
type DefaultFilter ¶
type DefaultFilter struct{}
DefaultFilter base filter
func (*DefaultFilter) AsBegin ¶
func (f *DefaultFilter) AsBegin(c Context) Response
AsBegin execute at the beginning
func (*DefaultFilter) AsEnd ¶
func (f *DefaultFilter) AsEnd(c Context) Response
AsEnd execute at the end
type Filter ¶
type Filter interface { Name() string Init(config string) error AsBegin(c Context) Response AsEnd(c Context) Response }
Filter base filter interface
type HeaderAuth ¶
type HeaderFilter ¶
type HeaderFilter struct { DefaultFilter // contains filtered or unexported fields }
HeaderFilter rate-limiting filter
func (*HeaderFilter) AsBegin ¶
func (f *HeaderFilter) AsBegin(c Context) Response
AsBegin execute at the beginning
func (*HeaderFilter) AsEnd ¶
func (f *HeaderFilter) AsEnd(c Context) Response
AsEnd execute at the end
func (*HeaderFilter) Init ¶
func (f *HeaderFilter) Init(config string) error
Init filter initialization
type RateLimitFilter ¶
type RateLimitFilter struct { DefaultFilter // contains filtered or unexported fields }
RateLimitFilter rate-limiting filter
func (*RateLimitFilter) AsBegin ¶
func (f *RateLimitFilter) AsBegin(c Context) Response
AsBegin execute at the beginning
func (*RateLimitFilter) AsEnd ¶
func (f *RateLimitFilter) AsEnd(c Context) Response
AsEnd execute at the end
func (*RateLimitFilter) Init ¶
func (f *RateLimitFilter) Init(config string) error
Init filter initialization
func (*RateLimitFilter) Name ¶
func (f *RateLimitFilter) Name() string
Name returns RateLimitFilter's name
type TimeUsedFilter ¶
type TimeUsedFilter struct { DefaultFilter // contains filtered or unexported fields }
TimeUsedFilter rate-limiting filter
func (*TimeUsedFilter) AsBegin ¶
func (f *TimeUsedFilter) AsBegin(c Context) Response
AsBegin execute at the beginning
func (*TimeUsedFilter) AsEnd ¶
func (f *TimeUsedFilter) AsEnd(c Context) Response
AsEnd execute at the end
func (*TimeUsedFilter) Init ¶
func (f *TimeUsedFilter) Init(config string) error
Init filter initialization
func (*TimeUsedFilter) Name ¶
func (f *TimeUsedFilter) Name() string
Name returns TimeUsedFilter's name