gmsg

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

README

GMSG

配置

// 访问密钥
AccessToken
// API地址
ApiUrl

参数

// 普通文本
TypeText     = model.TypeText
// 微信文本卡片
TypeTextCard = model.TypeTextCard
// Markdown
TypeMarkdown = model.TypeMarkdown
// HTML
TypeHTML     = model.TypeHTML

方法

// 取消还未发送的消息
Cancel(ctx context.Context, id int64) error
// 通过渠道ID发送
SendByID(ctx context.Context, id int64, cType model.Type, at int64, title, msg string) (int64, error)
// 通过渠道标记发送
SendBySign(ctx context.Context, sign string, cType model.Type, at int64, title, msg string) (int64, error)
// 通过消息ID获取发送状态
Status(ctx context.Context, id int64) (*model.StatusModel, error)

Documentation

Index

Constants

View Source
const (
	TypeText     = gmodel.TypeText     // 普通文本
	TypeTextCard = gmodel.TypeTextCard // 微信文本卡片
	TypeMarkdown = gmodel.TypeMarkdown // Markdown
	TypeHTML     = gmodel.TypeHTML     // HTML
)

Variables

View Source
var (
	AccessToken = sync_str.New("")
	ApiUrl      = sync_str.New("https://msg.ksyaki.co")
)
View Source
var AllType = []*TypeDetail{
	{TypeText, TypeText.String(), TypeText.StringEnglish()},
	{TypeTextCard, TypeTextCard.String(), TypeTextCard.StringEnglish()},
	{TypeMarkdown, TypeMarkdown.String(), TypeMarkdown.StringEnglish()},
	{TypeHTML, TypeHTML.String(), TypeHTML.StringEnglish()},
}

Functions

func Cancel

func Cancel(ctx context.Context, id int64) error

func SendByID

func SendByID(ctx context.Context, id int64, cType gmodel.Type, at int64, title, msg string) (int64, error)

func SendBySign

func SendBySign(ctx context.Context, sign string, cType gmodel.Type, at int64, title, msg string) (int64, error)

func Status

func Status(ctx context.Context, id int64) (*gmodel.StatusModel, error)

Types

type TypeDetail

type TypeDetail struct {
	Type        gmodel.Type `json:"type"`
	Name        string      `json:"name"`
	EnglishName string      `json:"english_name"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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