meta

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaFlags

type MetaFlags struct {
	Workspace *string

	Backend *string

	WorkDir *string
}

MetaFlags directly reflect the information that CLI is gathering via flags. They will be converted to MetaOptions, 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 NewMetaFlags

func NewMetaFlags() *MetaFlags

NewMetaFlags provides default flags and values for use in other commands.

func (*MetaFlags) AddFlags

func (f *MetaFlags) AddFlags(cmd *cobra.Command)

AddFlags registers flags for a cli.

func (*MetaFlags) ParseBackend added in v0.12.0

func (f *MetaFlags) ParseBackend() (backend.Backend, error)

func (*MetaFlags) ParseWorkspace added in v0.12.0

func (f *MetaFlags) ParseWorkspace(storageBackend backend.Backend) (*v1.Workspace, error)

func (*MetaFlags) ToOptions

func (f *MetaFlags) ToOptions() (*MetaOptions, error)

ToOptions converts MetaFlags to MetaOptions.

type MetaOptions

type MetaOptions struct {
	// RefProject references the project for this CLI invocation.
	RefProject *v1.Project

	// RefStack referenced the stack for this CLI invocation.
	RefStack *v1.Stack

	// RefWorkspace referenced the workspace for this CLI invocation.
	RefWorkspace *v1.Workspace

	// Backend referenced the target storage backend for this CLI invocation.
	Backend backend.Backend
}

MetaOptions are the meta-options that are available on all or most commands.

Jump to

Keyboard shortcuts

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