fligen

package
v0.0.0-...-c5655c4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2017 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator defines attributes need to generate go code from the yaml file

func NewGenerator

func NewGenerator(pkg string) *Generator

NewGenerator returns a cligen.Generator object used to translate yaml file into gocode for CLI

func (*Generator) Format

func (g *Generator) Format() []byte

Format the go code in Generator 'buf'

func (*Generator) Generate

func (g *Generator) Generate()

Generate the gocode for cobra commands read from yaml into Generator 'ctree'

func (*Generator) ProcessCommand

func (g *Generator) ProcessCommand(prefix string, c *command, tmpl string)

ProcessCommand uses templates to generates the cobra command that is generated from the yaml file. This is a recursive method.

func (*Generator) Unmarshal

func (g *Generator) Unmarshal(filepath string)

Unmarshal the yaml file to generate slice of command with flags into Generator 'ctree'

func (*Generator) WriteOut

func (g *Generator) WriteOut(file string)

WriteOut the go code into a go file

Jump to

Keyboard shortcuts

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