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
}
A Cache object is a in-memory cache.
func NewCache ¶
func NewCache(expire time.Duration, opts ...CacheOption) (*Cache, error)
NewCache returns a Cache with given expire.
type CacheOption ¶
type CacheOption func(cache *Cache)
CacheOption defines the method to customize a Cache.
func WithLimit ¶
func WithLimit(limit int) CacheOption
WithLimit customizes a Cache with items up to limit.
func WithName ¶
func WithName(name string) CacheOption
WithName customizes a Cache with the given name.
Click to show internal directories.
Click to hide internal directories.