-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add nats key sanitization function
Signed-off-by: Alexander Trost <[email protected]>
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
package cron | ||
|
||
type Provider struct { | ||
import ( | ||
"github.com/fivenet-app/fivenet/pkg/events" | ||
"go.uber.org/fx" | ||
) | ||
|
||
type Params struct { | ||
fx.In | ||
|
||
LC fx.Lifecycle | ||
|
||
JS *events.JSWrapper | ||
} | ||
|
||
type Cron struct { | ||
js *events.JSWrapper | ||
|
||
// TODO | ||
} | ||
|
||
func New(p Params) (*Cron, error) { | ||
return &Cron{ | ||
js: p.JS, | ||
}, nil | ||
} |
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,9 @@ | ||
package cron | ||
|
||
import "context" | ||
|
||
func (c *Cron) registerSubscriptions(ctx context.Context) error { | ||
// TODO | ||
|
||
return nil | ||
} |
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
package events | ||
|
||
import "strings" | ||
|
||
func SanitizeKey(in string) string { | ||
return strings.ReplaceAll( | ||
strings.ReplaceAll( | ||
strings.ReplaceAll( | ||
strings.ReplaceAll(in, "#", "."), | ||
":", "."), | ||
"/", "."), | ||
"=", "_") | ||
} |
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