Documentation ¶
Index ¶
- Constants
- type AlloraClientInterface
- type BlockMetadata
- type CodecInterface
- type EventsProducer
- type FilterInterface
- type Message
- type Metadata
- type Payload
- type ProcessedBlock
- type ProcessedBlockEvent
- type ProcessedBlockRepositoryInterface
- type ProcessorService
- type StreamingClient
- type TopicRouter
- type TransactionMetadata
- type TransactionsProducer
Constants ¶
View Source
const ( MessageTypeEvent string = "event" MessageTypeTransaction string = "transaction" )
View Source
const ( StatusPending string = "pending" StatusCompleted string = "completed" StatusFailed string = "failed" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlloraClientInterface ¶
type AlloraClientInterface interface { // GetLatestBlockHeight returns the latest block height GetLatestBlockHeight(ctx context.Context) (int64, error) // GetBlockByHeight returns a block by height GetBlockByHeight(ctx context.Context, height int64) (*ctypes.ResultBlock, error) // GetBlockResults returns the results of a block by height GetBlockResults(ctx context.Context, height int64) (*ctypes.ResultBlockResults, error) // GetHeader returns the header of a block by height GetHeader(ctx context.Context, height int64) (*ctypes.ResultHeader, error) }
type BlockMetadata ¶
type CodecInterface ¶
type CodecInterface interface { // ParseTx parses a transaction ParseTx(txBytes []byte) (*tx.Tx, error) // ParseTxMessage parses a transaction message ParseTxMessage(message *codectypes.Any) (proto.Message, error) // ParseTxMessages parses transaction messages ParseTxMessages(txMessages []*codectypes.Any) ([]proto.Message, error) // ParseEvent parses an event ParseEvent(event *abcitypes.Event) (proto.Message, error) // MarshalProtoJSON marshals a protobuf message to JSON MarshalProtoJSON(event proto.Message) (json.RawMessage, error) }
DecodeTxMsg decodes a transaction message
type EventsProducer ¶
type FilterInterface ¶
FilterInterface defines the interface for filters.
type Message ¶
type Message struct { ID string `json:"id"` // hash of the entire payload Type string `json:"type"` // event or transaction Name string `json:"name"` // type of the payload (full qualified name, e.g. emisions.v3.EventNetworkLossSet) Timestamp time.Time `json:"timestamp"` // timestamp of this message (created at, in UTC) Payload Payload `json:"payload"` // payload of the message }
These are the messages that are sent to Kafka
type Metadata ¶
type Metadata struct { BlockMetadata BlockMetadata `json:"block_metadata"` // metadata of the block TransactionMetadata TransactionMetadata `json:"transaction_metadata"` // metadata of the transaction }
type Payload ¶
type Payload struct { Metadata Metadata `json:"metadata"` // metadata of the block and transaction (when available) Data json.RawMessage `json:"data"` // json encoded payload (transaction or event) }
func NewPayload ¶
func NewPayload(metadata Metadata, data json.RawMessage) Payload
type ProcessedBlock ¶
ProcessedBlock is the model used to keep track of the processed blocks
type ProcessedBlockEvent ¶
ProcessedBlockEvent is the model used to keep track of the processed block events
type ProcessedBlockRepositoryInterface ¶
type ProcessedBlockRepositoryInterface interface { GetLastProcessedBlock(ctx context.Context) (ProcessedBlock, error) SaveProcessedBlock(ctx context.Context, block ProcessedBlock) error GetLastProcessedBlockEvent(ctx context.Context) (ProcessedBlockEvent, error) SaveProcessedBlockEvent(ctx context.Context, blockEvent ProcessedBlockEvent) error }
type ProcessorService ¶
type StreamingClient ¶
type TopicRouter ¶
type TopicRouter interface { // GetTopic returns the Kafka topic for a given message type GetTopic(msgType string) (string, error) }
TopicRouter defines the interface for determining Kafka topics based on message types.
type TransactionMetadata ¶
type TransactionsProducer ¶
Click to show internal directories.
Click to hide internal directories.