generate

package
v0.11.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdGenerate

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

NewCmdGenerate creates the `generate` command.

Types

type GenerateFlags

type GenerateFlags struct {
	WorkDir   string
	Backend   string
	Workspace string

	genericiooptions.IOStreams
}

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

func NewGenerateFlags(streams genericiooptions.IOStreams) *GenerateFlags

NewGenerateFlags returns a default GenerateFlags

func (*GenerateFlags) AddFlags

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

AddFlags registers flags for a cli.

func (*GenerateFlags) ToOptions

func (flags *GenerateFlags) ToOptions() (*GenerateOptions, error)

ToOptions converts from CLI inputs to runtime inputs.

type GenerateOptions

type GenerateOptions struct {
	WorkDir string

	Project   *v1.Project
	Stack     *v1.Stack
	Workspace *v1.Workspace

	SpecStorage spec.Storage
	Generator   generator.Generator
}

GenerateOptions defines flags and other configuration parameters for the `generate` command.

func (*GenerateOptions) Run

func (o *GenerateOptions) Run() error

Run executes the `generate` command.

func (*GenerateOptions) Validate

func (o *GenerateOptions) Validate(cmd *cobra.Command, args []string) error

Validate verifies if GenerateOptions are valid and without conflicts.

Directories

Path Synopsis
run

Jump to

Keyboard shortcuts

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