pushover

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 13 Imported by: 58

Documentation

Index

Constants

View Source
const (
	DefaultPushoverURL = "https://api.pushover.net/1/messages.json"
)

DefaultPushoverURL is the default URL for the Pushover API.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Whether Pushover integration is enabled.
	Enabled bool `toml:"enabled" override:"enabled"`
	// The Pushover API token.
	Token string `toml:"token" override:"token,redact"`
	// The User/Group that will be alerted.
	UserKey string `toml:"user-key" override:"user-key,redact"`
	// The URL for the Pushover API.
	// Default: DefaultPushoverAPI
	URL string `toml:"url" override:"url"`
}

Config is the pushover configuration as defined in the Kapacitor configuration file.

func NewConfig

func NewConfig() Config

NewConfig returns a new Pushover configuration with the URL set to be the default pushover URL.

func (Config) Validate

func (c Config) Validate() error

Validate ensures that all configuration options are valid. The Token, User, and URL parameters must be specified to be considered valid.

type Diagnostic added in v1.4.0

type Diagnostic interface {
	WithContext(ctx ...keyvalue.T) Diagnostic
	Error(msg string, err error)
}

type HandlerConfig

type HandlerConfig struct {
	// rather than all of a user's devices (multiple device names may
	// be separated by a comma)
	Device string `mapstructure:"device"`

	// Your message's title, otherwise your apps name is used
	Title string `mapstructure:"title"`

	// A supplementary URL to show with your message
	URL string `mapstructure:"url"`

	// A title for your supplementary URL, otherwise just URL is shown
	URLTitle string `mapstructure:"url-title"`

	// The name of one of the sounds supported by the device clients to override
	// the user's default sound choice
	Sound string `mapstructure:"sound"`

	// The User Key or Delivery Group key
	UserKey string `mapstructure:"user-key"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(c Config, d Diagnostic) *Service

func (*Service) Alert

func (s *Service) Alert(message, device, title, URL, URLTitle, sound string, userKey string, level alert.Level) error

func (*Service) Close

func (s *Service) Close() error

func (*Service) Handler

func (s *Service) Handler(c HandlerConfig, ctx ...keyvalue.T) alert.Handler

func (*Service) Open

func (s *Service) Open() error

func (*Service) Test

func (s *Service) Test(options interface{}) error

func (*Service) TestOptions

func (s *Service) TestOptions() interface{}

func (*Service) Update

func (s *Service) Update(newConfig []interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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