Skip to content

Commit 519fb95

Browse files
authored
Merge pull request #1282 from ripienaar/gwayz_account_dets
Support gateway account details
2 parents a3884c9 + 443c4f4 commit 519fb95

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

cli/server_request_command.go

+15-8
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ type SrvRequestCmd struct {
5151
includeAll bool
5252
includeDetails bool
5353

54-
detail bool
55-
sortOpt string
56-
cidFilter uint64
57-
stateFilter string
58-
userFilter string
59-
accountFilter string
60-
subjectFilter string
61-
nameFilter string
54+
detail bool
55+
sortOpt string
56+
cidFilter uint64
57+
stateFilter string
58+
userFilter string
59+
accountFilter string
60+
subjectFilter string
61+
nameFilter string
62+
accountSubscriptions bool
6263

6364
jsServerOnly bool
6465
jsEnabled bool
@@ -100,6 +101,7 @@ func configureServerRequestCommand(srv *fisk.CmdClause) {
100101
gwyz.Arg("filter-name", "Filter results on gateway name").PlaceHolder("NAME").StringVar(&c.nameFilter)
101102
gwyz.Flag("filter-account", "Show only a certain account in account detail").PlaceHolder("ACCOUNT").StringVar(&c.accountFilter)
102103
gwyz.Flag("accounts", "Show account detail").UnNegatableBoolVar(&c.detail)
104+
gwyz.Flag("subscriptions", "Show subscription details").Default("true").BoolVar(&c.accountSubscriptions)
103105

104106
healthz := req.Command("jetstream-health", "Request JetStream health status").Alias("healthz").Action(c.healthz)
105107
healthz.Arg("wait", "Wait for a certain number of responses").Uint32Var(&c.waitFor)
@@ -397,6 +399,11 @@ func (c *SrvRequestCmd) gwyz(_ *fisk.ParseContext) error {
397399
EventFilterOptions: c.reqFilter(),
398400
}
399401

402+
if c.accountFilter != "" && c.detail {
403+
opts.GatewayzOptions.AccountSubscriptions = c.accountSubscriptions
404+
opts.GatewayzOptions.AccountSubscriptionsDetail = c.accountSubscriptions
405+
}
406+
400407
res, err := c.doReq("GATEWAYZ", &opts, nc)
401408
if err != nil {
402409
return err

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ require (
6161
github.com/rivo/uniseg v0.4.7 // indirect
6262
github.com/shopspring/decimal v1.4.0 // indirect
6363
github.com/spf13/cast v1.7.1 // indirect
64+
go.uber.org/automaxprocs v1.6.0 // indirect
6465
golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa // indirect
6566
golang.org/x/net v0.35.0 // indirect
6667
golang.org/x/sys v0.30.0 // indirect

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ github.com/synadia-io/jwt-auth-builder.go v0.0.4/go.mod h1:8WYR7+nLQcDMBpocuPgdF
157157
github.com/tylertreat/hdrhistogram-writer v0.0.0-20210816161836-2e440612a39f h1:SGznmvCovewbaSgBsHgdThtWsLj5aCLX/3ZXMLd1UD0=
158158
github.com/tylertreat/hdrhistogram-writer v0.0.0-20210816161836-2e440612a39f/go.mod h1:IY84XkhrEJTdHYLNy/zObs8mXuUAp9I65VyarbPSCCY=
159159
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
160+
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
161+
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
160162
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
161163
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
162164
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=

0 commit comments

Comments
 (0)