queue

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NonFilter

func NonFilter(vaaEvent *VaaEvent) bool

NonFilter non filter vaa evant.

func PythFilter

func PythFilter(vaaEvent *VaaEvent) bool

PythFilter filter vaa event from pyth chain.

Types

type ConsumerMessage

type ConsumerMessage interface {
	Data() *VaaEvent
	Done()
	Failed()
	IsExpired() bool
}

ConsumerMessage defition.

type FilterConsumeFunc

type FilterConsumeFunc func(vaaEvent *VaaEvent) bool

FilterConsumeFunc filter vaaa func definition.

type SQS

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

SQS represents a VAA queue in SQS.

func NewVAASQS

func NewVAASQS(consumer *sqs.Consumer, filterConsume FilterConsumeFunc, metrics metrics.Metrics, logger *zap.Logger, opts ...SQSOption) *SQS

NewVAASQS creates a VAA queue in SQS instances.

func (*SQS) Close

func (q *SQS) Close()

Close closes all consumer resources.

func (*SQS) Consume

func (q *SQS) Consume(ctx context.Context) <-chan ConsumerMessage

Consume returns the channel with the received messages from SQS queue.

type SQSOption

type SQSOption func(*SQS)

SQSOption represents a VAA queue in SQS option function.

func WithChannelSize

func WithChannelSize(size int) SQSOption

WithChannelSize allows to specify an channel size when setting a value.

type VAAConsumeFunc

type VAAConsumeFunc func(context.Context) <-chan ConsumerMessage

VAAConsumeFunc is a function to consume VAAEvent.

type VaaEvent

type VaaEvent struct {
	ID             string     `json:"id"`
	ChainID        uint16     `json:"emitterChain"`
	EmitterAddress string     `json:"emitterAddr"`
	Sequence       string     `json:"sequence"`
	PhylaxSetIndex uint32     `json:"phylaxSetIndex"`
	Vaa            []byte     `json:"vaas"`
	IndexedAt      time.Time  `json:"indexedAt"`
	Timestamp      *time.Time `json:"timestamp"`
	UpdatedAt      *time.Time `json:"updatedAt"`
	TxHash         string     `json:"txHash"`
	Version        uint16     `json:"version"`
	Revision       uint16     `json:"revision"`
}

VaaEvent represents a vaa data to be handle by the pipeline.

Jump to

Keyboard shortcuts

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