middleware

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package middleware provides middleware for http Handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

A Chain is a middleware chain use for http request processing.

func NewChain

func NewChain(middlewares ...MiddlewareFunc) Chain

NewChain creates a new Middleware chain

func (Chain) Chain

func (c Chain) Chain(handler http.Handler) http.Handler

Chain returns a http.Handler that chains the middleware onion-style around the handler.

type MiddlewareFunc

type MiddlewareFunc func(next http.Handler) http.Handler

MiddlewareFunc is a function that acts as middleware for http Handlers.

func Conditional

func Conditional(middleware MiddlewareFunc, condition func(r *http.Request) bool) MiddlewareFunc

Conditional is a middleware that only executes middleware if the condition returns true for the request. If the condition returns false, the middleware is skipped, and request handling moves on to the next handler in the chain.

Directories

Path Synopsis
Package auth handles auth
Package auth handles auth
Package authtest is a mini server and token generator with a mock test to confirm keygen works correctly; not intended to test the whole api but rather just the token issuance and authentication
Package authtest is a mini server and token generator with a mock test to confirm keygen works correctly; not intended to test the whole api but rather just the token issuance and authentication
Package cachecontrol creates a cache control echo middleware
Package cachecontrol creates a cache control echo middleware
Package cors does cors stuff
Package cors does cors stuff
Package debug contains utility helper functions for debugging when working with echo server
Package debug contains utility helper functions for debugging when working with echo server
Package echocontext adds the echo context to the parent context
Package echocontext adds the echo context to the parent context
Package mime does mime stuff
Package mime does mime stuff
Package ratelimit implements a rate limiting middleware
Package ratelimit implements a rate limiting middleware
Package redirect does redirect stuff
Package redirect does redirect stuff
Package secure is middleware that provides protection against cross-site scripting (XSS) attack, content type sniffing, clickjacking, insecure connection and other code injection attacks
Package secure is middleware that provides protection against cross-site scripting (XSS) attack, content type sniffing, clickjacking, insecure connection and other code injection attacks
Package sentry is a middleware package for sentry integration
Package sentry is a middleware package for sentry integration
Package transaction implements a transaction middleware for REST endpoints using the ent db client
Package transaction implements a transaction middleware for REST endpoints using the ent db client

Jump to

Keyboard shortcuts

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