state_new

package
v0.260830.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: CC0-1.0 Imports: 17 Imported by: 0

Documentation

Overview

Sorry, workaround to import cycles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(log *log2.Log, teler tele_api.Teler) (context.Context, *state.Global)

func NewTestContext

func NewTestContext(t testing.TB, buildVersion string, confString string) (context.Context, *state.Global)

NewTestContext builds a Global/context for tests. The config always starts from the repo's defaultConfig.hcl (schema-complete by construction — it's generated from the same Config struct these tests decode into), then layers confString on top if given. confString only needs to contain the blocks a particular test cares about (e.g. `inventory { stock "x" {...} }`) — it does not need to be a complete, standalone config.

func WithConfig added in v0.260830.0

func WithConfig(extra string) string

WithConfig is a thin passthrough kept for existing call sites written before NewTestContext started loading defaultConfig.hcl as its base. extra no longer needs to be a complete, schema-valid HCL document — just the blocks a test wants to add or override — but code that already builds a bigger string (e.g. a locally-defined "minimal config" constant) still works fine passed through here, since decodeBody's per-fragment merge doesn't care how much or how little each fragment declares.

Types

This section is empty.

Jump to

Keyboard shortcuts

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