Documentation ¶
Index ¶
- func CheckAndMakeBasepath(basepath string) error
- type Store
- func (store *Store) Get(ctx context.Context, key string) ([]byte, error)
- func (store *Store) GetStream(ctx context.Context, key string) (io.ReadCloser, error)
- func (store *Store) Has(ctx context.Context, key string) (bool, error)
- func (store *Store) Init(basepath string, escapingFunc func(string) string, ...) error
- func (store *Store) InitDefaults(basepath string) error
- func (store *Store) Put(ctx context.Context, key string, content []byte) error
- func (store *Store) PutStream(ctx context.Context) (io.Writer, func(string) error, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAndMakeBasepath ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is implements storage.ReadableStorage and storage.WritableStorage, as well as quite a few of the other extended storage feature interfaces, backing it with simple filesystem operations.
This implementation uses golang's usual `os` package for IO, so it should be highly portable.
Both the sharding and escaping functions are configurable, but a typical recommended setup is to use base32 encoding, and a sharding function that returns two shards of two characters each. The escaping and sharding functions should be chosen with regard to each other -- the sharding function is applied to the escaped form.
func (*Store) GetStream ¶
GetStream implements go-ipld-prime/storage.StreamingReadableStorage.GetStream.