Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoResolve ¶
type AutoResolve struct {
State string `yaml:"state" json:"state"`
}
AutoResolve is the struct used for defining jira resolution state when alert is resolved.
type Config ¶
type Config struct {
Defaults *ReceiverConfig `yaml:"defaults,omitempty" json:"defaults,omitempty"`
Receivers []*ReceiverConfig `yaml:"receivers,omitempty" json:"receivers,omitempty"`
Template string `yaml:"template" json:"template"`
// 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 (*Config) ReceiverByName ¶
func (c *Config) ReceiverByName(name string) *ReceiverConfig
ReceiverByName loops the receiver list and returns the first instance with that name
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Duration ¶
func ParseDuration ¶
ParseDuration parses a string into a time.Duration, assuming that a year always has 365d, a week always has 7d, and a day always has 24h.
func (Duration) MarshalYAML ¶
func (*Duration) UnmarshalYAML ¶
type ReceiverConfig ¶
type ReceiverConfig struct {
Name string `yaml:"name" json:"name"`
// API access fields
APIURL string `yaml:"api_url" json:"api_url"`
User string `yaml:"user" json:"user"`
Password Secret `yaml:"password" json:"password"`
PersonalAccessToken Secret `yaml:"personal_access_token" json:"personal_access_token"`
// Required issue fields
Project string `yaml:"project" json:"project"`
OtherProjects []string `yaml:"other_projects" json:"other_projects"`
IssueType string `yaml:"issue_type" json:"issue_type"`
Summary string `yaml:"summary" json:"summary"`
ReopenState string `yaml:"reopen_state" json:"reopen_state"`
ReopenDuration *Duration `yaml:"reopen_duration" json:"reopen_duration"`
// Optional issue fields
Priority string `yaml:"priority" json:"priority"`
Description string `yaml:"description" json:"description"`
WontFixResolution string `yaml:"wont_fix_resolution" json:"wont_fix_resolution"`
Fields map[string]interface{} `yaml:"fields" json:"fields"`
Components []string `yaml:"components" json:"components"`
StaticLabels []string `yaml:"static_labels" json:"static_labels"`
// Label copy settings
AddGroupLabels *bool `yaml:"add_group_labels" json:"add_group_labels"`
// Flag to enable updates in comments.
UpdateInComment *bool `yaml:"update_in_comment" json:"update_in_comment"`
// Flag to auto-resolve opened issue when the alert is resolved.
AutoResolve *AutoResolve `yaml:"auto_resolve" json:"auto_resolve"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline" json:"-"`
}
ReceiverConfig is the configuration for one receiver. It has a unique name and includes API access fields (url and auth) and issue fields (required -- e.g. project, issue type -- and optional -- e.g. priority).
func (*ReceiverConfig) UnmarshalYAML ¶
func (rc *ReceiverConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Secret ¶
type Secret string
Secret is a string that must not be revealed on marshaling.
func (Secret) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface.
func (*Secret) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface for Secrets.