api

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SOCIArtifactInstall   = "install"
	SOCIArtifactPubKeyCrt = "pubkeycrt"
	SOCIArtifactSignature = "signature"
)
View Source
const (
	UserAgent = "ocidist/0.0.1 (https://github.com/project-machine/ocidist)"
)

Variables

View Source
var ManifestV2 = specs.Versioned{
	SchemaVersion: 2,
}

Functions

func ImageCopy

func ImageCopy(src, dest string, opts image.ImageCopyOpts) error

func SOCIArtifactType added in v0.0.7

func SOCIArtifactType(product, artifactType string) (string, error)

Types

type OCIAPI

type OCIAPI interface {
	Type() OCIRepoType

	GetRepoTags() ([]string, error)
	GetRepositories() ([]string, error)

	GetRepoTagList() (*dspec.TagList, error)
	GetManifest() (*ispec.Manifest, []byte, error)
	GetImage(*ispec.Descriptor) (*ispec.Image, error)
	GetReferrers(*ispec.Descriptor) (*ispec.Index, error)
	GetBlob(*ispec.Descriptor) ([]byte, error)

	PutBlob(*ispec.Descriptor, []byte) error
	PutManifest(*ispec.Manifest) error
	PutArtifact(artifactName, artifactType string, artifactBlob []byte) error

	ImageName() string
	SourceURL() string
	RepoPath() string
	RepoTag() string
}

func NewOCIAPI

func NewOCIAPI(rawURL string, config *OCIAPIConfig) (OCIAPI, error)

type OCIAPIConfig

type OCIAPIConfig struct {
	TLSVerify bool
	Debug     bool
}

type OCIDirRepo

type OCIDirRepo struct {
	// contains filtered or unexported fields
}

func NewOCIDirRepo

func NewOCIDirRepo(url *url.URL, config *OCIAPIConfig) (*OCIDirRepo, error)

func (*OCIDirRepo) BlobHead added in v0.0.7

func (odr *OCIDirRepo) BlobHead(layer *ispec.Descriptor) error

func (*OCIDirRepo) GetBlob added in v0.0.3

func (odr *OCIDirRepo) GetBlob(layer *ispec.Descriptor) ([]byte, error)

func (*OCIDirRepo) GetImage

func (odr *OCIDirRepo) GetImage(config *ispec.Descriptor) (*ispec.Image, error)

func (*OCIDirRepo) GetManifest

func (odr *OCIDirRepo) GetManifest() (*ispec.Manifest, []byte, error)

func (*OCIDirRepo) GetReferrers added in v0.0.3

func (odr *OCIDirRepo) GetReferrers(image *ispec.Descriptor) (*ispec.Index, error)

func (*OCIDirRepo) GetRepoTagList

func (odr *OCIDirRepo) GetRepoTagList() (*dspec.TagList, error)

func (*OCIDirRepo) GetRepoTags

func (odr *OCIDirRepo) GetRepoTags() ([]string, error)

oci:///path/to/oci/dir

func (*OCIDirRepo) GetRepositories

func (odr *OCIDirRepo) GetRepositories() ([]string, error)

func (*OCIDirRepo) ImageName

func (odr *OCIDirRepo) ImageName() string

func (*OCIDirRepo) OCIDir

func (odr *OCIDirRepo) OCIDir() string

func (*OCIDirRepo) PutArtifact added in v0.0.7

func (odr *OCIDirRepo) PutArtifact(aritfactName, artifactType string, artifactBlob []byte) error

func (*OCIDirRepo) PutBlob added in v0.0.7

func (odr *OCIDirRepo) PutBlob(layer *ispec.Descriptor, blob []byte) error

func (*OCIDirRepo) PutManifest added in v0.0.7

func (odr *OCIDirRepo) PutManifest(manifest *ispec.Manifest) error

func (*OCIDirRepo) RepoPath

func (odr *OCIDirRepo) RepoPath() string

func (*OCIDirRepo) RepoTag

func (odr *OCIDirRepo) RepoTag() string

func (*OCIDirRepo) SourceURL

func (odr *OCIDirRepo) SourceURL() string

func (*OCIDirRepo) Type

func (odr *OCIDirRepo) Type() OCIRepoType

type OCIDistRepo

type OCIDistRepo struct {
	// contains filtered or unexported fields
}

func NewOCIDistRepo

func NewOCIDistRepo(url *url.URL, config *OCIAPIConfig) (*OCIDistRepo, error)

func (*OCIDistRepo) BasePath

func (odr *OCIDistRepo) BasePath() string

func (*OCIDistRepo) BlobHead added in v0.0.7

func (odr *OCIDistRepo) BlobHead(layer *ispec.Descriptor) error

