pub struct Registry { /* private fields */ }Expand description
The daemon’s handle on the registry.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn open(base: &Client, state: Option<&Path>) -> Result<Option<Registry>>
pub fn open(base: &Client, state: Option<&Path>) -> Result<Option<Registry>>
The registry as set up on this host, or None when it is not.
state is the daemon’s state directory, for the push index.
The installed registry, else the host’s with the default state dir.
pub fn info(&self) -> &Info
pub fn remote(&self) -> &Remote
Sourcepub fn push(
&self,
org: &OrgId,
app: &str,
tag: &str,
tar: &Path,
log: &mut dyn FnMut(&str),
) -> Result<String>
pub fn push( &self, org: &OrgId, app: &str, tag: &str, tar: &Path, log: &mut dyn FnMut(&str), ) -> Result<String>
Push an OCI layout tar as <org>/<app>:<tag>. Returns the digest.
Sourcepub fn resolve(&self, org: &OrgId, r: &ImageRef) -> Result<String>
pub fn resolve(&self, org: &OrgId, r: &ImageRef) -> Result<String>
The digest an org’s registry: image names now.
Sourcepub fn list(&self, org: Option<&OrgId>) -> Result<Vec<RepoInfo>>
pub fn list(&self, org: Option<&OrgId>) -> Result<Vec<RepoInfo>>
Repositories and their tags, of one org or all.
Delete the manifests of <org>/<app> whose every tag doomed
picks, except spare digests (what is deployed). A digest that
another tag still names stays, and so does that tag: the registry
deletes manifests, not tags. Returns digest (tags) of each one
deleted. Blobs go at the next registry gc.
Sourcepub fn gc(
&self,
keep: usize,
protected: &BTreeSet<String>,
dry_run: bool,
log: &mut dyn FnMut(&str),
) -> Result<GcReport>
pub fn gc( &self, keep: usize, protected: &BTreeSet<String>, dry_run: bool, log: &mut dyn FnMut(&str), ) -> Result<GcReport>
Retention: per repository keep the newest keep tags and every
protected repo@digest (what deployed stacks, current and
previous, run), delete the other manifests, then have the registry
collect unreferenced blobs. Pushes wait meanwhile.