cache

package
v0.0.0-...-bfdbfb3 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNil = errors.New("result is nil")

ErrNil for not found.

Functions

This section is empty.

Types

type CacheAdapter

type CacheAdapter interface {
	Set(key string, value []byte, expire int) error
	Get(key string) ([]byte, error)
}

CacheAdapter defines the cache adapter for cache middleware.

type CacheMiddleware

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

CacheMiddleware provides the cache middleware.

func NewCache

func NewCache(adapter CacheAdapter, options ...CacheOption) *CacheMiddleware

NewCacheMiddleware returns a new cache middleware with options

func (*CacheMiddleware) Cache

type CacheOption

type CacheOption func(c *CacheMiddleware)

CacheOption defines the options for cache middleware.

func CacheOptionExpire

func CacheOptionExpire(expire int) CacheOption

func CacheOptionHash

func CacheOptionHash(h rum.RequestHash) CacheOption

Jump to

Keyboard shortcuts

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