qbot

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: GPL-3.0 Imports: 32 Imported by: 0

README

pkg/qbot

用于 Jel1ySpot/GoroBot 的 QQ 开放平台官方机器人适配器。 参考官方 tencent-connect/openclaw-qqbot 规范重构,支持 Webhook 回调(带 Ed25519 签名验证与 op:13 校验)及 WebSocket Gateway 两种连接模式。

快速开始

  1. 载入包
    • import "github.com/Jel1ySpot/GoroBot/pkg/qbot"
  2. 创建实例并使用
    • grb.Use(qbot.Create())
  3. 填写配置文件
填写配置文件

首次运行后,会在 conf/qbot 目录下创建空配置文件。配置示例:

debug: false
mode: "websocket" # 连接模式: "websocket" (默认), "webhook", 或 "both"
api:
   appid: "your app id"
   secret: "your secret key"

# 可选:仅在 mode 为 "webhook" 或需对外提供静态资源下载服务时需要配置
# webhook:
#    host: "0.0.0.0"
#    path: "/bot"
#    port: 8443
#    base_url: "http://your.domain.net:8443"
#    tls:
#       cert_path: "/path/to/server.crt"
#       key_path: "/path/to/server.key"

Documentation

Index

Constants

View Source
const (
	GatewayOpDispatch       = 0
	GatewayOpHeartbeat      = 1
	GatewayOpIdentify       = 2
	GatewayOpResume         = 6
	GatewayOpReconnect      = 7
	GatewayOpInvalidSession = 9
	GatewayOpHello          = 10
	GatewayOpHeartbeatAck   = 11
)

Gateway OpCodes

View Source
const (
	IntentGuilds              = 1 << 0
	IntentGuildMembers        = 1 << 1
	IntentDirectMessage       = 1 << 12
	IntentGroupAndC2C         = 1 << 25
	IntentInteraction         = 1 << 26
	IntentPublicGuildMessages = 1 << 30

	FullIntents = IntentGuilds | IntentGuildMembers | IntentDirectMessage | IntentGroupAndC2C | IntentInteraction | IntentPublicGuildMessages
)

Gateway Intents

View Source
const (
	DirectMessage botc.MessageType = iota
	GroupMessage
	GuildMessage
)
View Source
const (
	BindTaskCreateURL = "https://q.qq.com/lite/create_bind_task"
	BindResultPollURL = "https://q.qq.com/lite/poll_bind_result"

	BindStatusNone      = 0
	BindStatusPending   = 1
	BindStatusCompleted = 2
	BindStatusExpired   = 3
)
View Source
const (
	DefaultTokenBaseURL = "https://bots.qq.com"
	TokenPath           = "/app/getAppAccessToken"
)
View Source
const (
	ImageFileType = 1 // 图片
	VideoFileType = 2 // 视频
	VoiceFileType = 3 // 语音 (silk格式)
	FileFileType  = 4 // 普通文件
)

FileType 媒体文件类型

View Source
const (
	OpDispatch        = 0
	OpHttpCallbackAck = 12
	OpValidation      = 13
)

OpCodes

View Source
const (
	DefaultAPIBaseURL = "https://api.sgroup.qq.com"
)
View Source
const (
	DefaultConfigPath = "conf/qbot/"
)

Variables

View Source
var ExampleConfig []byte

Functions

func FormatID

func FormatID(type_ string, v ...string) string

func ParseID

func ParseID(idInfo string) (string, bool)

func ParseMessage added in v0.1.0

func ParseMessage(grb *GoroBot.Instant, bot *Service, data *Message) *botc.BaseMessage

ParseMessage 将 Message 转换为 BaseMessage

func ParseUser

func ParseUser(user *User, member *Member) *entity.Sender

Types

type Attachment added in v0.2.0

type Attachment struct {
	ContentType  string `json:"content_type"`
	URL          string `json:"url"`
	Filename     string `json:"filename,omitempty"`
	Height       int    `json:"height,omitempty"`
	Width        int    `json:"width,omitempty"`
	Size         int    `json:"size,omitempty"`
	VoiceWavURL  string `json:"voice_wav_url,omitempty"`
	AsrReferText string `json:"asr_refer_text,omitempty"`
}

Attachment 消息附件

type C2CMessageEvent added in v0.2.0

type C2CMessageEvent struct {
	ID        string `json:"id"`
	Content   string `json:"content"`
	Timestamp string `json:"timestamp"`
	Author    struct {
		UserOpenID string `json:"user_openid"`
	} `json:"author"`
	Attachments []*Attachment `json:"attachments,omitempty"`
	MessageType int           `json:"message_type,omitempty"`
}

C2CMessageEvent C2C消息结构

type CachedToken added in v0.2.0

type CachedToken struct {
	Token     string
	ExpiresAt time.Time
}

CachedToken 缓存的 Access Token

type ChannelMessageEvent added in v0.2.0

type ChannelMessageEvent struct {
	ID               string            `json:"id"`
	Content          string            `json:"content"`
	Timestamp        string            `json:"timestamp"`
	ChannelID        string            `json:"channel_id"`
	GuildID          string            `json:"guild_id"`
	Author           *User             `json:"author,omitempty"`
	Member           *Member           `json:"member,omitempty"`
	Attachments      []*Attachment     `json:"attachments,omitempty"`
	Mentions         []*User           `json:"mentions,omitempty"`
	MentionEveryone  bool              `json:"mention_everyone,omitempty"`
	DirectMessage    bool              `json:"direct_message,omitempty"`
	MessageReference *MessageReference `json:"message_reference,omitempty"`
}

ChannelMessageEvent 频道消息结构

type Client added in v0.2.0

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

Client QQBot OpenAPI 客户端

func NewClient added in v0.2.0

func NewClient(baseURL string, creds Credentials, tokenMgr *TokenManager, log logger.Inst, debug bool) *Client

NewClient 创建 OpenAPI 客户端

func (*Client) GetGatewayURL added in v0.2.0

func (c *Client) GetGatewayURL(ctx context.Context) (string, error)

GetGatewayURL 获取 WebSocket 网关地址

func (*Client) Me added in v0.2.0

func (c *Client) Me(ctx context.Context) (*User, error)

Me 获取机器人自身信息

func (*Client) PostC2CMessage added in v0.2.0

func (c *Client) PostC2CMessage(ctx context.Context, openid string, msg *MessageToCreate) (*Message, error)

PostC2CMessage 发送单聊(私聊)消息

func (*Client) PostGroupMessage added in v0.2.0

func (c *Client) PostGroupMessage(ctx context.Context, groupOpenid string, msg *MessageToCreate) (*Message, error)

PostGroupMessage 发送群聊消息

func (*Client) PostMessage added in v0.2.0

func (c *Client) PostMessage(ctx context.Context, channelID string, msg *MessageToCreate) (*Message, error)

PostMessage 发送频道子频道消息

func (*Client) Request added in v0.2.0

func (c *Client) Request(ctx context.Context, method, path string, body any, result any) error

Request 发起带鉴权的 HTTP 请求

func (*Client) UploadFileData added in v0.2.0

func (c *Client) UploadFileData(ctx context.Context, scope, targetID string, fileType uint64, data []byte) (*FileInfo, error)

UploadFileData 上传媒体文件数据

func (*Client) UploadFileURL added in v0.2.0

func (c *Client) UploadFileURL(ctx context.Context, scope, targetID string, fileType uint64, url string) (*FileInfo, error)

UploadFileURL 通过网络 URL 上传媒体文件

type Config

type Config struct {
	Debug       bool          `yaml:"debug" json:"debug"`
	Mode        string        `yaml:"mode" json:"mode"` // "websocket" (默认), "webhook", 或 "both"
	Intents     int           `yaml:"intents" json:"intents"`
	Credentials Credentials   `yaml:"api" json:"api"`
	Webhook     WebhookConfig `yaml:"webhook" json:"webhook"`
	Http        WebhookConfig `yaml:"http" json:"http"` // 兼容旧版 http 命名配置
}

func (*Config) GetWebhookConfig added in v0.2.0

func (c *Config) GetWebhookConfig() *WebhookConfig

GetWebhookConfig 获取 Webhook / HTTP 配置(优先读取 webhook,未配置时读取 http)

func (*Config) IsConfigured added in v0.2.0

func (c *Config) IsConfigured() bool

IsConfigured 检查是否已配置有效的 AppID 与 Secret

type Credentials added in v0.2.0

type Credentials struct {
	AppID     string `yaml:"appid" json:"app_id"`
	Secret    string `yaml:"secret" json:"secret"`
	AppSecret string `yaml:"client_secret" json:"client_secret"`
}

