middlewares

package
v0.0.0-...-7e562c3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL