stateindex

package
v0.2.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	Beginning = iota + 1
	Existing
	Ending
)

Variables

This section is empty.

Functions

func ConstructIndexEntries

func ConstructIndexEntries(updates map[string]*worldstate.DBUpdates, db worldstate.DB) (map[string]*worldstate.DBUpdates, error)

ConstructIndexEntries constructs index entries for the supplied the world state updates

func EncodeInt64

func EncodeInt64(n int64) string

EncodeInt64 encodes a given int64 value to a hexadecimal representation to preserve the order of actual value, i.e., -100 < -10 < 0 < 100 < 1000

func GetValue

func GetValue(value interface{}, t types.IndexAttributeType) interface{}

GetValue returns the value used by the index creator and the associated metadata

func IndexDB

func IndexDB(dbName string) string

Types

type IndexEntry

type IndexEntry struct {
	Attribute     string                   `json:"a"`
	Type          types.IndexAttributeType `json:"t"`
	ValuePosition int8                     `json:"vp"` // ValuePosition is used such that range query for lesser than, greater than can be executed easily
	Value         interface{}              `json:"v"`
	KeyPosition   int8                     `json:"kp"` // KeyPosition is used such that range query for lesser than, greater than can be executed easily
	Key           string                   `json:"k"`
}

IndexEntry hold metadata associated with the attribute being indexed along with the attribute value and key

func (*IndexEntry) Load

func (e *IndexEntry) Load(entry []byte) error

Load loads the string representation of IndexEntry into the IndexEntry object

func (*IndexEntry) String

func (e *IndexEntry) String() (string, error)

String returns a string representation of the indexEntry

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL