Documentation
¶
Overview ¶
Package oci facilitates transferring of git and git-lfs OCI artifacts.
Index ¶
- Constants
- func FindSuccessorsBundles(manDesc ocispec.Descriptor, bundleLayers []ocispec.Descriptor) ...
- func FindSuccessorsLFS(lfsLayers []ocispec.Descriptor) ...
- func PostCopyLFS(fstorePath, destRepoPath string) func(ctx context.Context, desc ocispec.Descriptor) error
- type Config
- type Helper
- type LFSConfig
- type ReferenceInfo
- type References
Constants ¶
const ( // ArtifactTypeSyncManifest is the artifact type for an sync manifest. ArtifactTypeSyncManifest = "application/vnd.act3-ace.git.repo.v1+json" // ArtifactTypeLFSManifest is the artifact type for an git-lfs manifest. ArtifactTypeLFSManifest = "application/vnd.act3-ace.git-lfs.repo.v1+json" // MediaTypeSyncConfig is the media type for a sync config. MediaTypeSyncConfig = "application/vnd.act3-ace.git.config.v1+json" // MediaTypeLFSConfig is the media type for a git-lfs config. Currently not used. MediaTypeLFSConfig = "application/vnd.act3-ace.git-lfs.config.v1+json" // MediaTypeBundleLayer is the media type for a git bundle stored as an oci layer. MediaTypeBundleLayer = "application/vnd.act3-ace.git.bundle.v1" // MediaTypeLFSLayer is the media type used for git-lfs layers. MediaTypeLFSLayer = "application/vnd.act3-ace.git-lfs.object.v1" // AnnotationDTVersion is the key for the annotation to denote the ace-dt version used during gather. AnnotationDTVersion = "vnd.act3-ace.data.version" )
Variables ¶
This section is empty.
Functions ¶
func FindSuccessorsBundles ¶
func FindSuccessorsBundles(manDesc ocispec.Descriptor, bundleLayers []ocispec.Descriptor) func(ctx context.Context, fetcher content.Fetcher, desc ocispec.Descriptor) ([]ocispec.Descriptor, error)
FindSuccessorsBundles limits the bundle layers copied to the provided set. Returns the default oras FindSuccessors result if no layers are provided. Assumes any image manifest encounters is a base git manifest.
func FindSuccessorsLFS ¶
func FindSuccessorsLFS(lfsLayers []ocispec.Descriptor) func(ctx context.Context, fetcher content.Fetcher, desc ocispec.Descriptor) ([]ocispec.Descriptor, error)
FindSuccessorsLFS limits the LFS layers copied to the provided set. Returns the default oras FindSuccessors result if no layers are provided. Assumes any image manifest encountered is an LFS manifest.
func PostCopyLFS ¶
func PostCopyLFS(fstorePath, destRepoPath string) func(ctx context.Context, desc ocispec.Descriptor) error
PostCopyLFS returns a func for the oras.CopyGraphOptions option PostCopy func. It adds a hardlink from the LFS file in fstorePath to the destRepoPath.
Types ¶
type Config ¶
type Config struct {
Refs References `json:"refs"`
}
Config holds information related to the git repository's references.
type Helper ¶
type Helper struct {
Target oras.GraphTarget
FStore *file.Store
FStorePath string
}
Helper assists in pushing to or fetching from an OCI compliant registry.
type LFSConfig ¶
type LFSConfig struct {
}
LFSConfig holds the oid information contained in the LFS manifest. Currently empty.
type ReferenceInfo ¶
type ReferenceInfo struct {
Commit cmd.Commit `json:"commit"` // commit pointed to by reference
Layer digest.Digest `json:"layer"` // OCI layer, the bundle with the commit
}
ReferenceInfo holds informations about git references stored in bundle layers.
type References ¶
type References struct {
Tags map[string]ReferenceInfo `json:"tags"` // tag reference : (commit, layer)
Heads map[string]ReferenceInfo `json:"heads"` // head reference : (commit, layer)
}
References hold the mappings tag and head refs to tuples of commit and layer digest pairs.