Skip to content

Commit a3884c9

Browse files
authored
Merge pull request #1281 from ripienaar/no_ttl_markers
Remove markers on purge and delete
2 parents 277d249 + dddd336 commit a3884c9

File tree

5 files changed

+26
-31
lines changed

5 files changed

+26
-31
lines changed

cli/auth_account_command.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func configureAuthAccountCommand(auth commandHost) {
250250
sk := acct.Command("keys", "Manage Scoped Signing Keys").Alias("sk").Alias("s")
251251

252252
skadd := sk.Command("add", "Adds a signing key").Alias("new").Alias("a").Alias("n").Action(c.skAddAction)
253-
skadd.Arg("name", "Account to act on").StringVar(&c.accountName)
253+
skadd.Arg("account", "Account to act on").StringVar(&c.accountName)
254254
skadd.Arg("role", "The role to add a key for").StringVar(&c.skRole)
255255
skadd.Flag("operator", "Operator to act on").StringVar(&c.operatorName)
256256
skadd.Flag("description", "Description for the signing key").StringVar(&c.description)
@@ -265,16 +265,16 @@ func configureAuthAccountCommand(auth commandHost) {
265265
skadd.Flag("sub-deny", "Sets subjects where subscribing is allowed").StringsVar(&c.subDeny)
266266

267267
skInfo := sk.Command("info", "Show information for a Scoped Signing Key").Alias("i").Alias("show").Alias("view").Action(c.skInfoAction)
268-
skInfo.Arg("name", "Account to view").StringVar(&c.accountName)
268+
skInfo.Arg("account", "Account to view").StringVar(&c.accountName)
269269
skInfo.Arg("key", "The role or key to view").StringVar(&c.skRole)
270270
skInfo.Flag("operator", "Operator to act on").StringVar(&c.operatorName)
271271

272272
skls := sk.Command("ls", "List Scoped Signing Keys").Alias("list").Action(c.skListAction)
273-
skls.Arg("name", "Account to act on").StringVar(&c.accountName)
273+
skls.Arg("account", "Account to act on").StringVar(&c.accountName)
274274
skls.Flag("operator", "Operator to act on").StringVar(&c.operatorName)
275275

276276
skrm := sk.Command("rm", "Remove a scoped signing key").Action(c.skRmAction)
277-
skrm.Arg("name", "Account to act on").StringVar(&c.accountName)
277+
skrm.Arg("account", "Account to act on").StringVar(&c.accountName)
278278
skrm.Flag("key", "The key to remove").StringVar(&c.skRole)
279279
skrm.Flag("operator", "Operator to act on").StringVar(&c.operatorName)
280280
skrm.Flag("force", "Removes without prompting").Short('f').UnNegatableBoolVar(&c.force)

cli/stream_command.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ type streamCmd struct {
165165
subjectDeleteMarkers bool
166166
subjectDeleteMarkerTTLSet bool
167167
subjectDeleteMarkerTTL time.Duration
168-
marker bool
169168
}
170169

171170
type streamStat struct {
@@ -359,7 +358,6 @@ Finding streams with certain subjects configured:
359358
strPurge.Flag("subject", "Limits the purge to a specific subject").PlaceHolder("SUBJECT").StringVar(&c.purgeSubject)
360359
strPurge.Flag("seq", "Purge up to but not including a specific message sequence").PlaceHolder("SEQUENCE").Uint64Var(&c.purgeSequence)
361360
strPurge.Flag("keep", "Keeps a certain number of messages after the purge").PlaceHolder("MESSAGES").Uint64Var(&c.purgeKeep)
362-
strPurge.Flag("marker", "Place a purge marker in compatible streams").Default("true").BoolVar(&c.marker)
363361

364362
strCopy := str.Command("copy", "Creates a new Stream based on the configuration of another, does not copy data").Alias("cp").Action(c.cpAction)
365363
strCopy.Arg("source", "Source Stream to copy").Required().StringVar(&c.stream)
@@ -369,7 +367,6 @@ Finding streams with certain subjects configured:
369367
strRmMsg := str.Command("rmm", "Securely removes an individual message from a Stream").Action(c.rmMsgAction)
370368
strRmMsg.Arg("stream", "Stream name").StringVar(&c.stream)
371369
strRmMsg.Arg("id", "Message Sequence to remove").Int64Var(&c.msgID)
372-
strRmMsg.Flag("marker", "Place a purge marker in compatible streams").Default("true").BoolVar(&c.marker)
373370
strRmMsg.Flag("force", "Force removal without prompting").Short('f').UnNegatableBoolVar(&c.force)
374371

375372
strView := str.Command("view", "View messages in a stream").Action(c.viewAction)
@@ -3187,7 +3184,6 @@ func (c *streamCmd) purgeAction(_ *fisk.ParseContext) (err error) {
31873184
Sequence: c.purgeSequence,
31883185
Subject: c.purgeSubject,
31893186
Keep: c.purgeKeep,
3190-
NoMarker: !c.marker,
31913187
}
31923188
}
31933189

@@ -3373,7 +3369,7 @@ func (c *streamCmd) rmMsgAction(_ *fisk.ParseContext) (err error) {
33733369
}
33743370
}
33753371

3376-
return stream.DeleteMessageRequest(api.JSApiMsgDeleteRequest{Seq: uint64(c.msgID), NoMarker: !c.marker})
3372+
return stream.DeleteMessageRequest(api.JSApiMsgDeleteRequest{Seq: uint64(c.msgID)})
33773373
}
33783374

