Documentation
¶
Index ¶
- Constants
- func PullFileFromRegistry(ctx context.Context, workdir string, dst io.Writer, sourceURL string, ...) error
- func PushFilesToRegistry(ctx context.Context, workDir string, artifact *Artifact, targetURL string, ...) error
- type Artifact
- type Option
- type Platform
- type PullOption
- type PullOptions
- type PushOption
- type PushOptions
Constants ¶
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 ¶
WithPassword returns a Option that sets the password.
func WithUsername ¶
WithUsername returns a Option that sets the username.
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.