Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackgroundConfig ¶
BackgroundConfig is config for a Background Cache.
func (*BackgroundConfig) RegisterFlags ¶
func (cfg *BackgroundConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet.
type Cache ¶
type Cache interface { StoreChunk(ctx context.Context, key string, buf []byte) error FetchChunkData(ctx context.Context, keys []string) (found []string, bufs [][]byte, missing []string, err error) Stop() error }
Cache byte arrays by key.
func NewBackground ¶
func NewBackground(cfg BackgroundConfig, cache Cache) Cache
NewBackground returns a new Cache that does stores on background goroutines.
type Config ¶
type Config struct { EnableDiskcache bool // contains filtered or unexported fields }
Config for building Caches.
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet.
type Diskcache ¶
type Diskcache struct {
// contains filtered or unexported fields
}
Diskcache is an on-disk chunk cache.
func NewDiskcache ¶
func NewDiskcache(cfg DiskcacheConfig) (*Diskcache, error)
NewDiskcache creates a new on-disk cache.
type DiskcacheConfig ¶
DiskcacheConfig for the Disk cache.
func (*DiskcacheConfig) RegisterFlags ¶
func (cfg *DiskcacheConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet
type Memcached ¶
type Memcached struct {
// contains filtered or unexported fields
}
Memcached type caches chunks in memcached
func NewMemcached ¶
func NewMemcached(cfg MemcachedConfig, client MemcachedClient) *Memcached
NewMemcached makes a new Memcache
type MemcachedClient ¶
type MemcachedClient interface { GetMulti(keys []string) (map[string]*memcache.Item, error) Set(item *memcache.Item) error }
MemcachedClient interface exists for mocking memcacheClient.
type MemcachedClientConfig ¶
type MemcachedClientConfig struct { Host string Service string Timeout time.Duration UpdateInterval time.Duration }
MemcachedClientConfig defines how a MemcachedClient should be constructed.
func (*MemcachedClientConfig) RegisterFlags ¶
func (cfg *MemcachedClientConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet
type MemcachedConfig ¶
MemcachedConfig is config to make a Memcached
func (*MemcachedConfig) RegisterFlags ¶
func (cfg *MemcachedConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet