server

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 17 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 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 CORSConfig added in v0.0.9

type CORSConfig struct {
	AllowedOrigins []string `json:"allowedOrigins"`
	AllowedMethods []string `json:"allowedMethods"`
	AllowedHeaders []string `json:"allowedHeaders"`
	MaxAge         int      `json:"maxAge"`
	Enabled        bool     `json:"enabled"`
}

CORSConfig holds CORS-related configuration options

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 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 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 ServerConfig

type ServerConfig struct {
	Port        int        `json:"port"`
	DataDir     string     `json:"dataDir"`
	BearerToken string     `json:"bearerToken,omitempty"`
	Enabled     bool       `json:"enabled"`
	CORS        CORSConfig `json:"cors"`
}

ServerConfig holds the configuration for the HTTP server

Jump to

Keyboard shortcuts

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