backends

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const LINE_API_URL = "https://notify-api.line.me/api/notify"
View Source
const PUSHBULET_API_URL = "https://api.pushbullet.com/v2/pushes"
View Source
const PUSHOVER_API_TOKEN = "abughxjjtuofgt89bz21mibut67j5t"
View Source
const PUSHOVER_API_URL = "https://api.pushover.net/1/messages.json"

Variables

This section is empty.

Functions

func OverrideConfigs

func OverrideConfigs(cfg *map[string]interface{}, cmd *cobra.Command)

func RegisterFlags

func RegisterFlags(cmd ...*cobra.Command)

func Send

func Send(cfg map[string]interface{}, title string, msg string, status *bool) error

Types

type BackendInterface

type BackendInterface interface {
	GetConfig() interface{}
	Send(config interface{}, title string, message string, status *bool) error
}

func NewLine added in v1.0.1

func NewLine() BackendInterface

func NewPushbullet added in v1.0.1

func NewPushbullet() BackendInterface

func NewPushover added in v1.0.1

func NewPushover() BackendInterface

func NewSlack added in v1.0.1

func NewSlack() BackendInterface

func NewSyslog added in v1.0.1

func NewSyslog() BackendInterface

type Line added in v1.0.1

type Line struct {
}

func (*Line) GetConfig added in v1.0.1

func (*Line) GetConfig() interface{}

func (*Line) Send added in v1.0.1

func (*Line) Send(configIface interface{}, title string, message string, status *bool) error

type LineConfig added in v1.0.1

type LineConfig struct {
	Token string `mapstructure:"token" validate:"required"`
}

type Pushbullet added in v1.0.1

type Pushbullet struct {
}

func (*Pushbullet) GetConfig added in v1.0.1

func (*Pushbullet) GetConfig() interface{}

func (*Pushbullet) Send added in v1.0.1

func (*Pushbullet) Send(configIface interface{}, title string, message string, status *bool) error

type PushbulletConfig added in v1.0.1

type PushbulletConfig struct {
	Token string `mapstructure:"token" validate:"required"`
}

type Pushover added in v1.0.1

type Pushover struct {
}

func (*Pushover) GetConfig added in v1.0.1

func (*Pushover) GetConfig() interface{}

func (*Pushover) Send added in v1.0.1

func (*Pushover) Send(configIface interface{}, title string, message string, status *bool) error

type PushoverConfig added in v1.0.1

type PushoverConfig struct {
	UserKey  string  `mapstructure:"user_key" validate:"required"`
	Device   *string `mapstructure:"device" validate:"omitempty"`
	Priority *string `mapstructure:"priority" validate:"omitempty,oneof=emergency high normal low lowest"`
	Retry    *int    `mapstructure:"retry" validate:"omitempty,min=30"`
	Expire   *int    `mapstructure:"expire" validate:"omitempty,min=0,max=10800"`
}

type Slack added in v1.0.1

type Slack struct {
}

func (*Slack) GetConfig added in v1.0.1

func (*Slack) GetConfig() interface{}

func (*Slack) Send added in v1.0.1

func (*Slack) Send(configIface interface{}, title string, message string, status *bool) error

type SlackConfig added in v1.0.1

type SlackConfig struct {
	Webhook string  `mapstructure:"webhook" validate:"required"`
	Color   *string `mapstructure:"color" validate:"omitempty,hexcolor"`
}

type Syslog added in v1.0.1

type Syslog struct {
}

func (*Syslog) GetConfig added in v1.0.1

func (*Syslog) GetConfig() interface{}

func (*Syslog) Send added in v1.0.1

func (*Syslog) Send(configIface interface{}, title string, message string, status *bool) error

type SyslogConfig added in v1.0.1

type SyslogConfig struct {
	Facility *string `` /* 172-byte string literal not displayed */
	Severity *string `mapstructure:"severity" validate:"omitempty,oneof=emerg alert crit err warning notice info debug"`
}

Jump to

Keyboard shortcuts

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