Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: R.I.Pienaar <[email protected]>
  • Loading branch information
ripienaar committed Sep 2, 2022
1 parent 4aa7d04 commit 5d3e737
Show file tree
Hide file tree
Showing 27 changed files with 92 additions and 31 deletions.
3 changes: 2 additions & 1 deletion api/consumers.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ type ConsumerConfig struct {
DeliverPolicy DeliverPolicy `json:"deliver_policy"`
DeliverSubject string `json:"deliver_subject,omitempty"`
DeliverGroup string `json:"deliver_group,omitempty"`
Durable string `json:"durable_name,omitempty"`
Durable string `json:"durable_name,omitempty"` // Durable is deprecated. All consumers will have names. picked by clients.
Name string `json:"name,omitempty"`
FilterSubject string `json:"filter_subject,omitempty"`
FlowControl bool `json:"flow_control,omitempty"`
Heartbeat time.Duration `json:"idle_heartbeat,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion api/schemas_generated.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// auto generated 2022-08-19 16:00:21.159269 +0300 EEST m=+0.026426854
// auto generated 2022-09-02 11:53:01.334366 +0200 CEST m=+0.025374519

package api

Expand Down
4 changes: 4 additions & 0 deletions consumers.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ func (m *Manager) LoadConsumer(stream string, name string) (consumer *Consumer,
}

func (m *Manager) consumerFromCfg(stream string, name string, cfg *api.ConsumerConfig) *Consumer {
if name == "" && cfg.Name != "" {
name = cfg.Name
}

return &Consumer{
name: name,
stream: stream,
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require (
github.com/dustin/go-humanize v1.0.0
github.com/google/go-cmp v0.5.8
github.com/klauspost/compress v1.15.9
github.com/nats-io/nats-server/v2 v2.8.5-0.20220831231927-4b5e0a3f87ad
github.com/nats-io/nats.go v1.16.1-0.20220831224735-5d4f44e50975
github.com/nats-io/nats-server/v2 v2.8.5-0.20220901192829-c4b5ca7cff77
github.com/nats-io/nats.go v1.16.1-0.20220901120628-84e2c74b56da
github.com/nats-io/nuid v1.0.1
golang.org/x/text v0.3.7
)
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI=
github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k=
github.com/nats-io/nats-server/v2 v2.8.5-0.20220831231927-4b5e0a3f87ad h1:f/7URe0uLLw/cRuWVoHDz50n3fENzGBsWJirSnPXHPQ=
github.com/nats-io/nats-server/v2 v2.8.5-0.20220831231927-4b5e0a3f87ad/go.mod h1:+f++B/5jpr71JATt7b5KCX+G7bt43iWx1OYWGkpE/Kk=
github.com/nats-io/nats.go v1.16.1-0.20220831224735-5d4f44e50975 h1:5muUE1m81XRAuTc+mWiZTNtD18hvPivw45DJNv1PRF4=
github.com/nats-io/nats.go v1.16.1-0.20220831224735-5d4f44e50975/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w=
github.com/nats-io/nats-server/v2 v2.8.5-0.20220901192829-c4b5ca7cff77 h1:BsOzAZ/yTUQKQxVVTjwLtM7T0j2XXkPICBjgOPY6bfU=
github.com/nats-io/nats-server/v2 v2.8.5-0.20220901192829-c4b5ca7cff77/go.mod h1:+f++B/5jpr71JATt7b5KCX+G7bt43iWx1OYWGkpE/Kk=
github.com/nats-io/nats.go v1.16.1-0.20220901120628-84e2c74b56da h1:VAeFGKLEHSiVb1nPowftbJCF7YQYXHyOsr+Mun0i4+c=
github.com/nats-io/nats.go v1.16.1-0.20220901120628-84e2c74b56da/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w=
github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8=
github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4=
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
Expand Down
2 changes: 1 addition & 1 deletion jsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func IsValidName(n string) bool {
return false
}

return !strings.ContainsAny(n, ">*. ")
return !strings.ContainsAny(n, ">*. /\\")
}

// APISubject returns API subject with prefix applied
Expand Down
9 changes: 7 additions & 2 deletions schema_source/jetstream/api/v1/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,11 @@
"properties": {
"durable_name": {
"description": "A unique name for a durable consumer",
"deprecationMessage": "Durable is deprecated. All consumers will have names. picked by clients.",
"$ref": "#/definitions/basic_name"
},
"name": {
"description": "A unique name for a consumer",
"$ref": "#/definitions/basic_name"
},
"description": {
Expand Down Expand Up @@ -693,7 +698,7 @@
"default": 0
},
"backoff": {
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages or those being normally retried",
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages",
"type": "array",
"items": {
"$ref": "#/definitions/golang_duration_nanos"
Expand Down Expand Up @@ -1010,7 +1015,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
9 changes: 8 additions & 1 deletion schemas/jetstream/api/v1/consumer_configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@
"properties": {
"durable_name": {
"description": "A unique name for a durable consumer",
"deprecationMessage": "Durable is deprecated. All consumers will have names. picked by clients.",
"type": "string",
"pattern": "^[^.*>]+$",
"minLength": 1
},
"name": {
"description": "A unique name for a consumer",
"type": "string",
"pattern": "^[^.*>]+$",
"minLength": 1
Expand Down Expand Up @@ -235,7 +242,7 @@
"minimum": -9223372036854775807
},
"backoff": {
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages or those being normally retried",
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages",
"type": "array",
"items": {
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
Expand Down
9 changes: 8 additions & 1 deletion schemas/jetstream/api/v1/consumer_create_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@
"properties": {
"durable_name": {
"description": "A unique name for a durable consumer",
"deprecationMessage": "Durable is deprecated. All consumers will have names. picked by clients.",
"type": "string",
"pattern": "^[^.*>]+$",
"minLength": 1
},
"name": {
"description": "A unique name for a consumer",
"type": "string",
"pattern": "^[^.*>]+$",
"minLength": 1
Expand Down Expand Up @@ -247,7 +254,7 @@
"minimum": -9223372036854775807
},
"backoff": {
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages or those being normally retried",
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages",
"type": "array",
"items": {
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
Expand Down
9 changes: 8 additions & 1 deletion schemas/jetstream/api/v1/consumer_create_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@
"properties": {
"durable_name": {
"description": "A unique name for a durable consumer",
"deprecationMessage": "Durable is deprecated. All consumers will have names. picked by clients.",
"type": "string",
"pattern": "^[^.*>]+$",
"minLength": 1
},
"name": {
"description": "A unique name for a consumer",
"type": "string",
"pattern": "^[^.*>]+$",
"minLength": 1
Expand Down Expand Up @@ -263,7 +270,7 @@
"minimum": -9223372036854775807
},
"backoff": {
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages or those being normally retried",
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages",
"type": "array",
"items": {
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
Expand Down
9 changes: 8 additions & 1 deletion schemas/jetstream/api/v1/consumer_info_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@
"properties": {
"durable_name": {
"description": "A unique name for a durable consumer",
"deprecationMessage": "Durable is deprecated. All consumers will have names. picked by clients.",
"type": "string",
"pattern": "^[^.*>]+$",
"minLength": 1
},
"name": {
"description": "A unique name for a consumer",
"type": "string",
"pattern": "^[^.*>]+$",
"minLength": 1
Expand Down Expand Up @@ -263,7 +270,7 @@
"minimum": -9223372036854775807
},
"backoff": {
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages or those being normally retried",
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages",
"type": "array",
"items": {
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
Expand Down
9 changes: 8 additions & 1 deletion schemas/jetstream/api/v1/consumer_list_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@
"properties": {
"durable_name": {
"description": "A unique name for a durable consumer",
"deprecationMessage": "Durable is deprecated. All consumers will have names. picked by clients.",
"type": "string",
"pattern": "^[^.*>]+$",
"minLength": 1
},
"name": {
"description": "A unique name for a consumer",
"type": "string",
"pattern": "^[^.*>]+$",
"minLength": 1
Expand Down Expand Up @@ -328,7 +335,7 @@
"minimum": -9223372036854775807
},
"backoff": {
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages or those being normally retried",
"description": "List of durations in Go format that represents a retry time scale for NaK'd messages",
"type": "array",
"items": {
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
Expand Down
2 changes: 1 addition & 1 deletion schemas/jetstream/api/v1/stream_configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/jetstream/api/v1/stream_create_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/jetstream/api/v1/stream_create_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/jetstream/api/v1/stream_info_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/jetstream/api/v1/stream_list_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/jetstream/api/v1/stream_restore_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/jetstream/api/v1/stream_snapshot_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/jetstream/api/v1/stream_update_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/jetstream/api/v1/stream_update_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
},
"allow_direct": {
"type": "boolean",
"default": false,
"default": true,
"description": "Allow higher performance, direct access to get individual messages via the $JS.DS.GET API"
},
"republish": {
Expand Down
12 changes: 11 additions & 1 deletion schemas/server/errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -1288,5 +1288,15 @@
"help": "",
"url": "",
"deprecates": ""
},
{
"constant": "JSConsumerCreateFilterSubjectMismatchErr",
"code": 400,
"error_code": 10131,
"description": "Consumer create request did not match filtered subject from create subject",
"comment": "",
"help": "",
"url": "",
"deprecates": ""
}
]
]
8 changes: 7 additions & 1 deletion streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var DefaultStream = api.StreamConfig{
MaxAge: 24 * 365 * time.Hour,
MaxMsgSize: -1,
Replicas: 1,
AllowDirect: true,
NoAck: false,
}

Expand All @@ -46,6 +47,7 @@ var DefaultWorkQueue = api.StreamConfig{
MaxBytes: -1,
MaxAge: 24 * 365 * time.Hour,
MaxMsgSize: -1,
AllowDirect: true,
Replicas: api.StreamDefaultReplicas,
NoAck: false,
}
Expand Down Expand Up @@ -718,9 +720,13 @@ func (s *Stream) DuplicateWindow() time.Duration { return s.cfg.Duplicates }
func (s *Stream) Mirror() *api.StreamSource { return s.cfg.Mirror }
func (s *Stream) Sources() []*api.StreamSource { return s.cfg.Sources }
func (s *Stream) Sealed() bool { return s.cfg.Sealed }
func (s *Stream) DeleteAllow() bool { return !s.cfg.DenyDelete }
func (s *Stream) DeleteAllowed() bool { return !s.cfg.DenyDelete }
func (s *Stream) PurgeAllowed() bool { return !s.cfg.DenyPurge }
func (s *Stream) RollupAllowed() bool { return s.cfg.RollupAllowed }
func (s *Stream) DirectAllowed() bool { return s.cfg.AllowDirect }
func (s *Stream) Republish() *api.RePublish { return s.cfg.RePublish }
func (s *Stream) IsRepublishing() bool { return s.Republish() != nil }

// DeleteAllow
// Deprecated: use DeleteAllowed()
func (s *Stream) DeleteAllow() bool { return !s.cfg.DenyDelete }

0 comments on commit 5d3e737

Please sign in to comment.