Skip to main content

Module dotenv

Module dotenv 

Source
Expand description

Minimal .env file parser for secretsh import-env.

Supported syntax:

  • KEY=value
  • export KEY=value (optional export prefix, stripped)
  • KEY="value with spaces" (double-quoted, \" and \\ escapes)
  • KEY='literal value' (single-quoted, no escape processing)
  • # comment lines (ignored)
  • Blank lines (ignored)
  • Inline comments: KEY=value # comment (only when unquoted)

Key names must match the vault constraint [A-Za-z_][A-Za-z0-9_]*. Values are returned as raw bytes (Vec<u8>).

Structs§

EnvEntry
A single key-value entry parsed from a .env file.

Functions§

parse_dotenv
Parse a .env file and return all key-value entries.
parse_dotenv_str
Parse the string contents of a .env file.