middleware

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAllMiddlewares

func ApplyAllMiddlewares(
	handler http.Handler,
	serviceName string,
	logger *zerolog.Logger,
	registry prometheus.Registerer,
	statistics *Statistics,
) http.Handler

func GetCacheState

func GetCacheState(ctx context.Context) string

func SetCacheState

func SetCacheState(r *http.Request, value string)

func StateHandler

func StateHandler(next http.Handler) http.Handler

Types

type RequestState

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

type Statistics added in v0.0.12

type Statistics struct {
	CacheHits       atomic.Uint64
	CacheMisses     atomic.Uint64
	UnCacheable     atomic.Uint64
	Revalidated     atomic.Uint64
	BytesServed     atomic.Uint64
	BytesDownloaded atomic.Uint64
}

func LoadSavedStatistics added in v0.0.12

func LoadSavedStatistics(path string, logger *zerolog.Logger) (*Statistics, error)

func (*Statistics) Save added in v0.0.12

func (s *Statistics) Save(path string, logger *zerolog.Logger) error

Jump to

Keyboard shortcuts

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