pkg

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCommand

func CreateCommand(
	targetType reflect.Type,
	options *CreateCommandOptions,
) (*cobra.Command, error)

Types

type CreateCommandOptions

type CreateCommandOptions struct {
	// TypeName is the name of the type to generate a command for
	TypeName string
	// CommandName is the name of the command to generate
	// (if empty, we use the type's name converted to kebab-case)
	CommandName string
	// Constructors is a map of functions that return objects of target type
	Constructors map[string]reflect.Value
	// MethodArgs is a map of method names to list of argument names
	MethodArgs map[string][]string
	// MethodDocs is a map of method names to documentation strings
	MethodDocs map[string]string
	// FailOnMissingDocs generator fails if a method has no documentation
	FailOnMissingDocs bool
}

Jump to

Keyboard shortcuts

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