Documentation
¶
Overview ¶
Package server 装配 chi 路由:/api/admin/*(静态 token OR platform_admin JWT)+ /api/user/*(JWT 保护,register/login 公开)+ 三个 AI 端点 + /healthz。 架构约束:所有 API 统一收口于 /api/*,前端 SPA 占用根及 /api/user/*、/app/*, 两者无前缀重叠,SPA fallback 可无歧义地回 index.html。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
AdminToken string
JWTIssuer *auth.Issuer // platform_admin JWT 鉴权(/api/admin 扩展)
UserStatus auth.UserStatusProvider // 用户快照 status+role(JWT 鉴权路径禁用/降权即拒;nil = JWT 路径全拒)
MaxInflight int64
ReadHeaderTimeout time.Duration
MaxHeaderBytes int
AdminHandler http.Handler // 已挂 /api/admin/* 路由
UserHandler http.Handler // 已挂 /api/user/* 路由(内部完成公开/JWT 分流)
AIHandler http.Handler // proxy 三个端点
WebFS fs.FS // 前端构建产物(nil = 不挂静态资源)
Logger *logx.Logger
}
Click to show internal directories.
Click to hide internal directories.