bottle

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 42 Imported by: 0

Documentation

Overview

Package bottle defines bottle command and subcommand actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GUIURLPath

func GUIURLPath(pth string) string

GUIURLPath returns the path used to store the connection URL to the last started bottle edit GUI HACK for the unit test.

func LoadAndUpgradeBottle

func LoadAndUpgradeBottle(ctx context.Context, cfg *v1alpha1.Configuration, path string) (*bottle.Bottle, error)

LoadAndUpgradeBottle loads a bottle from the provided path, and checks if it needs to be updated using the migration system.

func OpenFileInEditor

func OpenFileInEditor(ctx context.Context, editor string, filename string) error

OpenFileInEditor opens the specified file in the environment's default editor, or the config.DefaultEditor for user modification.

Types

type Action

type Action struct {
	*actions.DataTool

	Dir string // Bottle directory
}

Action represents a general bottle action.

type Annotate

type Annotate struct {
	*Action
}

Annotate represents the bottle annotate action.

func (*Annotate) Run

func (action *Annotate) Run(ctx context.Context, annotations []string, out io.Writer) error

Run runs the bottle annotate action.

type AnnotateList

type AnnotateList struct {
	*Action

	Telemetry actions.TelemetryOptions

	Selectors []string // Selectors for parts to retrieve
	Parts     []string // Titles of parts to retrieve
	Artifacts []string // Filter by public artifact type
	Insecure  bool     // Enables insecure communication with a registry if https fails with http response
	Empty     bool     // Only annotatelist metadata from the bottle
}

AnnotateList represents the bottle annotate list action.

func (*AnnotateList) Run

func (action *AnnotateList) Run(ctx context.Context, out io.Writer) error

Run runs the bottle annotate list action.

type ArtifactList

type ArtifactList struct {
	*Action
}

ArtifactList represents the bottle artifact list action.

func (*ArtifactList) Run

func (action *ArtifactList) Run(ctx context.Context, out io.Writer) error

Run runs the bottle artifact list action.

type ArtifactRemove

type ArtifactRemove struct {
	*Action
}

ArtifactRemove represents the bottle artifact remove action.

func (*ArtifactRemove) Run

func (action *ArtifactRemove) Run(ctx context.Context, artifactPath string, out io.Writer) error

Run runs the bottle artifact remove action.

type ArtifactSet

type ArtifactSet struct {
	*Action

	MediaType string // Artifact's media type
}

ArtifactSet represents the bottle artifact set action.

func (*ArtifactSet) Run

func (action *ArtifactSet) Run(ctx context.Context, artName, artPath string, out io.Writer) error

Run runs the bottle artifact set action.

type AuthorAdd

type AuthorAdd struct {
	*Action
}

AuthorAdd represents the bottle author add action.

func (*AuthorAdd) Run

func (action *AuthorAdd) Run(ctx context.Context, authorName, authorEmail, authorURL string, out io.Writer) error

Run runs the bottle author add action.

type AuthorList

type AuthorList struct {
	*Action
}

AuthorList represents the bottle author list action.

func (*AuthorList) Run

func (action *AuthorList) Run(ctx context.Context, out io.Writer) error

Run runs the bottle author list action.

type AuthorRemove

type AuthorRemove struct {
	*Action
}

AuthorRemove represents the bottle author remove action.

func (*AuthorRemove) Run

func (action *AuthorRemove) Run(ctx context.Context, authorName string, out io.Writer) error

Run runs the bottle author remove action.

type Commit

type Commit struct {
	*Action

	Compression CompressionLevelOptions
	NoDeprecate bool // Don't deprecate existing bottle
}

Commit represents the bottle commit action.

func (*Commit) Run

func (action *Commit) Run(ctx context.Context) error

Run runs the bottle commit action.

type CompressionLevelOptions

type CompressionLevelOptions struct {
	Level string // change the compression level of compressed bottle parts
}

CompressionLevelOptions defines options for bottle part Compression Levels.

type Delete

type Delete struct {
	*Action
	Ref string
}

Delete represents the bottle delete action.

func (*Delete) Run

func (action *Delete) Run(ctx context.Context) error

Run runs the bottle delete action.

type Describe

type Describe struct {
	*Action

	File string // File with description text to add to a bottle
}

Describe represents the bottle describe action.

func (*Describe) Run

func (action *Describe) Run(ctx context.Context, description string, out io.Writer) error

Run runs the bottle describe action.

type Edit

type Edit struct {
	*Action
}

Edit represents the bottle edit action.

func (*Edit) Run

func (action *Edit) Run(ctx context.Context, out io.Writer) error

Run runs the bottle edit action.

type GUI

type GUI struct {
	*Action

	Listen         string
	DisableBrowser bool
}

GUI represents the bottle gui action.

func (*GUI) Run

func (action *GUI) Run(ctx context.Context, out io.Writer) error

Run displays the bottle edit gui in a web browser and returns after the updated bottle data has been posted to the web server.

type Init

