server

package
v0.0.80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(envConfig *config.EnvConfig) (*http.Server, error)

New creates a new HTTP server with the given configuration

func Run

func Run(envConfig *config.EnvConfig) error

Run creates and starts the HTTP server with the given configuration

Types

type AddModelRequest added in v0.0.24

type AddModelRequest struct {
	Name  string          `json:"name"`
	Modes []cfg.ModelMode `json:"modes"` // Use alias cfg
}

AddModelRequest is the request body for adding a model to a provider's configuration

type AvailableModel added in v0.0.24

type AvailableModel struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"` // Optional description if available
}

AvailableModel represents a model available from the provider's service

type AvailableModelListResponse added in v0.0.24

type AvailableModelListResponse struct {
	Success bool             `json:"success"`
	Models  []AvailableModel `json:"models"`
	Error   string           `json:"error,omitempty"`
}

AvailableModelListResponse is the response for listing available models from a provider

type BackupResponse added in v0.0.8

type BackupResponse struct {
	Success  bool   `json:"success"`
	Message  string `json:"message,omitempty"`
	Error    string `json:"error,omitempty"`
	Filename string `json:"filename,omitempty"`
}

BackupResponse represents a response for backup operations

type BulkFileRequest added in v0.0.8

type BulkFileRequest struct {
	Files []FileRequest `json:"files"`
}

BulkFileRequest represents a request for bulk file operations

type BulkFileResponse added in v0.0.8

type BulkFileResponse struct {
	Success bool         `json:"success"`
	Message string       `json:"message,omitempty"`
	Error   string       `json:"error,omitempty"`
	Results []FileResult `json:"results,omitempty"`
}

BulkFileResponse represents a response for bulk file operations

type ConfiguredModel added in v0.0.24

type ConfiguredModel struct {
	Name  string          `json:"name"`
	Type  string          `json:"type"`  // e.g., "local", "external"
	Modes []cfg.ModelMode `json:"modes"` // Use alias cfg
}

ConfiguredModel represents a model as configured within Comanda

type ConfiguredModelListResponse added in v0.0.24

type ConfiguredModelListResponse struct {
	Success bool              `json:"success"`
	Models  []ConfiguredModel `json:"models"`
	Error   string            `json:"error,omitempty"`
}

ConfiguredModelListResponse is the response for listing models configured for a provider

type EnvironmentRequest added in v0.0.8

type EnvironmentRequest struct {
	Password string `json:"password"`
}

EnvironmentRequest represents a request for environment operations

type EnvironmentResponse added in v0.0.8

type EnvironmentResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message,omitempty"`
	Error   string `json:"error,omitempty"`
}

EnvironmentResponse represents a response for environment operations

type ErrorResponse added in v0.0.24

type ErrorResponse struct {
	Success bool   `json:"success"` // Should always be false
	Error   string `json:"error"`
}

ErrorResponse represents a generic error API response

type FileInfo added in v0.0.8

type FileInfo struct {
	Name       string    `json:"name"`
	Path       string    `json:"path"`
	Size       int64     `json:"size"`
	IsDir      bool      `json:"isDir"`
	CreatedAt  time.Time `json:"createdAt"`
	ModifiedAt time.Time `json:"modifiedAt"`
	Methods    string    `json:"methods,omitempty"`
}

FileInfo represents detailed information about a file

type FileRequest added in v0.0.8

type FileRequest struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}

FileRequest represents a request to create/edit a file

type FileResponse added in v0.0.8

type FileResponse struct {
	Success bool     `json:"success"`
	Message string   `json:"message,omitempty"`
	Error   string   `json:"error,omitempty"`
	File    FileInfo `json:"file,omitempty"`
}

FileResponse represents a response for file operations

type FileResult added in v0.0.8

type FileResult struct {
	Path    string `json:"path"`
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

FileResult represents the result of a single file operation

type FileUploadResponse added in v0.0.14

type FileUploadResponse struct {
	Success bool     `json:"success"`
	Message string   `json:"message,omitempty"`
	Error   string   `json:"error,omitempty"`
	File    FileInfo `json:"file,omitempty"`
}

FileUploadResponse represents a response for file upload operations

type GenerateRequest added in v0.0.35

type GenerateRequest struct {
	Prompt string `json:"prompt"`
	Model  string `json:"model,omitempty"`
}

GenerateRequest represents the request body for the generate endpoint

type GenerateResponse added in v0.0.35

type GenerateResponse struct {
	Success bool   `json:"success"`
	YAML    string `json:"yaml,omitempty"`
	Error   string `json:"error,omitempty"`
	Model   string `json:"model,omitempty"`
}

GenerateResponse represents the response for the generate endpoint

type HealthResponse

type HealthResponse struct {
	Status    string `json:"status"`
	Timestamp string `json:"timestamp"`
}

HealthResponse represents the health check response

type ListResponse

type ListResponse struct {
	Success bool       `json:"success"`
	Files   []FileInfo `json:"files"`
	Error   string     `json:"error,omitempty"`
}

ListResponse represents the response for file listing

type ProcessResponse

type ProcessResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message,omitempty"`
	Error   string `json:"error,omitempty"`
	Output  string `json:"output,omitempty"`
}

ProcessResponse represents the response for process operations

type ProviderInfo added in v0.0.8

type ProviderInfo struct {
	Name    string   `json:"name"`
	Models  []string `json:"models"`
	Enabled bool     `json:"enabled"`
}

ProviderInfo represents information about a provider

type ProviderListResponse added in v0.0.8

type ProviderListResponse struct {
	Success   bool           `json:"success"`
	Providers []ProviderInfo `json:"providers"`
	Error     string         `json:"error,omitempty"`
}

ProviderListResponse represents the response for provider listing

type ProviderRequest added in v0.0.8

type ProviderRequest struct {
	Name    string   `json:"name"`
	APIKey  string   `json:"apiKey"`
	Models  []string `json:"models,omitempty"`
	Enabled bool     `json:"enabled"`
}

ProviderRequest represents a request to modify a provider

type RestoreRequest added in v0.0.8

type RestoreRequest struct {
	Backup string `json:"backup"`
}

RestoreRequest represents a request for restore operations

type Server added in v0.0.8

type Server struct {
	// contains filtered or unexported fields
}

Server represents the HTTP server

type SuccessResponse added in v0.0.24

type SuccessResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message,omitempty"`
}

SuccessResponse represents a generic successful API response

type UpdateModelRequest added in v0.0.24

type UpdateModelRequest struct {
	Modes []cfg.ModelMode `json:"modes"` // Use alias cfg
}

UpdateModelRequest is the request body for updating a configured model's modes

type YAMLRequest added in v0.0.14

type YAMLRequest struct {
	Content   string `json:"content"`
	Input     string `json:"input"`
	Streaming bool   `json:"streaming"`
}

YAMLRequest represents a request for YAML operations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL