orasrpm

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPMConfigType       = "application/vnd.ciq.rpm.package.v1.config+json"
	RPMPackageLayerType = "application/vnd.ciq.rpm.package.v1.rpm"
)
View Source
const (
	RepomdConfigType            = "application/vnd.ciq.rpm.repomd.v1.config+json"
	RepomdXMLLayerType          = "application/vnd.ciq.rpm.repomd.v1.xml"
	RepomdXMLSignatureLayerType = "application/vnd.ciq.rpm.repomd.v1.xml.asc"
	RepomdDataConfigType        = "application/vnd.ciq.rpm.repomd.extra.v1.config+xml"
	RepomdDataLayerTypeFormat   = "application/vnd.ciq.rpm.repomd.extra.v1.%s"
)

Variables

View Source
var ErrNoRPMConfig = errors.New("RPM config not found")

Functions

func DefaultRPMLayerOptions added in v0.0.3

func DefaultRPMLayerOptions(rpmName, arch string) []oras.LayerOption

DefaultRPMLayerOptions returns the default layer options for a RPM package.

func GetRepomdDataLayerType added in v0.0.3

func GetRepomdDataLayerType(dataType string) string

func NewRPMPusher

func NewRPMPusher(path, repo string, opts ...name.Option) (oras.Pusher, error)

NewRPMPuller returns a pusher instance to push a local RPM package.

func NewRPMStreamPusher added in v0.0.20

func NewRPMStreamPusher(stream io.Reader, repo string, opts ...name.Option) (oras.Pusher, string, error)

NewRPMStreamPusher returns a pusher instance to push a RPM package from a stream.

func RPMReferenceLayer added in v0.0.20

func RPMReferenceLayer(r io.Reader, repo string, opts ...name.Option) (name.Reference, []oras.LayerOption, error)

RPMReferenceLayer returns the reference and the layer options for a RPM package.

Types

type GenericRPMMetadata added in v0.0.3

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

GenericRPMMetadata defines a generic RPM repository metadata.

func NewGenericRPMMetadata added in v0.0.3

func NewGenericRPMMetadata(path string, mediatype string, annotations map[string]string) (*GenericRPMMetadata, error)

NewGenericRPMMetadata returns a generic RPM repository metadata.

func (*GenericRPMMetadata) Annotations added in v0.0.3

func (g *GenericRPMMetadata) Annotations() map[string]string

Annotations returns optional annotations associated with the metadata file.

func (*GenericRPMMetadata) Digest added in v0.0.3

func (g *GenericRPMMetadata) Digest() (string, string)

Digest returns the metadata file digest.

func (*GenericRPMMetadata) Mediatype added in v0.0.3

func (g *GenericRPMMetadata) Mediatype() string

Mediatype returns the mediatype for this metadata.

func (*GenericRPMMetadata) Path added in v0.0.3

func (g *GenericRPMMetadata) Path() string

Path returns the metadata file path.

func (*GenericRPMMetadata) Size added in v0.0.3

func (g *GenericRPMMetadata) Size() int64

Size returns the metadata file size.

type RPMMetadata

type RPMMetadata interface {
	Path() string
	Digest() (string, string)
	Size() int64
	Mediatype() string
	Annotations() map[string]string
}

type RPMMetadataLayer

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

RPMMetadataLayer defines an OCI layer descriptor associated to RPM repository metadatas.

func NewRPMMetadataLayer

func NewRPMMetadataLayer(repomd RPMMetadata) *RPMMetadataLayer

NewRPMMetadataLayer returns an OCI layer descriptor for the corresponding RPM metadata.

func (*RPMMetadataLayer) Annotations

func (l *RPMMetadataLayer) Annotations() map[string]string

Annotations returns annotations associated to this layer.

func (*RPMMetadataLayer) Compressed

func (l *RPMMetadataLayer) Compressed() (io.ReadCloser, error)

Compressed returns an io.ReadCloser for the RPM file content.

func (*RPMMetadataLayer) DiffID

func (l *RPMMetadataLayer) DiffID() (v1.Hash, error)

DiffID returns the Hash of the uncompressed layer (not supported by ORAS).

func (*RPMMetadataLayer) Digest

func (l *RPMMetadataLayer) Digest() (v1.Hash, error)

Digest returns the Hash of the RPM package.

func (*RPMMetadataLayer) MediaType

func (l *RPMMetadataLayer) MediaType() (types.MediaType, error)

MediaType returns the media type of the Layer.

func (*RPMMetadataLayer) Platform

func (l *RPMMetadataLayer) Platform() *v1.Platform

Platform returns platform information for this layer.

func (*RPMMetadataLayer) Size

func (l *RPMMetadataLayer) Size() (int64, error)

Size returns the size of the RPM file.

func (*RPMMetadataLayer) Uncompressed

func (l *RPMMetadataLayer) Uncompressed() (io.ReadCloser, error)

Uncompressed returns an io.ReadCloser for the uncompressed layer contents (not supported by ORAS).

type RPMMetadataPusher

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

RPMMetadataPusher type to push RPM metadata to registry.

func NewRPMExtraMetadataPusher added in v0.0.3

func NewRPMExtraMetadataPusher(path, repo, dataType string, opts ...name.Option) (*RPMMetadataPusher, error)

func NewRPMMetadataPusher

func NewRPMMetadataPusher(ref name.Reference, configMediatype types.MediaType, layers ...oras.Layer) *RPMMetadataPusher

func (*RPMMetadataPusher) Image

func (rp *RPMMetadataPusher) Image() (v1.Image, error)

func (*RPMMetadataPusher) ImageIndex

func (rp *RPMMetadataPusher) ImageIndex() (v1.ImageIndex, error)

func (*RPMMetadataPusher) Reference

func (rp *RPMMetadataPusher) Reference() name.Reference

type RPMPuller

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

RPMPuller type to pull RPM package from registry.

func NewRPMPuller

func NewRPMPuller(ref name.Reference, writer io.Writer) *RPMPuller

NewRPMPuller returns a puller instance to pull RPM package from the reference and write image content to the writer.

func (*RPMPuller) Config

func (rp *RPMPuller) Config(config v1.Descriptor) error

Config validates the config mediatype.

func (*RPMPuller) IndexManifest

func (rp *RPMPuller) IndexManifest(index *v1.IndexManifest) *v1.Hash

IndexManifest returns the manifest digest corresponding to the current architecture.

func (*RPMPuller) Layers

func (rp *RPMPuller) Layers(layers []v1.Layer) error

Layers copy layers to the pull writer.

func (*RPMPuller) RawConfig

func (rp *RPMPuller) RawConfig(_ []byte) error

RawConfig sets the raw config, ignored for RPM.

func (*RPMPuller) Reference

func (rp *RPMPuller) Reference() name.Reference

Reference returns the reference for the puller.

Jump to

Keyboard shortcuts

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