wechat

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 18 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultWechatConfig = WechatConfig{
	NotifierConfig: amcommoncfg.NotifierConfig{
		VSendResolved: false,
	},
	Message: `{{ template "wechat.default.message" . }}`,
	ToUser:  `{{ template "wechat.default.to_user" . }}`,
	ToParty: `{{ template "wechat.default.to_party" . }}`,
	ToTag:   `{{ template "wechat.default.to_tag" . }}`,
	AgentID: `{{ template "wechat.default.agent_id" . }}`,
}

DefaultWechatConfig defines default values for wechat configurations.

Functions

This section is empty.

Types

type Notifier

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

Notifier implements a Notifier for wechat notifications.

func New

New returns a new Wechat notifier.

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, as ...*alert.Alert) notify.NotifyVerdict

Notify implements the Notifier interface.

type WechatConfig added in v0.35.0

type WechatConfig struct {
	amcommoncfg.NotifierConfig `yaml:",inline" json:",inline"`

	HTTPConfig *commoncfg.HTTPClientConfig `yaml:"http_config,omitempty" json:"http_config,omitempty"`

	APISecret     commoncfg.Secret `yaml:"api_secret,omitempty" json:"api_secret,omitempty"`
	APISecretFile string           `yaml:"api_secret_file,omitempty" json:"api_secret_file,omitempty"`
	CorpID        string           `yaml:"corp_id,omitempty" json:"corp_id,omitempty"`
	Message       string           `yaml:"message,omitempty" json:"message,omitempty"`
	APIURL        *amcommoncfg.URL `yaml:"api_url,omitempty" json:"api_url,omitempty"`
	ToUser        string           `yaml:"to_user,omitempty" json:"to_user,omitempty"`
	ToParty       string           `yaml:"to_party,omitempty" json:"to_party,omitempty"`
	ToTag         string           `yaml:"to_tag,omitempty" json:"to_tag,omitempty"`
	AgentID       string           `yaml:"agent_id,omitempty" json:"agent_id,omitempty"`
	MessageType   string           `yaml:"message_type,omitempty" json:"message_type,omitempty"`
}

WechatConfig configures notifications via Wechat.

func (*WechatConfig) UnmarshalYAML added in v0.35.0

func (c *WechatConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

func (*WechatConfig) Validate added in v0.35.0

func (c *WechatConfig) Validate() error

Jump to

Keyboard shortcuts

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