bot

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BotType_DingTalk   = "dingtalk"
	BotType_WorkWechat = "workwechat"
	BotType_Feishu     = "lark"
	BotType_Lark       = "lark"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func FromEnv

func FromEnv() *Client

func New

func New(opts ...ConfigOpt) *Client

func (*Client) Configs

func (s *Client) Configs() []*Config

func (*Client) SendMarkdown

func (c *Client) SendMarkdown(text string)

func (*Client) SendText

func (c *Client) SendText(text string, items ...interface{})

type Config

type Config struct {
	Webhook string
	Secret  string
	BotType string
	// contains filtered or unexported fields
}

Config 这个 Bot 主要针对钉钉 / 企业微信 / 飞书lark 企业微信的推送是最简单的,其次是飞书,最后是钉钉 配置一般来说分两个字段,Webhook 和 Secret

func (*Config) SendMarkdown

func (c *Config) SendMarkdown(text string)

func (*Config) SendText

func (c *Config) SendText(text string, items ...interface{})

type ConfigOpt

type ConfigOpt func(*Client)

func WithDelaySeconds

func WithDelaySeconds(i float64) ConfigOpt

func WithWebhook

func WithWebhook(webhook string) ConfigOpt

func WithWebhookWithSecret

func WithWebhookWithSecret(webhook string, key string) ConfigOpt

Jump to

Keyboard shortcuts

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