Documentation ¶
Index ¶
- func ConfigAdd(path string)
- func NewCache(ctx context.Context, opts ...Option) (*freecache.Cache, error)
- func NewCacheWithConfigPath(ctx context.Context, path string, opts ...Option) (*freecache.Cache, error)
- func NewCacheWithOptions(ctx context.Context, o *Options, opts ...Option) (cache *freecache.Cache, err error)
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(options *Options)
Option represents an option.
func WithCacheSize ¶
WithCacheSize returns option that defines cache size.
type Options ¶
type Options struct {
CacheSize int
}
Options represents cache options.
func NewOptions ¶
NewOptions returns options from config file or environment vars.
func NewOptionsWithPath ¶
NewOptionsWithPath unmarshals a given key path into options and returns it. NewOptionsWithPath unmarshals a given key path into options and returns it.
Click to show internal directories.
Click to hide internal directories.