Documentation
¶
Index ¶
- Constants
- func NewHTTPHandler(api http.Handler, webDirectory, desktopToken string, ...) (http.Handler, error)
- func Run(ctx context.Context, config Config, logger *log.Logger) error
- func WriteRuntimeUnits(destination io.Writer) error
- type Config
- type FileConfig
- type FileDatabaseConfig
- type FileDesktopConfig
- type FileRedisConfig
- type FileRuntimeConfig
- type FileStorageConfig
- type Host
- type Mode
Constants ¶
const ConfigFileVersion = 1
Variables ¶
This section is empty.
Functions ¶
func NewHTTPHandler ¶
func Run ¶
Run preserves the blocking CLI entrypoint while sharing the Host lifecycle used by embedded applications.
func WriteRuntimeUnits ¶
Types ¶
type Config ¶
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) Validate ¶
func (config FileConfig) Validate() error
type FileDatabaseConfig ¶
type FileDesktopConfig ¶
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 {
Enabled *bool `yaml:"enabled,omitempty" mapstructure:"enabled"`
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 Host ¶ added in v1.2.12
type Host struct {
// contains filtered or unexported fields
}
Host owns one single-node workflow runtime: scheduler, optional embedded worker, stores, automations, and HTTP transport. Constructing a disabled Host has no filesystem, network, or goroutine side effects.
func New ¶ added in v1.2.12
New constructs an explicitly enabled single-node host. It opens the runtime stores so callers can configure the embedded worker through Service before Start. When config.Enabled is false, New returns an inert Host.
func (*Host) Address ¶ added in v1.2.12
Address returns the bound address after Start. It is empty for a disabled or not-yet-started Host.
func (*Host) Service ¶ added in v1.2.12
Service exposes the canonical scheduler so an embedding application can register Units or executors before Start.
func (*Host) Shutdown ¶ added in v1.2.12
Shutdown is idempotent and closes the HTTP server, scheduler, database, and runtime-directory lock in ownership order.