1
0
mirror of https://github.com/kha7iq/pingme.git synced 2025-05-15 14:20:18 -07:00

fix: added comments in code

This commit is contained in:
kha7iq 2021-04-15 16:06:26 +08:00
parent 07f2ba7350
commit 06cabf4e57
7 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
// discordPingMe struct holds data parsed via flags for discord service.
type discordPingMe struct { type discordPingMe struct {
Token string Token string
Message string Message string

View File

@ -11,6 +11,7 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
// email struct holds data parsed via flags for email service.
type email struct { type email struct {
SenderAddress string SenderAddress string
Password string Password string

View File

@ -11,6 +11,7 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
// msTeams struct holds data parsed via flags for microsoft teams service.
type msTeams struct { type msTeams struct {
Webhook string Webhook string
Message string Message string

View File

@ -22,6 +22,7 @@ type rocketChat struct {
} }
var ( var (
// EmptyChannel variable holds default error message if no channel is provided.
EmptyChannel = "channel name or id can not be empty" EmptyChannel = "channel name or id can not be empty"
TimeValue = "⏰ " + time.Now().String() TimeValue = "⏰ " + time.Now().String()
) )

View File

@ -11,6 +11,7 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
// slackPingMe struct holds data parsed via flags for slack service.
type slackPingMe struct { type slackPingMe struct {
Token string Token string
Message string Message string

View File

@ -12,6 +12,7 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
// teleGram struct holds data parsed via flags for telegram service.
type teleGram struct { type teleGram struct {
Token string Token string
Message string Message string

View File

@ -9,6 +9,7 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
// Version variable is used for semVer
var Version string var Version string
func main() { func main() {
@ -20,7 +21,7 @@ func main() {
messaging platforms and also email, everything is configurable via environment messaging platforms and also email, everything is configurable via environment
variables and command line switches.Currently supported platforms include Slack, Telegram, variables and command line switches.Currently supported platforms include Slack, Telegram,
RocketChat, Discord, Microsoft Teams and email address.` RocketChat, Discord, Microsoft Teams and email address.`
// app.Commands contains the subcommands as functions which return []*cli.Command.
app.Commands = []*cli.Command{ app.Commands = []*cli.Command{
cmd.SendToTelegram(), cmd.SendToTelegram(),
cmd.SendToRocketChat(), cmd.SendToRocketChat(),