Documentation ¶
Index ¶
- Constants
- type ByteMarshaller
- func (bm ByteMarshaller) MarshallAddressKey(index *types.AddressIndex) []byte
- func (bm ByteMarshaller) MarshallAddressKeyPrefix(address string) []byte
- func (bm ByteMarshaller) MarshallAddressKeyPrefix2(address string, tm *big.Int) []byte
- func (bm ByteMarshaller) MarshallAddressKeyPrefix3(address string, tm time.Time) []byte
- func (bm ByteMarshaller) MarshallAddressKeyStr(address string, time *big.Int, sequence uint8) []byte
- func (bm ByteMarshaller) MarshallAddressValue(index *types.AddressIndex) []byte
- func (bm ByteMarshaller) MarshallBatchKey(from *big.Int, to *big.Int, step byte, createdAt *big.Int) []byte
- func (bm ByteMarshaller) MarshallBatchKeyFrom(from *big.Int) []byte
- func (bm ByteMarshaller) MarshallBatchValue(updatedAt *big.Int, currentBlock *big.Int) []byte
- func (bm ByteMarshaller) MarshallBlockKey(blockNumber string) []byte
- func (bm ByteMarshaller) MarshallBlockValue(blockIndex *types.BlockIndex) []byte
- func (bm ByteMarshaller) UnmarshallAddressKey(key []byte) (string, *big.Int)
- func (bm ByteMarshaller) UnmarshallAddressValue(value []byte) types.AddressIndex
- func (bm ByteMarshaller) UnmarshallBatchKey(key []byte) types.BatchStatus
- func (bm ByteMarshaller) UnmarshallBatchValue(value []byte) types.BatchStatus
- func (bm ByteMarshaller) UnmarshallBlockKey(key []byte) *big.Int
- func (bm ByteMarshaller) UnmarshallBlockValue(value []byte) types.BlockIndex
- type Marshaller
- type StringMarshaller
- func (sm StringMarshaller) MarshallAddressKey(index *types.AddressIndex) []byte
- func (sm StringMarshaller) MarshallAddressKeyStr(address string, blockNumber string) []byte
- func (sm StringMarshaller) MarshallAddressValue(index *types.AddressIndex) []byte
- func (sm StringMarshaller) MarshallBlockDBValue(blockIndex *types.BlockIndex) []byte
- func (sm StringMarshaller) UnmarshallAddressKey(key []byte) (string, *big.Int)
- func (sm StringMarshaller) UnmarshallAddressValue(value []byte) types.AddressIndex
- func (sm StringMarshaller) UnmarshallBlockDBValue(value []byte) []string
Constants ¶
const ( // TimestampByteLength length of time after marshall TimestampByteLength = 4 // BlockNumberMarshallLength length of block number after marshall BlockNumberMarshallLength = 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteMarshaller ¶
type ByteMarshaller struct { }
ByteMarshaller marshal data using byte array
func (ByteMarshaller) MarshallAddressKey ¶
func (bm ByteMarshaller) MarshallAddressKey(index *types.AddressIndex) []byte
MarshallAddressKey create LevelDB key
func (ByteMarshaller) MarshallAddressKeyPrefix ¶
func (bm ByteMarshaller) MarshallAddressKeyPrefix(address string) []byte
MarshallAddressKeyPrefix marshall the address which is key prefix of address db
func (ByteMarshaller) MarshallAddressKeyPrefix2 ¶
func (bm ByteMarshaller) MarshallAddressKeyPrefix2(address string, tm *big.Int) []byte
MarshallAddressKeyPrefix2 marshall the address and time which is key prefix of address db
func (ByteMarshaller) MarshallAddressKeyPrefix3 ¶
func (bm ByteMarshaller) MarshallAddressKeyPrefix3(address string, tm time.Time) []byte
MarshallAddressKeyPrefix3 same to MarshallAddressKeyPrefix2
func (ByteMarshaller) MarshallAddressKeyStr ¶
func (bm ByteMarshaller) MarshallAddressKeyStr(address string, time *big.Int, sequence uint8) []byte
MarshallAddressKeyStr create LevelDB key
func (ByteMarshaller) MarshallAddressValue ¶
func (bm ByteMarshaller) MarshallAddressValue(index *types.AddressIndex) []byte
MarshallAddressValue create LevelDB value
func (ByteMarshaller) MarshallBatchKey ¶
func (bm ByteMarshaller) MarshallBatchKey(from *big.Int, to *big.Int, step byte, createdAt *big.Int) []byte
MarshallBatchKey marshall key of batch status database
func (ByteMarshaller) MarshallBatchKeyFrom ¶
func (bm ByteMarshaller) MarshallBatchKeyFrom(from *big.Int) []byte
MarshallBatchKeyFrom marshall From in batch DB
func (ByteMarshaller) MarshallBatchValue ¶
MarshallBatchValue value of key-value init batch status database
func (ByteMarshaller) MarshallBlockKey ¶
func (bm ByteMarshaller) MarshallBlockKey(blockNumber string) []byte
MarshallBlockKey marshall key of block DB
func (ByteMarshaller) MarshallBlockValue ¶
func (bm ByteMarshaller) MarshallBlockValue(blockIndex *types.BlockIndex) []byte
MarshallBlockValue marshall a blockIndex to []byte so that we store it as value in Block db
func (ByteMarshaller) UnmarshallAddressKey ¶
func (bm ByteMarshaller) UnmarshallAddressKey(key []byte) (string, *big.Int)
UnmarshallAddressKey LevelDB key to address_time
func (ByteMarshaller) UnmarshallAddressValue ¶
func (bm ByteMarshaller) UnmarshallAddressValue(value []byte) types.AddressIndex
UnmarshallAddressValue LevelDB value to txhash_Value_Time
func (ByteMarshaller) UnmarshallBatchKey ¶
func (bm ByteMarshaller) UnmarshallBatchKey(key []byte) types.BatchStatus
UnmarshallBatchKey unmarshall key of batch status database
func (ByteMarshaller) UnmarshallBatchValue ¶
func (bm ByteMarshaller) UnmarshallBatchValue(value []byte) types.BatchStatus
UnmarshallBatchValue unmarshal value of key-value init batch status database
func (ByteMarshaller) UnmarshallBlockKey ¶
func (bm ByteMarshaller) UnmarshallBlockKey(key []byte) *big.Int
UnmarshallBlockKey unmarshall key of block DB
func (ByteMarshaller) UnmarshallBlockValue ¶
func (bm ByteMarshaller) UnmarshallBlockValue(value []byte) types.BlockIndex
UnmarshallBlockValue unmarshall a byte array into array of address, this is for Block db
type Marshaller ¶
type Marshaller interface { MarshallBatchValue(updatedAt *big.Int, currentBlock *big.Int) []byte UnmarshallBatchValue(value []byte) types.BatchStatus MarshallBatchKey(from *big.Int, to *big.Int, step byte, createdAt *big.Int) []byte MarshallBatchKeyFrom(from *big.Int) []byte UnmarshallBatchKey(value []byte) types.BatchStatus MarshallBlockValue(blockIndex *types.BlockIndex) []byte UnmarshallBlockValue(value []byte) types.BlockIndex MarshallBlockKey(blockNumber string) []byte UnmarshallBlockKey(key []byte) *big.Int MarshallAddressKey(index *types.AddressIndex) []byte MarshallAddressKeyPrefix(address string) []byte MarshallAddressKeyPrefix2(address string, time *big.Int) []byte MarshallAddressKeyPrefix3(address string, tm time.Time) []byte MarshallAddressKeyStr(address string, time *big.Int, sequence uint8) []byte MarshallAddressValue(index *types.AddressIndex) []byte UnmarshallAddressKey(key []byte) (string, *big.Int) UnmarshallAddressValue(value []byte) types.AddressIndex }
Marshaller the interface to convert business objects to/from byte
type StringMarshaller ¶
type StringMarshaller struct { }
StringMarshaller initial marshaller impl
func (StringMarshaller) MarshallAddressKey ¶
func (sm StringMarshaller) MarshallAddressKey(index *types.AddressIndex) []byte
MarshallAddressKey create LevelDB key
func (StringMarshaller) MarshallAddressKeyStr ¶
func (sm StringMarshaller) MarshallAddressKeyStr(address string, blockNumber string) []byte
MarshallAddressKeyStr create LevelDB key
func (StringMarshaller) MarshallAddressValue ¶
func (sm StringMarshaller) MarshallAddressValue(index *types.AddressIndex) []byte
MarshallAddressValue create LevelDB value
func (StringMarshaller) MarshallBlockDBValue ¶
func (sm StringMarshaller) MarshallBlockDBValue(blockIndex *types.BlockIndex) []byte
MarshallBlockDBValue marshall a blockIndex to []byte so that we store it as value in Block db
func (StringMarshaller) UnmarshallAddressKey ¶
func (sm StringMarshaller) UnmarshallAddressKey(key []byte) (string, *big.Int)
UnmarshallAddressKey LevelDB key to address_blockNumber
func (StringMarshaller) UnmarshallAddressValue ¶
func (sm StringMarshaller) UnmarshallAddressValue(value []byte) types.AddressIndex
UnmarshallAddressValue LevelDB value to txhash_Value_Time
func (StringMarshaller) UnmarshallBlockDBValue ¶
func (sm StringMarshaller) UnmarshallBlockDBValue(value []byte) []string
UnmarshallBlockDBValue unmarshall a byte array into array of address, this is for Block db