Documentation
¶
Index ¶
- type BackupFileInfo
- type BackupRequest
- type Config
- type ConfigResponse
- type Connection
- type DataTypeSelection
- type ErrorResponse
- type GenerateIdentityResponse
- 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 backup operation request
type Config ¶ added in v0.7.0
type Config struct {
OpenWebUIBaseURL string `json:"openWebUIBaseURL"`
AgeIdentity string `json:"ageIdentity"`
AgeRecipients string `json:"ageRecipients"`
Passphrase string `json:"passphrase"`
}
Config represents the application configuration
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 configuration response
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection represents a WebSocket connection
type DataTypeSelection ¶
type DataTypeSelection struct {
Knowledge bool `json:"knowledge"`
Models bool `json:"models"`
Tools bool `json:"tools"`
Prompts bool `json:"prompts"`
Files bool `json:"files"`
Chats bool `json:"chats"`
Users bool `json:"users"`
Groups bool `json:"groups"`
Feedbacks bool `json:"feedbacks"`
}
DataTypeSelection represents the selection of data types for backup/restore
type ErrorResponse ¶ added in v0.7.0
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse represents an error response
type GenerateIdentityResponse ¶ added in v0.7.0
type GenerateIdentityResponse struct {
Identity string `json:"identity"` // Private key (AGE-SECRET-KEY-...)
Recipient string `json:"recipient"` // Public key (age1...)
}
GenerateIdentityResponse contains a newly generated age identity pair
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"`
Status string `json:"status"`
Progress int `json:"progress"`
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 status of an 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 restore operation request
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 configuration update request
type WebSocketMessage ¶
type WebSocketMessage struct {
Type string `json:"type"`
Payload interface{} `json:"payload"`
}
WebSocketMessage represents a WebSocket message