Documentation
¶
Index ¶
- type BackupFileInfo
- type BackupRequest
- type ConfigResponse
- type Connection
- type DataTypeSelection
- type Hub
- type OperationManager
- func (om *OperationManager) GetAll() []OperationStatus
- func (om *OperationManager) GetStatus(id string) (*OperationStatus, error)
- func (om *OperationManager) SetOutputFile(id string, outputFile string)
- func (om *OperationManager) StartOperation(opType string, fn func(progress ProgressCallback) error) (string, error)
- type OperationStartResponse
- type OperationStatus
- type ProgressCallback
- type RestoreRequest
- type Server
- type UpdateConfigRequest
- type WebSocketMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupFileInfo ¶
type BackupFileInfo struct {
Name string `json:"name"`
Size int64 `json:"size"`
ModTime string `json:"modTime"`
DownloadURL string `json:"downloadUrl"`
}
BackupFileInfo represents metadata about a backup file
type BackupRequest ¶
type BackupRequest struct {
OutputFilename string `json:"outputFilename"`
EncryptRecipients []string `json:"encryptRecipients"`
DataTypes DataTypeSelection `json:"dataTypes"`
}
BackupRequest represents a request to create a backup
type ConfigResponse ¶
type ConfigResponse struct {
OpenWebUIURL string `json:"openWebUIURL"`
APIKey string `json:"apiKey,omitempty"`
ServerPort int `json:"serverPort"`
BackupsDir string `json:"backupsDir"`
DefaultRecipient string `json:"defaultRecipient"`
DefaultIdentity string `json:"defaultIdentity"`
DefaultAgeIdentity string `json:"defaultAgeIdentity,omitempty"`
DefaultAgeRecipients string `json:"defaultAgeRecipients,omitempty"`
AvailableBackups []string `json:"availableBackups"`
}
ConfigResponse represents the application configuration for the frontend
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection represents a WebSocket connection
type DataTypeSelection ¶
type DataTypeSelection struct {
Prompts bool `json:"prompts"`
Tools bool `json:"tools"`
Knowledge bool `json:"knowledge"`
Models bool `json:"models"`
Files bool `json:"files"`
Chats bool `json:"chats"`
Users bool `json:"users"`
Groups bool `json:"groups"`
Feedbacks bool `json:"feedbacks"`
}
DataTypeSelection specifies which data types to include in backup/restore
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub manages WebSocket connections
func (*Hub) Broadcast ¶
func (h *Hub) Broadcast(msg WebSocketMessage)
Broadcast sends a message to all connected clients
func (*Hub) HandleWebSocket ¶
HandleWebSocket upgrades HTTP connection to WebSocket
type OperationManager ¶
type OperationManager struct {
// contains filtered or unexported fields
}
OperationManager manages concurrent backup and restore operations
func NewOperationManager ¶
func NewOperationManager(hub *Hub) *OperationManager
NewOperationManager creates a new operation manager
func (*OperationManager) GetAll ¶
func (om *OperationManager) GetAll() []OperationStatus
GetAll returns all operations
func (*OperationManager) GetStatus ¶
func (om *OperationManager) GetStatus(id string) (*OperationStatus, error)
GetStatus retrieves the status of an operation
func (*OperationManager) SetOutputFile ¶
func (om *OperationManager) SetOutputFile(id string, outputFile string)
SetOutputFile sets the output file for an operation
func (*OperationManager) StartOperation ¶
func (om *OperationManager) StartOperation(opType string, fn func(progress ProgressCallback) error) (string, error)
StartOperation starts a new async operation and returns its ID
type OperationStartResponse ¶
type OperationStartResponse struct {
OperationID string `json:"operationId"`
}
OperationStartResponse represents the response when starting an operation
type OperationStatus ¶
type OperationStatus struct {
ID string `json:"id"`
Type string `json:"type"` // "backup" or "restore"
Status string `json:"status"` // "running", "completed", "failed"
Progress int `json:"progress"` // 0-100
Message string `json:"message"`
StartTime time.Time `json:"startTime"`
EndTime *time.Time `json:"endTime,omitempty"`
Error string `json:"error,omitempty"`
OutputFile string `json:"outputFile,omitempty"`
}
OperationStatus represents the current status of a backup or restore operation
type ProgressCallback ¶
ProgressCallback is a function that receives progress updates
type RestoreRequest ¶
type RestoreRequest struct {
InputFilename string `json:"inputFilename"`
DecryptIdentity string `json:"decryptIdentity"`
DataTypes DataTypeSelection `json:"dataTypes"`
Overwrite bool `json:"overwrite"`
}
RestoreRequest represents a request to restore from a backup
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP server
type UpdateConfigRequest ¶
type UpdateConfigRequest struct {
OpenWebUIURL *string `json:"openWebUIURL,omitempty"`
APIKey *string `json:"apiKey,omitempty"`
}
UpdateConfigRequest represents a request to update the configuration
type WebSocketMessage ¶
type WebSocketMessage struct {
Type string `json:"type"` // "status", "progress", "log"
Payload interface{} `json:"payload"`
}
WebSocketMessage represents a message sent over the WebSocket connection