ui

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeOK int = 0

	ExitCodeUnknownError = 10 + iota
	ExitCodeScaffoldNameMissingError
	ExitCodeScffoldNotFoundError
	ExitCodeFailedToGetScaffoldsError
	ExitCodeFailedToCreatetScaffoldsError

	ExitCodeInvalidArgumentListLengthError = cli.RunResultHelp
)

Exit codes are values representing an exit code for a error type.

Variables

View Source
var (
	// ColorGray represents bold texts in the shell
	ColorGray = ColorAttrs{color.Bold}
	// ColorGreen represents green and bold texts in the shell
	ColorGreen = ColorAttrs{color.FgGreen, color.Bold}
	// ColorBlue represents blue and bold texts in the shell
	ColorBlue = ColorAttrs{color.FgBlue, color.Bold}
	// ColorYellow represents yellow and bold texts in the shell
	ColorYellow = ColorAttrs{color.FgYellow, color.Bold}
	// ColorRed represents red and bold texts in the shell
	ColorRed = ColorAttrs{color.FgRed, color.Bold}
)

Functions

This section is empty.

Types

type ColorAttrs

type ColorAttrs []color.Attribute

ColorAttrs is a shell color attribute set

type MockUI

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

MockUI is a mock of UI interface

func NewMockUI

func NewMockUI(ctrl *gomock.Controller) *MockUI

NewMockUI creates a new mock instance

func (*MockUI) Ask

func (_m *MockUI) Ask(query string) (string, error)

Ask mocks base method

func (*MockUI) EXPECT

func (_m *MockUI) EXPECT() *MockUIMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockUI) Error

func (_m *MockUI) Error(msg string)

Error mocks base method

func (*MockUI) Status

func (_m *MockUI) Status(prefix string, message string, colorAttrs ColorAttrs)

Status mocks base method

type MockUIMockRecorder

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

MockUIMockRecorder is the mock recorder for MockUI

func (*MockUIMockRecorder) Ask

func (_mr *MockUIMockRecorder) Ask(arg0 interface{}) *gomock.Call

Ask indicates an expected call of Ask

func (*MockUIMockRecorder) Error

func (_mr *MockUIMockRecorder) Error(arg0 interface{}) *gomock.Call

Error indicates an expected call of Error

func (*MockUIMockRecorder) Status

func (_mr *MockUIMockRecorder) Status(arg0, arg1, arg2 interface{}) *gomock.Call

Status indicates an expected call of Status

type UI

type UI interface {
	Ask(query string) (string, error)
	Error(msg string)
	Status(prefix, message string, colorAttrs ColorAttrs)
}

UI is an interface for intaracting with the shell

func NewUI

func NewUI(inStream io.Reader, outStream, errStream io.Writer) UI

NewUI creates a new UI instance from streams

Jump to

Keyboard shortcuts

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