Documentation ¶
Index ¶
- Constants
- Variables
- func EventComparator(event1 IndexerEvent, event2 IndexerEvent) bool
- func InitIndexerRoutes()
- func PrintIndexerError(funcName string, errMsg string, args ...interface{})
- func ProcessMessage(message IndexerMessage)
- func ProcessMessageEvents(message IndexerMessage)
- func StartMessageProcessor()
- func TryProcessAcceptedMessages() bool
- func TryProcessFinalizedMessages() bool
- func TryProcessPendingMessage() bool
- type IndexerCursor
- type IndexerEvent
- type IndexerMessage
Constants ¶
View Source
const ( DATA_STATUS_FINALIZED = "DATA_STATUS_FINALIZED" DATA_STATUS_ACCEPTED = "DATA_STATUS_ACCEPTED" DATA_STATUS_PENDING = "DATA_STATUS_PENDING" )
Variables ¶
View Source
var AcceptedMessageLock = &sync.Mutex{}
View Source
var AcceptedMessageQueue []IndexerMessage
View Source
var FinalizedMessageLock = &sync.Mutex{}
View Source
var FinalizedMessageQueue []IndexerMessage
View Source
var LastAcceptedEndKey int
View Source
var LastFinalizedCursor int
View Source
var PendingMessageLock = &sync.Mutex{}
Functions ¶
func EventComparator ¶
func EventComparator(event1 IndexerEvent, event2 IndexerEvent) bool
TODO: Improve this with hashing?
func InitIndexerRoutes ¶
func InitIndexerRoutes()
func PrintIndexerError ¶
func ProcessMessage ¶
func ProcessMessage(message IndexerMessage)
func ProcessMessageEvents ¶
func ProcessMessageEvents(message IndexerMessage)
func StartMessageProcessor ¶
func StartMessageProcessor()
func TryProcessAcceptedMessages ¶
func TryProcessAcceptedMessages() bool
func TryProcessFinalizedMessages ¶
func TryProcessFinalizedMessages() bool
func TryProcessPendingMessage ¶
func TryProcessPendingMessage() bool
Types ¶
type IndexerCursor ¶
type IndexerEvent ¶
type IndexerMessage ¶
type IndexerMessage struct { Data struct { Cursor IndexerCursor `json:"cursor"` EndCursor IndexerCursor `json:"end_cursor"` Finality string `json:"finality"` Batch []struct { Status string `json:"status"` Events []IndexerEvent `json:"events"` } `json:"batch"` } `json:"data"` }
var LastProcessedPendingMessage *IndexerMessage
var LatestPendingMessage *IndexerMessage
TODO: Pointers? TODO: Load on init
Click to show internal directories.
Click to hide internal directories.