events

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobEventChannel    = "job_events"
	KeeperEventChannel = "keeper_events"
)

Variables

This section is empty.

Functions

func InitEventBus

func InitEventBus(redisAddr string) error

Types

type EventBus

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

func GetEventBus

func GetEventBus() *EventBus

func (*EventBus) PublishJobEvent

func (eb *EventBus) PublishJobEvent(ctx context.Context, event JobEvent) error

func (*EventBus) PublishKeeperEvent

func (eb *EventBus) PublishKeeperEvent(ctx context.Context, event KeeperEvent) error

func (*EventBus) Redis

func (eb *EventBus) Redis() *redis.Client

type JobEvent

type JobEvent struct {
	Type    string `json:"type"`
	JobID   int64  `json:"job_id"`
	JobType int    `json:"job_type"`
	ChainID int    `json:"chain_id"`
}

type KeeperEvent

type KeeperEvent struct {
	Type     string `json:"type"`
	KeeperID int64  `json:"keeper_id"`
}

Jump to

Keyboard shortcuts

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