Documentation ¶
Index ¶
- Constants
- func AddJWTMiddleware(jwtSecretKey string, skipper func(c echo.Context) bool)
- func InitEasyRouter()
- func InitRouter(version, gitSha1 string, debugMode bool, responseDelay time.Duration, ...)
- func MiddlewareRecoverSentry(client *raven.Client, config *middleware.RecoverConfig) echo.MiddlewareFunc
- func MiddlewareResponseDelay(duration time.Duration) echo.MiddlewareFunc
- func MiddlewareResponseVersion(version, gitSha1 string) echo.MiddlewareFunc
- func Router() *echo.Echo
- type EasyHandlerFunc
- type EasyRouterStruct
- type PendingRegistration
Constants ¶
const (
//JWTContextKey is used to set the ContextKey of the JWT middleware
JWTContextKey = "user_token"
)
Variables ¶
This section is empty.
Functions ¶
func AddJWTMiddleware ¶
AddJWTMiddleware will add a JWT middleware
func InitEasyRouter ¶
func InitEasyRouter()
InitEasyRouter initializes the local/private instance/singleton of _easyRouter
func InitRouter ¶
func InitRouter(version, gitSha1 string, debugMode bool, responseDelay time.Duration, sentryClient *raven.Client)
InitRouter will initialize the router
func MiddlewareRecoverSentry ¶
func MiddlewareRecoverSentry(client *raven.Client, config *middleware.RecoverConfig) echo.MiddlewareFunc
MiddlewareRecoverSentry returns a middleware which recovers from panics anywhere in the chain and sends the event to Sentry using the client and handles the control to the centralized HTTPErrorHandler
func MiddlewareResponseDelay ¶
func MiddlewareResponseDelay(duration time.Duration) echo.MiddlewareFunc
func MiddlewareResponseVersion ¶
func MiddlewareResponseVersion(version, gitSha1 string) echo.MiddlewareFunc
MiddlewareResponseVersion is a middleware to add X-VERSION and X-SHA1 to response headers
Types ¶
type EasyHandlerFunc ¶
EasyHandlerFunc is a simple func receiving a echo.Context and a tasks.Context
type EasyRouterStruct ¶
type EasyRouterStruct struct {
// contains filtered or unexported fields
}
EasyRouterStruct is a simple struct to manage registering of routes
func EasyRouter ¶
func EasyRouter() *EasyRouterStruct
EasyRouter returns the local/private instance/singleton of _easyRouter
func (*EasyRouterStruct) DELETE ¶
func (e *EasyRouterStruct) DELETE(path string) *PendingRegistration
DELETE will register a DELETE method to the path with the given handler and middlewares
func (*EasyRouterStruct) GET ¶
func (e *EasyRouterStruct) GET(path string) *PendingRegistration
GET will register a GET method to the path with the given handler and middlewares
func (*EasyRouterStruct) POST ¶
func (e *EasyRouterStruct) POST(path string) *PendingRegistration
POST will register a POST method to the path with the given handler and middlewares
func (*EasyRouterStruct) PUT ¶
func (e *EasyRouterStruct) PUT(path string) *PendingRegistration
PUT will register a PUT method to the path with the given handler and middlewares
type PendingRegistration ¶
type PendingRegistration struct {
// contains filtered or unexported fields
}
PendingRegistration holds the route that will get registered
func (*PendingRegistration) Handler ¶
func (p *PendingRegistration) Handler(h EasyHandlerFunc) *PendingRegistration