Documentation
¶
Overview ¶
Package expapi provides HTTP handlers for managing and interacting with cache backends.
WARNING: This package is intended for debugging, development, or administrative use only. It is NOT recommended to expose these endpoints in production environments, as they allow direct access to cache contents and deletion.
Endpoints:
GET /debug/httpcache -- List cache keys (if supported)
GET /debug/httpcache/{key} -- Retrieve a cache entry
DELETE /debug/httpcache/{key} -- Delete a cache entry
Backends that implement the KeyLister interface will support key listing. All handlers expect a "dsn" query parameter to select the cache backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DestroyHandler ¶
DestroyHandler returns the destroy handler for the HTTP cache API.
This is only needed to install the handler in a non-standard location.
func ListHandler ¶
ListHandler returns the list handler for the HTTP cache API.
This is only needed to install the handler in a non-standard location.
func Register ¶
func Register(opts ...RegisterOption)
Register registers the HTTP cache API handlers with the provided options.
func RetrieveHandler ¶
RetrieveHandler returns the retrieve handler for the HTTP cache API.
This is only needed to install the handler in a non-standard location.
Types ¶
type KeyLister ¶
KeyLister is an optional interface implemented by cache backends that support listing keys. It provides a method to retrieve all keys in the cache that match a given prefix.
type RegisterOption ¶
type RegisterOption interface {
// contains filtered or unexported methods
}
func WithServeMux ¶
func WithServeMux(mux *http.ServeMux) RegisterOption
WithServeMux allows specifying a custom http.ServeMux for the HTTP cache API handlers; default: http.DefaultServeMux.