Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileCachePool ¶
type FileCachePool interface { // GetLen fetch value length if hit GetLen(path string) (int64, bool) // PutLen set value length PutLen(path string, length int64) bool // GetOrRefill try to fetch cache value, call `fetch` if not hit GetOrRefill(path string, offset int64, count int, fetch func() ([]byte, error)) ([]byte, error) // GetHost get P2P Host for key GetHost(path string) (string, bool) // PutHost store P2P Host for key PutHost(path string, host string) bool // DelHost clear P2P Host for key DelHost(path string) }
FileCachePool provides basic interface for cache access
func NewCachePool ¶
func NewCachePool(config *Config) FileCachePool
NewCachePool creator for FileCachePool
Click to show internal directories.
Click to hide internal directories.