func (*OCIDistRepo) GetBlob added in v0.0.3

func (odr *OCIDistRepo) GetBlob(layer *ispec.Descriptor) ([]byte, error)

func (*OCIDistRepo) GetImage

func (odr *OCIDistRepo) GetImage(image *ispec.Descriptor) (*ispec.Image, error)

func (*OCIDistRepo) GetManifest

func (odr *OCIDistRepo) GetManifest() (*ispec.Manifest, []byte, error)

func (*OCIDistRepo) GetManifestWithDigest added in v0.0.7

func (odr *OCIDistRepo) GetManifestWithDigest() (*ispec.Manifest, []byte, digest.Digest, error)

func (*OCIDistRepo) GetReferrers added in v0.0.3

func (odr *OCIDistRepo) GetReferrers(image *ispec.Descriptor) (*ispec.Index, error)

func (*OCIDistRepo) GetRepoTagList

func (odr *OCIDistRepo) GetRepoTagList() (*dspec.TagList, error)

func (*OCIDistRepo) GetRepoTags

func (odr *OCIDistRepo) GetRepoTags() ([]string, error)

func (*OCIDistRepo) GetRepositories

func (odr *OCIDistRepo) GetRepositories() ([]string, error)

func (*OCIDistRepo) ImageName

func (odr *OCIDistRepo) ImageName() string

func (*OCIDistRepo) ManifestHead added in v0.0.7

func (odr *OCIDistRepo) ManifestHead() error

func (*OCIDistRepo) PutArtifact added in v0.0.7

func (odr *OCIDistRepo) PutArtifact(artifactName, artifactType string, artifactBlob []byte) error

func (*OCIDistRepo) PutBlob added in v0.0.7

func (odr *OCIDistRepo) PutBlob(layer *ispec.Descriptor, blob []byte) error

func (*OCIDistRepo) PutManifest added in v0.0.7

func (odr *OCIDistRepo) PutManifest(manifest *ispec.Manifest) error

func (*OCIDistRepo) RepoPath

func (odr *OCIDistRepo) RepoPath() string

func (*OCIDistRepo) RepoTag

func (odr *OCIDistRepo) RepoTag() string

func (*OCIDistRepo) SourceURL

func (odr *OCIDistRepo) SourceURL() string

func (*OCIDistRepo) Type

func (odr *OCIDistRepo) Type() OCIRepoType

type OCIRepoType

type OCIRepoType string
const (
	OCIDirRepoType  OCIRepoType = "oci"
	OCIDistRepoType OCIRepoType = "ocidist"
)

type SOCIArtifacts added in v0.0.4

type SOCIArtifacts struct {
	Install   string    `json:"install"`
	PubKeyCrt string    `json:"pubkeycrt"`
	Signature Signature `json:"signature"`
}

func NewSOCIArtifacts added in v0.0.7

func NewSOCIArtifacts(install, pubkeycrt, sig []byte) (SOCIArtifacts, error)

func (SOCIArtifacts) SignatureBlob added in v0.0.7

func (sa SOCIArtifacts) SignatureBlob() ([]byte, error)

type SOCIInfo added in v0.0.4

type SOCIInfo struct {
	Ref          string   `json:"ref"`
	Digest       string   `json:"digest"`
	InstallLayer string   `json:"install-layer"`
	Referrers    []string `json:"referrers"`
	Verification string   `json:"verification"`
}

type SOCIRef added in v0.0.4

type SOCIRef struct {
	API       OCIAPI
	Manifest  *ispec.Manifest  `json:"manifest"`
	Digest    digest.Digest    `json:"digest"`
	Install   ispec.Descriptor `json:"install"`
	PubKeyCrt ispec.Descriptor `json:"pubkeycrt"`
	Signature ispec.Descriptor `json:"signature"`
}

func NewSOCIRef added in v0.0.4

func NewSOCIRef(ociApi OCIAPI) (SOCIRef, error)

func (SOCIRef) GetArtifacts added in v0.0.4

func (sref SOCIRef) GetArtifacts() (SOCIArtifacts, error)

func (SOCIRef) GetInstallBlob added in v0.0.4

func (sref SOCIRef) GetInstallBlob() ([]byte, error)

func (SOCIRef) GetPubKeyCrtBlob added in v0.0.4

func (sref SOCIRef) GetPubKeyCrtBlob() ([]byte, error)

func (SOCIRef) GetSignatureBlob added in v0.0.4

func (sref SOCIRef) GetSignatureBlob() ([]byte, error)

func (SOCIRef) Verify added in v0.0.4

func (sref SOCIRef) Verify(caFile string) (bool, string, error)

type Signature added in v0.0.4

type Signature struct {
	Encoding string `json:"encoding"`
	Data     string `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL