Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
cv65kr committed Nov 7, 2023
1 parent e3adfb7 commit c921692
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions natsjobs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

const (
pipeSubject string = "subject"
pipeStream string = "streamID"
pipeStream string = "stream_id"
pipePrefetch string = "prefetch"
pipeDeleteAfterAck string = "delete_after_ack"
pipeDeliverNew string = "deliver_new"
Expand All @@ -21,7 +21,7 @@ type config struct {

Priority int64 `mapstructure:"priority"`
Subject string `mapstructure:"subject"`
StreamId string `mapstructure:"streamID"`
StreamID string `mapstructure:"stream_id"`
Prefetch int `mapstructure:"prefetch"`
RateLimit uint64 `mapstructure:"rate_limit"`
DeleteAfterAck bool `mapstructure:"delete_after_ack"`
Expand All @@ -42,8 +42,8 @@ func (c *config) InitDefaults() {
c.Priority = 10
}

if c.StreamId == "" {
c.StreamId = "default-streamID"
if c.StreamID == "" {
c.StreamID = "default-streamID"
}

if c.Subject == "" {
Expand Down
4 changes: 2 additions & 2 deletions natsjobs/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func FromConfig(tracer *sdktrace.TracerProvider, configKey string, log *zap.Logg
}

stream, err := js.CreateOrUpdateStream(context.Background(), jetstream.StreamConfig{
Name: conf.StreamId,
Name: conf.StreamID,
Subjects: []string{conf.Subject},
})
if err != nil {
Expand All @@ -141,7 +141,7 @@ func FromConfig(tracer *sdktrace.TracerProvider, configKey string, log *zap.Logg

priority: conf.Priority,
subject: conf.Subject,
streamID: conf.StreamId,
streamID: conf.StreamID,
deleteAfterAck: conf.DeleteAfterAck,
deleteStreamOnStop: conf.DeleteStreamOnStop,
prefetch: conf.Prefetch,
Expand Down
4 changes: 2 additions & 2 deletions tests/configs/.rr-nats-durability-redial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
config:
prefetch: 100
subject: default.*
streamId: foo
stream_id: foo
deliver_new: true
rate_limit: 100
delete_after_ack: true
Expand All @@ -43,7 +43,7 @@ jobs:
config:
prefetch: 100
subject: default2.*
streamId: foo2
stream_id: foo2
rate_limit: 100
deliver_new: true
delete_after_ack: true
Expand Down
4 changes: 2 additions & 2 deletions tests/configs/.rr-nats-init-v27-br.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
config:
prefetch: 100
subject: "default-5.*"
streamId: "foo-15"
stream_id: "foo-15"
delete_after_ack: "true"
deliver_new: "true"
priority: 1
Expand All @@ -43,7 +43,7 @@ jobs:
prefetch: 100
subject: "default-6.*"
delete_after_ack: "true"
streamId: "foo-6"
stream_id: "foo-6"
deliver_new: "true"
priority: 2

Expand Down
4 changes: 2 additions & 2 deletions tests/configs/.rr-nats-init-v27.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
config:
prefetch: 100
subject: "default-3.*"
streamId: "foo-3"
stream_id: "foo-3"
deliver_new: "true"
priority: 1

Expand All @@ -41,7 +41,7 @@ jobs:
config:
prefetch: 100
subject: "default-4.*"
streamId: "foo-4"
stream_id: "foo-4"
deliver_new: "true"
priority: 2

Expand Down
4 changes: 2 additions & 2 deletions tests/configs/.rr-nats-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
config:
prefetch: 100
subject: "xxxxxxx.*"
streamId: "foo"
stream_id: "foo"
delete_after_ack: true
deliver_new: "true"
priority: 1
Expand All @@ -42,7 +42,7 @@ jobs:
config:
prefetch: 100
subject: "default-2.*"
streamId: "foo-2"
stream_id: "foo-2"
deliver_new: "true"
delete_after_ack: true
priority: 2
Expand Down
2 changes: 1 addition & 1 deletion tests/configs/.rr-nats-otel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
config:
prefetch: 100
subject: "default-otel.*"
streamId: "foo-otel"
stream_id: "foo-otel"
delete_after_ack: true
deliver_new: "true"
priority: 1
Expand Down
4 changes: 2 additions & 2 deletions tests/configs/.rr-nats-pq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
config:
prefetch: 100
subject: "default-pq.*"
streamId: "foo-pq"
stream_id: "foo-pq"
delete_after_ack: true
deliver_new: "true"
priority: 1
Expand All @@ -40,7 +40,7 @@ jobs:
config:
prefetch: 100
subject: "default-2-pq.*"
streamId: "foo-2-pq"
stream_id: "foo-2-pq"
deliver_new: "true"
delete_after_ack: true
priority: 2
Expand Down
2 changes: 1 addition & 1 deletion tests/configs/.rr-nats-raw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
config:
prefetch: 100
subject: default-raw.*
streamId: foo-raw
stream_id: foo-raw
consume_all: true
delete_after_ack: true
deliver_new: true
Expand Down
4 changes: 2 additions & 2 deletions tests/configs/.rr-no-global.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
config:
prefetch: 100
subject: "default.*"
streamId: "foo"
stream_id: "foo"
deliver_new: "true"
priority: 1

Expand All @@ -40,7 +40,7 @@ jobs:
config:
prefetch: 100
subject: "default.*"
streamId: "foo"
stream_id: "foo"
deliver_new: "true"
priority: 2

Expand Down
2 changes: 1 addition & 1 deletion tests/jobs_nats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ func declareNATSPipe(address, subj, stream string) func(t *testing.T) {
"driver": "nats",
"name": "test-3",
"subject": subj,
"streamID": stream,
"stream_id": stream,
"deliver_new": "true",
"prefetch": "100",
"priority": "3",
Expand Down

0 comments on commit c921692

Please sign in to comment.