oci

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MediaTypePipedPlugin is the media type for PipeCD Agent plugins.
	MediaTypePipedPlugin = "application/vnd.pipecd.piped.plugin"
	// ArtifactTypePipedPlugin is the artifact type for PipeCD Agent plugins.
	ArtifactTypePipedPlugin = "application/vnd.pipecd.piped.plugin+type"
)

Variables

This section is empty.

Functions

func PullFileFromRegistry

func PullFileFromRegistry(ctx context.Context, workdir string, dst io.Writer, sourceURL string, opts ...PullOption) error

PullFileFromRegistry pulls a file from an OCI registry and writes it to the provided destination writer. It supports options for insecure connections and platform/media type targeting.

func PushFilesToRegistry

func PushFilesToRegistry(ctx context.Context, workDir string, artifact *Artifact, targetURL string, opts ...PushOption) error

PushFilesToRegistry pushes files described by the artifact to the target OCI registry URL. It supports options for insecure connections.

Types

type Artifact

type Artifact struct {
	// MediaType is the media type of the artifact.
	// e.g. "application/vnd.pipecd.piped.plugin"
	MediaType string
	// ArtifactType is the type of the artifact.
	// e.g. "application/vnd.pipecd.piped.plugin+type"
	ArtifactType string
	// FilePaths maps platforms to file paths.
	FilePaths map[Platform]string
}

Artifact describes an artifact to be pushed to an OCI registry.

type Option

type Option interface {
	PushOption
	PullOption
}

Option is an interface that combines PushOption and PullOption.

func WithInsecure

func WithInsecure() Option

WithInsecure returns an Option that enables insecure connections.

func WithPassword

func WithPassword(password string) Option

WithPassword returns a Option that sets the password.

func WithUsername

func WithUsername(username string) Option

WithUsername returns a Option that sets the username.

type Platform

type Platform struct {
	OS   string
	Arch string
}

Platform represents an OS/Arch platform for an OCI artifact.

type PullOption

type PullOption interface {
	// contains filtered or unexported methods
}

PullOption is an interface for applying pull options.

func WithArtifactType

func WithArtifactType(artifactType string) PullOption

WithArtifactType returns a PullOption that sets the artifact type.

func WithMediaType

func WithMediaType(mediaType string) PullOption

WithMediaType returns a PullOption that sets the media type.

func WithTargetArch

func WithTargetArch(arch string) PullOption

WithTargetArch returns a PullOption that sets the target architecture.

func WithTargetOS

func WithTargetOS(os string) PullOption

WithTargetOS returns a PullOption that sets the target OS.

type PullOptions

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

PullOptions holds options for pulling from an OCI registry.

type PushOption

type PushOption interface {
	// contains filtered or unexported methods
}

PushOption is an interface for applying push options.

type PushOptions

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

PushOptions holds options for pushing to an OCI registry.

Jump to

Keyboard shortcuts

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