Documentation ¶
Index ¶
- Constants
- func MakeAuth(header string, tokens []string) echo.MiddlewareFunc
- func MakeCORS(tokenHeader string) echo.MiddlewareFunc
- func MakeConnectionLimiter(limit uint64) echo.MiddlewareFunc
- func MakeLogger(log log.Logger) echo.MiddlewareFunc
- func MakePNA() echo.MiddlewareFunc
- type AuthMiddleware
- type LoggerMiddleware
Constants ¶
View Source
const InvalidTokenMessage = "Invalid API Token"
InvalidTokenMessage is the message set when an invalid / missing token is found.
View Source
const TokenPathParam = "token"
TokenPathParam is the name of the path parameter used by URLAuthPrefix
View Source
const URLAuthPrefix = "/urlAuth/:" + TokenPathParam
URLAuthPrefix is the echo formatted url/path param which can be used for supplying an API token.
Variables ¶
This section is empty.
Functions ¶
func MakeCORS ¶
func MakeCORS(tokenHeader string) echo.MiddlewareFunc
MakeCORS sets up CORS with a token header.
func MakeConnectionLimiter ¶
func MakeConnectionLimiter(limit uint64) echo.MiddlewareFunc
MakeConnectionLimiter makes an echo middleware that limits the number of simultaneous connections. All connections above the limit will be returned the 429 Too Many Requests http error.
func MakeLogger ¶
MakeLogger initializes the logger middleware function
Types ¶
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
AuthMiddleware provides some data to the handler.
type LoggerMiddleware ¶
type LoggerMiddleware struct {
// contains filtered or unexported fields
}
LoggerMiddleware provides some extra state to the logger middleware
Click to show internal directories.
Click to hide internal directories.