From 45fa48e1e5deeef53f2732bc7a389fb7f6c2fb6b Mon Sep 17 00:00:00 2001 From: namhq1989 Date: Fri, 16 Dec 2022 16:58:35 +0700 Subject: [PATCH] add stream utilities --- constant.go | 4 ++-- stream_utilties.go | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 stream_utilties.go diff --git a/constant.go b/constant.go index 6c6ded1..2fe638e 100644 --- a/constant.go +++ b/constant.go @@ -1,6 +1,6 @@ package natsio -var Stream = struct { +var AllStreams = struct { Selly string User string HelpCenter string @@ -16,7 +16,7 @@ var Stream = struct { Jobs: "jobs", } -var SellyServer = struct { +var AllServers = struct { App string Admin string SMS string diff --git a/stream_utilties.go b/stream_utilties.go new file mode 100644 index 0000000..0dda510 --- /dev/null +++ b/stream_utilties.go @@ -0,0 +1,14 @@ +package natsio + +type StreamUtilities struct { + Stream string + Server string +} + +func (s StreamUtilities) GenerateReqrepSubject(subject string) string { + return GenerateReqrepSubject(s.Stream, s.Server, subject) +} + +func (s StreamUtilities) GenerateJetStreamSubject(subject string) string { + return GenerateJetStreamSubject(s.Stream, s.Server, subject) +}