middleware

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package middleware provides HTTP middleware for the API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectionFromContext

func ConnectionFromContext(ctx context.Context) database.Connection

ConnectionFromContext retrieves the database connection from the context. Returns nil if no connection is present.

func DatabaseTypeFromContext

func DatabaseTypeFromContext(ctx context.Context) database.DatabaseType

DatabaseTypeFromContext retrieves the database type from the context. Returns an empty string if no type is present.

func WithConnection

func WithConnection(conn database.Connection) func(http.Handler) http.Handler

WithConnection is middleware that injects a database connection into the request context. This is useful when you need to access the database type or connection in handlers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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