server

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RunServer

func RunServer(ctx context.Context, config ServerConfig) error

RunServer is the main entry point for running the server

Types

type Server

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

Server represents the HTTP server

func NewServer

func NewServer(config ServerConfig) (*Server, error)

NewServer creates a new HTTP server

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop gracefully stops the server

type ServerConfig

type ServerConfig struct {
	Address       string
	ScriptFile    string
	LibDirs       []string
	Packages      []string // Package (.zip) paths or URLs
	Insecure      bool     // Allow self-signed HTTPS for package URLs
	CacheDir      string   // Override default OS cache dir for remote packages
	BearerToken   string
	AllowedPaths  []string // Filesystem path restrictions (empty = no restrictions)
	MCPToolsDir   string   // Empty means MCP disabled
	MCPExecTool   bool     // Enable code execution tool
	KVStoragePath string   // Empty means in-memory KV store
	TLSCert       string
	TLSKey        string
	TLSGenerate   bool
}

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