runtimehost

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileVersion = 1

Variables

This section is empty.

Functions

func NewHTTPHandler

func NewHTTPHandler(api http.Handler, webDirectory, desktopToken string, requestShutdown context.CancelFunc) (http.Handler, error)

func Run

func Run(ctx context.Context, config Config, logger *log.Logger) error

func WriteRuntimeUnits

func WriteRuntimeUnits(destination io.Writer) error

Types

type Config

type Config struct {
	Mode                  Mode
	Address               string
	DataDirectory         string
	WebDirectory          string
	DesktopToken          string
	Version               string
	DefaultScope          string
	AutomationPeriod      time.Duration
	DisableAutomations    bool
	DisableEmbeddedWorker bool
}

func (Config) Validate

func (config Config) Validate() error

type FileConfig

type FileConfig struct {
	Version    int                    `yaml:"version" mapstructure:"version"`
	Runtime    FileRuntimeConfig      `yaml:"runtime" mapstructure:"runtime"`
	Desktop    FileDesktopConfig      `yaml:"desktop,omitempty" mapstructure:"desktop"`
	Storage    FileStorageConfig      `yaml:"storage,omitempty" mapstructure:"storage"`
	Redis      FileRedisConfig        `yaml:"redis,omitempty" mapstructure:"redis"`
	Extensions map[string]interface{} `yaml:"extensions,omitempty" mapstructure:"extensions"`
}

func LoadConfigFile

func LoadConfigFile(path string) (FileConfig, error)

func (FileConfig) Apply

func (fileConfig FileConfig) Apply(config Config) (Config, error)

func (FileConfig) Validate

func (config FileConfig) Validate() error

type FileDatabaseConfig

type FileDatabaseConfig struct {
	Driver string `yaml:"driver,omitempty" mapstructure:"driver"`
	DSN    string `yaml:"dsn,omitempty" mapstructure:"dsn"`
	DSNEnv string `yaml:"dsn_env,omitempty" mapstructure:"dsn_env"`
}

type FileDesktopConfig

type FileDesktopConfig struct {
	PreventSleep  *bool  `yaml:"prevent_sleep,omitempty" mapstructure:"prevent_sleep"`
	LaunchAtLogin *bool  `yaml:"launch_at_login,omitempty" mapstructure:"launch_at_login"`
	Language      string `yaml:"language,omitempty" mapstructure:"language"`
}

type FileRedisConfig

type FileRedisConfig struct {
	Mode        string `yaml:"mode,omitempty" mapstructure:"mode"`
	Address     string `yaml:"address,omitempty" mapstructure:"address"`
	Username    string `yaml:"username,omitempty" mapstructure:"username"`
	PasswordEnv string `yaml:"password_env,omitempty" mapstructure:"password_env"`
	Database    int    `yaml:"database,omitempty" mapstructure:"database"`
	TLS         bool   `yaml:"tls,omitempty" mapstructure:"tls"`
}

type FileRuntimeConfig

type FileRuntimeConfig struct {
	ListenHost       string `yaml:"listen_host,omitempty" mapstructure:"listen_host"`
	Port             *int   `yaml:"port,omitempty" mapstructure:"port"`
	DataDirectory    string `yaml:"data_directory,omitempty" mapstructure:"data_directory"`
	EmbeddedWorker   *bool  `yaml:"embedded_worker,omitempty" mapstructure:"embedded_worker"`
	Automations      *bool  `yaml:"automations,omitempty" mapstructure:"automations"`
	AutomationPeriod string `yaml:"automation_period,omitempty" mapstructure:"automation_period"`
}

type FileStorageConfig

type FileStorageConfig struct {
	Database FileDatabaseConfig `yaml:"database,omitempty" mapstructure:"database"`
}

type Mode

type Mode string
const (
	ModeServer   Mode = "server"
	ModeDesktop  Mode = "desktop"
	ModeHeadless Mode = "headless"
)

Jump to

Keyboard shortcuts

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