Skip to content

Commit

Permalink
Merge pull request #1013 from jafossum/fix-nats-typos
Browse files Browse the repository at this point in the history
Fix docstring typos in nats and jetstream protocol
  • Loading branch information
embano1 authored Feb 10, 2024
2 parents 04ed212 + 2458ec7 commit 2574a05
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions protocol/nats/v2/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

var ErrInvalidQueueName = errors.New("invalid queue name for QueueSubscriber")

// NatsOptions is a helper function to group a variadic stan.ProtocolOption into
// []stan.Option that can be used by either Sender, Consumer or Protocol
// NatsOptions is a helper function to group a variadic nats.ProtocolOption into
// []nats.Option that can be used by either Sender, Consumer or Protocol
func NatsOptions(opts ...nats.Option) []nats.Option {
return opts
}
Expand Down
2 changes: 1 addition & 1 deletion protocol/nats/v2/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Protocol struct {
Sender *Sender
senderOptions []SenderOption

connOwned bool // whether this protocol created the stan connection
connOwned bool // whether this protocol created the nats connection
}

// NewProtocol creates a new NATS protocol.
Expand Down
4 changes: 2 additions & 2 deletions protocol/nats/v2/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Sender struct {
connOwned bool
}

// NewSender creates a new protocol.Sender responsible for opening and closing the STAN connection
// NewSender creates a new protocol.Sender responsible for opening and closing the NATS connection
func NewSender(url, subject string, natsOpts []nats.Option, opts ...SenderOption) (*Sender, error) {
conn, err := nats.Connect(url, natsOpts...)
if err != nil {
Expand All @@ -40,7 +40,7 @@ func NewSender(url, subject string, natsOpts []nats.Option, opts ...SenderOption
return s, nil
}

// NewSenderFromConn creates a new protocol.Sender which leaves responsibility for opening and closing the STAN
// NewSenderFromConn creates a new protocol.Sender which leaves responsibility for opening and closing the NATS
// connection to the caller
func NewSenderFromConn(conn *nats.Conn, subject string, opts ...SenderOption) (*Sender, error) {
s := &Sender{
Expand Down
2 changes: 1 addition & 1 deletion protocol/nats_jetstream/v2/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewSender(url, stream, subject string, natsOpts []nats.Option, jsmOpts []na
return s, nil
}

// NewSenderFromConn creates a new protocol.Sender which leaves responsibility for opening and closing the STAN
// NewSenderFromConn creates a new protocol.Sender which leaves responsibility for opening and closing the NATS
// connection to the caller
func NewSenderFromConn(conn *nats.Conn, stream, subject string, jsmOpts []nats.JSOpt, opts ...SenderOption) (*Sender, error) {
jsm, err := conn.JetStream(jsmOpts...)
Expand Down

0 comments on commit 2574a05

Please sign in to comment.