Credentials QQ机器人开放平台鉴权凭据

func (*Credentials) ClientSecret added in v0.2.0

func (c *Credentials) ClientSecret() string

ClientSecret 获取 Secret 或 ClientSecret

type CustomKeyboard added in v0.2.0

type CustomKeyboard struct {
	Rows []KeyboardRow `json:"rows"`
}

CustomKeyboard 自定义内嵌键盘内容

type ExtInfo added in v0.2.0

type ExtInfo struct {
	RefIdx string `json:"ref_idx,omitempty"`
}

ExtInfo 消息扩展信息

type FileInfo

type FileInfo struct {
	FileUUID string `json:"file_uuid,omitempty"`
	FileInfo string `json:"file_info,omitempty"`
	TTL      uint   `json:"ttl,omitempty"`
	ID       string `json:"id,omitempty"`
}

FileInfo 文件上传响应

type FileUpload

type FileUpload struct {
	FileType   int    `json:"file_type"`
	FileData   string `json:"file_data,omitempty"`
	URL        string `json:"url,omitempty"`
	SrvSendMsg bool   `json:"srv_send_msg"`
	FileName   string `json:"file_name,omitempty"`
}

FileUpload 文件上传请求体

type GatewayConnection added in v0.2.0

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

GatewayConnection WebSocket 网关连接

func NewGatewayConnection added in v0.2.0

func NewGatewayConnection(s *Service) *GatewayConnection

NewGatewayConnection 创建网关连接

func (*GatewayConnection) Start added in v0.2.0

func (g *GatewayConnection) Start(ctx context.Context)

Start 启动网关连接循环

type GroupMessageEvent added in v0.2.0

type GroupMessageEvent struct {
	ID          string `json:"id"`
	Content     string `json:"content"`
	Timestamp   string `json:"timestamp"`
	GroupOpenID string `json:"group_openid"`
	Author      struct {
		MemberOpenID string `json:"member_openid"`
		Username     string `json:"username,omitempty"`
		Bot          bool   `json:"bot,omitempty"`
	} `json:"author"`
	Attachments []*Attachment `json:"attachments,omitempty"`
	Mentions    []*User       `json:"mentions,omitempty"`
	MessageType int           `json:"message_type,omitempty"`
}

GroupMessageEvent 群消息结构

type InboundMessageAttachment added in v0.2.0

type InboundMessageAttachment = Attachment

InboundMessageAttachment 兼容旧名

type Keyboard added in v0.2.0

type Keyboard struct {
	ID      string          `json:"id,omitempty"`
	Content *CustomKeyboard `json:"content,omitempty"`
}

Keyboard 按钮组件

type KeyboardAction added in v0.2.0

type KeyboardAction struct {
	Type          int                 `json:"type"` // 0=跳转链接, 1=回调(INTERACTION_CREATE), 2=指令输入(文本发给机器人), 3=mqqapi
	Data          string              `json:"data,omitempty"`
	Enter         bool                `json:"enter,omitempty"` // 点击后是否直接发送
	Reply         bool                `json:"reply,omitempty"` // 指令是否发到输入框
	Permission    *KeyboardPermission `json:"permission,omitempty"`
	ClickLimit    int                 `json:"click_limit,omitempty"`
	UnsupportTips string              `json:"unsupport_tips,omitempty"`
}

KeyboardAction 按钮交互动作

type KeyboardButton added in v0.2.0

type KeyboardButton struct {
	ID         string              `json:"id,omitempty"`
	RenderData *KeyboardRenderData `json:"render_data,omitempty"`
	Action     *KeyboardAction     `json:"action,omitempty"`
}

KeyboardButton 单个按钮

type KeyboardPermission added in v0.2.0

type KeyboardPermission struct {
	Type           int      `json:"type"` // 0=所有人, 1=管理员, 2=指定用户, 3=指定身份组
	SpecifyRoleIDs []string `json:"specify_role_ids,omitempty"`
	SpecifyUserIDs []string `json:"specify_user_ids,omitempty"`
}

KeyboardPermission 按钮权限

type KeyboardRenderData added in v0.2.0

type KeyboardRenderData struct {
	Label        string `json:"label"`
	VisitedLabel string `json:"visited_label,omitempty"`
	Style        int    `json:"style"` // 0=灰色线框, 1=蓝色线框, 2=推荐回复, 3=红色字体, 4=蓝色背景
}

KeyboardRenderData 按钮渲染属性

type KeyboardRow added in v0.2.0

type KeyboardRow struct {
	Buttons []KeyboardButton `json:"buttons"`
}

KeyboardRow 按钮行

type Markdown added in v0.2.0

type Markdown struct {
	CustomTemplateID string            `json:"custom_template_id,omitempty"`
	Params           map[string]string `json:"params,omitempty"`
	Content          string            `json:"content,omitempty"`
}

Markdown 消息内容

type MediaInfo added in v0.2.0

type MediaInfo struct {
	FileInfo string `json:"file_info,omitempty"`
}

MediaInfo 富媒体消息标识

type Member added in v0.2.0

type Member struct {
	User     *User    `json:"user,omitempty"`
	Nick     string   `json:"nick,omitempty"`
	Roles    []string `json:"roles,omitempty"`
	JoinedAt string   `json:"joined_at,omitempty"`
}

Member 频道/群成员

type Message

type Message struct {
	ID               string            `json:"id"`
	Content          string            `json:"content"`
	Timestamp        string            `json:"timestamp"`
	Author           *User             `json:"author,omitempty"`
	GroupID          string            `json:"group_openid,omitempty"`
	ChannelID        string            `json:"channel_id,omitempty"`
	GuildID          string            `json:"guild_id,omitempty"`
	DirectMessage    bool              `json:"direct_message,omitempty"`
	Attachments      []*Attachment     `json:"attachments,omitempty"`
	Mentions         []*User           `json:"mentions,omitempty"`
	MentionEveryone  bool              `json:"mention_everyone,omitempty"`
	MessageReference *MessageReference `json:"message_reference,omitempty"`
	MsgType          int               `json:"message_type,omitempty"`
}

Message 统一接收消息对象

type MessageBuilder

type MessageBuilder struct {
	*MessageToCreate

	MediaData []byte
	MediaType uint64
	// contains filtered or unexported fields
}

func NewMessageBuilder

func NewMessageBuilder(from *MessageContext) *MessageBuilder

func (*MessageBuilder) ApplyElements added in v0.2.0

func (m *MessageBuilder) ApplyElements(elements []*botc.MessageElement) *MessageBuilder

ApplyElements 将 MessageElement 列表应用到构建器

func (*MessageBuilder) Build

func (m *MessageBuilder) Build() *MessageToCreate

func (*MessageBuilder) CmdEnter

func (m *MessageBuilder) CmdEnter(text string) *MessageBuilder

func (*MessageBuilder) CmdInput

func (m *MessageBuilder) CmdInput(text, show string, reference bool) *MessageBuilder

func (*MessageBuilder) Emoji

func (m *MessageBuilder) Emoji(id uint) *MessageBuilder

func (*MessageBuilder) ImageFromData

func (m *MessageBuilder) ImageFromData(data []byte) botc.MessageBuilder

func (*MessageBuilder) ImageFromFile

func (m *MessageBuilder) ImageFromFile(path string) botc.MessageBuilder

func (*MessageBuilder) ImageFromUrl

func (m *MessageBuilder) ImageFromUrl(url string) botc.MessageBuilder

func (*MessageBuilder) InlineKeyboard added in v0.2.0

func (m *MessageBuilder) InlineKeyboard(kb *botc.InlineKeyboard) botc.MessageBuilder

InlineKeyboard 设置内嵌按钮组件

func (*MessageBuilder) KeyboardTemplate added in v0.2.0

func (m *MessageBuilder) KeyboardTemplate(templateID string) *MessageBuilder

KeyboardTemplate 通过模板 ID 设置内嵌按钮

func (*MessageBuilder) Markdown added in v0.3.0

func (m *MessageBuilder) Markdown(content string) botc.MessageBuilder

func (*MessageBuilder) Mention

func (m *MessageBuilder) Mention(id string) botc.MessageBuilder

func (*MessageBuilder) Protocol

func (m *MessageBuilder) Protocol() string

func (*MessageBuilder) Quote

func (*MessageBuilder) ReplyTo

func (*MessageBuilder) Send

func (m *MessageBuilder) Send(id string) (*botc.BaseMessage, error)

