new

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package used to generate demo command code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdNew

func NewCmdNew(f cmdutil.Factory, ioStreams genericiooptions.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

	genericiooptions.IOStreams
}

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

func NewNewOptions

func NewNewOptions(ioStreams genericiooptions.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