Documentation ¶
Index ¶
- func GetString(c Cache, k string) (string, error)
- func IsCacheMiss(e error) bool
- func IsCacheMissMulti(e error) bool
- func NewReadCloser(b []byte) io.ReadCloser
- func NewReadCloserFromString(s string) io.ReadCloser
- func SetString(c Cache, k string, v string) (string, error)
- type Cache
- type CacheMiss
- type CacheMissMulti
- type FSCache
- func (c *FSCache) Evictions() int64
- func (c *FSCache) Get(key string) (io.ReadCloser, error)
- func (c *FSCache) Hits() int64
- func (c *FSCache) Misses() int64
- func (c *FSCache) Name() string
- func (c *FSCache) Set(key string, fh io.ReadCloser) (io.ReadCloser, error)
- func (c *FSCache) Size() int64
- func (c *FSCache) Unset(key string) error
- type GoCache
- func (c *GoCache) Evictions() int64
- func (c *GoCache) Get(key string) (io.ReadCloser, error)
- func (c *GoCache) Hits() int64
- func (c *GoCache) Misses() int64
- func (c *GoCache) Name() string
- func (c *GoCache) Set(key string, fh io.ReadCloser) (io.ReadCloser, error)
- func (c *GoCache) Size() int64
- func (c *GoCache) Unset(key string) error
- type GoCacheOptions
- type MultiCache
- func (mc *MultiCache) Evictions() int64
- func (mc *MultiCache) Get(key string) (io.ReadCloser, error)
- func (mc *MultiCache) Hits() int64
- func (mc *MultiCache) Misses() int64
- func (mc *MultiCache) Name() string
- func (mc *MultiCache) Set(key string, fh io.ReadCloser) (io.ReadCloser, error)
- func (mc *MultiCache) Size() int64
- func (mc *MultiCache) Unset(key string) error
- type NullCache
- func (c *NullCache) Evictions() int64
- func (c *NullCache) Get(key string) (io.ReadCloser, error)
- func (c *NullCache) Hits() int64
- func (c *NullCache) Misses() int64
- func (c *NullCache) Name() string
- func (c *NullCache) Set(key string, fh io.ReadCloser) (io.ReadCloser, error)
- func (c *NullCache) Size() int64
- func (c *NullCache) Unset(key string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCacheMiss ¶
func IsCacheMissMulti ¶
func NewReadCloser ¶
func NewReadCloser(b []byte) io.ReadCloser
func NewReadCloserFromString ¶
func NewReadCloserFromString(s string) io.ReadCloser
Types ¶
type Cache ¶
type Cache interface { Name() string Get(string) (io.ReadCloser, error) Set(string, io.ReadCloser) (io.ReadCloser, error) Unset(string) error Hits() int64 Misses() int64 Evictions() int64 Size() int64 }
func NewFSCache ¶
func NewGoCache ¶
func NewGoCache(opts *GoCacheOptions) (Cache, error)
func NewMultiCache ¶
func NewNullCache ¶
type CacheMissMulti ¶
type CacheMissMulti struct {
// contains filtered or unexported fields
}
func (CacheMissMulti) Error ¶
func (m CacheMissMulti) Error() string
type FSCache ¶
type FSCache struct { Cache TTL int64 FilePerms os.FileMode DirectoryPerms os.FileMode // contains filtered or unexported fields }
func (*FSCache) Set ¶
func (c *FSCache) Set(key string, fh io.ReadCloser) (io.ReadCloser, error)
type GoCache ¶
type GoCache struct { Cache Options *GoCacheOptions // contains filtered or unexported fields }
func (*GoCache) Set ¶
func (c *GoCache) Set(key string, fh io.ReadCloser) (io.ReadCloser, error)
type GoCacheOptions ¶
func DefaultGoCacheOptions ¶
func DefaultGoCacheOptions() (*GoCacheOptions, error)
func GoCacheOptionsFromArgs ¶
func GoCacheOptionsFromArgs(args map[string]string) (*GoCacheOptions, error)
type MultiCache ¶
type MultiCache struct { Cache // contains filtered or unexported fields }
func (*MultiCache) Evictions ¶
func (mc *MultiCache) Evictions() int64
func (*MultiCache) Get ¶
func (mc *MultiCache) Get(key string) (io.ReadCloser, error)
func (*MultiCache) Hits ¶
func (mc *MultiCache) Hits() int64
func (*MultiCache) Misses ¶
func (mc *MultiCache) Misses() int64
func (*MultiCache) Name ¶
func (mc *MultiCache) Name() string
func (*MultiCache) Set ¶
func (mc *MultiCache) Set(key string, fh io.ReadCloser) (io.ReadCloser, error)
func (*MultiCache) Size ¶
func (mc *MultiCache) Size() int64
func (*MultiCache) Unset ¶
func (mc *MultiCache) Unset(key string) error
Click to show internal directories.
Click to hide internal directories.