Documentation
¶
Overview ¶
Package replicas manages the on-disk cache of Entire data-plane replicas and the per-invocation NodeConfig that drives the transport's warm/cold paths.
A NodeConfig is built up front from the remote URL: the entry URL is derived from the cluster host, and the initial node list is whatever the local cache contains for (cluster, repo) — possibly empty on a cold invocation, in which case the transport's cold path probes the entry domain and populates the set from the first X-Entire-Replicas header it sees.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractRepoPath ¶
ExtractRepoPath builds the per-repo cache key from a remote URL's path. The path is used verbatim (minus leading/trailing slashes), so /et/<project>/<repo> (or legacy /git/<owner>/<repo>) and /gh/<owner>/<repo> live in distinct keyspaces — they're separate repos with potentially-different replica sets, even when the segments after the prefix match.
entire://host/et/project/repo -> "et/project/repo" entire://host/gh/owner/repo -> "gh/owner/repo"
func Invalidate ¶
func Invalidate(host, repoPath string)
Invalidate removes the cached entry for (host, repoPath). Best effort: failures are logged but never fatal. Runs under ModifyCache's lock so it doesn't race a concurrent Persist.
func LoadFresh ¶
LoadFresh returns the cached replica set for (host, repoPath) if one exists and is fresh, otherwise nil.
Types ¶
type NodeConfig ¶
NodeConfig is the discovery-time state the transport needs: an entry-domain URL to use when the cached replica set is empty or exhausted, whatever replicas are currently cached, the cluster host for same-cluster redirect checks, and the repo path used as the cache key (empty when the URL has no path, in which case caching is disabled).
func Resolve ¶
func Resolve(parsedURL *url.URL) NodeConfig
Resolve builds the NodeConfig for this invocation. No network operations: the entry URL is derived from the cluster host in the remote URL and the initial node list is whatever the local replica cache contains.
func (NodeConfig) Caching ¶
func (n NodeConfig) Caching() bool
Caching reports whether this config participates in the persistent replica cache. False when the URL had no recognisable repo path to key on.