serverchan

package
v1.0.0-rc.21 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package serverchan 是 Server 酱出站通道。SendKey 以 sctp 开头的是 Server 酱³(https://<uid>.push.ft07.com/send/<key>.send), 其余按 Turbo 版(https://sctapi.ftqq.com/<key>.send);POST JSON {title, desp},返回 code 为 0 才算成功。

Index

Constants

View Source
const Type = "serverchan"

Type 是通道类型名。

Variables

This section is empty.

Functions

func Endpoint

func Endpoint(sendKey string) (string, error)

Endpoint 是 SendKey 对应的发送地址。

Types

type Channel

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

Channel 是 Server 酱通道(只出站)。

func (*Channel) CheckConfig

func (c *Channel) CheckConfig(conf *models.NotificationConf) error

CheckConfig 只检查配置、不发请求:保存配置前调用。

func (*Channel) Close

func (c *Channel) Close(context.Context) error

Close 没有要释放的资源。

func (*Channel) Healthy

func (c *Channel) Healthy() bool

Healthy 恒为 true。

func (*Channel) Init

func (c *Channel) Init(_ context.Context, conf *models.NotificationConf) error

Init 解析配置:send_key 必填。

func (*Channel) OnInbound

func (c *Channel) OnInbound(notify.InboundHandler)

OnInbound 不支持入站。

func (*Channel) Send

func (c *Channel) Send(ctx context.Context, n notify.Notification) error

Send 推送一条通知:标题超过 32 个字时截断,完整标题放进正文第一行。

func (*Channel) SupportsInbound

func (c *Channel) SupportsInbound() bool

SupportsInbound 恒为 false。

func (*Channel) Type

func (c *Channel) Type() string

Type 返回通道类型名。

Jump to

Keyboard shortcuts

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