middleware

package
v0.0.0-...-e3813da Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheOption

type CacheOption func(*directives)

func CacheImmutable

func CacheImmutable(b ...bool) CacheOption

func CacheMaxAge

func CacheMaxAge(t time.Duration) CacheOption

func CacheMustRevalidate

func CacheMustRevalidate(b ...bool) CacheOption

func CacheMustUnderstand

func CacheMustUnderstand(b ...bool) CacheOption

func CacheNoCache

func CacheNoCache(b ...bool) CacheOption

func CacheNoStore

func CacheNoStore(b ...bool) CacheOption

func CacheNoTransform

func CacheNoTransform(b ...bool) CacheOption

func CachePrivate

func CachePrivate(b ...bool) CacheOption

func CacheProxyRevalidate

func CacheProxyRevalidate(b ...bool) CacheOption

func CachePublic

func CachePublic(b ...bool) CacheOption

func CacheSMaxAge

func CacheSMaxAge(t time.Duration) CacheOption

func CacheStaleIfError

func CacheStaleIfError(t time.Duration) CacheOption

func CacheStaleWhileRevalidate

func CacheStaleWhileRevalidate(t time.Duration) CacheOption

type Middleware

type Middleware = func(next http.Handler) http.Handler

func Cache

func Cache(options ...CacheOption) Middleware

func DisableCache

func DisableCache() Middleware

func FormMethod

func FormMethod(key string) Middleware

func Logger

func Logger(logger *slog.Logger) Middleware

func PersistentCache

func PersistentCache(options ...CacheOption) Middleware

TODO: PersistentCache is a smarter implementation of SmartCache that handles requests with authorization, Cache-Control from the client, and stores responses into a persistent storage solution like Redis.

func SmartCache

func SmartCache(options ...CacheOption) Middleware

TODO: SmartCache is a smarter implementation of Cache that handles requests with authorization, Cache-Control from the client, and others.

Jump to

Keyboard shortcuts

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