feat: add all handlers, use new jetstream simplified client

This commit is contained in:
2024-05-30 15:55:24 +08:00
parent d0f21b2fdd
commit ccfc2843b2
10 changed files with 261 additions and 259 deletions

View File

@@ -42,16 +42,14 @@ func init() {
}
func main() {
var (
wg sync.WaitGroup
)
var wg sync.WaitGroup
ctx, stop := notifyShutdown()
store, err := store.NewPgStore(store.PgOpts{
Logg: lo,
DSN: ko.MustString("postgres.dsn"),
MigrationsFolderPath: migrationsFolderFlag,
QueriesFolderPath: queriesFlag,
Logg: lo,
})
if err != nil {
lo.Error("could not initialize postgres store", "error", err)
@@ -59,9 +57,10 @@ func main() {
}
jetStreamSub, err := sub.NewJetStreamSub(sub.JetStreamOpts{
Endpoint: ko.MustString("jetstream.endpoint"),
Logg: lo,
Store: store,
Logg: lo,
Store: store,
Endpoint: ko.MustString("jetstream.endpoint"),
JetStreamID: ko.MustString("jetstream.id"),
})
if err != nil {
lo.Error("could not initialize jetstream sub", "error", err)