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 ¶
func (c *CacheMiddleware) Cache(next rum.RoundTripperFunc) rum.RoundTripperFunc
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
Click to show internal directories.
Click to hide internal directories.