Documentation
¶
Index ¶
- Variables
- func RegisterCache(scheme string, f NewCacheFunc)
- type Cache
- type EntryKind
- type GatedCache
- func (c *GatedCache) Contains(ctx context.Context, kind EntryKind, hash string) (bool, int64, error)
- func (c *GatedCache) Get(ctx context.Context, kind EntryKind, hash string, offset, length int64) (io.ReadCloser, int64, error)
- func (c *GatedCache) Put(ctx context.Context, kind EntryKind, hash string, size, offset int64) (io.WriteCloser, error)
- type HedgedCache
- func (c *HedgedCache) Contains(ctx context.Context, kind EntryKind, hash string) (bool, int64, error)
- func (c *HedgedCache) Get(ctx context.Context, kind EntryKind, hash string, offset, length int64) (io.ReadCloser, int64, error)
- func (c *HedgedCache) Put(ctx context.Context, kind EntryKind, hash string, size, offset int64) (io.WriteCloser, error)
- type NewCacheFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrInvalidSize = errors.New("invalid size") )
View Source
var (
ErrInvalidScheme = errors.New("invalid scheme")
)
Functions ¶
func RegisterCache ¶
func RegisterCache(scheme string, f NewCacheFunc)
Types ¶
type Cache ¶
type Cache interface { Put(ctx context.Context, kind EntryKind, hash string, size, offset int64) (io.WriteCloser, error) Get(ctx context.Context, kind EntryKind, hash string, offset, length int64) (io.ReadCloser, int64, error) Contains(ctx context.Context, kind EntryKind, hash string) (bool, int64, error) }
func NewGatedCache ¶
type GatedCache ¶
type GatedCache struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.