httpcache

package
v0.0.0-...-2bc8f10 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const PREFIX = "---HTTP-RESPONSE---\n"

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(b []byte) (*http.Response, error)

func Serialize

func Serialize(resp *http.Response) ([]byte, error)

Serialize writes the http.Response to the given writer using gob encoding.

Types

type HTTPCache

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

func New

func New(cache cache.GenericCache) *HTTPCache

func NewHTTP

func NewHTTP(cache cache.GenericCache) *HTTPCache

func (*HTTPCache) GenerateKey

func (d *HTTPCache) GenerateKey(request *http.Request) (string, error)

Generates a unique key to store a value, based on URL, method, selected headers, and body

func (*HTTPCache) GetKey

func (d *HTTPCache) GetKey(requestKey string) (*http.Response, error)

func (*HTTPCache) GetReq

func (d *HTTPCache) GetReq(req *http.Request) (*http.Response, error)

func (*HTTPCache) SetKey

func (d *HTTPCache) SetKey(requestKey string, resp *http.Response) error

func (*HTTPCache) SetReq

func (d *HTTPCache) SetReq(request *http.Request, resp *http.Response) error

Jump to

Keyboard shortcuts

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