controller

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PushoverClient communicates with the Pushover API
	PushoverClient *pushover.Pushover
)

Functions

func CMD

func CMD(cmd string, args []string) (out string, err error)

CMD runs a linux command and returns the full output

func Check

func Check(c *model.Config) (healthy bool, err error)

Check compares the output from the command to the list of error words

func CreateConfig

func CreateConfig()

CreateConfig will generate the config.json and write the file

func EvalFunction

func EvalFunction(in string, errorWords []string) (healthy bool, err error)

func GeneratePushover

func GeneratePushover(recipientID string, title, body string, priority int) (*pushover.Recipient, *pushover.Message)

func InitiateCron

func InitiateCron(cronString string, f func())

InitiateCron starts the cron that runs the function

func Load

func Load() (*model.Config, error)

func LoadFromFile

func LoadFromFile(f string) (*model.Config, error)

LoadFromFile attempts to read and unmarshal the config

func NewPushOverClient

func NewPushOverClient(token string) *pushover.Pushover

func NotifyPushover

func NotifyPushover(recipient *pushover.Recipient, message *pushover.Message) error

func NotifyPushoverFromConfig

func NotifyPushoverFromConfig(c *model.Config) error

func NotifyPushoverFromSystemError

func NotifyPushoverFromSystemError(c *model.Config, errStr string) error

func Setup

func Setup(c *model.Config)

Types

This section is empty.

Jump to

Keyboard shortcuts

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