cache

package
v1.0.85 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(maxAge time.Duration, persistEncodings bool) *Cache

func (Cache) Count

func (c Cache) Count() int

func (Cache) Delete

func (c Cache) Delete(key string)

func (Cache) Get

func (c Cache) Get(requestBody []byte, requestParams string) (CacheEntry, bool, string)

func (Cache) GetByKey

func (c Cache) GetByKey(key string) (CacheEntry, bool)

func (Cache) Keys

func (c Cache) Keys() []string

func (Cache) MaxAge

func (c Cache) MaxAge() time.Duration

func (Cache) Set

func (c Cache) Set(
	requestBody []byte,
	requestParams string,
	requestHeader http.Header,
	responseModel interface{},
	responseBody []byte,
	responseHeader http.Header,
	responseStatusCode int,
)

func (Cache) Size

func (c Cache) Size() uint64

type CacheEntry added in v1.0.85

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

func (*CacheEntry) Clone added in v1.0.85

func (e *CacheEntry) Clone() CacheEntry

func (*CacheEntry) ResponseBody added in v1.0.85

func (e *CacheEntry) ResponseBody() []byte

func (*CacheEntry) ResponseBodyBrotli added in v1.0.85

func (e *CacheEntry) ResponseBodyBrotli() []byte

func (*CacheEntry) ResponseBodyDeflate added in v1.0.85

func (e *CacheEntry) ResponseBodyDeflate() []byte

func (*CacheEntry) ResponseBodyGzip added in v1.0.85

func (e *CacheEntry) ResponseBodyGzip() []byte

func (*CacheEntry) ResponseHeader added in v1.0.85

func (e *CacheEntry) ResponseHeader() http.Header

func (*CacheEntry) ResponseModel added in v1.0.85

func (e *CacheEntry) ResponseModel() interface{}

func (*CacheEntry) ResponseStatusCode added in v1.0.85

func (e *CacheEntry) ResponseStatusCode() int

func (*CacheEntry) String added in v1.0.85

func (e *CacheEntry) String() string

func (*CacheEntry) UpdatedOn added in v1.0.85

func (e *CacheEntry) UpdatedOn() time.Time

Jump to

Keyboard shortcuts

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