Documentation ¶
Index ¶
- func WithMockAll(options *loggerMockOptions)
- type Logger
- func (_m *Logger) Debug(format string, args ...interface{})
- func (_m *Logger) EXPECT() *Logger_Expecter
- func (_m *Logger) Error(format string, args ...interface{})
- func (_m *Logger) Info(format string, args ...interface{})
- func (_m *Logger) Warn(format string, args ...interface{})
- func (_m *Logger) WithChannel(channel string) log.Logger
- func (_m *Logger) WithContext(ctx context.Context) log.Logger
- func (_m *Logger) WithFields(_a0 log.Fields) log.Logger
- type LoggerMock
- type LoggerMockOption
- type Logger_Debug_Call
- type Logger_Error_Call
- type Logger_Expecter
- func (_e *Logger_Expecter) Debug(format interface{}, args ...interface{}) *Logger_Debug_Call
- func (_e *Logger_Expecter) Error(format interface{}, args ...interface{}) *Logger_Error_Call
- func (_e *Logger_Expecter) Info(format interface{}, args ...interface{}) *Logger_Info_Call
- func (_e *Logger_Expecter) Warn(format interface{}, args ...interface{}) *Logger_Warn_Call
- func (_e *Logger_Expecter) WithChannel(channel interface{}) *Logger_WithChannel_Call
- func (_e *Logger_Expecter) WithContext(ctx interface{}) *Logger_WithContext_Call
- func (_e *Logger_Expecter) WithFields(_a0 interface{}) *Logger_WithFields_Call
- type Logger_Info_Call
- type Logger_Warn_Call
- type Logger_WithChannel_Call
- type Logger_WithContext_Call
- type Logger_WithFields_Call
- type Mock
- type SentryHub
- type SentryHub_CaptureException_Call
- func (_c *SentryHub_CaptureException_Call) Return(_a0 *sentry.EventID) *SentryHub_CaptureException_Call
- func (_c *SentryHub_CaptureException_Call) Run(run func(exception error)) *SentryHub_CaptureException_Call
- func (_c *SentryHub_CaptureException_Call) RunAndReturn(run func(error) *sentry.EventID) *SentryHub_CaptureException_Call
- type SentryHub_ConfigureScope_Call
- func (_c *SentryHub_ConfigureScope_Call) Return() *SentryHub_ConfigureScope_Call
- func (_c *SentryHub_ConfigureScope_Call) Run(run func(f func(*sentry.Scope))) *SentryHub_ConfigureScope_Call
- func (_c *SentryHub_ConfigureScope_Call) RunAndReturn(run func(func(*sentry.Scope))) *SentryHub_ConfigureScope_Call
- type SentryHub_Expecter
- func (_e *SentryHub_Expecter) CaptureException(exception interface{}) *SentryHub_CaptureException_Call
- func (_e *SentryHub_Expecter) ConfigureScope(f interface{}) *SentryHub_ConfigureScope_Call
- func (_e *SentryHub_Expecter) Flush(timeout interface{}) *SentryHub_Flush_Call
- func (_e *SentryHub_Expecter) WithScope(f interface{}) *SentryHub_WithScope_Call
- type SentryHub_Flush_Call
- type SentryHub_WithScope_Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithMockAll ¶ added in v0.26.0
func WithMockAll(options *loggerMockOptions)
WithMockAll is a LoggerMockOption that mocks calls to all log levels.
Types ¶
type Logger ¶
Logger is an autogenerated mock type for the Logger type
func NewLogger ¶
NewLogger creates a new instance of Logger. 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 (*Logger) EXPECT ¶
func (_m *Logger) EXPECT() *Logger_Expecter
func (*Logger) WithChannel ¶
WithChannel provides a mock function with given fields: channel
func (*Logger) WithContext ¶
WithContext provides a mock function with given fields: ctx
type LoggerMock ¶ added in v0.26.0
type LoggerMock interface { log.Logger Mock EXPECT() *Logger_Expecter }
func NewLoggerMock ¶
func NewLoggerMock(opts ...LoggerMockOption) LoggerMock
NewLoggerMock creates a new logger mock with the given options.
func NewLoggerMockedAll
deprecated
func NewLoggerMockedAll(opts ...LoggerMockOption) LoggerMock
NewLoggerMockedAll is the same as NewLoggerMock(WithMockAll).
Deprecated: use NewLoggerMock(WithMockAll) instead.
func NewLoggerMockedUntilLevel
deprecated
func NewLoggerMockedUntilLevel(level int, opts ...LoggerMockOption) LoggerMock
NewLoggerMockedUntilLevel returns a logger mocked up to the given log level. All other calls will cause an error and fail the test.
Deprecated: use NewLoggerMock(WithMockUntilLevel(level)) instead.
type LoggerMockOption ¶ added in v0.26.0
type LoggerMockOption func(*loggerMockOptions)
func WithMockUntilLevel ¶ added in v0.26.0
func WithMockUntilLevel(level int) LoggerMockOption
WithMockUntilLevel creates a LoggerMockOption that mocks calls up to the given log level. All other calls will cause an error and fail the test.
func WithTestingT ¶ added in v0.26.0
func WithTestingT(t *testing.T) LoggerMockOption
WithTestingT creates a LoggerMockOption that supplies the testing.T value to use for the logger. This enables the logger to fail the test instead of panicking (which could be caught) if a non-mocked log level is used, print the logs in case of a failed test after the test, and automatically assert any expectations for the created mock.
type Logger_Debug_Call ¶
Logger_Debug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Debug'
func (*Logger_Debug_Call) Return ¶
func (_c *Logger_Debug_Call) Return() *Logger_Debug_Call
func (*Logger_Debug_Call) Run ¶
func (_c *Logger_Debug_Call) Run(run func(format string, args ...interface{})) *Logger_Debug_Call
func (*Logger_Debug_Call) RunAndReturn ¶
func (_c *Logger_Debug_Call) RunAndReturn(run func(string, ...interface{})) *Logger_Debug_Call
type Logger_Error_Call ¶
Logger_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error'
func (*Logger_Error_Call) Return ¶
func (_c *Logger_Error_Call) Return() *Logger_Error_Call
func (*Logger_Error_Call) Run ¶
func (_c *Logger_Error_Call) Run(run func(format string, args ...interface{})) *Logger_Error_Call
func (*Logger_Error_Call) RunAndReturn ¶
func (_c *Logger_Error_Call) RunAndReturn(run func(string, ...interface{})) *Logger_Error_Call
type Logger_Expecter ¶
type Logger_Expecter struct {
// contains filtered or unexported fields
}
func (*Logger_Expecter) Debug ¶
func (_e *Logger_Expecter) Debug(format interface{}, args ...interface{}) *Logger_Debug_Call
Debug is a helper method to define mock.On call
- format string
- args ...interface{}
func (*Logger_Expecter) Error ¶
func (_e *Logger_Expecter) Error(format interface{}, args ...interface{}) *Logger_Error_Call
Error is a helper method to define mock.On call
- format string
- args ...interface{}
func (*Logger_Expecter) Info ¶
func (_e *Logger_Expecter) Info(format interface{}, args ...interface{}) *Logger_Info_Call
Info is a helper method to define mock.On call
- format string
- args ...interface{}
func (*Logger_Expecter) Warn ¶
func (_e *Logger_Expecter) Warn(format interface{}, args ...interface{}) *Logger_Warn_Call
Warn is a helper method to define mock.On call
- format string
- args ...interface{}
func (*Logger_Expecter) WithChannel ¶
func (_e *Logger_Expecter) WithChannel(channel interface{}) *Logger_WithChannel_Call
WithChannel is a helper method to define mock.On call
- channel string
func (*Logger_Expecter) WithContext ¶
func (_e *Logger_Expecter) WithContext(ctx interface{}) *Logger_WithContext_Call
WithContext is a helper method to define mock.On call
- ctx context.Context
func (*Logger_Expecter) WithFields ¶
func (_e *Logger_Expecter) WithFields(_a0 interface{}) *Logger_WithFields_Call
WithFields is a helper method to define mock.On call
- _a0 log.Fields
type Logger_Info_Call ¶
Logger_Info_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Info'
func (*Logger_Info_Call) Return ¶
func (_c *Logger_Info_Call) Return() *Logger_Info_Call
func (*Logger_Info_Call) Run ¶
func (_c *Logger_Info_Call) Run(run func(format string, args ...interface{})) *Logger_Info_Call
func (*Logger_Info_Call) RunAndReturn ¶
func (_c *Logger_Info_Call) RunAndReturn(run func(string, ...interface{})) *Logger_Info_Call
type Logger_Warn_Call ¶
Logger_Warn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Warn'
func (*Logger_Warn_Call) Return ¶
func (_c *Logger_Warn_Call) Return() *Logger_Warn_Call
func (*Logger_Warn_Call) Run ¶
func (_c *Logger_Warn_Call) Run(run func(format string, args ...interface{})) *Logger_Warn_Call
func (*Logger_Warn_Call) RunAndReturn ¶
func (_c *Logger_Warn_Call) RunAndReturn(run func(string, ...interface{})) *Logger_Warn_Call
type Logger_WithChannel_Call ¶
Logger_WithChannel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithChannel'
func (*Logger_WithChannel_Call) Return ¶
func (_c *Logger_WithChannel_Call) Return(_a0 log.Logger) *Logger_WithChannel_Call
func (*Logger_WithChannel_Call) Run ¶
func (_c *Logger_WithChannel_Call) Run(run func(channel string)) *Logger_WithChannel_Call
func (*Logger_WithChannel_Call) RunAndReturn ¶
func (_c *Logger_WithChannel_Call) RunAndReturn(run func(string) log.Logger) *Logger_WithChannel_Call
type Logger_WithContext_Call ¶
Logger_WithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithContext'
func (*Logger_WithContext_Call) Return ¶
func (_c *Logger_WithContext_Call) Return(_a0 log.Logger) *Logger_WithContext_Call
func (*Logger_WithContext_Call) Run ¶
func (_c *Logger_WithContext_Call) Run(run func(ctx context.Context)) *Logger_WithContext_Call
func (*Logger_WithContext_Call) RunAndReturn ¶
func (_c *Logger_WithContext_Call) RunAndReturn(run func(context.Context) log.Logger) *Logger_WithContext_Call
type Logger_WithFields_Call ¶
Logger_WithFields_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithFields'
func (*Logger_WithFields_Call) Return ¶
func (_c *Logger_WithFields_Call) Return(_a0 log.Logger) *Logger_WithFields_Call
func (*Logger_WithFields_Call) Run ¶
func (_c *Logger_WithFields_Call) Run(run func(_a0 log.Fields)) *Logger_WithFields_Call
func (*Logger_WithFields_Call) RunAndReturn ¶
func (_c *Logger_WithFields_Call) RunAndReturn(run func(log.Fields) log.Logger) *Logger_WithFields_Call
type Mock ¶ added in v0.26.0
type Mock interface { String() string TestData() objx.Map Test(t mock.TestingT) On(methodName string, arguments ...interface{}) *mock.Call Called(arguments ...interface{}) mock.Arguments MethodCalled(methodName string, arguments ...interface{}) mock.Arguments AssertExpectations(t mock.TestingT) bool AssertNumberOfCalls(t mock.TestingT, methodName string, expectedCalls int) bool AssertCalled(t mock.TestingT, methodName string, arguments ...interface{}) bool AssertNotCalled(t mock.TestingT, methodName string, arguments ...interface{}) bool IsMethodCallable(t mock.TestingT, methodName string, arguments ...interface{}) bool }
type SentryHub ¶
SentryHub is an autogenerated mock type for the SentryHub type
func NewSentryHub ¶
NewSentryHub creates a new instance of SentryHub. 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 (*SentryHub) CaptureException ¶
CaptureException provides a mock function with given fields: exception
func (*SentryHub) ConfigureScope ¶
ConfigureScope provides a mock function with given fields: f
func (*SentryHub) EXPECT ¶
func (_m *SentryHub) EXPECT() *SentryHub_Expecter
type SentryHub_CaptureException_Call ¶
SentryHub_CaptureException_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CaptureException'
func (*SentryHub_CaptureException_Call) Return ¶
func (_c *SentryHub_CaptureException_Call) Return(_a0 *sentry.EventID) *SentryHub_CaptureException_Call
func (*SentryHub_CaptureException_Call) Run ¶
func (_c *SentryHub_CaptureException_Call) Run(run func(exception error)) *SentryHub_CaptureException_Call
func (*SentryHub_CaptureException_Call) RunAndReturn ¶
func (_c *SentryHub_CaptureException_Call) RunAndReturn(run func(error) *sentry.EventID) *SentryHub_CaptureException_Call
type SentryHub_ConfigureScope_Call ¶
SentryHub_ConfigureScope_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigureScope'
func (*SentryHub_ConfigureScope_Call) Return ¶
func (_c *SentryHub_ConfigureScope_Call) Return() *SentryHub_ConfigureScope_Call
func (*SentryHub_ConfigureScope_Call) Run ¶
func (_c *SentryHub_ConfigureScope_Call) Run(run func(f func(*sentry.Scope))) *SentryHub_ConfigureScope_Call
func (*SentryHub_ConfigureScope_Call) RunAndReturn ¶
func (_c *SentryHub_ConfigureScope_Call) RunAndReturn(run func(func(*sentry.Scope))) *SentryHub_ConfigureScope_Call
type SentryHub_Expecter ¶
type SentryHub_Expecter struct {
// contains filtered or unexported fields
}
func (*SentryHub_Expecter) CaptureException ¶
func (_e *SentryHub_Expecter) CaptureException(exception interface{}) *SentryHub_CaptureException_Call
CaptureException is a helper method to define mock.On call
- exception error
func (*SentryHub_Expecter) ConfigureScope ¶
func (_e *SentryHub_Expecter) ConfigureScope(f interface{}) *SentryHub_ConfigureScope_Call
ConfigureScope is a helper method to define mock.On call
- f func(*sentry.Scope)
func (*SentryHub_Expecter) Flush ¶
func (_e *SentryHub_Expecter) Flush(timeout interface{}) *SentryHub_Flush_Call
Flush is a helper method to define mock.On call
- timeout time.Duration
func (*SentryHub_Expecter) WithScope ¶
func (_e *SentryHub_Expecter) WithScope(f interface{}) *SentryHub_WithScope_Call
WithScope is a helper method to define mock.On call
- f func(*sentry.Scope)
type SentryHub_Flush_Call ¶
SentryHub_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush'
func (*SentryHub_Flush_Call) Return ¶
func (_c *SentryHub_Flush_Call) Return(_a0 bool) *SentryHub_Flush_Call
func (*SentryHub_Flush_Call) Run ¶
func (_c *SentryHub_Flush_Call) Run(run func(timeout time.Duration)) *SentryHub_Flush_Call
func (*SentryHub_Flush_Call) RunAndReturn ¶
func (_c *SentryHub_Flush_Call) RunAndReturn(run func(time.Duration) bool) *SentryHub_Flush_Call
type SentryHub_WithScope_Call ¶
SentryHub_WithScope_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithScope'
func (*SentryHub_WithScope_Call) Return ¶
func (_c *SentryHub_WithScope_Call) Return() *SentryHub_WithScope_Call
func (*SentryHub_WithScope_Call) Run ¶
func (_c *SentryHub_WithScope_Call) Run(run func(f func(*sentry.Scope))) *SentryHub_WithScope_Call
func (*SentryHub_WithScope_Call) RunAndReturn ¶
func (_c *SentryHub_WithScope_Call) RunAndReturn(run func(func(*sentry.Scope))) *SentryHub_WithScope_Call