Documentation ¶
Index ¶
- func AddWriteLayer(base cadata.Store, writeTo cadata.Store) cadata.Store
- func NewFSStore(x posixfs.FS, maxSize int) cadata.Store
- func NewMem() cadata.Store
- type AsyncStore
- func (s *AsyncStore) Close() error
- func (s *AsyncStore) Delete(ctx context.Context, id ID) error
- func (s *AsyncStore) Exists(ctx context.Context, id ID) (bool, error)
- func (s *AsyncStore) Get(ctx context.Context, id ID, buf []byte) (int, error)
- func (s *AsyncStore) Hash(x []byte) ID
- func (s *AsyncStore) List(ctx context.Context, span cadata.Span, ids []ID) (int, error)
- func (s *AsyncStore) MaxSize() int
- func (s *AsyncStore) Post(ctx context.Context, data []byte) (ID, error)
- type ID
- type MemSet
- type Set
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AsyncStore ¶
type AsyncStore struct {
// contains filtered or unexported fields
}
AsyncStore allows blobs to be Posted in the background by a pool of workers. It is not safe for concurrent use by multiple callers.
Close must return nil for any previous Post to be considered successful. When in doubt, call Exists on the underlying store.
If you have a loop that repeatedly calls Post, and Post is high latency, AsyncStore will probably improve performance. AsyncStore is not Read-Your-Writes consistent.
func NewAsyncStore ¶
func NewAsyncStore(target Store, numWorkers int) *AsyncStore
func (*AsyncStore) Close ¶
func (s *AsyncStore) Close() error
func (*AsyncStore) Hash ¶
func (s *AsyncStore) Hash(x []byte) ID
func (*AsyncStore) MaxSize ¶
func (s *AsyncStore) MaxSize() int
Click to show internal directories.
Click to hide internal directories.