Documentation ¶
Overview ¶
Package fs_db provides a client for a simple key-value database for storing files.
Index ¶
Constants ¶
View Source
const ( // IsoLevelReadUncommitted transaction iso level read uncommitted. IsoLevelReadUncommitted = model.TxIsoLevel(iota) // IsoLevelReadCommitted transaction iso level read committed. IsoLevelReadCommitted // IsoLevelRepeatableRead transaction iso level repeatable read. IsoLevelRepeatableRead // IsoLevelSerializable transaction iso level serializable. // // Since the set operation contains insert and update operations, the serializable level is equal to the repeatable read. IsoLevelSerializable )
View Source
const ( // IsoLevelDefault the default transaction iso level is ReadCommitted IsoLevelDefault = IsoLevelReadCommitted )
Variables ¶
View Source
var ( SizeErr = errors.New("no free space") NotFoundErr = errors.New("not found") EmptyKeyErr = errors.New("empty name") HeaderNotFoundErr = errors.New("header not found") // Tx errors TxNotFoundErr = errors.New("transaction not found") TxAlreadyExistsErr = errors.New("transaction already exists") TxSerializationErr = errors.New("serialization error") // Config errors EmptyDbPathErr = errors.New("empty db path") EmptyRootDirs = errors.New("empty root dirs") )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { Store // Begin starts a transaction with isoLevel. Begin(ctx context.Context, isoLevel ...model.TxIsoLevel) (Tx, error) }
DB provides fs db interface.
type Store ¶ added in v1.0.0
type Store interface { // Set sets the contents of b using the key. Set(ctx context.Context, key string, b []byte) error // SetReader sets the reader content using the key. SetReader(ctx context.Context, key string, reader io.Reader, size uint64) error // Get returns content by key. Get(ctx context.Context, key string) ([]byte, error) // GetReader returns content as io.ReadCloser by key. GetReader(ctx context.Context, key string) (io.ReadCloser, error) // Delete delete content by key. Delete(ctx context.Context, key string) error }
Store provides KV operations with files.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
example
|
|
internal
|
|
delivery/grpc/store/mocks
Code generated by MockGen.
|
Code generated by MockGen. |
usecase/cleaner/mocks
Code generated by MockGen.
|
Code generated by MockGen. |
usecase/dir/mocks
Code generated by MockGen.
|
Code generated by MockGen. |
usecase/root/mocks
Code generated by MockGen.
|
Code generated by MockGen. |
usecase/store/mocks
Code generated by MockGen.
|
Code generated by MockGen. |
usecase/transaction/mocks
Code generated by MockGen.
|
Code generated by MockGen. |
utils/grpc/streamreader/mocks
Code generated by MockGen.
|
Code generated by MockGen. |
pkg
|
|
Click to show internal directories.
Click to hide internal directories.