-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: R.I.Pienaar <[email protected]>
- Loading branch information
Showing
20 changed files
with
718 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package advisory | ||
|
||
import "github.com/nats-io/jsm.go/api/event" | ||
|
||
// JSConsumerGroupPinnedAdvisoryV1 is an advisory published when a consumer pinned_client grouped consumer pins a client | ||
// | ||
// NATS Schema Type io.nats.jetstream.advisory.v1.consumer_group_pinned | ||
type JSConsumerGroupPinnedAdvisoryV1 struct { | ||
event.NATSEvent | ||
|
||
Account string `json:"account,omitempty"` | ||
Stream string `json:"stream"` | ||
Consumer string `json:"consumer"` | ||
Domain string `json:"domain,omitempty"` | ||
Group string `json:"group"` | ||
PinnedClientId string `json:"pinned_id"` | ||
} | ||
|
||
func init() { | ||
err := event.RegisterTextCompactTemplate("io.nats.jetstream.advisory.v1.consumer_group_pinned", `{{ .Time | ShortTime }} [PINNED] Consumer {{ .Stream }} > {{ .Consumer }} pinned client {{ .PinnedClientId }} for group {{ .Group }}`) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
err = event.RegisterTextExtendedTemplate("io.nats.jetstream.advisory.v1.consumer_group_pinned", ` | ||
[{{ .Time | ShortTime }}] [{{ .ID }}] Grouped Consumer Pinned a Client | ||
Stream: {{ .Stream }} | ||
Consumer: {{ .Consumer }} | ||
Group: {{ .Group }} | ||
Domain: {{ .Domain }} | ||
Pinned Client: {{ .PinnedClientId }}`) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package advisory | ||
|
||
import "github.com/nats-io/jsm.go/api/event" | ||
|
||
// JSConsumerGroupUnPinnedAdvisoryV1 is an advisory published when a consumer pinned_client grouped consumer unpins a client | ||
// | ||
// NATS Schema Type io.nats.jetstream.advisory.v1.consumer_group_unpinned | ||
type JSConsumerGroupUnPinnedAdvisoryV1 struct { | ||
event.NATSEvent | ||
|
||
Account string `json:"account,omitempty"` | ||
Stream string `json:"stream"` | ||
Consumer string `json:"consumer"` | ||
Domain string `json:"domain,omitempty"` | ||
Group string `json:"group"` | ||
Reason string `json:"reason"` | ||
} | ||
|
||
func init() { | ||
err := event.RegisterTextCompactTemplate("io.nats.jetstream.advisory.v1.consumer_group_unpinned", `{{ .Time | ShortTime }} [UNPINNED] Consumer {{ .Stream }} > {{ .Consumer }} unpinned client for group {{ .Group }}: {{ .Reason }}`) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
err = event.RegisterTextExtendedTemplate("io.nats.jetstream.advisory.v1.consumer_group_unpinned", ` | ||
[{{ .Time | ShortTime }}] [{{ .ID }}] Grouped Consumer Un-Pinned a Client | ||
Stream: {{ .Stream }} | ||
Consumer: {{ .Consumer }} | ||
Group: {{ .Group }} | ||
Domain: {{ .Domain }} | ||
Reason: {{ .Reason }}`) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.