server

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 15 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 HealthResponse

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

type ListResponse

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

type ProcessResponse

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

type ServerConfig

type ServerConfig struct {
	Port        int
	DataDir     string
	BearerToken string
	Enabled     bool
}

ServerConfig holds the configuration for the HTTP server

type YAMLFileInfo

type YAMLFileInfo struct {
	Name    string `json:"name"`
	Methods string `json:"methods"` // "GET" or "POST"
}

Jump to

Keyboard shortcuts

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