type Init struct {
	*Action

	Force bool // Recreate the initialization metadata even if it already exists
}

Init represents the init action.

func (*Init) Run

func (action *Init) Run(ctx context.Context, out io.Writer) error

Run runs the bottle init action.

type Label

type Label struct {
	*Action
}

Label represents the bottle label action.

func (*Label) Run

func (action *Label) Run(ctx context.Context, labels []string, out io.Writer) error

Run runs the bottle label action.

type LabelList

type LabelList struct {
	*Action
}

LabelList represents the bottle label list action.

func (*LabelList) Run

func (action *LabelList) Run(ctx context.Context, out io.Writer) error

Run runs the bottle label list action.

type MetricAdd

type MetricAdd struct {
	*Action

	Description string // Description of metric
}

MetricAdd represents the bottle metric add action.

func (*MetricAdd) Run

func (action *MetricAdd) Run(ctx context.Context, metricName, metricValue string, out io.Writer) error

Run runs the bottle metric add action.

type MetricList

type MetricList struct {
	*Action
}

MetricList represents the bottle metric list action.

func (*MetricList) Run

func (action *MetricList) Run(ctx context.Context, out io.Writer) error

Run runs the bottle metric list action.

type MetricRemove

type MetricRemove struct {
	*Action
}

MetricRemove represents the bottle metric remove action.

func (*MetricRemove) Run

func (action *MetricRemove) Run(ctx context.Context, metricName string, out io.Writer) error

Run runs the bottle metric remove action.

type PartLabel

type PartLabel struct {
	*Action
}

PartLabel represents the bottle part label action.

func (*PartLabel) Run

func (action *PartLabel) Run(ctx context.Context, partPaths []string, labels []string, out io.Writer) error

Run runs the bottle part label action.

type PartList

type PartList struct {
	*Action

	WithDigest bool // Show parts information with digest
}

PartList represents the bottle part list action.

func (*PartList) Run

func (action *PartList) Run(ctx context.Context, out io.Writer) error

Run runs the bottle part list action.

type Pull

type Pull struct {
	*Action

	Telemetry    actions.TelemetryOptions
	PartSelector bottle.PartSelectorOptions
}

Pull represents the bottle pull action.

func (*Pull) Run

func (action *Pull) Run(ctx context.Context, bottleRef string) error

Run runs the bottle pull action.

type Push

type Push struct {
	*Action

	Telemetry   actions.TelemetryOptions
	Compression CompressionLevelOptions

	NoOverwrite bool // Only push data if if doesn't already exist
	NoDeprecate bool // Don't deprecate existing bottle

	Ref string
}

Push represents the bottle push action.

func (*Push) Run

func (action *Push) Run(ctx context.Context) error

Run runs the bottle push action.

type Show

type Show struct {
	*Action

	PartSelector bottle.PartSelectorOptions
	Ref          string
}

Show represents the bottle show action.

func (*Show) Run

func (action *Show) Run(ctx context.Context, out io.Writer) error

Run runs the bottle show action.

type Sign

type Sign struct {
	*Action

	// DigestAlg    string
	KeyPath      string
	KeyAPI       string
	UserIdentity string
	KeyID        string

	NoDeprecate bool // Don't deprecate existing bottle when committing.
}

Sign represents a manifest digest sign action.

func (*Sign) Run

func (action *Sign) Run(ctx context.Context, keyAlias string) error

Run runs the bottle verify action.

type SourceAdd

type SourceAdd struct {
	*Action

	// BottleForURI is true when the srcURI should be interpreted as a bottle directory (to extract the bottle ID from)
	BottleForURI bool
	// ReferenceForURI is true when the srcURI should be interpreted as a bottle reference
	ReferenceForURI bool
}

SourceAdd represents the bottle source add action.

func (*SourceAdd) Run

func (action *SourceAdd) Run(ctx context.Context, srcName, srcURI string, out io.Writer) error

Run runs the bottle source add action.

type SourceList

type SourceList struct {
	*Action
}

SourceList represents the bottle source list action.

func (*SourceList) Run

func (action *SourceList) Run(ctx context.Context, out io.Writer) error

Run runs the bottle source list action.

type SourceRemove

type SourceRemove struct {
	*Action
}

SourceRemove represents the bottle source remove action.

func (*SourceRemove) Run

func (action *SourceRemove) Run(ctx context.Context, srcName string, out io.Writer) error

Run runs the bottle source remove action.

type Status

type Status struct {
	*Action

	// Show file paths within subdirectories for changed files
	Details bool
}

Status represents the bottle status action.

func (*Status) Run

func (action *Status) Run(ctx context.Context, out io.Writer) error

Run runs the bottle status action.

type Verify

type Verify struct {
	*Action

	// DigestAlg   string
	Telemetry actions.TelemetryOptions
}

Verify is the action structure.

func (*Verify) Run

func (action *Verify) Run(ctx context.Context, args ...string) error

Run runs the bottle verify action.

Jump to

Keyboard shortcuts

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