Documentation ¶
Index ¶
- func Accepted(ectx echo.Context) error
- func BadRequest(ectx echo.Context, i interface{}) error
- func CORSConfig() middleware.CORSConfig
- func Forbidden(ectx echo.Context) error
- func InternalServerError(ectx echo.Context) error
- func NoContent(ectx echo.Context) error
- func Ok(ectx echo.Context, i interface{}) error
- func RegisterHandlers(e *echo.Echo)
- func RegisterMiddlewares(e *echo.Echo)
- func ReturnInternalServerError(ectx echo.Context) error
- func SendToPocketBook(ectx echo.Context) error
- func ServerAddress() string
- func Start(e *echo.Echo) error
- func TooManyRequests(ectx echo.Context) error
- type EndpointThrottlingConfig
- type EndpointThrottlingLimiter
- type InvalidRequestFieldResponse
- type SendToPocketBookRequest
- type ThrottlingEngine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(ectx echo.Context, i interface{}) error
func CORSConfig ¶
func CORSConfig() middleware.CORSConfig
func InternalServerError ¶
func InternalServerError(ectx echo.Context) error
func RegisterHandlers ¶
func RegisterHandlers(e *echo.Echo)
func RegisterMiddlewares ¶
func RegisterMiddlewares(e *echo.Echo)
func ReturnInternalServerError ¶
func ReturnInternalServerError(ectx echo.Context) error
func SendToPocketBook ¶
func SendToPocketBook(ectx echo.Context) error
func ServerAddress ¶
func ServerAddress() string
func TooManyRequests ¶
func TooManyRequests(ectx echo.Context) error
Types ¶
type EndpointThrottlingLimiter ¶
type EndpointThrottlingLimiter struct { Limiter *rate.Limiter LastSeen time.Time Config EndpointThrottlingConfig }
func NewEndpointThrottlingLimiter ¶
func NewEndpointThrottlingLimiter(req http.Request) EndpointThrottlingLimiter
type InvalidRequestFieldResponse ¶
type InvalidRequestFieldResponse struct { Field string `json:"field"` Reason string `json:"reason"` }
func InvalidEmailResponse ¶
func InvalidEmailResponse() InvalidRequestFieldResponse
func NotConnectableUrlResponse ¶
func NotConnectableUrlResponse() InvalidRequestFieldResponse
func UnsupportedDocumentResponse ¶
func UnsupportedDocumentResponse() InvalidRequestFieldResponse
func UnsupportedEmailDomainResponse ¶
func UnsupportedEmailDomainResponse() InvalidRequestFieldResponse
type SendToPocketBookRequest ¶
type ThrottlingEngine ¶
type ThrottlingEngine struct { Visitors map[string]EndpointThrottlingLimiter VisitorsMutex *sync.Mutex }
func NewThrottlingEngine ¶
func NewThrottlingEngine() ThrottlingEngine
func (*ThrottlingEngine) CanAllowRequest ¶
func (te *ThrottlingEngine) CanAllowRequest(req http.Request, ectx echo.Context) bool
func (*ThrottlingEngine) StartThrottlingEngineCleanUp ¶
func (te *ThrottlingEngine) StartThrottlingEngineCleanUp()
Click to show internal directories.
Click to hide internal directories.