bootstrap

package
v1.40.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, opts ...ServeOption) error

Serve starts the Hector server with the given options. It handles the entire lifecycle: config loading, app initialization, server start, signal handling.

Types

type BootstrapDependencies

type BootstrapDependencies struct {
	DBPool         *config.DBPool
	SessionService session.Service
	TaskService    task.Service
	VectorProvider vector.Provider
}

BootstrapDependencies holds the dependencies available to the runtime factory.

type RuntimeFactory

type RuntimeFactory func(ctx context.Context, deps BootstrapDependencies, appID string, appCfg *config.AppConfig) (server.Runtime, error)

RuntimeFactory creates a runtime for an app.

type ServeOption

type ServeOption func(*ServeOptions)

ServeOption is a functional option for Serve.

func WithAutoSecret added in v1.31.3

func WithAutoSecret(secret string) ServeOption

WithAutoSecret sets an auto-generated secret to display prominently in the startup banner.

func WithConfigPath

func WithConfigPath(path string) ServeOption

WithConfigPath sets the path to the app config file.

func WithRuntimeFactory

func WithRuntimeFactory(f RuntimeFactory) ServeOption

WithRuntimeFactory sets a custom runtime factory.

func WithServerConfig

func WithServerConfig(cfg *config.ServerConfig) ServeOption

WithServerConfig sets the server configuration.

func WithWatch

func WithWatch(watch bool) ServeOption

WithWatch enables config file watching.

type ServeOptions

type ServeOptions struct {
	// ServerConfig is the operational configuration (port, db, etc).
	ServerConfig *config.ServerConfig
	// ConfigPath is the path to the app config file (yaml).
	ConfigPath string
	// Watch enables config file watching for hot-reload.
	Watch bool
	// RuntimeFactory is the factory for creating runtimes.
	// If nil, defaults to standard runtime.NewBuilder().WithConfig(cfg).Build().
	RuntimeFactory RuntimeFactory
	// AutoSecret is set when the auth secret was auto-generated (not user-provided).
	// It is displayed prominently in the startup banner.
	AutoSecret string
}

ServeOptions configuration for the Serve function.

Jump to

Keyboard shortcuts

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