new

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 12 Imported by: 0

Documentation

Overview

Package new used to generate demo command code. nolint: predeclared

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdNew

func NewCmdNew(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewCmdNew returns new initialized instance of 'new' sub command.

Types

type NewOptions

type NewOptions struct {
	Group  bool
	Outdir string

	// command template options, will render to command template
	CommandName         string
	CommandDescription  string
	CommandFunctionName string
	Dot                 string

	genericclioptions.IOStreams
}

NewOptions is an options struct to support 'new' sub command.

func NewNewOptions

func NewNewOptions(ioStreams genericclioptions.IOStreams) *NewOptions

NewNewOptions returns an initialized NewOptions instance.

func (*NewOptions) Complete

func (o *NewOptions) Complete(cmd *cobra.Command, args []string) error

Complete completes all the required options.

func (*NewOptions) CreateCommand

func (o *NewOptions) CreateCommand() error

CreateCommand create the command with options.

func (*NewOptions) CreateCommandWithSubCommands

func (o *NewOptions) CreateCommandWithSubCommands() error

CreateCommandWithSubCommands create sub commands with options.

func (*NewOptions) GenerateGoCode

func (o *NewOptions) GenerateGoCode(name, codeTemplate string) error

GenerateGoCode generate go source file.

func (*NewOptions) Run

func (o *NewOptions) Run(args []string) error

Run executes a new sub command using the specified options.

func (*NewOptions) Validate

func (o *NewOptions) Validate(cmd *cobra.Command) error

Validate makes sure there is no discrepency in command options.

Jump to

Keyboard shortcuts

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