cache

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyResponse

func CopyResponse(resp *http.Response) *http.Response

func CreateCacheKey

func CreateCacheKey(req *http.Request) string

Types

type Cache

type Cache interface {
	Get(key string) *http.Response
	Set(key string, value *http.Response)
	Delete(key string)
	Clear()
	Has(key string) bool
}

func NewNoOpCache

func NewNoOpCache() Cache

type GoCache

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

func NewGoCache

func NewGoCache(ttl int32, tti int32) GoCache

func (GoCache) Clear

func (c GoCache) Clear()

func (GoCache) Delete

func (c GoCache) Delete(key string)

func (GoCache) Get

func (c GoCache) Get(key string) *http.Response

func (GoCache) Has

func (c GoCache) Has(key string) bool

func (GoCache) Set

func (c GoCache) Set(key string, value *http.Response)

type NoOpCache

type NoOpCache struct {
}

func (NoOpCache) Clear

func (c NoOpCache) Clear()

func (NoOpCache) Delete

func (c NoOpCache) Delete(key string)

func (NoOpCache) Get

func (c NoOpCache) Get(key string) *http.Response

func (NoOpCache) Has

func (c NoOpCache) Has(key string) bool

func (NoOpCache) Set

func (c NoOpCache) Set(key string, value *http.Response)

Jump to

Keyboard shortcuts

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