cache

package
v2.0.1-0...-09e0ba5 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 7 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)
	GetString(key string) string
	SetString(key string, value string)
	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) GetString

func (c GoCache) GetString(key string) string

func (GoCache) Has

func (c GoCache) Has(key string) bool

func (GoCache) Set

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

func (GoCache) SetString

func (c GoCache) SetString(key string, value string)

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) GetString

func (c NoOpCache) GetString(key string) string

func (NoOpCache) Has

func (c NoOpCache) Has(key string) bool

func (NoOpCache) Set

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

func (NoOpCache) SetString

func (c NoOpCache) SetString(key string, value string)

Jump to

Keyboard shortcuts

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