middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(repo repository.PostmarkRepository) func(http.Handler) http.Handler

AuthMiddleware validates the PostmarkApp API token

func GetServer

func GetServer(r *http.Request) *models.Server

GetServer retrieves the server from the request context

func GetServerID

func GetServerID(r *http.Request) int

GetServerID retrieves the server ID from the request context

func RequireJSONMiddleware

func RequireJSONMiddleware(next http.Handler) http.Handler

RequireJSONMiddleware ensures the Content-Type is application/json

Types

type ContextKey

type ContextKey string

ContextKey is a type for context keys

const (
	// ServerIDKey is the context key for the server ID
	ServerIDKey ContextKey = "server_id"
	// ServerKey is the context key for the full server object
	ServerKey ContextKey = "server"
)

Jump to

Keyboard shortcuts

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