cmd

package
v0.0.0-...-30c4d99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2018 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "nanny",
	Short: "Nanny is a monitor that alerts when your other programs stop breathing",
	Long: `Nanny runs a API, that expects HTTP POST from your program in periodic
intervals. If your program does not call nanny in expected interval, it
notifies you.`,
	Run: run,
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type Config

type Config struct {
	Name       string
	Addr       string
	StorageDSN string `mapstructure:"storage_dsn"`
	Stderr     Stderr
	Email      Email
	Sentry     Sentry
	Twilio     Twilio
	Slack      Slack
}

Config is a config, not much to say here, really.

type Email

type Email struct {
	Enabled      bool
	From         string
	To           []string
	Subject      string
	Body         string
	SMTPServer   string `mapstructure:"smtp_server"`
	SMTPPort     int    `mapstructure:"smtp_port"`
	SMTPUser     string `mapstructure:"smtp_user"`
	SMTPPassword string `mapstructure:"smtp_password"`
}

Email notifier config.

type Sentry

type Sentry struct {
	Enabled bool
	DSN     string
}

Sentry notifier config.

type Slack

type Slack struct {
	Enabled    bool
	WebhookURL string
}

Slack config.

type Stderr

type Stderr struct {
	Enabled bool
}

Stderr notifier config.

type Twilio

type Twilio struct {
	Enabled    bool
	AccountSID string
	AuthToken  string
	AppSID     string
	From       string
	To         string
}

Twilio SMS config.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL