Documentation
¶
Overview ¶
Package gateway 实现 Golem 的 API 网关,允许通过 HTTP 协议与 Agent 进行交互。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(token string, processor ChatProcessor) http.Handler
NewHandler 创建并配置网关的路由处理器。
Types ¶
type ChatProcessor ¶
type ChatProcessor interface {
// ProcessForChannel 处理来自指定通道和聊天 ID 的消息。
ProcessForChannel(ctx context.Context, channel, chatID, senderID, content string) (string, error)
}
ChatProcessor 定义了网关处理聊天请求所需的接口。
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server 表示网关服务器实例。
func New ¶
func New(cfg config.GatewayConfig, processor ChatProcessor) *Server
New 创建并返回一个新的网关服务器实例。
Click to show internal directories.
Click to hide internal directories.