secrets

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package secrets locates and loads the repo-local .harness-secrets/env file. The file format is a tiny KEY=VALUE subset of dotenv: one assignment per line, `#` for comments, optional surrounding quotes on values.

The package walks upward from a starting directory until it finds .harness-secrets/env, so it works whether tests run from the module root or from a subpackage.

Env vars already set in the process take priority — the file is a fallback, not an override.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("secrets: invalid file format")

ErrInvalid is returned when the secrets file is malformed.

Functions

func LoadFrom

func LoadFrom(dir string) (string, error)

LoadFrom walks upward from `dir` until it finds .harness-secrets/env. Returns the path loaded (or "" if missing).

func LoadRepo

func LoadRepo() (string, error)

LoadRepo finds and loads .harness-secrets/env. Returns the path it loaded from (or empty if none found). Missing file is not an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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