Documentation
¶
Index ¶
- func ExpandEnvArgs(args []string) []string
- func GetEnvBool(envKey string, defaultValue bool) bool
- func GetEnvDuration(envKey string, defaultValue time.Duration) time.Duration
- func GetEnvInt(envKey string, defaultValue int) int
- func GetEnvString(envKey, defaultValue string) string
- func LookupGitHubAPIURL(defaultURL string) string
- func LookupGitHubToken() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandEnvArgs ¶ added in v0.2.15
ExpandEnvArgs expands Docker -e flags that reference environment variables. Converts "-e VAR_NAME" to "-e VAR_NAME=value" by reading from the process environment. If the variable is not set, the flag is passed through unchanged.
func GetEnvBool ¶
GetEnvBool returns the boolean value of the environment variable specified by envKey. If the environment variable is not set or is empty, it returns the defaultValue. Truthy values (case-insensitive): "1", "true", "yes", "on" Falsy values (case-insensitive): "0", "false", "no", "off" Any other value returns the defaultValue.
func GetEnvDuration ¶ added in v0.2.13
GetEnvDuration returns the time.Duration value of the environment variable specified by envKey. If the environment variable is not set, is empty, or cannot be parsed by time.ParseDuration, it returns the defaultValue. Accepts any string valid for time.ParseDuration (e.g. "2h", "30m", "90s").
func GetEnvInt ¶
GetEnvInt returns the integer value of the environment variable specified by envKey. If the environment variable is not set, is empty, cannot be parsed as an integer, or is not positive (> 0), it returns the defaultValue. This function validates that the value is a positive integer.
func GetEnvString ¶
GetEnvString returns the value of the environment variable specified by envKey. If the environment variable is not set or is empty, it returns the defaultValue.
func LookupGitHubAPIURL ¶ added in v0.2.18
LookupGitHubAPIURL returns the GitHub API base URL from the GITHUB_API_URL environment variable. If the variable is not set or empty, it returns defaultURL. Any trailing slash is stripped from the result.
func LookupGitHubToken ¶ added in v0.2.18
func LookupGitHubToken() string
LookupGitHubToken searches environment variables for a GitHub token using a canonical priority order. It returns the first non-empty (trimmed) value found, or an empty string if none is set.
Priority order:
- GITHUB_MCP_SERVER_TOKEN
- GITHUB_TOKEN
- GITHUB_PERSONAL_ACCESS_TOKEN
- GH_TOKEN
Types ¶
This section is empty.