pusher

package
v0.0.0-...-30fe120 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package pusher implements the logic for push operations.

Index

Constants

View Source
const (
	// ConfigLayerName is the name of config layers.
	ConfigLayerName = "config"
	// ArtifactsIndexName is the name of the index containing all manifests.
	ArtifactsIndexName = "index"
)

Variables

View Source
var (
	// ErrInvalidPlatformFormat error when the platform is invalid.
	ErrInvalidPlatformFormat = errors.New("invalid platform format")
	// ErrMismatchFilepathAndPlatform error when the number of filepaths and platforms is not the same.
	ErrMismatchFilepathAndPlatform = errors.New("number of filepaths and platform should be the same")
	// ErrInvalidNumberRulesfiles error when the number of rulesfiles is not the one expected.
	ErrInvalidNumberRulesfiles = errors.New("invalid number of rulesfiles")
	// ErrInvalidDependenciesFormat error when the dependencies are invalid.
	ErrInvalidDependenciesFormat = errors.New("invalid dependency format")
)

Functions

This section is empty.

Types

type Option

type Option func(*opts) error

Option is a functional option for pusher.

func WithDependencies

func WithDependencies(deps ...string) Option

WithDependencies sets the dependencies option.

Dependencies can be expressed in the format "artifact-name:1.0.0" (use "|" to append alternatives, eg. "|alternative-a:1.0.0|alternative-b:1.0.0").

func WithFilepaths

func WithFilepaths(filepaths []string) Option

WithFilepaths sets the filepaths passed at execution time.

func WithFilepathsAndPlatforms

func WithFilepathsAndPlatforms(filepaths, platforms []string) Option

WithFilepathsAndPlatforms sets filepaths and platforms passed at execution time. It also checks that the number of filepaths and platforms is the same.

func WithTags

func WithTags(tags ...string) Option

WithTags sets the tags option.

type Options

type Options []Option

Options is a slice of Option.

type ProgressTracker

type ProgressTracker func(target oras.Target) oras.Target

ProgressTracker type of the tracker that the pusher accepts. It implements the tracker logic.

type Pusher

type Pusher struct {
	Client *auth.Client
	// contains filtered or unexported fields
}

Pusher implements push operations.

func NewPusher

func NewPusher(client *auth.Client, plainHTTP bool, tracker ProgressTracker) *Pusher

NewPusher create a new pusher that can be used for push operations.

func (*Pusher) Push

func (p *Pusher) Push(ctx context.Context, artifactType oci.ArtifactType,
	ref string, options ...Option) (*oci.RegistryResult, error)

Push an artifact to a remote registry.

artifactType can be either a rule or plugin. artifactPath path of the artifact blob on the disk. ref format follows: REGISTRY/REPO[:TAG|@DIGEST]. Ex. localhost:5000/hello:latest.

Jump to

Keyboard shortcuts

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