Documentation
¶
Index ¶
- type APIHandler
- func (h *APIHandler) AckReports(c *gin.Context)
- func (h *APIHandler) AppendWorkflowFeedback(c *gin.Context)
- func (h *APIHandler) ArchiveSession(c *gin.Context)
- func (h *APIHandler) CancelSession(c *gin.Context)
- func (h *APIHandler) DeleteWorkflowDraft(c *gin.Context)
- func (h *APIHandler) GetCurrentSession(c *gin.Context)
- func (h *APIHandler) GetSession(c *gin.Context)
- func (h *APIHandler) GetSettings(c *gin.Context)
- func (h *APIHandler) GetTask(c *gin.Context)
- func (h *APIHandler) GetWorkflowDraft(c *gin.Context)
- func (h *APIHandler) KeepaliveSession(c *gin.Context)
- func (h *APIHandler) ListQueuedFeedbacks(c *gin.Context)
- func (h *APIHandler) ListSessions(c *gin.Context)
- func (h *APIHandler) ListTasks(c *gin.Context)
- func (h *APIHandler) ReadReports(c *gin.Context)
- func (h *APIHandler) RenameSession(c *gin.Context)
- func (h *APIHandler) RevokeQueuedFeedback(c *gin.Context)
- func (h *APIHandler) RevokeSession(c *gin.Context)
- func (h *APIHandler) SaveWorkflowDraft(c *gin.Context)
- func (h *APIHandler) SendTaskFeedback(c *gin.Context)
- func (h *APIHandler) SubmitFeedback(c *gin.Context)
- func (h *APIHandler) TranscribeAudio(c *gin.Context)
- func (h *APIHandler) UnarchiveSession(c *gin.Context)
- func (h *APIHandler) UpdateSessionMaxChecks(c *gin.Context)
- func (h *APIHandler) UpdateSessionPromptWait(c *gin.Context)
- func (h *APIHandler) UpdateSessionUserPresence(c *gin.Context)
- func (h *APIHandler) UpdateSessionWaitCountdown(c *gin.Context)
- func (h *APIHandler) UpdateSettings(c *gin.Context)
- type AckReportsRequest
- type AuthHandler
- func (a *AuthHandler) ChangeCredentials(c *gin.Context)
- func (a *AuthHandler) ClearAllBlockedIPs(c *gin.Context)
- func (a *AuthHandler) GetBlockedIPs(c *gin.Context)
- func (a *AuthHandler) GetEffectiveCredentials(c *gin.Context) (username string, password string)
- func (a *AuthHandler) Login(c *gin.Context)
- func (a *AuthHandler) Middleware() gin.HandlerFunc
- func (a *AuthHandler) ResetCredentials(c *gin.Context)
- func (a *AuthHandler) Status(c *gin.Context)
- func (a *AuthHandler) UnblockIP(c *gin.Context)
- func (a *AuthHandler) VerifyToken(tokenString string) bool
- type BlockedIPInfo
- type ChangeCredentialsRequest
- type IPAttempt
- type LoginRequest
- type RateLimiter
- func (rl *RateLimiter) CheckLocked(ip string) (isLocked bool, remaining time.Duration)
- func (rl *RateLimiter) ClearAll()
- func (rl *RateLimiter) Close()
- func (rl *RateLimiter) GetBlockedIPs() []BlockedIPInfo
- func (rl *RateLimiter) RecordFailure(ip string, maxAttempts int, lockoutDuration time.Duration) (isLocked bool, remaining time.Duration)
- func (rl *RateLimiter) RecordSuccess(ip string)
- func (rl *RateLimiter) UnblockIP(ip string)
- type SSEBroker
- type SendTaskFeedbackRequest
- type Server
- type SubmitFeedbackRequest
- type TranscribeAudioRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIHandler ¶
type APIHandler struct {
// contains filtered or unexported fields
}
func NewAPIHandler ¶
func (*APIHandler) AckReports ¶
func (h *APIHandler) AckReports(c *gin.Context)
func (*APIHandler) AppendWorkflowFeedback ¶
func (h *APIHandler) AppendWorkflowFeedback(c *gin.Context)
func (*APIHandler) ArchiveSession ¶
func (h *APIHandler) ArchiveSession(c *gin.Context)
func (*APIHandler) CancelSession ¶
func (h *APIHandler) CancelSession(c *gin.Context)
func (*APIHandler) DeleteWorkflowDraft ¶
func (h *APIHandler) DeleteWorkflowDraft(c *gin.Context)
func (*APIHandler) GetCurrentSession ¶
func (h *APIHandler) GetCurrentSession(c *gin.Context)
func (*APIHandler) GetSession ¶
func (h *APIHandler) GetSession(c *gin.Context)
func (*APIHandler) GetTask ¶
func (h *APIHandler) GetTask(c *gin.Context)
func (*APIHandler) GetWorkflowDraft ¶
func (h *APIHandler) GetWorkflowDraft(c *gin.Context)
Workflow Drafts Handlers
func (*APIHandler) KeepaliveSession ¶
func (h *APIHandler) KeepaliveSession(c *gin.Context)
func (*APIHandler) ListQueuedFeedbacks ¶
func (h *APIHandler) ListQueuedFeedbacks(c *gin.Context)
func (*APIHandler) ListSessions ¶
func (h *APIHandler) ListSessions(c *gin.Context)
func (*APIHandler) ReadReports ¶
func (h *APIHandler) ReadReports(c *gin.Context)
func (*APIHandler) RenameSession ¶
func (h *APIHandler) RenameSession(c *gin.Context)
func (*APIHandler) RevokeQueuedFeedback ¶
func (h *APIHandler) RevokeQueuedFeedback(c *gin.Context)
func (*APIHandler) RevokeSession ¶
func (h *APIHandler) RevokeSession(c *gin.Context)
func (*APIHandler) SaveWorkflowDraft ¶
func (h *APIHandler) SaveWorkflowDraft(c *gin.Context)
func (*APIHandler) SendTaskFeedback ¶
func (h *APIHandler) SendTaskFeedback(c *gin.Context)
func (*APIHandler) SubmitFeedback ¶
func (h *APIHandler) SubmitFeedback(c *gin.Context)
func (*APIHandler) TranscribeAudio ¶
func (h *APIHandler) TranscribeAudio(c *gin.Context)
func (*APIHandler) UnarchiveSession ¶
func (h *APIHandler) UnarchiveSession(c *gin.Context)
func (*APIHandler) UpdateSessionMaxChecks ¶
func (h *APIHandler) UpdateSessionMaxChecks(c *gin.Context)
func (*APIHandler) UpdateSessionPromptWait ¶
func (h *APIHandler) UpdateSessionPromptWait(c *gin.Context)
func (*APIHandler) UpdateSessionUserPresence ¶
func (h *APIHandler) UpdateSessionUserPresence(c *gin.Context)
func (*APIHandler) UpdateSessionWaitCountdown ¶
func (h *APIHandler) UpdateSessionWaitCountdown(c *gin.Context)
func (*APIHandler) UpdateSettings ¶
func (h *APIHandler) UpdateSettings(c *gin.Context)
type AckReportsRequest ¶
type AckReportsRequest struct {
ThroughSequence int64 `json:"through_sequence"`
}
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
func NewAuthHandler ¶
func NewAuthHandler(cfg *config.Config, st *store.Store, limiter *RateLimiter) *AuthHandler
func (*AuthHandler) ChangeCredentials ¶
func (a *AuthHandler) ChangeCredentials(c *gin.Context)
ChangeCredentials 修改管理账号和密码(需提供旧密码进行鉴权验证)
func (*AuthHandler) ClearAllBlockedIPs ¶
func (a *AuthHandler) ClearAllBlockedIPs(c *gin.Context)
func (*AuthHandler) GetBlockedIPs ¶
func (a *AuthHandler) GetBlockedIPs(c *gin.Context)
func (*AuthHandler) GetEffectiveCredentials ¶
func (a *AuthHandler) GetEffectiveCredentials(c *gin.Context) (username string, password string)
GetEffectiveCredentials 获取当前生效的账号和密码(优先数据库,兜底环境变量)
func (*AuthHandler) Login ¶
func (a *AuthHandler) Login(c *gin.Context)
func (*AuthHandler) Middleware ¶
func (a *AuthHandler) Middleware() gin.HandlerFunc
func (*AuthHandler) ResetCredentials ¶
func (a *AuthHandler) ResetCredentials(c *gin.Context)
ResetCredentials 重置账号密码回退至环境变量初始值
func (*AuthHandler) Status ¶
func (a *AuthHandler) Status(c *gin.Context)
func (*AuthHandler) UnblockIP ¶
func (a *AuthHandler) UnblockIP(c *gin.Context)
func (*AuthHandler) VerifyToken ¶
func (a *AuthHandler) VerifyToken(tokenString string) bool
type BlockedIPInfo ¶
type LoginRequest ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter() *RateLimiter
func (*RateLimiter) CheckLocked ¶
func (rl *RateLimiter) CheckLocked(ip string) (isLocked bool, remaining time.Duration)
CheckLocked 检查该 IP 是否处于封禁锁定期
func (*RateLimiter) Close ¶
func (rl *RateLimiter) Close()
func (*RateLimiter) GetBlockedIPs ¶
func (rl *RateLimiter) GetBlockedIPs() []BlockedIPInfo
GetBlockedIPs 获取当前所有处于封禁状态的 IP 列表
func (*RateLimiter) RecordFailure ¶
func (rl *RateLimiter) RecordFailure(ip string, maxAttempts int, lockoutDuration time.Duration) (isLocked bool, remaining time.Duration)
RecordFailure 记录一次登录失败,若达到阈值则自动封禁
func (*RateLimiter) RecordSuccess ¶
func (rl *RateLimiter) RecordSuccess(ip string)
RecordSuccess 登录成功,清除该 IP 的所有失败记录
type SSEBroker ¶
type SSEBroker struct {
// contains filtered or unexported fields
}
func NewSSEBroker ¶
func NewSSEBroker() *SSEBroker
type SendTaskFeedbackRequest ¶
type SendTaskFeedbackRequest struct {
Body string `json:"body"`
ExpectedRevision int64 `json:"expected_revision"`
References []model.PathReference `json:"references"`
}
type SubmitFeedbackRequest ¶
type SubmitFeedbackRequest struct {
ResponseText string `json:"response_text"`
UserMessages []string `json:"user_messages"`
Images []model.SessionImage `json:"images"`
}
Click to show internal directories.
Click to hide internal directories.