mock

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MPL-2.0, MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mock is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerKit

type HandlerKit struct {
	Executor *mock_exec.MockExecutor
	MockCtrl *gomock.Controller
	Session  *MockSession

	// ExitOnErr defines the expected pattern for an ExitOnErr/ExitOnErrShort call.
	//
	// After NewHandlerKit processes all HandlerKitOption functions, it configures the related
	// mock if the pattern is non-nil.
	ExitOnErr *regexp.Regexp

	// stdout if non-nil will be used by the Handler for session instead of os.Stdout.
	Stdout io.Writer

	// stderr if non-nil will be used by the Handler for session instead of os.Stderr.
	Stderr io.Writer
}

HandlerKit provides an embeddable starting point for sub-commands' own HandlerKit implementations to build on, providing setup for common mocks via NewHandlerKit.

Embedders must call Finish.

func NewHandlerKit

func NewHandlerKit(mockCtrl *gomock.Controller) *HandlerKit

func (*HandlerKit) Finish

func (k *HandlerKit) Finish()

Finish creates the expected calls, based on mock-related HandlerKit fields, that were not already created by other methods.

type MockSession

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

MockSession is a mock of Session interface

func NewMockSession

func NewMockSession(ctrl *gomock.Controller) *MockSession

NewMockSession creates a new mock instance

func (*MockSession) EXPECT

func (m *MockSession) EXPECT() *MockSessionMockRecorder

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

func (*MockSession) Err

func (m *MockSession) Err() io.Writer

Err mocks base method

func (*MockSession) ExitOnErr

func (m *MockSession) ExitOnErr(err error, msg string, code int)

ExitOnErr mocks base method

func (*MockSession) ExitOnErrShort

func (m *MockSession) ExitOnErrShort(err error, msg string, code int)

ExitOnErrShort mocks base method

func (*MockSession) ExitOnErrsShort

func (m *MockSession) ExitOnErrsShort(errs []error, code int)

ExitOnErrsShort mocks base method

func (*MockSession) Exitf

func (m *MockSession) Exitf(code int, format string, a ...interface{})

Exitf mocks base method

func (*MockSession) In

func (m *MockSession) In() io.Reader

In mocks base method

func (*MockSession) OnSignal

func (m *MockSession) OnSignal(s os.Signal, do func(os.Signal)) func()

OnSignal mocks base method

func (*MockSession) Out

func (m *MockSession) Out() io.Writer

Out mocks base method

func (*MockSession) SetErr

func (m *MockSession) SetErr(arg0 io.Writer)

SetErr mocks base method

func (*MockSession) SetIn

func (m *MockSession) SetIn(arg0 io.Reader)

SetIn mocks base method

func (*MockSession) SetOut

func (m *MockSession) SetOut(arg0 io.Writer)

SetOut mocks base method

type MockSessionMockRecorder

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

MockSessionMockRecorder is the mock recorder for MockSession

func (*MockSessionMockRecorder) Err

func (mr *MockSessionMockRecorder) Err() *gomock.Call

Err indicates an expected call of Err

func (*MockSessionMockRecorder) ExitOnErr

func (mr *MockSessionMockRecorder) ExitOnErr(err, msg, code interface{}) *gomock.Call

ExitOnErr indicates an expected call of ExitOnErr

func (*MockSessionMockRecorder) ExitOnErrShort

func (mr *MockSessionMockRecorder) ExitOnErrShort(err, msg, code interface{}) *gomock.Call

ExitOnErrShort indicates an expected call of ExitOnErrShort

func (*MockSessionMockRecorder) ExitOnErrsShort

func (mr *MockSessionMockRecorder) ExitOnErrsShort(errs, code interface{}) *gomock.Call

ExitOnErrsShort indicates an expected call of ExitOnErrsShort

func (*MockSessionMockRecorder) Exitf

func (mr *MockSessionMockRecorder) Exitf(code, format interface{}, a ...interface{}) *gomock.Call

Exitf indicates an expected call of Exitf

func (*MockSessionMockRecorder) In

In indicates an expected call of In

func (*MockSessionMockRecorder) OnSignal

func (mr *MockSessionMockRecorder) OnSignal(s, do interface{}) *gomock.Call

OnSignal indicates an expected call of OnSignal

func (*MockSessionMockRecorder) Out

func (mr *MockSessionMockRecorder) Out() *gomock.Call

Out indicates an expected call of Out

func (*MockSessionMockRecorder) SetErr

func (mr *MockSessionMockRecorder) SetErr(arg0 interface{}) *gomock.Call

SetErr indicates an expected call of SetErr

func (*MockSessionMockRecorder) SetIn

func (mr *MockSessionMockRecorder) SetIn(arg0 interface{}) *gomock.Call

SetIn indicates an expected call of SetIn

func (*MockSessionMockRecorder) SetOut

func (mr *MockSessionMockRecorder) SetOut(arg0 interface{}) *gomock.Call

SetOut indicates an expected call of SetOut

Jump to

Keyboard shortcuts

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