controller

package
v0.0.0-...-194d0c4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2018 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownCommand   = errors.New("unknown command")
	ErrArgumentRequired = errors.New("argument required")
	ErrUnknownTarget    = errors.New("unknown target")
)
View Source
var DefaultCLIReader io.Reader = os.Stdin
View Source
var DefaultREPLUI = newREPLUI("")

DefaultREPLUI is used for e2e testing

View Source
var (
	ErrProtoFileRequired = errors.New("least one proto file required")
)

Functions

This section is empty.

Types

type BaseUI

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

func NewBasicUI

func NewBasicUI() *BaseUI

func (*BaseUI) ErrPrintln

func (u *BaseUI) ErrPrintln(a interface{})

func (*BaseUI) ErrWriter

func (u *BaseUI) ErrWriter() io.Writer

func (*BaseUI) InfoPrintln

func (u *BaseUI) InfoPrintln(a interface{})

func (*BaseUI) Println

func (u *BaseUI) Println(a interface{})

func (*BaseUI) Writer

func (u *BaseUI) Writer() io.Writer

type CLI

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

func NewCLI

func NewCLI(name, version string, ui UI) *CLI

NewCLI instantiate CLI interface. if Evans is used as REPL mode, its UI is created by newREPLUI() in runAsREPL. if CLI mode, its ui is same as passed ui.

func (*CLI) Error

func (c *CLI) Error(err error)

func (*CLI) Run

func (c *CLI) Run(args []string) int

func (*CLI) Usage

func (c *CLI) Usage()

func (*CLI) Version

func (c *CLI) Version()

type ColoredREPLUI

type ColoredREPLUI struct {
	*REPLUI
}

func (*ColoredREPLUI) ErrPrintln

func (u *ColoredREPLUI) ErrPrintln(a interface{})

func (*ColoredREPLUI) InfoPrintln

func (u *ColoredREPLUI) InfoPrintln(a interface{})

type ColoredUI

type ColoredUI struct {
	UI
}

func (*ColoredUI) ErrPrintln

func (u *ColoredUI) ErrPrintln(a interface{})

func (*ColoredUI) InfoPrintln

func (u *ColoredUI) InfoPrintln(a interface{})

type Commander

type Commander interface {
	Help() string
	Synopsis() string
	Validate(args []string) error
	Run(args []string) (io.Reader, error)
}

type REPL

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

func NewREPL

func NewREPL(config *config.REPL, env entity.Environment, ui UI, inputPort port.InputPort) *REPL

func (*REPL) Start

func (r *REPL) Start() error

type REPLUI

type REPLUI struct {
	UI
	// contains filtered or unexported fields
}

func (*REPLUI) ErrPrintln

func (u *REPLUI) ErrPrintln(a interface{})

func (*REPLUI) InfoPrintln

func (u *REPLUI) InfoPrintln(a interface{})

func (*REPLUI) Println

func (u *REPLUI) Println(a interface{})

type Runnable

type Runnable interface {
	Run(args []string) int
}

type UI

type UI interface {
	Println(a interface{})
	InfoPrintln(a interface{})
	ErrPrintln(a interface{})

	Writer() io.Writer
	ErrWriter() io.Writer
}

func NewUI

func NewUI(r io.Reader, w, ew io.Writer) UI

Jump to

Keyboard shortcuts

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