Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message[T any] interface { Data() T Done(context.Context) Failed() IsExpired() bool SentTimestamp() *time.Time }
Message represents a message from a queue.
type Observation ¶
type Observation struct { Addr []byte `json:"addr"` Hash []byte `json:"hash"` Signature []byte `json:"signature"` TxHash []byte `json:"txHash"` MessageID string `json:"messageId"` }
Observation represents a signed observation.
type ObservationInMemory ¶
type ObservationInMemory struct {
// contains filtered or unexported fields
}
VAAInMemory represents VAA queue in memory.
func NewObservationInMemory ¶
func NewObservationInMemory(opts ...ObservationInMemoryOption) *ObservationInMemory
NewVAAInMemory creates a VAA queue in memory instances.
func (*ObservationInMemory) Consume ¶
func (i *ObservationInMemory) Consume(_ context.Context) <-chan Message[*gossipv1.SignedObservation]
Consume returns the channel with the received messages.
func (*ObservationInMemory) Publish ¶
func (i *ObservationInMemory) Publish(_ context.Context, o *gossipv1.SignedObservation) error
Publish sends the message to a channel.
type ObservationInMemoryOption ¶
type ObservationInMemoryOption func(*ObservationInMemory)
VAAInMemoryOption represents a VAA queue in memory option function.
func ObservationWithSize ¶
func ObservationWithSize(v int) ObservationInMemoryOption
WithSize allows to specify an channel size when setting a value.
type ObservationSqs ¶
type ObservationSqs struct {
// contains filtered or unexported fields
}
ObservationSqs represents a observation queue in SQS.
func NewObservationSqs ¶
func NewObservationSqs(producer *sqs.Producer, consumer *sqs.Consumer, logger *zap.Logger, opts ...VAASqsOption) *ObservationSqs
NewObservationSqs creates a observation queue in SQS instances.
func (*ObservationSqs) Close ¶
func (q *ObservationSqs) Close()
Close closes all consumer resources.
func (*ObservationSqs) Consume ¶
func (q *ObservationSqs) Consume(ctx context.Context) <-chan Message[*gossipv1.SignedObservation]
Consume returns the channel with the received messages from SQS queue.
func (*ObservationSqs) Publish ¶
func (q *ObservationSqs) Publish(ctx context.Context, o *gossipv1.SignedObservation) error
Publish sends the message to a SQS queue.
type VAAInMemory ¶
type VAAInMemory struct {
// contains filtered or unexported fields
}
VAAInMemory represents VAA queue in memory.
func NewVAAInMemory ¶
func NewVAAInMemory(opts ...VAAInMemoryOption) *VAAInMemory
NewVAAInMemory creates a VAA queue in memory instances.
type VAAInMemoryOption ¶
type VAAInMemoryOption func(*VAAInMemory)
VAAInMemoryOption represents a VAA queue in memory option function.
func WithSize ¶
func WithSize(v int) VAAInMemoryOption
WithSize allows to specify an channel size when setting a value.
type VAASqs ¶
type VAASqs struct {
// contains filtered or unexported fields
}
VAASqs represents a VAA queue in VAASqs.
func NewVaaSqs ¶
func NewVaaSqs(producer *sqs.Producer, consumer *sqs.Consumer, logger *zap.Logger, opts ...VAASqsOption) *VAASqs
NewVaaSqs creates a VAA queue in SQS instances.
type VAASqsOption ¶
type VAASqsOption func(*VAASqs)
VAASqsOption represents a VAA queue in SQS option function.
func WithChannelSize ¶
func WithChannelSize(size int) VAASqsOption
WithChannelSize allows to specify an channel size when setting a value.