Documentation ¶
Index ¶
- type Card
- type Config
- type Diagnostic
- type HandlerConfig
- type Service
- func (s *Service) Alert(channelURL, alertTopic, alertID, message 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
- 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 Card ¶
type Card struct { CardType string `json:"@type"` Context string `json:"@context"` Title string `json:"title"` Text string `json:"text"` Summary string `json:"summary"` }
Card is a Microsoft MessageCard structure. See https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#card-fields.
type Config ¶
type Config struct { // Whether Teams integration is enabled. Enabled bool `toml:"enabled" override:"enabled"` // The incoming (to Teams) channel webhook URL. ChannelURL string `toml:"channel-url" override:"channel-url"` // Whether all alerts should automatically post to Teams. Global bool `toml:"global" override:"global"` // 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"` }
type Diagnostic ¶
type Diagnostic interface { WithContext(ctx ...keyvalue.T) Diagnostic Error(msg string, err error) }
type HandlerConfig ¶
type HandlerConfig struct { // Teams channel webhook URL used to post messages. // If empty uses the channel URL from the configuration. ChannelURL string `mapstructure:"channel-url"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(c Config, d Diagnostic) *Service
func (*Service) StateChangesOnly ¶
func (*Service) TestOptions ¶
func (s *Service) TestOptions() interface{}
Click to show internal directories.
Click to hide internal directories.