middleware

package
v0.0.0-...-91dbc65 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cors

func Cors(next http.Handler) http.Handler

Cors sets the cross-origin resource sharing HTTP headers.

func NewRateLimiter

func NewRateLimiter(config config.RateLimiter) (*httplimit.Middleware, error)

NewRateLimiter returns a rate limiter with the configuration values passed.

Types

type Logger

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

Logger contains a logger to log HTTP calls.

func NewLogger

func NewLogger(config config.Logger) (*Logger, error)

NewLogger returns a new logging middleware.

func (*Logger) Log

func (l *Logger) Log(next http.Handler) http.Handler

Log intercepts and logs each API request.

Jump to

Keyboard shortcuts

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