Documentation
¶
Overview ¶
Package bark 是 Bark(iOS 推送)出站通道:POST {server}/push,JSON 里带 device_key;返回 code 为 200 才算成功。
Index ¶
- Constants
- type Channel
- func (c *Channel) CheckConfig(conf *models.NotificationConf) error
- func (c *Channel) Close(context.Context) error
- func (c *Channel) Healthy() bool
- func (c *Channel) Init(_ context.Context, conf *models.NotificationConf) error
- func (c *Channel) OnInbound(notify.InboundHandler)
- func (c *Channel) Send(ctx context.Context, n notify.Notification) error
- func (c *Channel) SupportsInbound() bool
- func (c *Channel) Type() string
Constants ¶
const DefaultServer = "https://api.day.app"
DefaultServer 是官方服务器;自建的 bark-server 填自己的地址。
const Type = "bark"
Type 是通道类型名。
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel 是 Bark 通道(只出站)。
func (*Channel) CheckConfig ¶
func (c *Channel) CheckConfig(conf *models.NotificationConf) error
CheckConfig 只检查配置、不发请求:保存配置前调用。
func (*Channel) Init ¶
Init 解析配置:device_key 必填;server 默认官方服务器;group、sound 可选; allow_private 打开后才能用本机或内网的服务器。
func (*Channel) OnInbound ¶
func (c *Channel) OnInbound(notify.InboundHandler)
OnInbound 不支持入站,什么也不做。
func (*Channel) SupportsInbound ¶
SupportsInbound 恒为 false:Bark 只出站。