func (*MessageBuilder) Text

func (m *MessageBuilder) Text(text string) botc.MessageBuilder

func (*MessageBuilder) VideoFromData

func (m *MessageBuilder) VideoFromData(data []byte) *MessageBuilder

func (*MessageBuilder) VideoFromFile

func (m *MessageBuilder) VideoFromFile(path string) *MessageBuilder

func (*MessageBuilder) VideoFromUrl

func (m *MessageBuilder) VideoFromUrl(url string) *MessageBuilder

func (*MessageBuilder) VoiceFromData

func (m *MessageBuilder) VoiceFromData(data []byte) *MessageBuilder

func (*MessageBuilder) VoiceFromFile

func (m *MessageBuilder) VoiceFromFile(path string) *MessageBuilder

func (*MessageBuilder) VoiceFromUrl

func (m *MessageBuilder) VoiceFromUrl(url string) *MessageBuilder

type MessageContext

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

func NewMessageContext added in v0.1.0

func NewMessageContext(bot *Service, event *WSPayload, data *Message) *MessageContext

func (*MessageContext) BotContext

func (m *MessageContext) BotContext() botc.BotContext

func (*MessageContext) Features added in v0.2.0

func (m *MessageContext) Features() []botc.Feature

func (*MessageContext) Message

func (m *MessageContext) Message() *botc.BaseMessage

func (*MessageContext) NewMessageBuilder

func (m *MessageContext) NewMessageBuilder() botc.MessageBuilder

func (*MessageContext) Protocol

func (m *MessageContext) Protocol() string

func (*MessageContext) Reply

func (m *MessageContext) Reply(elements []*botc.MessageElement) (*botc.BaseMessage, error)

func (*MessageContext) ReplyText

func (m *MessageContext) ReplyText(a ...any) (*botc.BaseMessage, error)

func (*MessageContext) SenderID

func (m *MessageContext) SenderID() string

func (*MessageContext) String

func (m *MessageContext) String() string

func (*MessageContext) SupportsFeature added in v0.2.0

func (m *MessageContext) SupportsFeature(feature botc.Feature) bool

type MessageReference added in v0.2.0

type MessageReference struct {
	MessageID             string `json:"message_id,omitempty"`
	IgnoreGetMessageError bool   `json:"ignore_get_message_error,omitempty"`
	EventID               string `json:"event_id,omitempty"`
}

MessageReference 引用回复

type MessageResponse added in v0.2.0

type MessageResponse struct {
	ID        string   `json:"id"`
	Timestamp any      `json:"timestamp"`
	ExtInfo   *ExtInfo `json:"ext_info,omitempty"`
}

MessageResponse 发送消息响应

type MessageToCreate added in v0.2.0

type MessageToCreate struct {
	Content          string            `json:"content,omitempty"`
	MsgType          int               `json:"msg_type"`
	Markdown         *Markdown         `json:"markdown,omitempty"`
	Keyboard         *Keyboard         `json:"keyboard,omitempty"`
	Media            *MediaInfo        `json:"media,omitempty"`
	MessageReference *MessageReference `json:"message_reference,omitempty"`
	EventID          string            `json:"event_id,omitempty"`
	MsgID            string            `json:"msg_id,omitempty"`
	MsgSeq           int               `json:"msg_seq,omitempty"`
	Timestamp        int64             `json:"timestamp,omitempty"`
}

MessageToCreate 发送消息体

type QRCredentials added in v0.2.0

type QRCredentials struct {
	AppID      string
	Secret     string
	UserOpenID string
}

QRCredentials 扫码绑定的机器人凭据

type Service

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

func Create

func Create() *Service

func (*Service) API added in v0.2.0

func (s *Service) API() *Client

func (*Service) Contacts added in v0.1.0

func (s *Service) Contacts() []entity.User
func (s *Service) DownloadResourceFromRefLink(refLink string) (string, error)

func (*Service) Features added in v0.2.0

func (s *Service) Features() []botc.Feature

func (*Service) GenResourceURL

func (s *Service) GenResourceURL(id string) string

func (*Service) Groups added in v0.1.0

func (s *Service) Groups() []entity.Group

func (*Service) ID added in v0.1.0

func (s *Service) ID() string

func (*Service) Init

func (s *Service) Init(grb *GoroBot.Instant) error

func (*Service) Name

