mirror of
https://github.com/kha7iq/pingme.git
synced 2025-05-15 22:30:11 -07:00
fix: added comments in code
This commit is contained in:
parent
07f2ba7350
commit
06cabf4e57
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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()
|
||||||
)
|
)
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
3
main.go
3
main.go
@ -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(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user