-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from multiversx/more-notifiers-instances
Added the possibility to define more than one Pushover & Telegram notifiers
- Loading branch information
Showing
5 changed files
with
188 additions
and
24 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,6 +1,11 @@ | ||
[Pushover] | ||
Token="" | ||
UserKey="" | ||
# to add more pushover notifiers, uncomment and use the example below | ||
# Additional = [ | ||
# { Token = "token P2", UserKey = "userKey P2"}, | ||
# { Token = "token P3", UserKey = "userKey P3"}, | ||
# ] | ||
|
||
[Smtp] | ||
Email="[email protected]" | ||
|
@@ -9,3 +14,8 @@ | |
[Telegram] | ||
Token="" | ||
ChatID="" | ||
# to add more telegram notifiers, uncomment and use the example below | ||
# Additional = [ | ||
# { Token = "token T2", ChatID = "chatID T2"}, | ||
# { Token = "token T3", ChatID = "chatID T3"}, | ||
# ] |
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 |
---|---|---|
|
@@ -134,30 +134,62 @@ func TestLoadCredentialsConfig(t *testing.T) { | |
|
||
testString := ` | ||
[Pushover] | ||
Token="token1" | ||
UserKey="userKey1" | ||
Token="token P1" | ||
UserKey="userKey P1" | ||
Additional = [ | ||
{ Token = "token P2", UserKey = "userKey P2"}, | ||
{ Token = "token P3", UserKey = "userKey P3"}, | ||
] | ||
[Smtp] | ||
Email="[email protected]" | ||
Password="password" | ||
[Telegram] | ||
Token="token2" | ||
ChatID="chat_id2" | ||
Token="token T1" | ||
ChatID="chatID T1" | ||
Additional = [ | ||
{ Token = "token T2", ChatID = "chatID T2"}, | ||
{ Token = "token T3", ChatID = "chatID T3"}, | ||
] | ||
` | ||
|
||
expectedCfg := CredentialsConfig{ | ||
Pushover: PushoverCredentialsConfig{ | ||
Token: "token1", | ||
UserKey: "userKey1", | ||
TokenUserKeyConfig: TokenUserKeyConfig{ | ||
Token: "token P1", | ||
UserKey: "userKey P1", | ||
}, | ||
Additional: []TokenUserKeyConfig{ | ||
{ | ||
Token: "token P2", | ||
UserKey: "userKey P2", | ||
}, | ||
{ | ||
Token: "token P3", | ||
UserKey: "userKey P3", | ||
}, | ||
}, | ||
}, | ||
Smtp: EmailPasswordConfig{ | ||
Email: "[email protected]", | ||
Password: "password", | ||
}, | ||
Telegram: TelegramCredentialsConfig{ | ||
Token: "token2", | ||
ChatID: "chat_id2", | ||
TokenChatIDConfig: TokenChatIDConfig{ | ||
Token: "token T1", | ||
ChatID: "chatID T1", | ||
}, | ||
Additional: []TokenChatIDConfig{ | ||
{ | ||
Token: "token T2", | ||
ChatID: "chatID T2", | ||
}, | ||
{ | ||
Token: "token T3", | ||
ChatID: "chatID T3", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
|
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