Documentation
¶
Index ¶
- func BinName() string
- func FormatExampleCommands(command string, examples []Example) (res string)
- func GetTableWriter() table.Writer
- func Long(in string) string
- func StreamOutput(wg *sync.WaitGroup, input io.Reader, output io.Writer)
- func Verbosef(verbose bool, format string, args ...interface{})
- func Verboseln(verbose bool, output ...interface{})
- type Example
- type Exec
- type HttpServer
- type MockExec
- type MockExec_ExecuteCommand_Call
- func (_c *MockExec_ExecuteCommand_Call) Return(n int, err error) *MockExec_ExecuteCommand_Call
- func (_c *MockExec_ExecuteCommand_Call) Run(run func(ctx context.Context, cmdArgs []string)) *MockExec_ExecuteCommand_Call
- func (_c *MockExec_ExecuteCommand_Call) RunAndReturn(run func(ctx context.Context, cmdArgs []string) (int, error)) *MockExec_ExecuteCommand_Call
- type MockExec_Expecter
- type MockHttpServer
- func (_m *MockHttpServer) EXPECT() *MockHttpServer_Expecter
- func (_mock *MockHttpServer) Handle(pattern string, handler http.Handler)
- func (_mock *MockHttpServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (_mock *MockHttpServer) ListenAndServe(addr string, handler http.Handler) error
- func (_mock *MockHttpServer) Redirect(w http.ResponseWriter, r *http.Request, url string, code int)
- type MockHttpServer_Expecter
- func (_e *MockHttpServer_Expecter) Handle(pattern interface{}, handler interface{}) *MockHttpServer_Handle_Call
- func (_e *MockHttpServer_Expecter) HandleFunc(pattern interface{}, handler interface{}) *MockHttpServer_HandleFunc_Call
- func (_e *MockHttpServer_Expecter) ListenAndServe(addr interface{}, handler interface{}) *MockHttpServer_ListenAndServe_Call
- func (_e *MockHttpServer_Expecter) Redirect(w interface{}, r interface{}, url interface{}, code interface{}) *MockHttpServer_Redirect_Call
- type MockHttpServer_HandleFunc_Call
- func (_c *MockHttpServer_HandleFunc_Call) Return() *MockHttpServer_HandleFunc_Call
- func (_c *MockHttpServer_HandleFunc_Call) Run(run func(pattern string, handler func(http.ResponseWriter, *http.Request))) *MockHttpServer_HandleFunc_Call
- func (_c *MockHttpServer_HandleFunc_Call) RunAndReturn(run func(pattern string, handler func(http.ResponseWriter, *http.Request))) *MockHttpServer_HandleFunc_Call
- type MockHttpServer_Handle_Call
- func (_c *MockHttpServer_Handle_Call) Return() *MockHttpServer_Handle_Call
- func (_c *MockHttpServer_Handle_Call) Run(run func(pattern string, handler http.Handler)) *MockHttpServer_Handle_Call
- func (_c *MockHttpServer_Handle_Call) RunAndReturn(run func(pattern string, handler http.Handler)) *MockHttpServer_Handle_Call
- type MockHttpServer_ListenAndServe_Call
- func (_c *MockHttpServer_ListenAndServe_Call) Return(err error) *MockHttpServer_ListenAndServe_Call
- func (_c *MockHttpServer_ListenAndServe_Call) Run(run func(addr string, handler http.Handler)) *MockHttpServer_ListenAndServe_Call
- func (_c *MockHttpServer_ListenAndServe_Call) RunAndReturn(run func(addr string, handler http.Handler) error) *MockHttpServer_ListenAndServe_Call
- type MockHttpServer_Redirect_Call
- func (_c *MockHttpServer_Redirect_Call) Return() *MockHttpServer_Redirect_Call
- func (_c *MockHttpServer_Redirect_Call) Run(run func(w http.ResponseWriter, r *http.Request, url string, code int)) *MockHttpServer_Redirect_Call
- func (_c *MockHttpServer_Redirect_Call) RunAndReturn(run func(w http.ResponseWriter, r *http.Request, url string, code int)) *MockHttpServer_Redirect_Call
- type Prompt
- type RealExec
- type RealHttpServer
- func (*RealHttpServer) Handle(pattern string, handler http.Handler)
- func (*RealHttpServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (*RealHttpServer) ListenAndServe(addr string, handler http.Handler) error
- func (*RealHttpServer) Redirect(w http.ResponseWriter, r *http.Request, url string, code int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatExampleCommands ¶
func GetTableWriter ¶
func Long ¶
Remove tabs to allow formatted multi-line descriptions in Code without cluttering the help output
func StreamOutput ¶ added in v0.9.0
Types ¶
type HttpServer ¶ added in v0.9.0
type MockExec ¶ added in v0.9.0
MockExec is an autogenerated mock type for the Exec type
func NewMockExec ¶ added in v0.9.0
NewMockExec creates a new instance of MockExec. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockExec) EXPECT ¶ added in v0.9.0
func (_m *MockExec) EXPECT() *MockExec_Expecter
type MockExec_ExecuteCommand_Call ¶ added in v0.9.0
MockExec_ExecuteCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCommand'
func (*MockExec_ExecuteCommand_Call) Return ¶ added in v0.9.0
func (_c *MockExec_ExecuteCommand_Call) Return(n int, err error) *MockExec_ExecuteCommand_Call
func (*MockExec_ExecuteCommand_Call) Run ¶ added in v0.9.0
func (_c *MockExec_ExecuteCommand_Call) Run(run func(ctx context.Context, cmdArgs []string)) *MockExec_ExecuteCommand_Call
func (*MockExec_ExecuteCommand_Call) RunAndReturn ¶ added in v0.9.0
func (_c *MockExec_ExecuteCommand_Call) RunAndReturn(run func(ctx context.Context, cmdArgs []string) (int, error)) *MockExec_ExecuteCommand_Call
type MockExec_Expecter ¶ added in v0.9.0
type MockExec_Expecter struct {
// contains filtered or unexported fields
}
func (*MockExec_Expecter) ExecuteCommand ¶ added in v0.9.0
func (_e *MockExec_Expecter) ExecuteCommand(ctx interface{}, cmdArgs interface{}) *MockExec_ExecuteCommand_Call
ExecuteCommand is a helper method to define mock.On call
- ctx
- cmdArgs
type MockHttpServer ¶ added in v0.9.0
MockHttpServer is an autogenerated mock type for the HttpServer type
func NewMockHttpServer ¶ added in v0.9.0
func NewMockHttpServer(t interface {
mock.TestingT
Cleanup(func())
}) *MockHttpServer
NewMockHttpServer creates a new instance of MockHttpServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockHttpServer) EXPECT ¶ added in v0.9.0
func (_m *MockHttpServer) EXPECT() *MockHttpServer_Expecter
func (*MockHttpServer) Handle ¶ added in v0.9.0
func (_mock *MockHttpServer) Handle(pattern string, handler http.Handler)
Handle provides a mock function for the type MockHttpServer
func (*MockHttpServer) HandleFunc ¶ added in v0.9.0
func (_mock *MockHttpServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
HandleFunc provides a mock function for the type MockHttpServer
func (*MockHttpServer) ListenAndServe ¶ added in v0.9.0
func (_mock *MockHttpServer) ListenAndServe(addr string, handler http.Handler) error
ListenAndServe provides a mock function for the type MockHttpServer
func (*MockHttpServer) Redirect ¶ added in v0.9.0
func (_mock *MockHttpServer) Redirect(w http.ResponseWriter, r *http.Request, url string, code int)
Redirect provides a mock function for the type MockHttpServer
type MockHttpServer_Expecter ¶ added in v0.9.0
type MockHttpServer_Expecter struct {
// contains filtered or unexported fields
}
func (*MockHttpServer_Expecter) Handle ¶ added in v0.9.0
func (_e *MockHttpServer_Expecter) Handle(pattern interface{}, handler interface{}) *MockHttpServer_Handle_Call
Handle is a helper method to define mock.On call
- pattern
- handler
func (*MockHttpServer_Expecter) HandleFunc ¶ added in v0.9.0
func (_e *MockHttpServer_Expecter) HandleFunc(pattern interface{}, handler interface{}) *MockHttpServer_HandleFunc_Call
HandleFunc is a helper method to define mock.On call
- pattern
- handler
func (*MockHttpServer_Expecter) ListenAndServe ¶ added in v0.9.0
func (_e *MockHttpServer_Expecter) ListenAndServe(addr interface{}, handler interface{}) *MockHttpServer_ListenAndServe_Call
ListenAndServe is a helper method to define mock.On call
- addr
- handler
func (*MockHttpServer_Expecter) Redirect ¶ added in v0.9.0
func (_e *MockHttpServer_Expecter) Redirect(w interface{}, r interface{}, url interface{}, code interface{}) *MockHttpServer_Redirect_Call
Redirect is a helper method to define mock.On call
- w
- r
- url
- code
type MockHttpServer_HandleFunc_Call ¶ added in v0.9.0
MockHttpServer_HandleFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleFunc'
func (*MockHttpServer_HandleFunc_Call) Return ¶ added in v0.9.0
func (_c *MockHttpServer_HandleFunc_Call) Return() *MockHttpServer_HandleFunc_Call
func (*MockHttpServer_HandleFunc_Call) Run ¶ added in v0.9.0
func (_c *MockHttpServer_HandleFunc_Call) Run(run func(pattern string, handler func(http.ResponseWriter, *http.Request))) *MockHttpServer_HandleFunc_Call
func (*MockHttpServer_HandleFunc_Call) RunAndReturn ¶ added in v0.9.0
func (_c *MockHttpServer_HandleFunc_Call) RunAndReturn(run func(pattern string, handler func(http.ResponseWriter, *http.Request))) *MockHttpServer_HandleFunc_Call
type MockHttpServer_Handle_Call ¶ added in v0.9.0
MockHttpServer_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle'
func (*MockHttpServer_Handle_Call) Return ¶ added in v0.9.0
func (_c *MockHttpServer_Handle_Call) Return() *MockHttpServer_Handle_Call
func (*MockHttpServer_Handle_Call) Run ¶ added in v0.9.0
func (_c *MockHttpServer_Handle_Call) Run(run func(pattern string, handler http.Handler)) *MockHttpServer_Handle_Call
func (*MockHttpServer_Handle_Call) RunAndReturn ¶ added in v0.9.0
func (_c *MockHttpServer_Handle_Call) RunAndReturn(run func(pattern string, handler http.Handler)) *MockHttpServer_Handle_Call
type MockHttpServer_ListenAndServe_Call ¶ added in v0.9.0
MockHttpServer_ListenAndServe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListenAndServe'
func (*MockHttpServer_ListenAndServe_Call) Return ¶ added in v0.9.0
func (_c *MockHttpServer_ListenAndServe_Call) Return(err error) *MockHttpServer_ListenAndServe_Call
func (*MockHttpServer_ListenAndServe_Call) Run ¶ added in v0.9.0
func (_c *MockHttpServer_ListenAndServe_Call) Run(run func(addr string, handler http.Handler)) *MockHttpServer_ListenAndServe_Call
func (*MockHttpServer_ListenAndServe_Call) RunAndReturn ¶ added in v0.9.0
func (_c *MockHttpServer_ListenAndServe_Call) RunAndReturn(run func(addr string, handler http.Handler) error) *MockHttpServer_ListenAndServe_Call
type MockHttpServer_Redirect_Call ¶ added in v0.9.0
MockHttpServer_Redirect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Redirect'
func (*MockHttpServer_Redirect_Call) Return ¶ added in v0.9.0
func (_c *MockHttpServer_Redirect_Call) Return() *MockHttpServer_Redirect_Call
func (*MockHttpServer_Redirect_Call) Run ¶ added in v0.9.0
func (_c *MockHttpServer_Redirect_Call) Run(run func(w http.ResponseWriter, r *http.Request, url string, code int)) *MockHttpServer_Redirect_Call
func (*MockHttpServer_Redirect_Call) RunAndReturn ¶ added in v0.9.0
func (_c *MockHttpServer_Redirect_Call) RunAndReturn(run func(w http.ResponseWriter, r *http.Request, url string, code int)) *MockHttpServer_Redirect_Call
type Prompt ¶
type Prompt struct{}
func (*Prompt) InputPrompt ¶
Prompt for non-empty user input from STDIN
type RealHttpServer ¶ added in v0.9.0
type RealHttpServer struct{}
func (*RealHttpServer) Handle ¶ added in v0.9.0
func (*RealHttpServer) Handle(pattern string, handler http.Handler)
func (*RealHttpServer) HandleFunc ¶ added in v0.9.0
func (*RealHttpServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
func (*RealHttpServer) ListenAndServe ¶ added in v0.9.0
func (*RealHttpServer) ListenAndServe(addr string, handler http.Handler) error
func (*RealHttpServer) Redirect ¶ added in v0.9.0
func (*RealHttpServer) Redirect(w http.ResponseWriter, r *http.Request, url string, code int)