Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Request related KeyHeader string `json:"key_header,omitempty"` // Connector ConnectorRPC string `json:"connector_rpc,omitempty"` // Rate Limit MaxSources int `json:"max_sources,omitempty"` Average int64 `json:"average,omitempty"` Period int64 `json:"period,omitempty"` Burst int64 `json:"burst,omitempty"` }
Config the plugin configuration.
func CreateConfig ¶
func CreateConfig() *Config
CreateConfig creates the default plugin configuration.
type FlowController ¶
type FlowController struct { Core // contains filtered or unexported fields }
FlowController : a FlowController plugin.
func (*FlowController) ServeHTTP ¶
func (fc *FlowController) ServeHTTP(rw http.ResponseWriter, req *http.Request)
The Full processor
func (*FlowController) Stop ¶
func (fc *FlowController) Stop()
Stop will not be called, it's just a resource release reminder
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func (*RateLimiter) RateLimit ¶
func (rl *RateLimiter) RateLimit(rw http.ResponseWriter, req *http.Request, account *string) bool
type ResponseWriterProxy ¶
type ResponseWriterProxy struct { http.ResponseWriter // contains filtered or unexported fields }
func NewResponseWriterProxy ¶
func NewResponseWriterProxy(rw http.ResponseWriter) *ResponseWriterProxy
func (*ResponseWriterProxy) StatusCode ¶
func (rwp *ResponseWriterProxy) StatusCode() int
func (*ResponseWriterProxy) WriteHeader ¶
func (rwp *ResponseWriterProxy) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.