Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeKV(key []byte, value []byte) *store.KV
- func EncodeKey(key []byte) []byte
- func EncodeReference(key, referencedKey []byte, atTx uint64) *store.KV
- func EncodeZAdd(set []byte, score float64, key []byte, atTx uint64) *store.KV
- func UnWrapWithPrefix(wb []byte) (b []byte, prefix byte)
- func WrapReferenceValueAt(key []byte, atTx uint64) []byte
- func WrapWithPrefix(b []byte, prefix byte) []byte
- func WrapZAddReferenceAt(set []byte, score float64, key []byte, atTx uint64) []byte
- type DB
- type DbOptions
- func (o *DbOptions) GetCorruptionChecker() bool
- func (o *DbOptions) GetDbName() string
- func (o *DbOptions) GetDbRootPath() string
- func (o *DbOptions) GetStoreOptions() *store.Options
- func (o *DbOptions) WithCorruptionChecker(cc bool) *DbOptions
- func (o *DbOptions) WithDbName(dbName string) *DbOptions
- func (o *DbOptions) WithDbRootPath(Path string) *DbOptions
- func (o *DbOptions) WithStoreOptions(storeOpts *store.Options) *DbOptions
- type KeyIndex
Constants ¶
View Source
const ( SetKeyPrefix = iota SortedSetKeyPrefix )
View Source
const ( PlainValuePrefix = iota ReferenceValuePrefix )
View Source
const MaxKeyResolutionLimit = 1
View Source
const MaxKeyScanLimit = 1000
Variables ¶
View Source
var ( ErrIndexKeyMismatch = status.New(codes.InvalidArgument, "mismatch between provided index and key").Err() ErrNoReferenceProvided = status.New(codes.InvalidArgument, "provided argument is not a reference").Err() ErrReferenceKeyMissing = status.New(codes.InvalidArgument, "reference key not provided").Err() ErrZAddIndexMissing = status.New(codes.InvalidArgument, "zAdd index not provided").Err() ErrReferenceIndexMissing = status.New(codes.InvalidArgument, "reference index not provided").Err() )
View Source
var ErrFinalKeyCannotBeConvertedIntoReference = errors.New("final key cannot be converted into a reference")
View Source
var ErrMaxKeyResolutionLimitReached = errors.New("max key resolution limit reached. It may be due to cyclic references")
View Source
var ErrMaxKeyScanLimitExceeded = errors.New("max key scan limit exceeded")
View Source
var ErrReferencedKeyCannotBeAReference = errors.New("referenced key cannot be a reference")
Functions ¶
func UnWrapWithPrefix ¶
unWrapWithPrefix ...
func WrapReferenceValueAt ¶
Types ¶
type DB ¶
type DB interface { Health(e *empty.Empty) (*schema.HealthResponse, error) CurrentState() (*schema.ImmutableState, error) Set(req *schema.SetRequest) (*schema.TxMetadata, error) Get(req *schema.KeyRequest) (*schema.Entry, error) VerifiableSet(req *schema.VerifiableSetRequest) (*schema.VerifiableTx, error) VerifiableGet(req *schema.VerifiableGetRequest) (*schema.VerifiableEntry, error) GetAll(req *schema.KeyListRequest) (*schema.Entries, error) ExecAll(operations *schema.ExecAllRequest) (*schema.TxMetadata, error) Size() (uint64, error) Count(prefix *schema.KeyPrefix) (*schema.EntryCount, error) CountAll() (*schema.EntryCount, error) TxByID(req *schema.TxRequest) (*schema.Tx, error) VerifiableTxByID(req *schema.VerifiableTxRequest) (*schema.VerifiableTx, error) History(req *schema.HistoryRequest) (*schema.Entries, error) SetReference(req *schema.ReferenceRequest) (*schema.TxMetadata, error) VerifiableSetReference(req *schema.VerifiableReferenceRequest) (*schema.VerifiableTx, error) ZAdd(req *schema.ZAddRequest) (*schema.TxMetadata, error) ZScan(req *schema.ZScanRequest) (*schema.ZEntries, error) VerifiableZAdd(req *schema.VerifiableZAddRequest) (*schema.VerifiableTx, error) Scan(req *schema.ScanRequest) (*schema.Entries, error) PrintTree() (*schema.Tree, error) Close() error GetOptions() *DbOptions }
type DbOptions ¶
type DbOptions struct {
// contains filtered or unexported fields
}
DbOptions database instance options
func DefaultOption ¶
func DefaultOption() *DbOptions
DefaultOption Initialise Db Optionts to default values
func (*DbOptions) GetCorruptionChecker ¶
GetCorruptionChecker returns if corruption checker should start for this database instance
func (*DbOptions) GetDbRootPath ¶
GetDbRootPath returns the directory in which this database resides
func (*DbOptions) GetStoreOptions ¶
GetStoreOptions returns backing store options
func (*DbOptions) WithCorruptionChecker ¶
WithCorruptionChecker sets if corruption checker should start for this database instance
func (*DbOptions) WithDbName ¶
WithDbName sets dbName, which is also db instance directory
func (*DbOptions) WithDbRootPath ¶
WithDbRootPath sets the directory in which this database will reside
Click to show internal directories.
Click to hide internal directories.