Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { ID string `bson:"_id"` ChainID uint16 `bson:"emitterChain"` EmitterAddress string `bson:"emitterAddr"` Sequence string `bson:"sequence"` GuardianSetIndex uint32 `bson:"guardianSetIndex"` Vaa []byte `bson:"vaas"` IndexedAt time.Time `bson:"indexedAt"` Timestamp *time.Time `bson:"timestamp"` UpdatedAt *time.Time `bson:"updatedAt"` TxHash string `bson:"txHash"` Version uint16 `bson:"version"` Revision uint16 `bson:"revision"` Hash []byte `bson:"hash"` IsDuplicated bool `bson:"isDuplicated"` }
Event represents a database change.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher represents a listener of database changes.
func NewWatcher ¶
func NewWatcher(ctx context.Context, db *mongo.Database, dbName string, handler WatcherFunc, alertClient alert.AlertClient, metrics metrics.Metrics, logger *zap.Logger) *Watcher
NewWatcher creates a new database event watcher.
type WatcherFunc ¶
WatcherFunc is a function to send database changes.
Click to show internal directories.
Click to hide internal directories.