pusher

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 3

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")
	// ErrInvalidNumberAssets error when the number of assets is not the one expected.
	ErrInvalidNumberAssets = errors.New("invalid number of assets")
	// 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 WithAnnotationSource

func WithAnnotationSource(annotationSource string) Option

WithAnnotationSource sets the annotation source option.

func WithArtifactConfig

func WithArtifactConfig(config oci.ArtifactConfig) Option

WithArtifactConfig sets the artifact configuration.

Dependencies and requirements can be set by oci.ArtifactConfig.

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 Pusher

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

Pusher implements push operations.

func NewPusher

func NewPusher(client remote.Client, plainHTTP bool, tracker output.Tracker) *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