Documentation ¶
Index ¶
- Variables
- func Bytes2float(bytes []byte) float64
- func Float642bytes(float float64) []byte
- func SetKey(key []byte, set []byte, score float64) (ik []byte, err error)
- type Options
- type Store
- func (t *Store) ByIndex(index schema.Index) (item *schema.Item, err error)
- func (t *Store) BySafeIndex(options schema.SafeIndexOptions) (safeitem *schema.SafeItem, err error)
- func (t *Store) Close() error
- func (s *Store) ConsistencyProof(index schema.Index) (*schema.ConsistencyProof, error)
- func (t *Store) Count(prefix schema.KeyPrefix) (count *schema.ItemsCount, err error)
- func (t *Store) CountAll() (count uint64)
- func (t *Store) CurrentRoot() (root *schema.Root, err error)
- func (t *Store) DbSize() (int64, int64)
- func (t *Store) Dump(kvChan chan *pb.KVList) (err error)
- func (t *Store) FlushToDisk()
- func (t *Store) Get(key schema.Key) (item *schema.Item, err error)
- func (t *Store) GetTree() *schema.Tree
- func (t *Store) HealthCheck() bool
- func (t *Store) History(key schema.Key) (list *schema.ItemList, err error)
- func (t *Store) IScan(options schema.IScanOptions) (list *schema.Page, err error)
- func (s *Store) InclusionProof(index schema.Index) (*schema.InclusionProof, error)
- func (t *Store) Reference(refOpts *schema.ReferenceOptions, options ...WriteOption) (index *schema.Index, err error)
- func (t *Store) Restore(kvChan chan *pb.KVList) (i uint64, err error)
- func (t *Store) SafeGet(options schema.SafeGetOptions) (safeItem *schema.SafeItem, err error)
- func (t *Store) SafeReference(options schema.SafeReferenceOptions) (proof *schema.Proof, err error)
- func (t *Store) SafeSet(options schema.SafeSetOptions) (proof *schema.Proof, err error)
- func (t *Store) SafeZAdd(options schema.SafeZAddOptions) (proof *schema.Proof, err error)
- func (t *Store) Scan(options schema.ScanOptions) (list *schema.ItemList, err error)
- func (t *Store) Set(kv schema.KeyValue, options ...WriteOption) (index *schema.Index, err error)
- func (t *Store) SetBatch(list schema.KVList, options ...WriteOption) (index *schema.Index, err error)
- func (t *Store) Wait()
- func (t *Store) ZAdd(zaddOpts schema.ZAddOptions, options ...WriteOption) (index *schema.Index, err error)
- func (t *Store) ZScan(options schema.ZScanOptions) (list *schema.ItemList, err error)
- type WriteOption
- type WriteOptions
Constants ¶
This section is empty.
Variables ¶
var ( ErrInconsistentState = status.New(codes.Unknown, "inconsistent state").Err() ErrIndexNotFound = status.New(codes.NotFound, "index not found").Err() ErrInvalidKey = status.New(codes.InvalidArgument, "invalid key").Err() ErrInvalidReference = status.New(codes.InvalidArgument, "invalid reference").Err() ErrInvalidKeyPrefix = status.New(codes.InvalidArgument, "invalid key prefix").Err() ErrInvalidSet = status.New(codes.InvalidArgument, "invalid set").Err() ErrInvalidOffset = status.New(codes.InvalidArgument, "invalid offset").Err() ErrInvalidRootIndex = status.New(codes.InvalidArgument, "invalid root index").Err() ErrObsoleteDataFormat = status.New(codes.Unknown, "data format in which elements are written on disk is not up to date to the current version of immudb server. Please upgrade to access to complete functionalities").Err() ErrInconsistentDigest = status.New(codes.Unknown, "insertion order index hash is not equal to the digest of the related value").Err() )
immudb errors
var ( // ErrValueLogSize is returned when opt.ValueLogFileSize option is not within the valid // range. ErrValueLogSize = status.New(codes.Unknown, badger.ErrValueLogSize.Error()).Err() // ErrKeyNotFound is returned when key isn't found on a txn.Get. ErrKeyNotFound = status.New(codes.NotFound, badger.ErrKeyNotFound.Error()).Err() // ErrTxnTooBig is returned if too many writes are fit into a single transaction. ErrTxnTooBig = status.New(codes.Unknown, badger.ErrTxnTooBig.Error()).Err() // ErrConflict is returned when a transaction conflicts with another transaction. This can // happen if the read rows had been updated concurrently by another transaction. ErrConflict = status.New(codes.Unknown, badger.ErrConflict.Error()).Err() // ErrReadOnlyTxn is returned if an update function is called on a read-only transaction. ErrReadOnlyTxn = status.New(codes.Unknown, badger.ErrReadOnlyTxn.Error()).Err() // ErrDiscardedTxn is returned if a previously discarded transaction is re-used. ErrDiscardedTxn = status.New(codes.Unknown, badger.ErrDiscardedTxn.Error()).Err() // ErrEmptyKey is returned if an empty key is passed on an update function. ErrEmptyKey = status.New(codes.Unknown, badger.ErrEmptyKey.Error()).Err() // ErrRetry is returned when a log file containing the value is not found. // This usually indicates that it may have been garbage collected, and the // operation needs to be retried. ErrRetry = status.New(codes.Unknown, badger.ErrRetry.Error()).Err() // ErrThresholdZero is returned if threshold is set to zero, and value log GC is called. // In such a case, GC can't be run. ErrThresholdZero = status.New(codes.Unknown, badger.ErrThresholdZero.Error()).Err() // ErrNoRewrite is returned if a call for value log GC doesn't result in a log file rewrite. ErrNoRewrite = status.New(codes.Unknown, badger.ErrNoRewrite.Error()).Err() // ErrRejected is returned if a value log GC is called either while another GC is running, or // after DB::Close has been called. ErrRejected = status.New(codes.Unknown, badger.ErrRejected.Error()).Err() // ErrInvalidRequest is returned if the user request is invalid. ErrInvalidRequest = status.New(codes.Unknown, badger.ErrInvalidRequest.Error()).Err() // ErrManagedTxn is returned if the user tries to use an API which isn't // allowed due to external management of transactions, when using ManagedDB. ErrManagedTxn = status.New(codes.Unknown, badger.ErrManagedTxn.Error()).Err() // ErrInvalidDump if a data dump made previously cannot be loaded into the database. ErrInvalidDump = status.New(codes.Unknown, badger.ErrInvalidDump.Error()).Err() // ErrZeroBandwidth is returned if the user passes in zero bandwidth for sequence. ErrZeroBandwidth = status.New(codes.Unknown, badger.ErrZeroBandwidth.Error()).Err() // ErrInvalidLoadingMode is returned when opt.ValueLogLoadingMode option is not // within the valid range ErrInvalidLoadingMode = status.New(codes.Unknown, badger.ErrInvalidLoadingMode.Error()).Err() // ErrReplayNeeded is returned when opt.ReadOnly is set but the // database requires a value log replay. ErrReplayNeeded = status.New(codes.Unknown, badger.ErrReplayNeeded.Error()).Err() // ErrWindowsNotSupported is returned when opt.ReadOnly is used on Windows ErrWindowsNotSupported = status.New(codes.Unknown, badger.ErrWindowsNotSupported.Error()).Err() // ErrTruncateNeeded is returned when the value log gets corrupt, and requires truncation of // corrupt data to allow Badger to run properly. ErrTruncateNeeded = status.New(codes.Unknown, badger.ErrTruncateNeeded.Error()).Err() // ErrBlockedWrites is returned if the user called DropAll. During the process of dropping all // data from Badger, we stop accepting new writes, by returning this error. ErrBlockedWrites = status.New(codes.Unknown, badger.ErrBlockedWrites.Error()).Err() // ErrNilCallback is returned when subscriber's callback is nil. ErrNilCallback = status.New(codes.Unknown, badger.ErrNilCallback.Error()).Err() // ErrEncryptionKeyMismatch is returned when the storage key is not // matched with the key previously given. ErrEncryptionKeyMismatch = status.New(codes.Unknown, badger.ErrEncryptionKeyMismatch.Error()).Err() // ErrInvalidDataKeyID is returned if the datakey id is invalid. ErrInvalidDataKeyID = status.New(codes.Unknown, badger.ErrInvalidDataKeyID.Error()).Err() ErrInvalidEncryptionKey = status.New(codes.Unknown, badger.ErrInvalidEncryptionKey.Error()).Err() ErrGCInMemoryMode = status.New(codes.Unknown, badger.ErrGCInMemoryMode.Error()).Err() )
fixme(leogr): review codes and fix/remove errors which do not make sense in this context, finally correct comments accordingly.
Functions ¶
Types ¶
type Store ¶
Store ...
func (*Store) BySafeIndex ¶
BySafeIndex fetches the entry at the specified index together with the inclusion proof for it and the consistency proof for the current root
func (*Store) ConsistencyProof ¶
ConsistencyProof returns the consistency proof between the specified index and the current root
func (*Store) CurrentRoot ¶
CurrentRoot returns the index and the hash of the current tree root, if any. When the tree is empty and no root is available then the zerovalue for _schema.Root_ is returned instead.
func (*Store) FlushToDisk ¶
func (t *Store) FlushToDisk()
FlushToDisk flushes cached data from memory to disk
func (*Store) GetTree ¶ added in v0.6.1
GetTree returns a structure that rapresents merkle tree. Every node is marked as in memory, root and with reference key.
func (*Store) InclusionProof ¶
InclusionProof returns the inclusion proof of the specified index in the current tree
func (*Store) Reference ¶
func (t *Store) Reference(refOpts *schema.ReferenceOptions, options ...WriteOption) (index *schema.Index, err error)
Reference adds a new entry who's value is an existing key
func (*Store) SafeGet ¶
SafeGet fetches the entry having the specified key together with the inclusion proof for it and the consistency proof for the current root
func (*Store) SafeReference ¶
SafeReference adds a reference entry to an existing key and returns the inclusion proof for it and the consistency proof for the previous root
func (*Store) SafeSet ¶
SafeSet adds an entry and returns the inclusion proof for it and the consistency proof for the previous root
func (*Store) SafeZAdd ¶
SafeZAdd adds the specified score and key to the specified sorted set and returns the inclusion proof for it and the consistency proof for the previous root
func (*Store) SetBatch ¶
func (t *Store) SetBatch(list schema.KVList, options ...WriteOption) (index *schema.Index, err error)
SetBatch adds many entries at once
func (*Store) ZAdd ¶
func (t *Store) ZAdd(zaddOpts schema.ZAddOptions, options ...WriteOption) (index *schema.Index, err error)
ZAdd adds a score for an existing key in the specified sorted set
type WriteOptions ¶
type WriteOptions struct {
// contains filtered or unexported fields
}
WriteOptions ...