pub struct GoEnvConfig { /* private fields */ }Expand description
Resolved $GOENV configuration (FR-001–FR-008), consulted per-dependency via
Self::resolve_source_for.
Implementations§
Source§impl GoEnvConfig
impl GoEnvConfig
Sourcepub fn parse(content: &str, policy: &RegistryAccessPolicy) -> Self
pub fn parse(content: &str, policy: &RegistryAccessPolicy) -> Self
Parses $GOENV file content (FR-001: KEY=VALUE lines, #-comments and blank lines
ignored) into a resolved config, validating any GOPROXY hop against policy
(FR-011).
Sourcepub fn resolve_source_for(&self, module_path: &str) -> DependencySource
pub fn resolve_source_for(&self, module_path: &str) -> DependencySource
FR-002/FR-007/FR-008/FR-009: resolves one module’s DependencySource.
- A
GOPRIVATE-matched module bypassesGOPROXYentirely, routing to the fixedGOPRIVATE_CHAIN_KEYchain (FR-008) — checked first, regardless ofGOPROXY. - No
GOPROXYoverride declared -> plainDependencySource::Registry(US-005). - A
GOPROXYoverride where every hop is invalid ->DependencySource::CustomRegistry(FR-009, fail-closed, never aproxy.golang.orgfallback). - Otherwise ->
DependencySource::AlternateRegistrypointing at the chainSelf::goproxy_chainregisters.
Sourcepub fn goproxy_chain(&self) -> Option<&GoProxyChain>
pub fn goproxy_chain(&self) -> Option<&GoProxyChain>
The resolved GOPROXY chain to register, if any (None when absent or every hop was
invalid — nothing to register in either case).
Sourcepub fn has_goprivate(&self) -> bool
pub fn has_goprivate(&self) -> bool
Whether at least one declared GOPRIVATE pattern actually compiled into a usable
matcher — gates whether the caller must also register the fixed
GOPRIVATE_CHAIN_KEY chain.
Checks tokens.is_some() rather than mere presence in self.goprivate (issue #566): a
pattern rejected either by F6’s oversized-pattern guard or as malformed (unterminated
[ character class, issue #568) is still stored with tokens: None (see
GlobPattern::tokens’s doc) rather than removed, and can never match anything, so
counting it here would register a GOPRIVATE_CHAIN_KEY chain nothing can ever route
to.
Sourcepub fn resolved_chains(&self) -> Vec<GoProxyChain>
pub fn resolved_chains(&self) -> Vec<GoProxyChain>
Every chain this config implies, ready for GoRegistry::register_chain — the resolved
GOPROXY chain (if any), plus the fixed GOPRIVATE_CHAIN_KEY bypass chain when
Self::has_goprivate holds (registered regardless of whether GOPROXY itself is also
declared — FR-008 applies independently of GOPROXY). Empty when $GOENV declares no
override at all, or when every declared GOPRIVATE pattern was rejected (US-005/#566:
nothing usable to register).