cache

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalEdgeCache

func MarshalEdgeCache(cache *EdgeCache) ([]byte, error)

Types

type CacheManager

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

func NewCacheManager

func NewCacheManager(storage storage.Storage) *CacheManager

func (CacheManager) Cache

func (c CacheManager) Cache(req *http.Request, statusCode int, header http.Header, body io.ReadCloser) error

func (CacheManager) Query

func (c CacheManager) Query(req *http.Request) (*EdgeCache, error)

type EdgeCache

type EdgeCache struct {
	StatusCode int         `json:"code"`
	Header     http.Header `json:"header"`
	Body       []byte      `json:"body"`
}

EdgeCache hold all data of a response

func NewDefaultEdgeCache

func NewDefaultEdgeCache() *EdgeCache

func NewEdgeCache

func NewEdgeCache(statusCode int, header http.Header, body []byte) *EdgeCache

func UnmarshalEdgeCache

func UnmarshalEdgeCache(data []byte) (*EdgeCache, error)

Jump to

Keyboard shortcuts

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