extractor

package
v0.0.0-...-0ab412c Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExtractFunc db.Extractor

Functions

func EventContextFromAuthz

func EventContextFromAuthz(ctx db.EventContext, msgIndex int) (db.EventContext, error)

func GetIncomesFromBuySellNftMsg

func GetIncomesFromBuySellNftMsg(events types.StringEvents, txHash string) []db.NftIncome

marketplace messages may contain multiple coin_received events, should not directly use GetEventValue() or GetEventsValue() since it only returns the first one

func GetIncomesFromSendNftMsgs

func GetIncomesFromSendNftMsgs(eventsList db.EventsList, msgIndex int, txHash string) []db.NftIncome

func GetIscnVersion

func GetIscnVersion(iscn string) int

func Run

func Run(pool *pgxpool.Pool) chan<- int64

TODO: should we make extractor synchronous with poller instead of async?

Types

type EventExtractor

type EventExtractor struct {
	// contains filtered or unexported fields
}

func NewEventExtractor

func NewEventExtractor() *EventExtractor

func (*EventExtractor) Extract

func (e *EventExtractor) Extract(ctx db.EventContext) error

func (*EventExtractor) RegisterAll

func (e *EventExtractor) RegisterAll(processor EventProcessor)

func (*EventExtractor) RegisterType

func (e *EventExtractor) RegisterType(eventType string, processor EventProcessor)

func (*EventExtractor) RegisterTypeKey

func (e *EventExtractor) RegisterTypeKey(eventType, key string, processor EventProcessor)

func (*EventExtractor) RegisterTypeKeyValue

func (e *EventExtractor) RegisterTypeKeyValue(eventType, key, value string, processor EventProcessor)

type EventProcessor

type EventProcessor func(payload *Payload, event *types.StringEvent) error

type Payload

type Payload struct {
	db.EventContext
	MsgIndex int
}

func PayloadFromEventContext

func PayloadFromEventContext(ctx db.EventContext) *Payload

func (*Payload) GetEvents

func (payload *Payload) GetEvents() types.StringEvents

func (*Payload) GetMessage

func (payload *Payload) GetMessage() json.RawMessage

func (*Payload) Next

func (payload *Payload) Next() bool

Jump to

Keyboard shortcuts

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