Documentation ¶
Index ¶
- type Config
- type Diagnostic
- type HandlerConfig
- type Service
- func (s *Service) Alert(id string, message string, details string, level alert.Level, ...) error
- func (s *Service) Close() error
- func (s *Service) Global() bool
- func (s *Service) Handler(c HandlerConfig, ctx ...keyvalue.T) (alert.Handler, error)
- func (s *Service) Open() error
- func (s *Service) StateChangesOnly() bool
- func (s *Service) Test(options interface{}) error
- func (s *Service) TestOptions() interface{}
- func (s *Service) Update(newConfig []interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Whether BigPanda integration is enabled. Enabled bool `toml:"enabled" override:"enabled"` // Whether all alerts should automatically post to BigPanda. Global bool `toml:"global" override:"global"` //Each integration must have an App Key in BigPanda to identify it as a unique source. AppKey string `toml:"app-key" override:"app-key"` //Each integration must have an App Key in BigPanda to identify it as a unique source. Token string `toml:"token" override:"token,redact"` // Whether all alerts should automatically use stateChangesOnly mode. // Only applies if global is also set. StateChangesOnly bool `toml:"state-changes-only" override:"state-changes-only"` // Whether to skip the tls verification InsecureSkipVerify bool `toml:"insecure-skip-verify" override:"insecure-skip-verify"` //BigPanda Alert api URL, if not specified https://api.bigpanda.io/data/v2/alerts is used URL string `toml:"url" override:"url"` }
type Diagnostic ¶
type Diagnostic interface { WithContext(ctx ...keyvalue.T) Diagnostic Error(msg string, err error) }
type HandlerConfig ¶
type HandlerConfig struct { // BigPanda AppKey AppKey string `mapstructure:"app-key"` // webhook URL used to post alert. // If empty uses the service URL from the configuration. URL string `mapstructure:"url"` // custom primary BigPanda property PrimaryProperty string `mapstructure:"primary-property"` // custom secondary BigPanda property SecondaryProperty string `mapstructure:"secondary-property"` }
HandlerConfig defines the high-level struct required to connect to BigPanda
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(c Config, d Diagnostic) (*Service, error)
func (*Service) StateChangesOnly ¶
func (*Service) TestOptions ¶
func (s *Service) TestOptions() interface{}
Click to show internal directories.
Click to hide internal directories.