Documentation ¶
Overview ¶
* Copyright 2020 ICON Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2020 ICON Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func AppendKeys(key []byte, keys ...interface{}) []byte
- func AppendRawKeys(key []byte, keys ...interface{}) []byte
- func SplitKeys(key []byte) ([][]byte, error)
- func ToBytes(v interface{}) []byte
- type ArrayDB
- type BytesStore
- type BytesStoreSnapshot
- type BytesStoreState
- type DictDB
- type KeyBuilder
- type KeyBuilderType
- type ObjectStoreSnapshot
- type ObjectStoreState
- type RawBytesStoreSnapshot
- type RawBytesStoreState
- type StoreState
- type Value
- type ValueSnapshot
- type ValueState
- type ValueStore
- type VarDB
- type WritableValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendKeys ¶
func AppendRawKeys ¶
Types ¶
type ArrayDB ¶
type ArrayDB struct {
// contains filtered or unexported fields
}
func NewArrayDB ¶
func NewArrayDB(source interface{}, key KeyBuilder) *ArrayDB
type BytesStore ¶
type BytesStoreSnapshot ¶
var EmptyBytesStoreSnapshot BytesStoreSnapshot = emptyBytesStoreSnapshot{}
func NewBytesStoreSnapshotFromRaw ¶ added in v0.9.10
func NewBytesStoreSnapshotFromRaw(s RawBytesStoreSnapshot) BytesStoreSnapshot
type BytesStoreState ¶
type BytesStoreState interface { GetValue(key []byte) ([]byte, error) SetValue(key []byte, value []byte) ([]byte, error) DeleteValue(key []byte) ([]byte, error) }
var EmptyBytesStoreState BytesStoreState = &snapshotStore{EmptyBytesStoreSnapshot}
func NewBytesStoreStateFromRaw ¶ added in v0.9.6
func NewBytesStoreStateFromRaw(s RawBytesStoreState) BytesStoreState
func NewBytesStoreStateWithSnapshot ¶
func NewBytesStoreStateWithSnapshot(s BytesStoreSnapshot) BytesStoreState
type DictDB ¶
type DictDB struct {
// contains filtered or unexported fields
}
func NewDictDB ¶
func NewDictDB(source interface{}, depth int, key KeyBuilder) *DictDB
type KeyBuilder ¶
type KeyBuilder interface { Append(keys ...interface{}) KeyBuilder Build() []byte }
func NewHashKey ¶ added in v0.9.10
func NewHashKey(prefix []byte, keys ...interface{}) KeyBuilder
func ToKey ¶
func ToKey(builderType KeyBuilderType, keys ...interface{}) KeyBuilder
type KeyBuilderType ¶
type KeyBuilderType int
const ( HashBuilder KeyBuilderType = iota PrefixedHashBuilder RLPBuilder RawBuilder )
type ObjectStoreSnapshot ¶
type ObjectStoreState ¶
type RawBytesStoreSnapshot ¶ added in v0.9.10
type RawBytesStoreState ¶ added in v0.9.6
type StoreState ¶
type StoreState interface { GetValue(key []byte) Value At(key []byte) WritableValue }
func ToStoreState ¶
func ToStoreState(store interface{}) StoreState
type Value ¶
type Value interface { BigInt() *big.Int Int64() int64 Address() module.Address Bytes() []byte String() string Bool() bool Object() trie.Object }
func NewValue ¶
func NewValue(vs ValueSnapshot) Value
type ValueSnapshot ¶
func NewValueSnapshotFromBytes ¶
func NewValueSnapshotFromBytes(bs []byte) ValueSnapshot
type ValueState ¶
type ValueState interface { ValueSnapshot SetBytes(value []byte) error SetObject(value trie.Object) error Delete() (ValueSnapshot, error) }
type ValueStore ¶
type ValueStore interface { GetValue(key []byte) ValueSnapshot At(key []byte) ValueState }
type VarDB ¶
type VarDB struct {
WritableValue
}
func NewVarDB ¶
func NewVarDB(source interface{}, key KeyBuilder) *VarDB
type WritableValue ¶
func NewWritableValue ¶
func NewWritableValue(vs ValueState) WritableValue