2022-11-21 06:18:33 -08:00
|
|
|
package queue
|
|
|
|
|
2024-02-06 16:00:45 -08:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
2023-05-10 11:49:40 -07:00
|
|
|
|
2022-11-21 06:18:33 -08:00
|
|
|
// Message represents a message from a queue.
|
2024-02-06 16:00:45 -08:00
|
|
|
type Message[T any] interface {
|
|
|
|
Data() T
|
2023-05-10 11:49:40 -07:00
|
|
|
Done(context.Context)
|
2023-02-02 09:51:33 -08:00
|
|
|
Failed()
|
|
|
|
IsExpired() bool
|
2022-11-21 06:18:33 -08:00
|
|
|
}
|
2024-02-06 16:00:45 -08:00
|
|
|
|
|
|
|
// Observation represents a signed observation.
|
|
|
|
type Observation struct {
|
|
|
|
Addr []byte `json:"addr"`
|
|
|
|
Hash []byte `json:"hash"`
|
|
|
|
Signature []byte `json:"signature"`
|
|
|
|
TxHash []byte `json:"txHash"`
|
|
|
|
MessageID string `json:"messageId"`
|
|
|
|
}
|