bootstrap

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package bootstrap will own top-level process startup for the Go port.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatLocalTimestamp

func FormatLocalTimestamp(value time.Time) string

func LogFilePath

func LogFilePath(logDir string) string

Types

type CreateLoggerFunc

type CreateLoggerFunc func(config.LoggingConfig, string, LoggerOptions) (Logger, error)

type Logger

type Logger interface {
	Debug(message string, context map[string]any)
	Info(message string, context map[string]any)
	Warn(message string, context map[string]any)
	Error(message string, context map[string]any)
}

func CreateLogger

func CreateLogger(cfg config.LoggingConfig, logDir string, options LoggerOptions) (Logger, error)

type LoggerOptions

type LoggerOptions struct {
	Stdout io.Writer
	Stderr io.Writer
	Now    func() time.Time
}

type Options

type Options struct {
	Args            []string
	Env             map[string]string
	CWD             string
	Stdout          io.Writer
	Stderr          io.Writer
	LoadConfig      LoadConfigFunc
	CreateLogger    CreateLoggerFunc
	StartRuntime    StartRuntimeFunc
	WaitForShutdown bool
	SignalNotifier  SignalNotifier
}

type Result

type Result struct {
	Config   config.Config
	Metadata config.LoadFileMetadata
	Logger   Logger
	Runtime  Runtime
}

func Bootstrap

func Bootstrap(ctx context.Context, options Options) (Result, error)

type Runtime

type Runtime any

type RuntimeDependencies

type RuntimeDependencies struct {
	Config   config.Config
	Metadata config.LoadFileMetadata
	Logger   Logger
}

type ShutdownRuntime

type ShutdownRuntime interface {
	Stop(reason string)
	WaitForShutdown()
}

type SignalNotifier

type SignalNotifier interface {
	Notify(chan<- os.Signal, ...os.Signal)
	Stop(chan<- os.Signal)
}

type StartRuntimeFunc

type StartRuntimeFunc func(context.Context, RuntimeDependencies) (Runtime, error)

Jump to

Keyboard shortcuts

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