expapi

package
v0.12.0 Latest Latest
Warning

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

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

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

func DestroyHandler() http.Handler

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

func ListHandler() http.Handler

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

func RetrieveHandler() http.Handler

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

type KeyLister interface {
	Keys(prefix string) ([]string, error)
}

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.

Jump to

Keyboard shortcuts

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