Documentation
¶
Index ¶
- func GetAuthContext(ctx context.Context) *domain.AuthContext
- type AdminStatsResponse
- type AuthMiddleware
- type CORSMiddleware
- type ChunkStats
- type ComponentHealth
- type Config
- type ConnectionStats
- type DocumentStats
- type DocumentURLResponse
- type ErrorResponse
- type HealthResponse
- type LoggingMiddleware
- type Pinger
- type RecoveryMiddleware
- type ResetPasswordRequest
- type Server
- type SourceDocumentsResponse
- type SourceStats
- type StatusResponse
- type SyncAcceptedResponse
- type TriggerReindexResponse
- type UpdateContainersRequest
- type UserStats
- type VersionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthContext ¶
func GetAuthContext(ctx context.Context) *domain.AuthContext
GetAuthContext retrieves the auth context from request context
Types ¶
type AdminStatsResponse ¶
type AdminStatsResponse struct {
Documents DocumentStats `json:"documents"`
Chunks ChunkStats `json:"chunks"`
Sources SourceStats `json:"sources"`
Connections ConnectionStats `json:"installations"`
Users UserStats `json:"users"`
}
AdminStatsResponse represents system-wide statistics @Description System-wide statistics for the admin dashboard
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
AuthMiddleware handles authentication and authorization
func NewAuthMiddleware ¶
func NewAuthMiddleware(authService driving.AuthService) *AuthMiddleware
NewAuthMiddleware creates a new AuthMiddleware
func (*AuthMiddleware) Authenticate ¶
func (m *AuthMiddleware) Authenticate(next http.Handler) http.Handler
Authenticate validates the request token and adds auth context
func (*AuthMiddleware) RequireAdmin ¶
func (m *AuthMiddleware) RequireAdmin(next http.Handler) http.Handler
RequireAdmin ensures the authenticated user is an admin
func (*AuthMiddleware) RequireRole ¶
RequireRole ensures the authenticated user has one of the specified roles
type CORSMiddleware ¶
type CORSMiddleware struct {
// contains filtered or unexported fields
}
CORSMiddleware handles CORS
func NewCORSMiddleware ¶
func NewCORSMiddleware(allowedOrigins []string) *CORSMiddleware
NewCORSMiddleware creates a new CORSMiddleware
type ChunkStats ¶
type ChunkStats struct {
Total int `json:"total"`
}
ChunkStats represents chunk statistics
type ComponentHealth ¶
type ComponentHealth struct {
Status string `json:"status"` // "healthy" or "unhealthy"
Message string `json:"message,omitempty"` // optional message for unhealthy components
}
ComponentHealth represents health status of a single component
type Config ¶
type Config struct {
Host string
Port int
Version string
CORSOrigins []string
UIBaseURL string // Frontend URL for OAuth redirects (default: http://localhost:3000)
}
Config holds server configuration
type ConnectionStats ¶
type ConnectionStats struct {
Total int `json:"total"`
}
ConnectionStats represents installation statistics
type DocumentStats ¶
type DocumentStats struct {
Total int `json:"total"`
}
DocumentStats represents document statistics
type DocumentURLResponse ¶
type DocumentURLResponse struct {
URL string `json:"url" example:"https://github.com/owner/repo/blob/main/README.md"`
}
DocumentURLResponse represents the response containing a document's external URL @Description Document URL response
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error" example:"invalid request body"`
}
ErrorResponse represents an API error response @Description API error response
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"` // overall status: "healthy" or "degraded"
Components map[string]ComponentHealth `json:"components,omitempty"` // individual component health
}
HealthResponse represents the health check response with component status
type LoggingMiddleware ¶
type LoggingMiddleware struct{}
LoggingMiddleware logs HTTP requests
func NewLoggingMiddleware ¶
func NewLoggingMiddleware() *LoggingMiddleware
NewLoggingMiddleware creates a new LoggingMiddleware
type RecoveryMiddleware ¶
type RecoveryMiddleware struct{}
RecoveryMiddleware recovers from panics
func NewRecoveryMiddleware ¶
func NewRecoveryMiddleware() *RecoveryMiddleware
NewRecoveryMiddleware creates a new RecoveryMiddleware
type ResetPasswordRequest ¶
type ResetPasswordRequest struct {
Password string `json:"password" binding:"required"`
}
ResetPasswordRequest represents a password reset request @Description Password reset request
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP server
func NewServer ¶
func NewServer( cfg Config, authService driving.AuthService, userService driving.UserService, searchService driving.SearchService, sourceService driving.SourceService, docService driving.DocumentService, settingsService driving.SettingsService, providerService driving.ProviderService, oauthService driving.OAuthService, connectionService driving.ConnectionService, syncOrchestrator driving.SyncOrchestrator, capabilitiesService driving.CapabilitiesService, setupService driving.SetupService, adminService driving.AdminService, taskQueue driven.TaskQueue, searchQueryRepo driven.SearchQueryRepository, db Pinger, redisClient Pinger, oauthServerService driving.OAuthServerService, mcpHandler http.Handler, ) *Server
NewServer creates a new HTTP server
type SourceDocumentsResponse ¶
type SourceDocumentsResponse struct {
Documents []*domain.Document `json:"documents"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
SourceDocumentsResponse represents a paginated list of documents for a source @Description Paginated list of documents belonging to a source
type SourceStats ¶
SourceStats represents source statistics
type StatusResponse ¶
type StatusResponse struct {
Status string `json:"status" example:"ok"`
}
StatusResponse represents a simple status response @Description Simple status response
type SyncAcceptedResponse ¶
type SyncAcceptedResponse struct {
Status string `json:"status" example:"accepted"`
SourceID string `json:"source_id" example:"src_abc123"`
}
SyncAcceptedResponse represents the response when sync is triggered @Description Sync accepted response
type TriggerReindexResponse ¶
type TriggerReindexResponse struct {
TaskIDs []string `json:"task_ids"`
Message string `json:"message"`
}
TriggerReindexResponse represents the response from triggering a reindex @Description Response containing task IDs created for reindex operation
type UpdateContainersRequest ¶
type UpdateContainersRequest struct {
// Containers is the list of containers to index.
// Empty list means index all available containers.
Containers []domain.Container `json:"containers"`
}
UpdateContainersRequest represents a request to update source container containers @Description Request to update which containers a source should index
type UserStats ¶
type UserStats struct {
Total int `json:"total"`
}
UserStats represents user statistics
type VersionResponse ¶
type VersionResponse struct {
Version string `json:"version" example:"1.0.0"`
}
VersionResponse represents the API version response @Description API version response