shellenvservice

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package shellenvservice persists the operator-defined environment variables contenox injects into shells it spawns, layered on top of the environment scrub so they always win. Values are plaintext in the kv table, so no secrets belong here.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidName = errors.New("shellenvservice: invalid environment variable name")

ErrInvalidName is returned when a variable name is not a usable environment variable name.

Functions

func ValidEnvName

func ValidEnvName(name string) bool

ValidEnvName reports whether name is a usable environment-variable name: a non-empty run of ASCII letters, digits and underscores, not starting with a digit.

Types

type Service

type Service interface {
	// Get returns the global variables — an empty (never nil) map when none are
	// set, so a caller can range over it unconditionally.
	Get(ctx context.Context) (map[string]string, error)
	// Set replaces the global variables with vars after validating every name. An
	// empty map clears them.
	Set(ctx context.Context, vars map[string]string) error
}

Service reads and writes the global shell-env variable map.

func New

func New(db libdb.DBManager) Service

New builds the service over db. It opens a fresh non-transactional store per call, matching the runtime's other kv-backed services.

Jump to

Keyboard shortcuts

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