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 ¶
const InvalidTokenMessage = "Invalid API Token"
InvalidTokenMessage is the message set when an invalid / missing token is found.
const TokenPathParam = "token"
TokenPathParam is the name of the path parameter used by URLAuthPrefix
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 MakeAuth ¶
func MakeAuth(header string, tokens []string) echo.MiddlewareFunc
MakeAuth constructs the auth middleware function
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 ¶
func MakeLogger(log log.Logger) echo.MiddlewareFunc
MakeLogger initializes the logger middleware function
func MakePNA ¶
func MakePNA() echo.MiddlewareFunc
MakePNA constructs the Private Network Access 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