Documentation
¶
Index ¶
- func IsRangeOperation(op syntax.Token) bool
- func LookForRangesWithHeight(conditions []syntax.Condition) (queryRange QueryRanges, indexes []int, heightRange QueryRange)
- func ParseEventSeqFromEventKey(key []byte) (int64, error)
- type DvsRequestIndex
- func (dvsReqIdx *DvsRequestIndex) AddBatch(batch *requestindex.Batch) error
- func (dvsReqIdx *DvsRequestIndex) Get(hash []byte) (*avsi.DVSRequestResult, error)
- func (dvsReqIdx *DvsRequestIndex) GetEventSeq() (*big.Int, error)
- func (dvsReqIdx *DvsRequestIndex) Index(result *avsi.DVSRequestResult) error
- func (dvsReqIdx *DvsRequestIndex) Search(ctx context.Context, q *query.Query) ([]*avsi.DVSRequestResult, error)
- func (dvsReqIdx *DvsRequestIndex) SetLogger(l log.Logger)
- type HeightInfo
- type QueryRange
- type QueryRanges
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRangeOperation ¶ added in v0.3.0
IsRangeOperation returns a boolean signifying if a query Operator is a range operation or not.
func LookForRangesWithHeight ¶ added in v0.3.0
func LookForRangesWithHeight(conditions []syntax.Condition) (queryRange QueryRanges, indexes []int, heightRange QueryRange)
LookForRangesWithHeight returns a mapping of QueryRanges and the matching indexes in the provided query conditions.
Types ¶
type DvsRequestIndex ¶
type DvsRequestIndex struct {
// contains filtered or unexported fields
}
DvsRequestIndex is the simplest possible requestindex, backed by key-value storage (levelDB).
func NewDvsRequestIndex ¶
func NewDvsRequestIndex(store dbm.DB) *DvsRequestIndex
NewDvsRequestIndex creates new KV requestindex.
func (*DvsRequestIndex) AddBatch ¶
func (dvsReqIdx *DvsRequestIndex) AddBatch(batch *requestindex.Batch) error
func (*DvsRequestIndex) Get ¶
func (dvsReqIdx *DvsRequestIndex) Get(hash []byte) (*avsi.DVSRequestResult, error)
Get gets transaction from the DvsRequestIndex storage and returns it or nil if the transaction is not found.
func (*DvsRequestIndex) GetEventSeq ¶
func (dvsReqIdx *DvsRequestIndex) GetEventSeq() (*big.Int, error)
func (*DvsRequestIndex) Index ¶
func (dvsReqIdx *DvsRequestIndex) Index(result *avsi.DVSRequestResult) error
func (*DvsRequestIndex) Search ¶
func (dvsReqIdx *DvsRequestIndex) Search(ctx context.Context, q *query.Query) ([]*avsi.DVSRequestResult, error)
Search performs a search using the given query. Search will exit early and return any result fetched so far, when a message is received on the context chan.
func (*DvsRequestIndex) SetLogger ¶
func (dvsReqIdx *DvsRequestIndex) SetLogger(l log.Logger)
type HeightInfo ¶ added in v0.3.0
type HeightInfo struct {
// contains filtered or unexported fields
}
type QueryRange ¶ added in v0.3.0
type QueryRange struct {
LowerBound interface{} // int || time.Time
UpperBound interface{} // int || time.Time
Key string
IncludeLowerBound bool
IncludeUpperBound bool
}
QueryRange defines a range within a query condition.
func (QueryRange) AnyBound ¶ added in v0.3.0
func (qr QueryRange) AnyBound() interface{}
AnyBound returns either the lower bound if non-nil, otherwise the upper bound.
func (QueryRange) LowerBoundValue ¶ added in v0.3.0
func (qr QueryRange) LowerBoundValue() interface{}
LowerBoundValue returns the value for the lower bound. If the lower bound is nil, nil will be returned.
func (QueryRange) UpperBoundValue ¶ added in v0.3.0
func (qr QueryRange) UpperBoundValue() interface{}
UpperBoundValue returns the value for the upper bound. If the upper bound is nil, nil will be returned.
type QueryRanges ¶ added in v0.3.0
type QueryRanges map[string]QueryRange
QueryRanges defines a mapping between a composite event key and a QueryRange.
e.g.account.number => queryRange{lowerBound: 1, upperBound: 5}
func LookForRanges
deprecated
added in
v0.3.0
func LookForRanges(conditions []syntax.Condition) (ranges QueryRanges, indexes []int)
Deprecated: This function is not used anymore and will be replaced with LookForRangesWithHeight