Skip to content

Commit a97d0d8

Browse files
authored
correcting nats jetstreamns vs streams (#14)
1 parent 3cb5432 commit a97d0d8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ type (
9898
// natsClient is the nats client for the application.
9999
natsClient *nats.Conn
100100

101+
// natsJetStream is the nats jetstream for the application.
102+
natsJetStream jetstream.JetStream
103+
101104
// natStream is the nats stream for the application.
102105
natsStream jetstream.Stream
103106
}
@@ -383,7 +386,12 @@ func (a *App) NatsClient() *nats.Conn {
383386
}
384387

385388
// NatsJetStream returns the JetStream stream for the application.
386-
func (a *App) NatsJetStream() jetstream.Stream {
389+
func (a *App) NatsJetStream() jetstream.JetStream {
390+
return a.natsJetStream
391+
}
392+
393+
// NatsStream returns the NATS stream for the application.
394+
func (a *App) NatsStream() jetstream.Stream {
387395
return a.natsStream
388396
}
389397

options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ func WithNatsJetStream(streamName string, subjects []string) StartOption {
352352
if err != nil {
353353
return fmt.Errorf("failed to create jetstream: %w", err)
354354
}
355+
a.natsJetStream = js
355356

356357
_, err = js.CreateStream(a.baseCtx, jetstream.StreamConfig{
357358
Name: streamName,

0 commit comments

Comments
 (0)