Documentation ¶
Index ¶
- type AncientWriteOp
- type KV
- func (k *KV) Ancient(kind string, number uint64) ([]byte, error)
- func (k *KV) AncientSize(kind string) (uint64, error)
- func (k *KV) Ancients() (uint64, error)
- func (k *KV) AppendAncient(number uint64, hash, header, body, receipt, td []byte) error
- func (k *KV) Close() error
- func (k *KV) Compact(start []byte, limit []byte) error
- func (k *KV) Delete(key []byte) error
- func (k *KV) DiffStore() ethdb.KeyValueStore
- func (k *KV) Error() error
- func (k *KV) Get(key []byte) ([]byte, error)
- func (k *KV) Has(key []byte) (bool, error)
- func (k *KV) HasAncient(kind string, number uint64) (bool, error)
- func (k *KV) Key() []byte
- func (k *KV) ModifyAncients(_ func(AncientWriteOp) error) (int64, error)
- func (k *KV) NewBatch() ethdb.Batch
- func (k *KV) NewIterator(prefix []byte, start []byte) ethdb.Iterator
- func (k *KV) Next() bool
- func (k *KV) Path() string
- func (k *KV) Put(key []byte, value []byte) error
- func (k *KV) ReadAncients(kind string, start uint64, count uint64, maxBytes uint64) ([][]byte, error)
- func (k *KV) Release()
- func (k *KV) SetDiffStore(diff ethdb.KeyValueStore)
- func (k *KV) Stat(property string) (string, error)
- func (k *KV) Sync() error
- func (k *KV) TruncateAncients(n uint64) error
- func (k *KV) Value() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AncientWriteOp ¶ added in v0.0.6
type AncientWriteOp interface { // Append adds an RLP-encoded item. Append(kind string, number uint64, item interface{}) error // AppendRaw adds an item without RLP-encoding it. AppendRaw(kind string, number uint64, item []byte) error }
AncientWriteOp is given to the function argument of ModifyAncients.
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
func (*KV) AncientSize ¶
AncientSize returns the ancient size of the specified category.
func (*KV) AppendAncient ¶ added in v0.0.3
func (*KV) DiffStore ¶ added in v0.0.4
func (k *KV) DiffStore() ethdb.KeyValueStore
func (*KV) Error ¶
Error returns any accumulated error. Exhausting all the key/value pairs is not considered to be an error.
func (*KV) HasAncient ¶
HasAncient returns an indicator whether the specified data exists in the ancient store.
func (*KV) Key ¶
Key returns the key of the current key/value pair, or nil if done. The caller should not modify the contents of the returned slice, and its contents may change on the next call to Next.
func (*KV) ModifyAncients ¶
func (k *KV) ModifyAncients(_ func(AncientWriteOp) error) (int64, error)
ModifyAncients runs a write operation on the ancient store. If the function returns an error, any changes to the underlying store are reverted. The integer return value is the total size of the written data.
func (*KV) Next ¶
Next moves the iterator to the next key/value pair. It returns whether the iterator is exhausted.
func (*KV) ReadAncients ¶
func (k *KV) ReadAncients(kind string, start uint64, count uint64, maxBytes uint64) ([][]byte, error)
ReadAncients retrieves multiple items in sequence, starting from the index 'start'. It will return
- at most 'count' items,
- at least 1 item (even if exceeding the maxBytes), but will otherwise return as many items as fit into maxBytes.
func (*KV) Release ¶
func (k *KV) Release()
Release releases associated resources. Release should always succeed and can be called multiple times without causing error.
func (*KV) SetDiffStore ¶ added in v0.0.4
func (k *KV) SetDiffStore(diff ethdb.KeyValueStore)
func (*KV) TruncateAncients ¶
TruncateAncients discards all but the first n ancient data from the ancient store.