spicegen

package
v0.1.0-preview.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ExitSuccess = 0
	ExitFailure = 1
	ExitUsage   = 2
)

Variables

This section is empty.

Functions

func ConfigurationSchema

func ConfigurationSchema() (spiceconfig.Schema, error)

func Main

func Main(arguments []string) int

func RunCommand

func RunCommand(options CommandOptions) int

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(ctx context.Context, observers ...spicelifecycle.Observer) (*Application, error)

func NewApplicationWithOptions

func NewApplicationWithOptions(ctx context.Context, options ApplicationOptions) (*Application, error)

func (*Application) Components

func (application *Application) Components() Components

Components returns a typed snapshot of constructed singleton beans.

func (*Application) RegisterObserver

func (application *Application) RegisterObserver(observer spicelifecycle.Observer) error

func (*Application) Run

func (application *Application) Run(ctx context.Context, shutdown spicelifecycle.ContextFactory) error

func (*Application) ShutdownTimeout

func (application *Application) ShutdownTimeout() time.Duration

func (*Application) Start

func (application *Application) Start(ctx context.Context) error

func (*Application) State

func (application *Application) State() spicelifecycle.State

func (*Application) Stop

func (application *Application) Stop(ctx context.Context) error

type ApplicationOptions

type ApplicationOptions struct {
	Overrides                 BeanOverrides
	Profiles                  []string
	Sources                   []spiceconfig.Source
	AllowUnknownConfiguration bool
	Observers                 []spicelifecycle.Observer
}

type BeanOverrideLayer

type BeanOverrideLayer struct {
	Name      string
	Overrides BeanOverrides
}

BeanOverrideLayer is one named immutable override composition layer. Layers are applied in order; a later layer deliberately replaces an earlier value.

type BeanOverrides

type BeanOverrides struct {
	// Provider0 replaces bean "integer.stats".
	Provider0 spicebean.Override[tool.Tool]
	// Proof replaces bean "proof".
	Proof spicebean.Override[*composition.Proof]
}

BeanOverrides provides compile-time-typed singleton replacements. Replacements use the normal generated cleanup and rollback path.

func ComposeBeanOverrides

func ComposeBeanOverrides(layers ...BeanOverrideLayer) (BeanOverrides, error)

ComposeBeanOverrides validates and deterministically composes named layers. It never mutates a running application or performs runtime bean lookup.

type CommandOptions

type CommandOptions struct {
	Context         context.Context
	Arguments       []string
	Stdout          io.Writer
	Stderr          io.Writer
	Logger          *slog.Logger
	ShutdownTimeout time.Duration
	ShutdownContext ShutdownContextFactory
	Application     ApplicationOptions
}

type Components

type Components struct {
	// Provider0 is bean "integer.stats".
	Provider0 tool.Tool
	// Proof is bean "proof".
	Proof *composition.Proof
}

Components is a typed snapshot of constructed singleton beans. It performs no reflection or string-based lookup.

type ShutdownContextFactory

type ShutdownContextFactory func(time.Duration) (context.Context, context.CancelFunc)

Directories

Path Synopsis
sources

Jump to

Keyboard shortcuts

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