2 Commits

Author SHA1 Message Date
rogeecn
e7a1db2c16 fix: job contracts 2025-03-11 09:44:44 +08:00
Rogee
c8cf318faa feat: add event contracts 2025-02-11 15:51:29 +08:00
2 changed files with 9 additions and 6 deletions

View File

@@ -1,15 +1,13 @@
package contracts
import (
"time"
"github.com/riverqueue/river"
)
type CronJob interface {
Description() string
Periodic() time.Duration
JobArgs() []river.JobArgs
InsertOpts() *river.InsertOpts
Kind() string
Periodic() river.PeriodicSchedule
JobArgs() river.JobArgs
InsertOpts() river.InsertOpts
RunOnStart() bool
}

View File

@@ -7,3 +7,8 @@ type EventHandler interface {
PublishToTopic() string
Handler(msg *message.Message) ([]*message.Message, error)
}
type EventPublisher interface {
Topic() string
Marshal() ([]byte, error)
}