Documentation
¶
Index ¶
- Constants
- Variables
- type Dingtalk
- type Option
- func WithAccessKey(accessKey string) Option
- func WithAccessKeySecret(accessKeySecret string) Option
- func WithConnectTimeout(connectTimeout time.Duration) Option
- func WithEndpoint(endpoint string) Option
- func WithMaxIdleConns(maxIdleConns int) Option
- func WithNetwork(network string) Option
- func WithReadTimeout(readTimeout time.Duration) Option
- func WithRegionId(regionId string) Option
- func WithRobots(robots []*RobotOptions) Option
- type Options
- type Robot
- type RobotOption
- type RobotOptions
- type SendMessageRequest
- type Webhook
- type WebhookOption
- type WebhookOptions
- type WebhookRobot
- type WebhookRobotOption
- type WebhookRobotOptions
- type WebhookSendMessageReq
- type WebhookSendMessageReqAt
- type WithdrawMessageRequest
Constants ¶
View Source
const ( SecuritySign = "sign" SecurityKeyword = "keyword" )
Variables ¶
View Source
var (
ErrNotFoundRobot = fmt.Errorf("未找到对应机器人")
)
Functions ¶
This section is empty.
Types ¶
type Dingtalk ¶
type Dingtalk struct {
// contains filtered or unexported fields
}
func (*Dingtalk) SendMessage ¶
func (*Dingtalk) WithdrawMessage ¶
type Option ¶
type Option func(*Options)
func WithAccessKey ¶
func WithAccessKeySecret ¶
func WithConnectTimeout ¶
func WithEndpoint ¶
func WithMaxIdleConns ¶
func WithNetwork ¶
func WithReadTimeout ¶
func WithRegionId ¶
func WithRobots ¶
func WithRobots(robots []*RobotOptions) Option
type Options ¶
type Options struct { AccessKey string // 验证 key AccessKeySecret string // 验证秘钥 RegionId string // 区域 例:cn-hangzhou Network string // 需访问服务器的网络类型。例:inner,vpc Endpoint string // 服务器地址,例:ecs-cn-hangzhou.aliyuncs.com ReadTimeout time.Duration // 读超时,单位:秒 ConnectTimeout time.Duration // 连接超时,单位:秒 MaxIdleConns int // 最大连接数 Robots []*RobotOptions }
Options 基础配置
type Robot ¶
type Robot struct {
// contains filtered or unexported fields
}
func NewRobot ¶
func NewRobot(options *RobotOptions) *Robot
type RobotOption ¶
type RobotOption func(*RobotOptions)
func WithConversationId ¶
func WithConversationId(conversationId string) RobotOption
func WithCoolAppCode ¶
func WithCoolAppCode(coolAppCode string) RobotOption
func WithName ¶
func WithName(name string) RobotOption
func WithRobotCode ¶
func WithRobotCode(robotCode string) RobotOption
func WithToken ¶
func WithToken(token string) RobotOption
type RobotOptions ¶
type RobotOptions struct { Name string RobotCode string ConversationId string Token string CoolAppCode string }
RobotOptions 机器人配置
type SendMessageRequest ¶
type Webhook ¶
type Webhook struct {
// contains filtered or unexported fields
}
func NewWebhook ¶
func NewWebhook(opts ...WebhookOption) *Webhook
func (*Webhook) SendMessage ¶
func (*Webhook) WithdrawMessage ¶
type WebhookOption ¶
type WebhookOption func(*WebhookOptions)
func WithWebhookRobot ¶
func WithWebhookRobot(robots []*WebhookRobotOptions) WebhookOption
type WebhookOptions ¶
type WebhookOptions struct {
Robots []*WebhookRobotOptions
}
type WebhookRobot ¶
type WebhookRobot struct {
// contains filtered or unexported fields
}
func NewWebhookRobot ¶
func NewWebhookRobot(options *WebhookRobotOptions) *WebhookRobot
func (*WebhookRobot) PostMessage ¶
func (robot *WebhookRobot) PostMessage(body map[string]interface{}) error
func (*WebhookRobot) SendMessage ¶
func (robot *WebhookRobot) SendMessage(msg *WebhookSendMessageReq) error
func (*WebhookRobot) Sign ¶
func (robot *WebhookRobot) Sign(timestamp int64) string
type WebhookRobotOption ¶
type WebhookRobotOption func(*WebhookRobotOptions)
func WithSignSecret ¶
func WithSignSecret(signSecret string) WebhookRobotOption
func WithWebhook ¶
func WithWebhook(webhook string) WebhookRobotOption
func WithWebhookRobotName ¶
func WithWebhookRobotName(name string) WebhookRobotOption
type WebhookRobotOptions ¶
type WebhookSendMessageReq ¶
type WebhookSendMessageReqAt ¶
type WithdrawMessageRequest ¶
Click to show internal directories.
Click to hide internal directories.