launchenv

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package launchenv freezes environment layers at launch, matching util/launch-environment. Trust order is process environment, project .env, then user .env. Windows variable names are case-folded.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Value  string
	Source Source
	Path   string // Source file path; empty for process environment.
}

Entry is a resolved environment entry.

type LayerInput

type LayerInput struct {
	Source Source
	Path   string
	Values map[string]string
}

LayerInput contains raw input for one layer.

type Snapshot

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

Snapshot is an immutable launch environment.

func New

func New(layers []LayerInput) *Snapshot

New accepts layers in any order and resolves them in fixed trust order.

func (*Snapshot) Get

func (s *Snapshot) Get(name string) (Entry, bool)

Get resolves a variable across all layers in trust order.

func (*Snapshot) GetFrom

func (s *Snapshot) GetFrom(name string, sources []Source) (Entry, bool)

GetFrom resolves only the specified layers in fixed trust order.

type Source

type Source string

Source identifies a layer in descending trust order.

const (
	SourceProcess    Source = "process"
	SourceProjectEnv Source = "project-env"
	SourceUserEnv    Source = "user-env"
)

Jump to

Keyboard shortcuts

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