middleware

package
v0.0.0-...-1f6104b Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Ported from chi's basic_auth middleware implementation [Source](https://github.com/go-chi/chi/blob/v1.5.5/middleware/basic_auth.go)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(realm string, creds map[string]string) ivy.Handler

BasicAuth implements a simple middleware for HTTP Basic Authentication. It takes a realm (displayed in browser prompt) and a map of username -> password.

Example:

r.Use(middleware.BasicAuth("Restricted", map[string]string{
    "admin": "secret",
    "user":  "password",
}))

func Logger

func Logger(loggerOpts ...LoggerOptions) ivy.Handler

func RequestID

func RequestID(generatorFn ...func() string) ivy.Handler

func RequiredQueryParams

func RequiredQueryParams(params ...string) ivy.Handler

Types

type LoggerOptions

type LoggerOptions struct {
	ShowQuery   *bool
	ShowHeaders *bool
	RouteFilter func(path string) bool
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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