Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlobCache ¶
type BlobCache interface { Add(key string, p []byte, opts ...Option) FetchAt(key string, offset int64, p []byte, opts ...Option) (n int, err error) }
func NewDirectoryCache ¶
func NewDirectoryCache(directory string, config DirectoryCacheConfig) (BlobCache, error)
func NewMemoryCache ¶
func NewMemoryCache() BlobCache
type DirectoryCacheConfig ¶
type Option ¶
type Option func(o *cacheOpt) *cacheOpt
func Direct ¶
func Direct() Option
When Direct option is specified for FetchAt and Add methods, these operation won't use on-memory caches. When you know that the targeting value won't be used immediately, you can prevent the limited space of on-memory caches from being polluted by these unimportant values.
Click to show internal directories.
Click to hide internal directories.