templater

package
v0.0.0-...-0657d2b Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateContent

func GenerateContent(data Root) ([]byte, error)

GenerateContext executes templates over data to generate cli code

Types

type App

type App struct {
	Name      string
	Version   bool
	Copyright string
	Usage     string
	Flags     []Flag
	// Action is the service method to call
	// if empty, calling the command will display the helper
	Action                 string
	EnableBashCompletion   bool
	UseShortOptionHandling bool
	Commands               []Command
}

type Command

type Command struct {
	Name  string
	Usage string
	Flags []Flag
	// Action is the service method to call
	// if empty, calling the command will display the helper
	Action      string
	SubCommands []Command
}

type Exit

type Exit struct {
	VarName string
	Message string
	Code    int
}

type Flag

type Flag struct {
	Name    string
	Value   string
	Type    string
	Usage   string
	Aliases []string
	EnvVars []string
}

type Root

type Root struct {
	PackageName string
	Methods     []string
	Version     string
	VersionFlag Flag
	App         App
	Exits       []Exit
}

Jump to

Keyboard shortcuts

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