Documentation
¶
Overview ¶
Package cloudconfig owns cloud.json persistence and runtime configuration primitives shared by the CLI and terminal UI.
Index ¶
Constants ¶
const ( LabelSourceNone = "not set" LabelSourceFile = "read from cloud.json" LabelSourceEnv = "set via ENGRAM_CLOUD_TOKEN" )
const EnvCloudServer = "ENGRAM_CLOUD_SERVER"
EnvCloudServer is the environment variable that overrides cloud.json.server_url.
const EnvCloudToken = "ENGRAM_CLOUD_TOKEN"
EnvCloudToken is the environment variable that overrides cloud.json.token.
Variables ¶
This section is empty.
Functions ¶
func SourceLabel ¶
SourceLabel returns the user-facing label for a token source.
func ValidateServerURL ¶
ValidateServerURL accepts HTTP(S) server URLs with a host. Query and fragment components are rejected so stored runtime endpoints remain unambiguous.
Types ¶
type Config ¶
Config is the on-disk cloud.json shape.
func ApplyServerOverride ¶
ApplyServerOverride applies ENGRAM_CLOUD_SERVER when it is non-empty.
type Source ¶
type Source int
Source identifies where the effective cloud token came from.
func EffectiveToken ¶
EffectiveToken resolves the environment token before the cloud.json fallback. A malformed configuration is treated as unavailable by this convenience API; callers that must surface parse failures should call Load first.