Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { API *APIConfig Receivers []*ReceiverConfig Template string // Catches all undefined fields and must be empty after parsing. XXX map[string]interface{} `yaml:",inline" json:"-"` }
Config is the top-level configuration for JIRAlert's config file.
func ReadConfiguration ¶ added in v0.0.1
ReadConfiguration parses the YAML input into a Config
func (*Config) ReceiverByName ¶
func (c *Config) ReceiverByName(name string) *ReceiverConfig
ReceiverByName loops the receiver list and returns the first instance with that name
type Notifier ¶ added in v0.1.0
type Notifier interface {
Notify(data *alertmanager.Data) map[string]StatusNotify
}
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
github.com/andygrunwald/go-jira Receiver wraps a JIRA client corresponding to a specific Alertmanager receiver, with its configuration and templates.
func NewReceiver ¶
func NewReceiver(context context.Context, a *APIConfig, c *ReceiverConfig, t *Template, file string) (*Receiver, error)
NewReceiver creates a Receiver using the provided configuration and template.
func (*Receiver) Notify ¶
func (r *Receiver) Notify(context context.Context, data *alertmanager.Data) (map[string]StatusNotify, error)
Notify implements the Notifier interface.
type ReceiverConfig ¶
type ReceiverConfig struct { Name string // Required issue fields Project string IssueType string Summary string ReopenState string // Optional issue fields Priority string Description string Comment string WontFixResolution string Fields map[string]interface{} Components []string // Label copy settings AddGroupLabels bool // Catches all undefined fields and must be empty after parsing. XXX map[string]interface{} }
ReceiverConfig is the configuration for one receiver. It has a unique name and includes and issue fields (required -- e.g. project, issue type -- and optional -- e.g. priority).
type StatusNotify ¶ added in v0.1.0
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template wraps a text template and error, to make it easier to execute multiple templates and only check for errors once at the end (assuming one is only interested in the first error, which is usually the case).
func LoadTemplate ¶
LoadTemplate reads and parses all templates defined in the given file and constructs a jiralert.Template.
Directories ¶
Path | Synopsis |
---|---|
Package alertmanager defines structures and primitives to support Alertmanager's webhook API.
|
Package alertmanager defines structures and primitives to support Alertmanager's webhook API. |
cmd
|
|