33793375
func (c *streamCmd) getAction(_ *fisk.ParseContext) (err error) {

go.mod

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/nats-io/natscli
22

3-
go 1.23.0
3+
go 1.23.6
44

55
require (
66
github.com/AlecAivazis/survey/v2 v2.3.7
@@ -17,19 +17,18 @@ require (
1717
github.com/gosuri/uiprogress v0.0.1
1818
github.com/jedib0t/go-pretty/v6 v6.6.6
1919
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
20-
github.com/klauspost/compress v1.17.11
21-
github.com/nats-io/jsm.go v0.1.1-0.20250213110753-19c36a3b25c7
20+
github.com/klauspost/compress v1.18.0
21+
github.com/nats-io/jsm.go v0.1.1-0.20250220111643-ccd9863e0621
2222
github.com/nats-io/jwt/v2 v2.7.3
23-
github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20250215015430-3c575bf046e1
24-
github.com/nats-io/nats.go v1.39.0
23+
github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20250220020605-cad5114b5064
24+
github.com/nats-io/nats.go v1.39.1
2525
github.com/nats-io/nkeys v0.4.10
2626
github.com/nats-io/nuid v1.0.1
27-
github.com/prometheus/client_golang v1.20.5
27+
github.com/prometheus/client_golang v1.21.0
2828
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
2929
github.com/synadia-io/jwt-auth-builder.go v0.0.4
3030
github.com/tylertreat/hdrhistogram-writer v0.0.0-20210816161836-2e440612a39f
3131
golang.org/x/crypto v0.33.0
32-
golang.org/x/exp v0.0.0-20250215185904-eff6e970281f
3332
golang.org/x/term v0.29.0
3433
gopkg.in/gizak/termui.v1 v1.0.0-20151021151108-e62b5929642a
3534
gopkg.in/yaml.v3 v3.0.1
@@ -62,6 +61,7 @@ require (
6261
github.com/rivo/uniseg v0.4.7 // indirect
6362
github.com/shopspring/decimal v1.4.0 // indirect
6463
github.com/spf13/cast v1.7.1 // indirect
64+
golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa // indirect
6565
golang.org/x/net v0.35.0 // indirect
6666
golang.org/x/sys v0.30.0 // indirect
6767
golang.org/x/text v0.22.0 // indirect

go.sum

+12-12
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ github.com/jedib0t/go-pretty/v6 v6.6.6/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyq
7373
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
7474
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
7575
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
76-
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
77-
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
76+
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
77+
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
7878
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
7979
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
8080
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -105,14 +105,14 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx
105105
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
106106
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
107107
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
108-
github.com/nats-io/jsm.go v0.1.1-0.20250213110753-19c36a3b25c7 h1:b/C5HLAv6mjK4jmP3G/oUqU43LC+4/ociB+ohdx3dhk=
109-
github.com/nats-io/jsm.go v0.1.1-0.20250213110753-19c36a3b25c7/go.mod h1:8dMjkX/FvrOkAcQH4nGyv49V+v6yLEge9uf1Kql5HQs=
108+
github.com/nats-io/jsm.go v0.1.1-0.20250220111643-ccd9863e0621 h1:0nZJ+iH8JZIxjRsxVon+vfXfL6fDJXYyE+u+PH2X4fE=
109+
github.com/nats-io/jsm.go v0.1.1-0.20250220111643-ccd9863e0621/go.mod h1:+y0n/fl9uLK9wCCfVVAt4oiRlq75Gj4UMGwekoiiVG8=
110110
github.com/nats-io/jwt/v2 v2.7.3 h1:6bNPK+FXgBeAqdj4cYQ0F8ViHRbi7woQLq4W29nUAzE=
111111
github.com/nats-io/jwt/v2 v2.7.3/go.mod h1:GvkcbHhKquj3pkioy5put1wvPxs78UlZ7D/pY+BgZk4=
112-
github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20250215015430-3c575bf046e1 h1:UNMH/zBtcAXuBcOI6PUsTRIqp07EZk2VyUA3Pcwz3Ko=
113-
github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20250215015430-3c575bf046e1/go.mod h1:rx54jecOLXzMFsVMhsVcUX74wDWWAbU98zqj6gIkvOY=
114-
github.com/nats-io/nats.go v1.39.0 h1:2/yg2JQjiYYKLwDuBzV0FbB2sIV+eFNkEevlRi4n9lI=
115-
github.com/nats-io/nats.go v1.39.0/go.mod h1:MgRb8oOdigA6cYpEPhXJuRVH6UE/V4jblJ2jQ27IXYM=
112+
github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20250220020605-cad5114b5064 h1:4ylzrue/HOkfgV+ImULDLj7Q6EXlmdeGYQcqwcMjOoU=
113+
github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20250220020605-cad5114b5064/go.mod h1:rx54jecOLXzMFsVMhsVcUX74wDWWAbU98zqj6gIkvOY=
114+
github.com/nats-io/nats.go v1.39.1 h1:oTkfKBmz7W047vRxV762M67ZdXeOtUgvbBaNoQ+3PPk=
115+
github.com/nats-io/nats.go v1.39.1/go.mod h1:MgRb8oOdigA6cYpEPhXJuRVH6UE/V4jblJ2jQ27IXYM=
116116
github.com/nats-io/nkeys v0.4.10 h1:glmRrpCmYLHByYcePvnTBEAwawwapjCPMjy2huw20wc=
117117
github.com/nats-io/nkeys v0.4.10/go.mod h1:OjRrnIKnWBFl+s4YK5ChQfvHP2fxqZexrKJoVVyWB3U=
118118
github.com/nats-io/nsc/v2 v2.10.3-0.20250110165315-eeda721ecff6 h1:V1uh9L3rGIUeYoMd0/EZY2Tvy5+1CkgGpDRx8t3+PNY=
@@ -128,8 +128,8 @@ github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
128128
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
129129
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
130130
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
131-
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
132-
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
131+
github.com/prometheus/client_golang v1.21.0 h1:DIsaGmiaBkSangBgMtWdNfxbMNdku5IK6iNhrEqWvdA=
132+
github.com/prometheus/client_golang v1.21.0/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg=
133133
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
134134
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
135135
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
@@ -167,8 +167,8 @@ golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL
167167
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
168168
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
169169
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
170-
golang.org/x/exp v0.0.0-20250215185904-eff6e970281f h1:oFMYAjX0867ZD2jcNiLBrI9BdpmEkvPyi5YrBGXbamg=
171-
golang.org/x/exp v0.0.0-20250215185904-eff6e970281f/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk=
170+
golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa h1:t2QcU6V556bFjYgu4L6C+6VrCPyJZ+eyRsABUPs1mz4=
171+
golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk=
172172
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
173173
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
174174
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=

internal/util/util.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ package util
1515

1616
import (
1717
"bytes"
18+
"cmp"
1819
"encoding/base64"
1920
"encoding/json"
2021
"errors"
@@ -37,8 +38,6 @@ import (
3738
"github.com/nats-io/nats.go"
3839
"github.com/nats-io/natscli/internal/asciigraph"
3940
"github.com/nats-io/natscli/options"
40-
"golang.org/x/exp/constraints"
41-
4241
"github.com/nats-io/nkeys"
4342
terminal "golang.org/x/term"
4443
)
@@ -326,7 +325,7 @@ func SurveyColors() []survey.AskOpt {
326325
}
327326
}
328327

329-
func SortMultiSort[V constraints.Ordered, S string | constraints.Ordered](i1 V, j1 V, i2 S, j2 S) bool {
328+
func SortMultiSort[V cmp.Ordered, S string | cmp.Ordered](i1 V, j1 V, i2 S, j2 S) bool {
330329
if i1 == j1 {
331330
return i2 < j2
332331
}

0 commit comments

Comments
 (0)