func (s *Service) Name() string

func (*Service) NewMessageBuilder added in v0.1.0

func (s *Service) NewMessageBuilder() botc.MessageBuilder

func (*Service) Protocol added in v0.1.0

func (s *Service) Protocol() string

func (*Service) QRConnect added in v0.2.0

func (s *Service) QRConnect(ctx context.Context) (*QRCredentials, error)

QRConnect 发起扫码绑定流程,返回获取到的凭据

func (*Service) Release

func (s *Service) Release(grb *GoroBot.Instant) error

func (*Service) SendDirectMessage added in v0.1.0

func (s *Service) SendDirectMessage(target entity.User, elements []*botc.MessageElement) (*botc.BaseMessage, error)

func (*Service) SendGroupMessage added in v0.1.0

func (s *Service) SendGroupMessage(target entity.Group, elements []*botc.MessageElement) (*botc.BaseMessage, error)

func (*Service) Status added in v0.1.0

func (s *Service) Status() botc.LoginStatus

func (*Service) SupportsFeature added in v0.2.0

func (s *Service) SupportsFeature(feature botc.Feature) bool

func (*Service) UploadFileData

func (s *Service) UploadFileData(id string, fileType uint64, data []byte) (*FileInfo, error)

UploadFileData 上传媒体文件数据并获取 FileInfo

func (*Service) WebhookHandler added in v0.2.0

func (s *Service) WebhookHandler(w http.ResponseWriter, r *http.Request)

WebhookHandler HTTP Webhook 处理入口

type TokenManager added in v0.2.0

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

TokenManager AccessToken 管理器,支持缓存与后台自动刷新

func NewTokenManager added in v0.2.0

func NewTokenManager(baseURL string, log logger.Inst) *TokenManager

NewTokenManager 创建 TokenManager

func (*TokenManager) ClearCache added in v0.2.0

func (m *TokenManager) ClearCache(appID string)

ClearCache 清理缓存

func (*TokenManager) GetAccessToken added in v0.2.0

func (m *TokenManager) GetAccessToken(ctx context.Context, appID, clientSecret string) (string, error)

GetAccessToken 获取 Access Token,优先读取未过期缓存

func (*TokenManager) StartBackgroundRefresh added in v0.2.0

func (m *TokenManager) StartBackgroundRefresh(ctx context.Context, appID, clientSecret string)

StartBackgroundRefresh 启动后台自动刷新协程

type User added in v0.2.0

type User struct {
	ID           string `json:"id,omitempty"`
	Username     string `json:"username,omitempty"`
	Avatar       string `json:"avatar,omitempty"`
	Bot          bool   `json:"bot,omitempty"`
	UserOpenID   string `json:"user_openid,omitempty"`
	MemberOpenID string `json:"member_openid,omitempty"`
}

User QQ平台用户对象

type ValidationPayload added in v0.2.0

type ValidationPayload struct {
	PlainToken string `json:"plain_token"`
	EventTs    string `json:"event_ts"`
}

ValidationPayload 回调地址验证数据 (op: 13)

type ValidationResponse added in v0.2.0

type ValidationResponse struct {
	PlainToken string `json:"plain_token"`
	Signature  string `json:"signature"`
}

ValidationResponse 回调地址验证响应

type WSPayload added in v0.2.0

type WSPayload struct {
	Op int             `json:"op"`
	D  json.RawMessage `json:"d,omitempty"`
	S  *int            `json:"s,omitempty"`
	T  string          `json:"t,omitempty"`
	ID string          `json:"id,omitempty"`
}

WSPayload WebSocket / Webhook 传输 Payload

type WebhookAck added in v0.2.0

type WebhookAck struct {
	Op int `json:"op"`
	D  int `json:"d"`
}

WebhookAck 回调确认响应 (op: 12)

type WebhookConfig added in v0.2.0

type WebhookConfig struct {
	Host    string `yaml:"host" json:"host"`
	Port    uint   `yaml:"port" json:"port"`
	Path    string `yaml:"path" json:"path"`
	BaseURL string `yaml:"base_url" json:"base_url"`
	TLS     struct {
		CertPath string `yaml:"cert_path" json:"cert_path"`
		KeyPath  string `yaml:"key_path" json:"key_path"`
	} `yaml:"tls" json:"tls"`
}

Jump to

Keyboard shortcuts

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