mod

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const LatestVersion = "latest"

LatestVersion is the tag name that denotes the latest stable version of a module.

Variables

This section is empty.

Functions

func NewCmdInit

func NewCmdInit() *cobra.Command

NewCmdInit returns an initialized Command instance for the 'mod init' sub command

func NewCmdMod

func NewCmdMod(streams genericclioptions.IOStreams) *cobra.Command

NewCmdMod returns an initialized Command instance for 'mod' sub command

func NewCmdPush

func NewCmdPush(ioStreams genericiooptions.IOStreams) *cobra.Command

NewCmdPush returns an initialized Command instance for the 'mod push' sub command.

Types

type InitOptions

type InitOptions struct {
	Name        string
	Path        string
	TemplateURL string
}

func (*InitOptions) Run

func (o *InitOptions) Run() error

func (*InitOptions) Validate

func (o *InitOptions) Validate(args []string) error

type PushModFlags

type PushModFlags struct {
	Latest           bool
	OSArch           string
	Annotations      []string
	Credentials      string
	Sign             string
	CosignKey        string
	InsecureRegistry bool

	genericiooptions.IOStreams
}

PushModFlags directly reflect the information that CLI is gathering via flags. They will be converted to PushModOptions, which reflect the runtime requirements for the command.

This structure reduces the transformation to wiring and makes the logic itself easy to unit test.

func NewPushModFlags

func NewPushModFlags(ioStreams genericiooptions.IOStreams) *PushModFlags

NewPushModFlags returns a default PushModFlags.

func (*PushModFlags) AddFlags

func (flags *PushModFlags) AddFlags(cmd *cobra.Command)

AddFlags registers flags for a cli.

func (*PushModFlags) ToOptions

func (flags *PushModFlags) ToOptions(args []string, ioStreams genericiooptions.IOStreams) (*PushModOptions, error)

ToOptions converts from CLI inputs to runtime inputs.

type PushModOptions

type PushModOptions struct {
	ModulePath string
	OCIUrl     string
	Latest     bool
	OSArch     string
	Name       string
	Version    string
	Sign       string
	CosignKey  string

	Client   *ociclient.Client
	Metadata metadata.Metadata

	genericiooptions.IOStreams
}

PushModOptions is a set of options that allows you to push module. This is the object reflects the runtime needs of a `mod push` command, making the logic itself easy to unit test.

func (*PushModOptions) Run

func (o *PushModOptions) Run() error

Run executes the `mod push` command.

func (*PushModOptions) Validate

func (o *PushModOptions) Validate() error

Validate verifies if PushModOptions are valid and without conflicts.

Jump to

Keyboard shortcuts

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