Documentation ¶
Overview ¶
Package pusher implements the logic for push operations.
Index ¶
Constants ¶
const ( // ConfigLayerName is the name of config layers. ConfigLayerName = "config" // ArtifactsIndexName is the name of the index containing all manifests. ArtifactsIndexName = "index" )
Variables ¶
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 ¶
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 ¶
WithFilepaths sets the filepaths passed at execution time.
func WithFilepathsAndPlatforms ¶
WithFilepathsAndPlatforms sets filepaths and platforms passed at execution time. It also checks that the number of filepaths and platforms is the same.
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 ¶
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.