gorg

package
v0.0.0-...-0f94b86 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCommand

func RegisterCommand(name string, cmd Command)

RegisterCommand adds command to the global Commands map

func Usage

func Usage(w io.Writer) error

Usage writes gin-rest-generator usage message to w

Types

type BaseCommand

type BaseCommand struct {
	Flags *flag.FlagSet
	Short string
	Usage string
	Help  string
}

BaseCommand implements Command interface

func (BaseCommand) FlagSet

func (b BaseCommand) FlagSet() *flag.FlagSet

FlagSet implements Command

func (BaseCommand) HelpMessage

func (b BaseCommand) HelpMessage(w io.Writer) error

HelpMessage implements Command

func (BaseCommand) ShortDescription

func (b BaseCommand) ShortDescription() string

ShortDescription implements Command

func (BaseCommand) UsageLine

func (b BaseCommand) UsageLine() string

UsageLine implements Command

type Command

type Command interface {
	//FlagSet returns command specific flag set. If command doesn't have any flags nil should be returned.
	FlagSet() *flag.FlagSet

	//Run runs command
	Run(args []string, stdout io.Writer) error

	//Description returns short description of a command that is shown in the help message
	ShortDescription() string

	UsageLine() string
	HelpMessage(w io.Writer) error
}

Command interface represents gorg subcommand

func GetCommand

func GetCommand(name string) Command

GetCommand returns command from the global Commands map

type CommandLineError

type CommandLineError string

CommandLineError is returned from the commands when invalid command line parameters are passed

func (CommandLineError) Error

func (e CommandLineError) Error() string

type GenerateCommand

type GenerateCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

GenerateCommand implements Command interface

func NewGenerateCommand

func NewGenerateCommand(l remoteTemplateLoader) *GenerateCommand

NewGenerateCommand creates GenerateCommand

func (*GenerateCommand) Run

func (gc *GenerateCommand) Run(args []string, stdout io.Writer) error

Run implements Command interface

type TemplateCommand

type TemplateCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

TemplateCommand implements Command interface

func NewTemplateCommand

func NewTemplateCommand(loader remoteTemplateLoader) *TemplateCommand

NewTemplateCommand creates TemplateCommand

func (*TemplateCommand) Run

func (gc *TemplateCommand) Run(args []string, w io.Writer) error

Run implements Command interface

Jump to

Keyboard shortcuts

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