Validate bark, ntfy, generic+ shortcut

This commit is contained in:
Owen Valentine 2023-10-17 10:24:31 +02:00
parent 0995478cc0
commit af907181fa
No known key found for this signature in database

View file

@ -13,6 +13,7 @@ func init() {
err := validate.RegisterValidation("shoutrrr", func(fl validator.FieldLevel) bool { err := validate.RegisterValidation("shoutrrr", func(fl validator.FieldLevel) bool {
prefixes := [...]string{ prefixes := [...]string{
"bark://",
"discord://", "discord://",
"smtp://", "smtp://",
"gotify://", "gotify://",
@ -21,6 +22,7 @@ func init() {
"join://", "join://",
"mattermost://", "mattermost://",
"matrix://", "matrix://",
"ntfy://",
"opsgenie://", "opsgenie://",
"pushbullet://", "pushbullet://",
"pushover://", "pushover://",
@ -30,6 +32,7 @@ func init() {
"telegram://", "telegram://",
"zulip://", "zulip://",
"generic://", "generic://",
"generic+",
} }
str := fl.Field().String() str := fl.Field().String()