Documentation ¶
Index ¶
- Variables
- func Collect(ctx context.Context, lowBlockNum, highBlockNum uint64, ...) (out []search.SearchMatch, err error)
- func EOSDocumentID(blockNum uint64, transactionID string, actionIndex int) string
- func ExplodeEOSDocumentID(ref string) (blockNum uint64, trxID string, actionIdx uint16, skip bool)
- func GetEOSIndexedFields() []*search.IndexedField
- func GetEOSIndexedFieldsMap() map[string]*search.IndexedField
- func InitEOSIndexedFields()
- type EOSBleveQueryValidator
- type EOSBlockMapper
- type EOSSearchMatch
Constants ¶
This section is empty.
Variables ¶
View Source
var EOSIndexedFields = []search.IndexedField{ {"account", search.AccountType}, {"active", search.FreeFormType}, {"active_key", search.FreeFormType}, {"actor", search.FreeFormType}, {"amount", search.AssetType}, {"auth", search.FreeFormType}, {"authority", search.FreeFormType}, {"bid", search.FreeFormType}, {"bidder", search.AccountType}, {"canceler", search.AccountType}, {"creator", search.AccountType}, {"executer", search.AccountType}, {"from", search.AccountType}, {"is_active", search.BooleanType}, {"is_priv", search.BooleanType}, {"isproxy", search.BooleanType}, {"issuer", search.AccountType}, {"level", search.FreeFormType}, {"location", search.FreeFormType}, {"maximum_supply", search.AssetType}, {"name", search.NameType}, {"newname", search.NameType}, {"owner", search.AccountType}, {"parent", search.AccountType}, {"payer", search.AccountType}, {"permission", search.PermissionType}, {"producer", search.AccountType}, {"producer_key", search.FreeFormType}, {"proposal_name", search.NameType}, {"proposal_hash", search.FreeFormType}, {"proposer", search.AccountType}, {"proxy", search.FreeFormType}, {"public_key", search.FreeFormType}, {"producers", search.FreeFormType}, {"quant", search.FreeFormType}, {"quantity", search.FreeFormType}, {"ram_payer", search.AccountType}, {"receiver", search.AccountType}, {"requested", search.BooleanType}, {"requirement", search.FreeFormType}, {"symbol", search.FreeFormType}, {"threshold", search.FreeFormType}, {"to", search.AccountType}, {"transfer", search.FreeFormType}, {"voter", search.AccountType}, {"voter_name", search.NameType}, {"weight", search.FreeFormType}, }
View Source
var TestMatchCollector = func(ctx context.Context, lowBlockNum, highBlockNum uint64, results bsearch.DocumentMatchCollection) (out []search.SearchMatch, err error) { trxs := make(map[string][]uint16) var trxList []*testTrxResult for _, el := range results { if err := ctx.Err(); err != nil { return nil, err } blockNum, trxID, actionIdx, skip := testExplodeDocumentID(el.ID) if skip { continue } if blockNum < lowBlockNum || blockNum > highBlockNum { continue } if _, found := trxs[trxID]; !found { trxList = append(trxList, &testTrxResult{ id: trxID, blockNum: blockNum, }) } trxs[trxID] = append(trxs[trxID], actionIdx) } for _, trx := range trxList { actions := trxs[trx.id] sort.Slice(actions, func(i, j int) bool { return actions[i] < actions[j] }) out = append(out, &EOSSearchMatch{ TrxIDPrefix: trx.id, ActionIndexes: actions, BlockNumber: trx.blockNum, }) } return out, nil }
Functions ¶
func Collect ¶
func Collect(ctx context.Context, lowBlockNum, highBlockNum uint64, results bsearch.DocumentMatchCollection) (out []search.SearchMatch, err error)
func EOSDocumentID ¶
func ExplodeEOSDocumentID ¶
func GetEOSIndexedFields ¶
func GetEOSIndexedFields() []*search.IndexedField
GetIndexedFields returns the list of indexed fields of the service, from the cached list of indexed fields. Function `InitIndexedFields` must be called prior using this function.
func GetEOSIndexedFieldsMap ¶
func GetEOSIndexedFieldsMap() map[string]*search.IndexedField
func InitEOSIndexedFields ¶
func InitEOSIndexedFields()
InitIndexedFields initialize the list of indexed fields of the service
Types ¶
type EOSBleveQueryValidator ¶
type EOSBleveQueryValidator struct{}
func (*EOSBleveQueryValidator) Validate ¶
func (v *EOSBleveQueryValidator) Validate(q *search.BleveQuery) error
type EOSBlockMapper ¶
type EOSBlockMapper struct {
// contains filtered or unexported fields
}
func NewEOSBlockMapper ¶
func NewEOSBlockMapper(hooksActionName string, filterOn, filterOut string) (*EOSBlockMapper, error)
func (*EOSBlockMapper) IndexMapping ¶
func (m *EOSBlockMapper) IndexMapping() *mapping.IndexMappingImpl
func (*EOSBlockMapper) Map ¶
func (m *EOSBlockMapper) Map(mapper *mapping.IndexMappingImpl, block *bstream.Block) ([]*document.Document, error)
type EOSSearchMatch ¶
type EOSSearchMatch struct { TrxIDPrefix string `json:"prefix"` // ID prefix ActionIndexes []uint16 `json:"acts"` // Action indexes within the transactions BlockNumber uint64 `json:"blk"` // Current block for this trx Index uint64 `json:"idx"` // Index of the matching transaction within a block (depends on order of sort) }
func (*EOSSearchMatch) BlockNum ¶
func (m *EOSSearchMatch) BlockNum() uint64
func (*EOSSearchMatch) FillProtoSpecific ¶
func (m *EOSSearchMatch) FillProtoSpecific(match *pbsearch.SearchMatch, block *bstream.Block) (err error)
func (*EOSSearchMatch) GetIndex ¶
func (m *EOSSearchMatch) GetIndex() uint64
func (*EOSSearchMatch) SetIndex ¶
func (m *EOSSearchMatch) SetIndex(index uint64)
func (*EOSSearchMatch) TransactionIDPrefix ¶
func (m *EOSSearchMatch) TransactionIDPrefix() string
Click to show internal directories.
Click to hide internal directories.