Skip to main content

hyperlane_plugin_env/
const.rs

1/// Default environment variable prefix for Hyperlane server settings (`HYPERLANE_`).
2pub const DEFAULT_ENV_PREFIX: &str = "HYPERLANE_";
3
4/// Environment key for bind address (`ADDRESS`, e.g. `HYPERLANE_ADDRESS=0.0.0.0:8080`).
5pub const KEY_ADDRESS: &str = "ADDRESS";
6
7/// Environment key for bind host fallback (`HOST`).
8pub const KEY_HOST: &str = "HOST";
9
10/// Environment key for bind port fallback (`PORT`).
11pub const KEY_PORT: &str = "PORT";
12
13/// Environment key for `TCP_NODELAY` (`NODELAY`).
14pub const KEY_NODELAY: &str = "NODELAY";
15
16/// Environment key for `IP_TTL` (`TTL`).
17pub const KEY_TTL: &str = "TTL";
18
19/// Environment key for server wire protocol (`PROTOCOL`: `http1`, `http2`, `http3`).
20pub const KEY_PROTOCOL: &str = "PROTOCOL";
21
22/// Environment key for TLS certificate PEM path (`TLS_CERT`).
23pub const KEY_TLS_CERT: &str = "TLS_CERT";
24
25/// Environment key for TLS private key PEM path (`TLS_KEY`).
26pub const KEY_TLS_KEY: &str = "TLS_KEY";
27
28/// Redacted debug/display marker for [`SecretValue`].
29pub const REDACTED_MARKER: &str = "[REDACTED]";
30
31/// Optional shell `export ` prefix stripped in `.env` files.
32pub(crate) const EXPORT_PREFIX: &str = "export ";
33
34/// Boolean true literal (`true`).
35pub(crate) const BOOL_TRUE: &str = "true";
36
37/// Boolean false literal (`false`).
38pub(crate) const BOOL_FALSE: &str = "false";
39
40/// Protocol literal for HTTP/1.x.
41pub(crate) const PROTO_HTTP1: &str = "http1";
42
43/// Protocol literal for HTTP/2.
44pub(crate) const PROTO_HTTP2: &str = "http2";
45
46/// Protocol literal for HTTP/3.
47pub(crate) const PROTO_HTTP3: &str = "http3";
48
49/// Error display prefix for missing required environment key.
50pub(crate) const ERR_MISSING: &str = "missing required env key";
51
52/// Error display prefix for typed parse failure.
53pub(crate) const ERR_PARSE: &str = "failed to parse env key";
54
55/// Error display prefix for `.env` syntax errors.
56pub(crate) const ERR_SYNTAX: &str = "invalid .env syntax";
57
58/// Error display prefix for filesystem I/O errors.
59pub(crate) const ERR_IO: &str = "failed to read .env file";
60
61/// Error reason for invalid boolean value.
62pub(crate) const ERR_INVALID_BOOL: &str = "invalid boolean";
63
64/// Error reason for invalid duration value.
65pub(crate) const ERR_INVALID_DURATION: &str = "invalid duration";
66
67/// Error reason for invalid protocol value.
68pub(crate) const ERR_INVALID_PROTOCOL: &str = "expected http1, http2, or http3";
69
70/// Error reason for missing `=` in `.env` line.
71pub(crate) const ERR_MISSING_EQ: &str = "missing '=' separator";
72
73/// Error reason for invalid variable key in `.env`.
74pub(crate) const ERR_INVALID_KEY: &str = "invalid variable name";
75
76/// Error reason for unclosed quoted value in `.env`.
77pub(crate) const ERR_UNCLOSED_QUOTE: &str = "unterminated quoted value";