envfile

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package envfile loads, merges, hashes and ships environment files. Values are delivered via files (API-side --env-file locally, 0600 files on the host) — never through argv. Files are only re-shipped when the content hash changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(content []byte) string

Hash returns the sha256 hex of rendered content.

func Load

func Load(files []string, sopsAge bool) (map[string]string, error)

Load parses env files in order (later files win), returning a key→value map. Files ending in .enc or with encryption sops-age are decrypted via sops; plaintext never leaves the machine unencrypted.

func RemotePath

func RemotePath(service string) string

RemotePath is where a service's env file lives on the host.

func Render

func Render(env map[string]string) []byte

Render produces deterministic env-file content from a map (sorted keys).

func Ship

func Ship(h *exec.Host, service string, content []byte) (bool, error)

Ship writes the env file to the host (0600) if its hash changed, returning whether a write happened.

func WriteTemp

func WriteTemp(content []byte) (string, error)

WriteTemp writes content to a 0600 temp file for local --env-file delivery and returns its path. Caller removes it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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