From 06cabf4e57722dd33099a59d4463453a21712b3c Mon Sep 17 00:00:00 2001 From: kha7iq Date: Thu, 15 Apr 2021 16:06:26 +0800 Subject: [PATCH] fix: added comments in code --- cmd/discord.go | 1 + cmd/email.go | 1 + cmd/msteams.go | 1 + cmd/rocketchat.go | 1 + cmd/slack.go | 1 + cmd/telegram.go | 1 + main.go | 3 ++- 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/discord.go b/cmd/discord.go index e7286b0..11de496 100644 --- a/cmd/discord.go +++ b/cmd/discord.go @@ -11,6 +11,7 @@ import ( "github.com/urfave/cli/v2" ) +// discordPingMe struct holds data parsed via flags for discord service. type discordPingMe struct { Token string Message string diff --git a/cmd/email.go b/cmd/email.go index e586833..fda5267 100644 --- a/cmd/email.go +++ b/cmd/email.go @@ -11,6 +11,7 @@ import ( "github.com/urfave/cli/v2" ) +// email struct holds data parsed via flags for email service. type email struct { SenderAddress string Password string diff --git a/cmd/msteams.go b/cmd/msteams.go index cdc49b3..d8e20a4 100644 --- a/cmd/msteams.go +++ b/cmd/msteams.go @@ -11,6 +11,7 @@ import ( "github.com/urfave/cli/v2" ) +// msTeams struct holds data parsed via flags for microsoft teams service. type msTeams struct { Webhook string Message string diff --git a/cmd/rocketchat.go b/cmd/rocketchat.go index 98db4ca..d113e4d 100644 --- a/cmd/rocketchat.go +++ b/cmd/rocketchat.go @@ -22,6 +22,7 @@ type rocketChat struct { } var ( + // EmptyChannel variable holds default error message if no channel is provided. EmptyChannel = "channel name or id can not be empty" TimeValue = "⏰ " + time.Now().String() ) diff --git a/cmd/slack.go b/cmd/slack.go index 1f69376..42a2c53 100644 --- a/cmd/slack.go +++ b/cmd/slack.go @@ -11,6 +11,7 @@ import ( "github.com/urfave/cli/v2" ) +// slackPingMe struct holds data parsed via flags for slack service. type slackPingMe struct { Token string Message string diff --git a/cmd/telegram.go b/cmd/telegram.go index bec2192..c843452 100644 --- a/cmd/telegram.go +++ b/cmd/telegram.go @@ -12,6 +12,7 @@ import ( "github.com/urfave/cli/v2" ) +// teleGram struct holds data parsed via flags for telegram service. type teleGram struct { Token string Message string diff --git a/main.go b/main.go index 73407ba..8420f54 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( "github.com/urfave/cli/v2" ) +// Version variable is used for semVer var Version string func main() { @@ -20,7 +21,7 @@ func main() { messaging platforms and also email, everything is configurable via environment variables and command line switches.Currently supported platforms include Slack, Telegram, RocketChat, Discord, Microsoft Teams and email address.` - + // app.Commands contains the subcommands as functions which return []*cli.Command. app.Commands = []*cli.Command{ cmd.SendToTelegram(), cmd.SendToRocketChat(),