config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Enabled bool   `mapstructure:"enabled"`
	APIKey  string `mapstructure:"api_key"`
}

type Config

type Config struct {
	Server    ServerConfig    `mapstructure:"server"`
	Providers ProvidersConfig `mapstructure:"providers"`
	Defaults  DefaultsConfig  `mapstructure:"defaults"`
	Auth      AuthConfig      `mapstructure:"auth"`
	Database  DatabaseConfig  `mapstructure:"database"`
	Logging   LoggingConfig   `mapstructure:"logging"`
	Pool      PoolConfig      `mapstructure:"pool"`
}

func Load

func Load() (*Config, error)

func (*Config) ResolveAgentPath

func (c *Config) ResolveAgentPath() string

ResolveAgentPath resolves the agent_path to an absolute path. If the path is relative, it tries (in order):

  1. Relative to the executable's directory
  2. Relative to CWD
  3. PATH lookup via exec.LookPath (for /usr/local/bin installs)

type CustomConfig

type CustomConfig struct {
	Enabled bool   `mapstructure:"enabled"`
	Name    string `mapstructure:"name"`
	BaseURL string `mapstructure:"base_url"`
	APIKey  string `mapstructure:"api_key"`
	Timeout string `mapstructure:"timeout"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Path string `mapstructure:"path"`
}

type DefaultsConfig

type DefaultsConfig struct {
	TTL          string `mapstructure:"ttl"`
	Image        string `mapstructure:"image"`
	MemoryMB     int    `mapstructure:"memory_mb"`
	VCPUs        int    `mapstructure:"vcpus"`
	DiskSizeMB   int    `mapstructure:"disk_size_mb"`
	PoolSize     int    `mapstructure:"pool_size"`
	PoolTemplate string `mapstructure:"pool_template"`
}

type E2BConfig

type E2BConfig struct {
	Enabled bool   `mapstructure:"enabled"`
	APIKey  string `mapstructure:"api_key"`
	BaseURL string `mapstructure:"base_url"`
}

type FirecrackerConfig

type FirecrackerConfig struct {
	Enabled         bool   `mapstructure:"enabled"`
	FirecrackerPath string `mapstructure:"firecracker_path"`
	KernelPath      string `mapstructure:"kernel_path"`
	DefaultRootfs   string `mapstructure:"default_rootfs"`
	AgentPath       string `mapstructure:"agent_path"`
	DataDir         string `mapstructure:"data_dir"`
}

type LoggingConfig

type LoggingConfig struct {
	Level  string `mapstructure:"level"`
	Format string `mapstructure:"format"`
}

type MockConfig

type MockConfig struct {
	Enabled bool `mapstructure:"enabled"`
}

type PoolConfig

type PoolConfig struct {
	Enabled       bool   `mapstructure:"enabled"`
	MaxVMs        int    `mapstructure:"max_vms"`
	MaxUsersPerVM int    `mapstructure:"max_users_per_vm"`
	Image         string `mapstructure:"image"`
	MemoryMB      int    `mapstructure:"memory_mb"`
	VCPUs         int    `mapstructure:"vcpus"`
	Overflow      string `mapstructure:"overflow"` // "reject" or "queue"
}

type ProvidersConfig

type ProvidersConfig struct {
	Default     string            `mapstructure:"default"`
	Mock        MockConfig        `mapstructure:"mock"`
	Firecracker FirecrackerConfig `mapstructure:"firecracker"`
	E2B         E2BConfig         `mapstructure:"e2b"`
	Custom      CustomConfig      `mapstructure:"custom"`
}

type ServerConfig

type ServerConfig struct {
	Host string `mapstructure:"host"`
	Port int    `mapstructure:"port"`
}

func (ServerConfig) Addr

func (s ServerConfig) Addr() string

Jump to

Keyboard shortcuts

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