Documentation
¶
Index ¶
- Constants
- Variables
- type CLI
- type CommandFactory
- type ConnectionHandler
- type Editor
- type Executer
- type ExecutionContext
- type Formater
- type Key
- type KeyEvent
- type Message
- type MessageType
- type MockCommandFactory
- type MockCommandFactory_Create_Call
- func (_c *MockCommandFactory_Create_Call) Return(_a0 Executer, _a1 error) *MockCommandFactory_Create_Call
- func (_c *MockCommandFactory_Create_Call) Run(run func(raw string)) *MockCommandFactory_Create_Call
- func (_c *MockCommandFactory_Create_Call) RunAndReturn(run func(string) (Executer, error)) *MockCommandFactory_Create_Call
- type MockCommandFactory_Expecter
- type MockConnectionHandler
- type MockConnectionHandler_Expecter
- func (_e *MockConnectionHandler_Expecter) Ping(ctx interface{}) *MockConnectionHandler_Ping_Call
- func (_e *MockConnectionHandler_Expecter) Send(ctx interface{}, msg interface{}) *MockConnectionHandler_Send_Call
- func (_e *MockConnectionHandler_Expecter) SetOnMessage(_a0 interface{}) *MockConnectionHandler_SetOnMessage_Call
- type MockConnectionHandler_Ping_Call
- func (_c *MockConnectionHandler_Ping_Call) Return(_a0 error) *MockConnectionHandler_Ping_Call
- func (_c *MockConnectionHandler_Ping_Call) Run(run func(ctx context.Context)) *MockConnectionHandler_Ping_Call
- func (_c *MockConnectionHandler_Ping_Call) RunAndReturn(run func(context.Context) error) *MockConnectionHandler_Ping_Call
- type MockConnectionHandler_Send_Call
- func (_c *MockConnectionHandler_Send_Call) Return(_a0 error) *MockConnectionHandler_Send_Call
- func (_c *MockConnectionHandler_Send_Call) Run(run func(ctx context.Context, msg string)) *MockConnectionHandler_Send_Call
- func (_c *MockConnectionHandler_Send_Call) RunAndReturn(run func(context.Context, string) error) *MockConnectionHandler_Send_Call
- type MockConnectionHandler_SetOnMessage_Call
- func (_c *MockConnectionHandler_SetOnMessage_Call) Return() *MockConnectionHandler_SetOnMessage_Call
- func (_c *MockConnectionHandler_SetOnMessage_Call) Run(run func(_a0 func(context.Context, []byte))) *MockConnectionHandler_SetOnMessage_Call
- func (_c *MockConnectionHandler_SetOnMessage_Call) RunAndReturn(run func(func(context.Context, []byte))) *MockConnectionHandler_SetOnMessage_Call
- type MockEditor
- type MockEditor_CommandMode_Call
- func (_c *MockEditor_CommandMode_Call) Return(_a0 string, _a1 error) *MockEditor_CommandMode_Call
- func (_c *MockEditor_CommandMode_Call) Run(run func(ctx context.Context, initBuffer string)) *MockEditor_CommandMode_Call
- func (_c *MockEditor_CommandMode_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockEditor_CommandMode_Call
- type MockEditor_Edit_Call
- func (_c *MockEditor_Edit_Call) Return(_a0 string, _a1 error) *MockEditor_Edit_Call
- func (_c *MockEditor_Edit_Call) Run(run func(ctx context.Context, initBuffer string)) *MockEditor_Edit_Call
- func (_c *MockEditor_Edit_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockEditor_Edit_Call
- type MockEditor_Expecter
- type MockEditor_SetInput_Call
- type MockExecuter
- type MockExecuter_Execute_Call
- func (_c *MockExecuter_Execute_Call) Return(_a0 Executer, _a1 error) *MockExecuter_Execute_Call
- func (_c *MockExecuter_Execute_Call) Run(run func(_a0 ExecutionContext)) *MockExecuter_Execute_Call
- func (_c *MockExecuter_Execute_Call) RunAndReturn(run func(ExecutionContext) (Executer, error)) *MockExecuter_Execute_Call
- type MockExecuter_Expecter
- type MockExecutionContext
- func (_m *MockExecutionContext) CommandMode(initBuffer string) (string, error)
- func (_m *MockExecutionContext) CreateCommand(raw string) (Executer, error)
- func (_m *MockExecutionContext) EXPECT() *MockExecutionContext_Expecter
- func (_m *MockExecutionContext) EditorMode(initBuffer string) (string, error)
- func (_m *MockExecutionContext) FormatMessage(msg Message, noColor bool) (string, error)
- func (_m *MockExecutionContext) Ping() error
- func (_m *MockExecutionContext) Print(data string, attr ...color.Attribute) error
- func (_m *MockExecutionContext) PrintToFile(data string) error
- func (_m *MockExecutionContext) SendRequest(req string) error
- func (_m *MockExecutionContext) WaitForResponse(timeout time.Duration) (Message, error)
- type MockExecutionContext_CommandMode_Call
- func (_c *MockExecutionContext_CommandMode_Call) Return(_a0 string, _a1 error) *MockExecutionContext_CommandMode_Call
- func (_c *MockExecutionContext_CommandMode_Call) Run(run func(initBuffer string)) *MockExecutionContext_CommandMode_Call
- func (_c *MockExecutionContext_CommandMode_Call) RunAndReturn(run func(string) (string, error)) *MockExecutionContext_CommandMode_Call
- type MockExecutionContext_CreateCommand_Call
- func (_c *MockExecutionContext_CreateCommand_Call) Return(_a0 Executer, _a1 error) *MockExecutionContext_CreateCommand_Call
- func (_c *MockExecutionContext_CreateCommand_Call) Run(run func(raw string)) *MockExecutionContext_CreateCommand_Call
- func (_c *MockExecutionContext_CreateCommand_Call) RunAndReturn(run func(string) (Executer, error)) *MockExecutionContext_CreateCommand_Call
- type MockExecutionContext_EditorMode_Call
- func (_c *MockExecutionContext_EditorMode_Call) Return(_a0 string, _a1 error) *MockExecutionContext_EditorMode_Call
- func (_c *MockExecutionContext_EditorMode_Call) Run(run func(initBuffer string)) *MockExecutionContext_EditorMode_Call
- func (_c *MockExecutionContext_EditorMode_Call) RunAndReturn(run func(string) (string, error)) *MockExecutionContext_EditorMode_Call
- type MockExecutionContext_Expecter
- func (_e *MockExecutionContext_Expecter) CommandMode(initBuffer interface{}) *MockExecutionContext_CommandMode_Call
- func (_e *MockExecutionContext_Expecter) CreateCommand(raw interface{}) *MockExecutionContext_CreateCommand_Call
- func (_e *MockExecutionContext_Expecter) EditorMode(initBuffer interface{}) *MockExecutionContext_EditorMode_Call
- func (_e *MockExecutionContext_Expecter) FormatMessage(msg interface{}, noColor interface{}) *MockExecutionContext_FormatMessage_Call
- func (_e *MockExecutionContext_Expecter) Ping() *MockExecutionContext_Ping_Call
- func (_e *MockExecutionContext_Expecter) Print(data interface{}, attr ...interface{}) *MockExecutionContext_Print_Call
- func (_e *MockExecutionContext_Expecter) PrintToFile(data interface{}) *MockExecutionContext_PrintToFile_Call
- func (_e *MockExecutionContext_Expecter) SendRequest(req interface{}) *MockExecutionContext_SendRequest_Call
- func (_e *MockExecutionContext_Expecter) WaitForResponse(timeout interface{}) *MockExecutionContext_WaitForResponse_Call
- type MockExecutionContext_FormatMessage_Call
- func (_c *MockExecutionContext_FormatMessage_Call) Return(_a0 string, _a1 error) *MockExecutionContext_FormatMessage_Call
- func (_c *MockExecutionContext_FormatMessage_Call) Run(run func(msg Message, noColor bool)) *MockExecutionContext_FormatMessage_Call
- func (_c *MockExecutionContext_FormatMessage_Call) RunAndReturn(run func(Message, bool) (string, error)) *MockExecutionContext_FormatMessage_Call
- type MockExecutionContext_Ping_Call
- type MockExecutionContext_PrintToFile_Call
- func (_c *MockExecutionContext_PrintToFile_Call) Return(_a0 error) *MockExecutionContext_PrintToFile_Call
- func (_c *MockExecutionContext_PrintToFile_Call) Run(run func(data string)) *MockExecutionContext_PrintToFile_Call
- func (_c *MockExecutionContext_PrintToFile_Call) RunAndReturn(run func(string) error) *MockExecutionContext_PrintToFile_Call
- type MockExecutionContext_Print_Call
- func (_c *MockExecutionContext_Print_Call) Return(_a0 error) *MockExecutionContext_Print_Call
- func (_c *MockExecutionContext_Print_Call) Run(run func(data string, attr ...color.Attribute)) *MockExecutionContext_Print_Call
- func (_c *MockExecutionContext_Print_Call) RunAndReturn(run func(string, ...color.Attribute) error) *MockExecutionContext_Print_Call
- type MockExecutionContext_SendRequest_Call
- func (_c *MockExecutionContext_SendRequest_Call) Return(_a0 error) *MockExecutionContext_SendRequest_Call
- func (_c *MockExecutionContext_SendRequest_Call) Run(run func(req string)) *MockExecutionContext_SendRequest_Call
- func (_c *MockExecutionContext_SendRequest_Call) RunAndReturn(run func(string) error) *MockExecutionContext_SendRequest_Call
- type MockExecutionContext_WaitForResponse_Call
- func (_c *MockExecutionContext_WaitForResponse_Call) Return(_a0 Message, _a1 error) *MockExecutionContext_WaitForResponse_Call
- func (_c *MockExecutionContext_WaitForResponse_Call) Run(run func(timeout time.Duration)) *MockExecutionContext_WaitForResponse_Call
- func (_c *MockExecutionContext_WaitForResponse_Call) RunAndReturn(run func(time.Duration) (Message, error)) *MockExecutionContext_WaitForResponse_Call
- type MockFormater
- type MockFormater_Expecter
- type MockFormater_FormatForFile_Call
- func (_c *MockFormater_FormatForFile_Call) Return(_a0 string, _a1 error) *MockFormater_FormatForFile_Call
- func (_c *MockFormater_FormatForFile_Call) Run(run func(msgType string, msgData string)) *MockFormater_FormatForFile_Call
- func (_c *MockFormater_FormatForFile_Call) RunAndReturn(run func(string, string) (string, error)) *MockFormater_FormatForFile_Call
- type MockFormater_FormatMessage_Call
- func (_c *MockFormater_FormatMessage_Call) Return(_a0 string, _a1 error) *MockFormater_FormatMessage_Call
- func (_c *MockFormater_FormatMessage_Call) Run(run func(msgType string, msgData string)) *MockFormater_FormatMessage_Call
- func (_c *MockFormater_FormatMessage_Call) RunAndReturn(run func(string, string) (string, error)) *MockFormater_FormatMessage_Call
- type RunOptions
Constants ¶
const ( CommandsLimit = 100 HideCursor = "\x1b[?25l" ShowCursor = "\x1b[?25h" ClearTerminal = "\u001B[H\u001B[2J" WelcomMessage = "Use Enter to input request and send it, Ctrl+C to exit" )
Variables ¶
var ErrInterrupted = fmt.Errorf("interrupted")
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
func NewCLI ¶
func NewCLI(cmdFactory CommandFactory, wsConn ConnectionHandler, output io.Writer, editor Editor, formater Formater) *CLI
NewCLI creates a new CLI instance with the given wsConn, input, and output. It returns an error if it fails to get the current user, create the necessary directories, load the macro for the domain, or initialize the CLI instance.
func (*CLI) OnKeyEvent ¶
type CommandFactory ¶
type ConnectionHandler ¶
type Executer ¶
type Executer interface {
Execute(ExecutionContext) (Executer, error)
}
type ExecutionContext ¶
type ExecutionContext interface {
Print(data string, attr ...color.Attribute) error
PrintToFile(data string) error
FormatMessage(msg Message, noColor bool) (string, error)
SendRequest(req string) error
WaitForResponse(timeout time.Duration) (Message, error)
EditorMode(initBuffer string) (string, error)
CommandMode(initBuffer string) (string, error)
CreateCommand(raw string) (Executer, error)
Ping() error
}
type Key ¶
type Key uint16
const ( KeyEsc Key = 27 KeyCtrlC Key = 3 KeyCtrlD Key = 4 KeyEnter Key = 13 KeyCtrlS Key = 19 KeyCtrlU Key = 21 KeySpace Key = 32 KeyAltBackspace Key = 23 KeyBackspace Key = 8 MacBackspace2 Key = 127 KeyDelete Key = 65522 KeyArrowLeft Key = 65515 KeyArrowRight Key = 65514 KeyArrowUp Key = 65517 KeyArrowDown Key = 65516 KeyTab Key = 9 KeyHome Key = 65505 KeyEnd Key = 65507 KeyCtrlL Key = 12 )
type Message ¶
type Message struct {
Data string `json:"data"`
Type MessageType `json:"type"`
}
type MessageType ¶
type MessageType uint8
const ( Request MessageType = iota Response )
func (MessageType) String ¶
func (mt MessageType) String() string
type MockCommandFactory ¶
MockCommandFactory is an autogenerated mock type for the CommandFactory type
func NewMockCommandFactory ¶
func NewMockCommandFactory(t interface {
mock.TestingT
Cleanup(func())
}) *MockCommandFactory
NewMockCommandFactory creates a new instance of MockCommandFactory. 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 (*MockCommandFactory) Create ¶
func (_m *MockCommandFactory) Create(raw string) (Executer, error)
Create provides a mock function with given fields: raw
func (*MockCommandFactory) EXPECT ¶
func (_m *MockCommandFactory) EXPECT() *MockCommandFactory_Expecter
type MockCommandFactory_Create_Call ¶
MockCommandFactory_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
func (*MockCommandFactory_Create_Call) Return ¶
func (_c *MockCommandFactory_Create_Call) Return(_a0 Executer, _a1 error) *MockCommandFactory_Create_Call
func (*MockCommandFactory_Create_Call) Run ¶
func (_c *MockCommandFactory_Create_Call) Run(run func(raw string)) *MockCommandFactory_Create_Call
func (*MockCommandFactory_Create_Call) RunAndReturn ¶
func (_c *MockCommandFactory_Create_Call) RunAndReturn(run func(string) (Executer, error)) *MockCommandFactory_Create_Call
type MockCommandFactory_Expecter ¶
type MockCommandFactory_Expecter struct {
// contains filtered or unexported fields
}
func (*MockCommandFactory_Expecter) Create ¶
func (_e *MockCommandFactory_Expecter) Create(raw interface{}) *MockCommandFactory_Create_Call
Create is a helper method to define mock.On call
- raw string
type MockConnectionHandler ¶
MockConnectionHandler is an autogenerated mock type for the ConnectionHandler type
func NewMockConnectionHandler ¶
func NewMockConnectionHandler(t interface {
mock.TestingT
Cleanup(func())
}) *MockConnectionHandler
NewMockConnectionHandler creates a new instance of MockConnectionHandler. 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 (*MockConnectionHandler) EXPECT ¶
func (_m *MockConnectionHandler) EXPECT() *MockConnectionHandler_Expecter
func (*MockConnectionHandler) Ping ¶ added in v0.7.3
func (_m *MockConnectionHandler) Ping(ctx context.Context) error
Ping provides a mock function with given fields: ctx
func (*MockConnectionHandler) Send ¶
func (_m *MockConnectionHandler) Send(ctx context.Context, msg string) error
Send provides a mock function with given fields: ctx, msg
func (*MockConnectionHandler) SetOnMessage ¶
func (_m *MockConnectionHandler) SetOnMessage(_a0 func(context.Context, []byte))
SetOnMessage provides a mock function with given fields: _a0
type MockConnectionHandler_Expecter ¶
type MockConnectionHandler_Expecter struct {
// contains filtered or unexported fields
}
func (*MockConnectionHandler_Expecter) Ping ¶ added in v0.7.3
func (_e *MockConnectionHandler_Expecter) Ping(ctx interface{}) *MockConnectionHandler_Ping_Call
Ping is a helper method to define mock.On call
- ctx context.Context
func (*MockConnectionHandler_Expecter) Send ¶
func (_e *MockConnectionHandler_Expecter) Send(ctx interface{}, msg interface{}) *MockConnectionHandler_Send_Call
Send is a helper method to define mock.On call
- ctx context.Context
- msg string
func (*MockConnectionHandler_Expecter) SetOnMessage ¶
func (_e *MockConnectionHandler_Expecter) SetOnMessage(_a0 interface{}) *MockConnectionHandler_SetOnMessage_Call
SetOnMessage is a helper method to define mock.On call
- _a0 func(context.Context , []byte)
type MockConnectionHandler_Ping_Call ¶ added in v0.7.3
MockConnectionHandler_Ping_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ping'
func (*MockConnectionHandler_Ping_Call) Return ¶ added in v0.7.3
func (_c *MockConnectionHandler_Ping_Call) Return(_a0 error) *MockConnectionHandler_Ping_Call
func (*MockConnectionHandler_Ping_Call) Run ¶ added in v0.7.3
func (_c *MockConnectionHandler_Ping_Call) Run(run func(ctx context.Context)) *MockConnectionHandler_Ping_Call
func (*MockConnectionHandler_Ping_Call) RunAndReturn ¶ added in v0.7.3
func (_c *MockConnectionHandler_Ping_Call) RunAndReturn(run func(context.Context) error) *MockConnectionHandler_Ping_Call
type MockConnectionHandler_Send_Call ¶
MockConnectionHandler_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send'
func (*MockConnectionHandler_Send_Call) Return ¶
func (_c *MockConnectionHandler_Send_Call) Return(_a0 error) *MockConnectionHandler_Send_Call
func (*MockConnectionHandler_Send_Call) Run ¶
func (_c *MockConnectionHandler_Send_Call) Run(run func(ctx context.Context, msg string)) *MockConnectionHandler_Send_Call
func (*MockConnectionHandler_Send_Call) RunAndReturn ¶
func (_c *MockConnectionHandler_Send_Call) RunAndReturn(run func(context.Context, string) error) *MockConnectionHandler_Send_Call
type MockConnectionHandler_SetOnMessage_Call ¶
MockConnectionHandler_SetOnMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOnMessage'
func (*MockConnectionHandler_SetOnMessage_Call) Return ¶
func (_c *MockConnectionHandler_SetOnMessage_Call) Return() *MockConnectionHandler_SetOnMessage_Call
func (*MockConnectionHandler_SetOnMessage_Call) Run ¶
func (_c *MockConnectionHandler_SetOnMessage_Call) Run(run func(_a0 func(context.Context, []byte))) *MockConnectionHandler_SetOnMessage_Call
func (*MockConnectionHandler_SetOnMessage_Call) RunAndReturn ¶
func (_c *MockConnectionHandler_SetOnMessage_Call) RunAndReturn(run func(func(context.Context, []byte))) *MockConnectionHandler_SetOnMessage_Call
type MockEditor ¶
MockEditor is an autogenerated mock type for the Editor type
func NewMockEditor ¶
func NewMockEditor(t interface {
mock.TestingT
Cleanup(func())
}) *MockEditor
NewMockEditor creates a new instance of MockEditor. 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 (*MockEditor) CommandMode ¶
CommandMode provides a mock function with given fields: ctx, initBuffer
func (*MockEditor) EXPECT ¶
func (_m *MockEditor) EXPECT() *MockEditor_Expecter
func (*MockEditor) SetInput ¶
func (_m *MockEditor) SetInput(input <-chan KeyEvent)
SetInput provides a mock function with given fields: input
type MockEditor_CommandMode_Call ¶
MockEditor_CommandMode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CommandMode'
func (*MockEditor_CommandMode_Call) Return ¶
func (_c *MockEditor_CommandMode_Call) Return(_a0 string, _a1 error) *MockEditor_CommandMode_Call
func (*MockEditor_CommandMode_Call) Run ¶
func (_c *MockEditor_CommandMode_Call) Run(run func(ctx context.Context, initBuffer string)) *MockEditor_CommandMode_Call
func (*MockEditor_CommandMode_Call) RunAndReturn ¶
func (_c *MockEditor_CommandMode_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockEditor_CommandMode_Call
type MockEditor_Edit_Call ¶
MockEditor_Edit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Edit'
func (*MockEditor_Edit_Call) Return ¶
func (_c *MockEditor_Edit_Call) Return(_a0 string, _a1 error) *MockEditor_Edit_Call
func (*MockEditor_Edit_Call) Run ¶
func (_c *MockEditor_Edit_Call) Run(run func(ctx context.Context, initBuffer string)) *MockEditor_Edit_Call
func (*MockEditor_Edit_Call) RunAndReturn ¶
func (_c *MockEditor_Edit_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockEditor_Edit_Call
type MockEditor_Expecter ¶
type MockEditor_Expecter struct {
// contains filtered or unexported fields
}
func (*MockEditor_Expecter) CommandMode ¶
func (_e *MockEditor_Expecter) CommandMode(ctx interface{}, initBuffer interface{}) *MockEditor_CommandMode_Call
CommandMode is a helper method to define mock.On call
- ctx context.Context
- initBuffer string
func (*MockEditor_Expecter) Edit ¶
func (_e *MockEditor_Expecter) Edit(ctx interface{}, initBuffer interface{}) *MockEditor_Edit_Call
Edit is a helper method to define mock.On call
- ctx context.Context
- initBuffer string
func (*MockEditor_Expecter) SetInput ¶
func (_e *MockEditor_Expecter) SetInput(input interface{}) *MockEditor_SetInput_Call
SetInput is a helper method to define mock.On call
- input <-chan KeyEvent
type MockEditor_SetInput_Call ¶
MockEditor_SetInput_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetInput'
func (*MockEditor_SetInput_Call) Return ¶
func (_c *MockEditor_SetInput_Call) Return() *MockEditor_SetInput_Call
func (*MockEditor_SetInput_Call) Run ¶
func (_c *MockEditor_SetInput_Call) Run(run func(input <-chan KeyEvent)) *MockEditor_SetInput_Call
func (*MockEditor_SetInput_Call) RunAndReturn ¶
func (_c *MockEditor_SetInput_Call) RunAndReturn(run func(<-chan KeyEvent)) *MockEditor_SetInput_Call
type MockExecuter ¶
MockExecuter is an autogenerated mock type for the Executer type
func NewMockExecuter ¶
func NewMockExecuter(t interface {
mock.TestingT
Cleanup(func())
}) *MockExecuter
NewMockExecuter creates a new instance of MockExecuter. 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 (*MockExecuter) EXPECT ¶
func (_m *MockExecuter) EXPECT() *MockExecuter_Expecter
func (*MockExecuter) Execute ¶
func (_m *MockExecuter) Execute(_a0 ExecutionContext) (Executer, error)
Execute provides a mock function with given fields: _a0
type MockExecuter_Execute_Call ¶
MockExecuter_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
func (*MockExecuter_Execute_Call) Return ¶
func (_c *MockExecuter_Execute_Call) Return(_a0 Executer, _a1 error) *MockExecuter_Execute_Call
func (*MockExecuter_Execute_Call) Run ¶
func (_c *MockExecuter_Execute_Call) Run(run func(_a0 ExecutionContext)) *MockExecuter_Execute_Call
func (*MockExecuter_Execute_Call) RunAndReturn ¶
func (_c *MockExecuter_Execute_Call) RunAndReturn(run func(ExecutionContext) (Executer, error)) *MockExecuter_Execute_Call
type MockExecuter_Expecter ¶
type MockExecuter_Expecter struct {
// contains filtered or unexported fields
}
func (*MockExecuter_Expecter) Execute ¶
func (_e *MockExecuter_Expecter) Execute(_a0 interface{}) *MockExecuter_Execute_Call
Execute is a helper method to define mock.On call
- _a0 ExecutionContext
type MockExecutionContext ¶
MockExecutionContext is an autogenerated mock type for the ExecutionContext type
func NewMockExecutionContext ¶
func NewMockExecutionContext(t interface {
mock.TestingT
Cleanup(func())
}) *MockExecutionContext
NewMockExecutionContext creates a new instance of MockExecutionContext. 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 (*MockExecutionContext) CommandMode ¶
func (_m *MockExecutionContext) CommandMode(initBuffer string) (string, error)
CommandMode provides a mock function with given fields: initBuffer
func (*MockExecutionContext) CreateCommand ¶
func (_m *MockExecutionContext) CreateCommand(raw string) (Executer, error)
CreateCommand provides a mock function with given fields: raw
func (*MockExecutionContext) EXPECT ¶
func (_m *MockExecutionContext) EXPECT() *MockExecutionContext_Expecter
func (*MockExecutionContext) EditorMode ¶
func (_m *MockExecutionContext) EditorMode(initBuffer string) (string, error)
EditorMode provides a mock function with given fields: initBuffer
func (*MockExecutionContext) FormatMessage ¶
func (_m *MockExecutionContext) FormatMessage(msg Message, noColor bool) (string, error)
FormatMessage provides a mock function with given fields: msg, noColor
func (*MockExecutionContext) Ping ¶ added in v0.7.3
func (_m *MockExecutionContext) Ping() error
Ping provides a mock function with no fields
func (*MockExecutionContext) Print ¶
func (_m *MockExecutionContext) Print(data string, attr ...color.Attribute) error
Print provides a mock function with given fields: data, attr
func (*MockExecutionContext) PrintToFile ¶
func (_m *MockExecutionContext) PrintToFile(data string) error
PrintToFile provides a mock function with given fields: data
func (*MockExecutionContext) SendRequest ¶
func (_m *MockExecutionContext) SendRequest(req string) error
SendRequest provides a mock function with given fields: req
func (*MockExecutionContext) WaitForResponse ¶
func (_m *MockExecutionContext) WaitForResponse(timeout time.Duration) (Message, error)
WaitForResponse provides a mock function with given fields: timeout
type MockExecutionContext_CommandMode_Call ¶
MockExecutionContext_CommandMode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CommandMode'
func (*MockExecutionContext_CommandMode_Call) Return ¶
func (_c *MockExecutionContext_CommandMode_Call) Return(_a0 string, _a1 error) *MockExecutionContext_CommandMode_Call
func (*MockExecutionContext_CommandMode_Call) Run ¶
func (_c *MockExecutionContext_CommandMode_Call) Run(run func(initBuffer string)) *MockExecutionContext_CommandMode_Call
func (*MockExecutionContext_CommandMode_Call) RunAndReturn ¶
func (_c *MockExecutionContext_CommandMode_Call) RunAndReturn(run func(string) (string, error)) *MockExecutionContext_CommandMode_Call
type MockExecutionContext_CreateCommand_Call ¶
MockExecutionContext_CreateCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateCommand'
func (*MockExecutionContext_CreateCommand_Call) Return ¶
func (_c *MockExecutionContext_CreateCommand_Call) Return(_a0 Executer, _a1 error) *MockExecutionContext_CreateCommand_Call
func (*MockExecutionContext_CreateCommand_Call) Run ¶
func (_c *MockExecutionContext_CreateCommand_Call) Run(run func(raw string)) *MockExecutionContext_CreateCommand_Call
func (*MockExecutionContext_CreateCommand_Call) RunAndReturn ¶
func (_c *MockExecutionContext_CreateCommand_Call) RunAndReturn(run func(string) (Executer, error)) *MockExecutionContext_CreateCommand_Call
type MockExecutionContext_EditorMode_Call ¶
MockExecutionContext_EditorMode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EditorMode'
func (*MockExecutionContext_EditorMode_Call) Return ¶
func (_c *MockExecutionContext_EditorMode_Call) Return(_a0 string, _a1 error) *MockExecutionContext_EditorMode_Call
func (*MockExecutionContext_EditorMode_Call) Run ¶
func (_c *MockExecutionContext_EditorMode_Call) Run(run func(initBuffer string)) *MockExecutionContext_EditorMode_Call
func (*MockExecutionContext_EditorMode_Call) RunAndReturn ¶
func (_c *MockExecutionContext_EditorMode_Call) RunAndReturn(run func(string) (string, error)) *MockExecutionContext_EditorMode_Call
type MockExecutionContext_Expecter ¶
type MockExecutionContext_Expecter struct {
// contains filtered or unexported fields
}
func (*MockExecutionContext_Expecter) CommandMode ¶
func (_e *MockExecutionContext_Expecter) CommandMode(initBuffer interface{}) *MockExecutionContext_CommandMode_Call
CommandMode is a helper method to define mock.On call
- initBuffer string
func (*MockExecutionContext_Expecter) CreateCommand ¶
func (_e *MockExecutionContext_Expecter) CreateCommand(raw interface{}) *MockExecutionContext_CreateCommand_Call
CreateCommand is a helper method to define mock.On call
- raw string
func (*MockExecutionContext_Expecter) EditorMode ¶
func (_e *MockExecutionContext_Expecter) EditorMode(initBuffer interface{}) *MockExecutionContext_EditorMode_Call
EditorMode is a helper method to define mock.On call
- initBuffer string
func (*MockExecutionContext_Expecter) FormatMessage ¶
func (_e *MockExecutionContext_Expecter) FormatMessage(msg interface{}, noColor interface{}) *MockExecutionContext_FormatMessage_Call
FormatMessage is a helper method to define mock.On call
- msg Message
- noColor bool
func (*MockExecutionContext_Expecter) Ping ¶ added in v0.7.3
func (_e *MockExecutionContext_Expecter) Ping() *MockExecutionContext_Ping_Call
Ping is a helper method to define mock.On call
func (*MockExecutionContext_Expecter) Print ¶
func (_e *MockExecutionContext_Expecter) Print(data interface{}, attr ...interface{}) *MockExecutionContext_Print_Call
Print is a helper method to define mock.On call
- data string
- attr ...color.Attribute
func (*MockExecutionContext_Expecter) PrintToFile ¶
func (_e *MockExecutionContext_Expecter) PrintToFile(data interface{}) *MockExecutionContext_PrintToFile_Call
PrintToFile is a helper method to define mock.On call
- data string
func (*MockExecutionContext_Expecter) SendRequest ¶
func (_e *MockExecutionContext_Expecter) SendRequest(req interface{}) *MockExecutionContext_SendRequest_Call
SendRequest is a helper method to define mock.On call
- req string
func (*MockExecutionContext_Expecter) WaitForResponse ¶
func (_e *MockExecutionContext_Expecter) WaitForResponse(timeout interface{}) *MockExecutionContext_WaitForResponse_Call
WaitForResponse is a helper method to define mock.On call
- timeout time.Duration
type MockExecutionContext_FormatMessage_Call ¶
MockExecutionContext_FormatMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FormatMessage'
func (*MockExecutionContext_FormatMessage_Call) Return ¶
func (_c *MockExecutionContext_FormatMessage_Call) Return(_a0 string, _a1 error) *MockExecutionContext_FormatMessage_Call
func (*MockExecutionContext_FormatMessage_Call) Run ¶
func (_c *MockExecutionContext_FormatMessage_Call) Run(run func(msg Message, noColor bool)) *MockExecutionContext_FormatMessage_Call
func (*MockExecutionContext_FormatMessage_Call) RunAndReturn ¶
func (_c *MockExecutionContext_FormatMessage_Call) RunAndReturn(run func(Message, bool) (string, error)) *MockExecutionContext_FormatMessage_Call
type MockExecutionContext_Ping_Call ¶ added in v0.7.3
MockExecutionContext_Ping_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ping'
func (*MockExecutionContext_Ping_Call) Return ¶ added in v0.7.3
func (_c *MockExecutionContext_Ping_Call) Return(_a0 error) *MockExecutionContext_Ping_Call
func (*MockExecutionContext_Ping_Call) Run ¶ added in v0.7.3
func (_c *MockExecutionContext_Ping_Call) Run(run func()) *MockExecutionContext_Ping_Call
func (*MockExecutionContext_Ping_Call) RunAndReturn ¶ added in v0.7.3
func (_c *MockExecutionContext_Ping_Call) RunAndReturn(run func() error) *MockExecutionContext_Ping_Call
type MockExecutionContext_PrintToFile_Call ¶
MockExecutionContext_PrintToFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrintToFile'
func (*MockExecutionContext_PrintToFile_Call) Return ¶
func (_c *MockExecutionContext_PrintToFile_Call) Return(_a0 error) *MockExecutionContext_PrintToFile_Call
func (*MockExecutionContext_PrintToFile_Call) Run ¶
func (_c *MockExecutionContext_PrintToFile_Call) Run(run func(data string)) *MockExecutionContext_PrintToFile_Call
func (*MockExecutionContext_PrintToFile_Call) RunAndReturn ¶
func (_c *MockExecutionContext_PrintToFile_Call) RunAndReturn(run func(string) error) *MockExecutionContext_PrintToFile_Call
type MockExecutionContext_Print_Call ¶
MockExecutionContext_Print_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Print'
func (*MockExecutionContext_Print_Call) Return ¶
func (_c *MockExecutionContext_Print_Call) Return(_a0 error) *MockExecutionContext_Print_Call
func (*MockExecutionContext_Print_Call) Run ¶
func (_c *MockExecutionContext_Print_Call) Run(run func(data string, attr ...color.Attribute)) *MockExecutionContext_Print_Call
func (*MockExecutionContext_Print_Call) RunAndReturn ¶
func (_c *MockExecutionContext_Print_Call) RunAndReturn(run func(string, ...color.Attribute) error) *MockExecutionContext_Print_Call
type MockExecutionContext_SendRequest_Call ¶
MockExecutionContext_SendRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendRequest'
func (*MockExecutionContext_SendRequest_Call) Return ¶
func (_c *MockExecutionContext_SendRequest_Call) Return(_a0 error) *MockExecutionContext_SendRequest_Call
func (*MockExecutionContext_SendRequest_Call) Run ¶
func (_c *MockExecutionContext_SendRequest_Call) Run(run func(req string)) *MockExecutionContext_SendRequest_Call
func (*MockExecutionContext_SendRequest_Call) RunAndReturn ¶
func (_c *MockExecutionContext_SendRequest_Call) RunAndReturn(run func(string) error) *MockExecutionContext_SendRequest_Call
type MockExecutionContext_WaitForResponse_Call ¶
MockExecutionContext_WaitForResponse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForResponse'
func (*MockExecutionContext_WaitForResponse_Call) Return ¶
func (_c *MockExecutionContext_WaitForResponse_Call) Return(_a0 Message, _a1 error) *MockExecutionContext_WaitForResponse_Call
func (*MockExecutionContext_WaitForResponse_Call) Run ¶
func (_c *MockExecutionContext_WaitForResponse_Call) Run(run func(timeout time.Duration)) *MockExecutionContext_WaitForResponse_Call
func (*MockExecutionContext_WaitForResponse_Call) RunAndReturn ¶
func (_c *MockExecutionContext_WaitForResponse_Call) RunAndReturn(run func(time.Duration) (Message, error)) *MockExecutionContext_WaitForResponse_Call
type MockFormater ¶
MockFormater is an autogenerated mock type for the Formater type
func NewMockFormater ¶
func NewMockFormater(t interface {
mock.TestingT
Cleanup(func())
}) *MockFormater
NewMockFormater creates a new instance of MockFormater. 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 (*MockFormater) EXPECT ¶
func (_m *MockFormater) EXPECT() *MockFormater_Expecter
func (*MockFormater) FormatForFile ¶
func (_m *MockFormater) FormatForFile(msgType string, msgData string) (string, error)
FormatForFile provides a mock function with given fields: msgType, msgData
func (*MockFormater) FormatMessage ¶
func (_m *MockFormater) FormatMessage(msgType string, msgData string) (string, error)
FormatMessage provides a mock function with given fields: msgType, msgData
type MockFormater_Expecter ¶
type MockFormater_Expecter struct {
// contains filtered or unexported fields
}
func (*MockFormater_Expecter) FormatForFile ¶
func (_e *MockFormater_Expecter) FormatForFile(msgType interface{}, msgData interface{}) *MockFormater_FormatForFile_Call
FormatForFile is a helper method to define mock.On call
- msgType string
- msgData string
func (*MockFormater_Expecter) FormatMessage ¶
func (_e *MockFormater_Expecter) FormatMessage(msgType interface{}, msgData interface{}) *MockFormater_FormatMessage_Call
FormatMessage is a helper method to define mock.On call
- msgType string
- msgData string
type MockFormater_FormatForFile_Call ¶
MockFormater_FormatForFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FormatForFile'
func (*MockFormater_FormatForFile_Call) Return ¶
func (_c *MockFormater_FormatForFile_Call) Return(_a0 string, _a1 error) *MockFormater_FormatForFile_Call
func (*MockFormater_FormatForFile_Call) Run ¶
func (_c *MockFormater_FormatForFile_Call) Run(run func(msgType string, msgData string)) *MockFormater_FormatForFile_Call
func (*MockFormater_FormatForFile_Call) RunAndReturn ¶
func (_c *MockFormater_FormatForFile_Call) RunAndReturn(run func(string, string) (string, error)) *MockFormater_FormatForFile_Call
type MockFormater_FormatMessage_Call ¶
MockFormater_FormatMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FormatMessage'
func (*MockFormater_FormatMessage_Call) Return ¶
func (_c *MockFormater_FormatMessage_Call) Return(_a0 string, _a1 error) *MockFormater_FormatMessage_Call
func (*MockFormater_FormatMessage_Call) Run ¶
func (_c *MockFormater_FormatMessage_Call) Run(run func(msgType string, msgData string)) *MockFormater_FormatMessage_Call
func (*MockFormater_FormatMessage_Call) RunAndReturn ¶
func (_c *MockFormater_FormatMessage_Call) RunAndReturn(run func(string, string) (string, error)) *MockFormater_FormatMessage_Call