Documentation ¶
Index ¶
- func NewErrorRecorderRepository(client Client) repository.ErrorRecorder
- func StackTracer(err error) ([]runtime.Frame, bool)
- type Client
- type ClientMock
- func (mock *ClientMock) ErrorWithStackSkipWithExtrasAndContext(ctx context.Context, level string, err error, skip int, ...)
- func (mock *ClientMock) ErrorWithStackSkipWithExtrasAndContextCalls() []struct{ ... }
- func (mock *ClientMock) SetStackTracer(stackTracer rollbar.StackTracerFunc)
- func (mock *ClientMock) SetStackTracerCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErrorRecorderRepository ¶
func NewErrorRecorderRepository(client Client) repository.ErrorRecorder
Types ¶
type Client ¶
type Client interface { ErrorWithStackSkipWithExtrasAndContext( ctx context.Context, level string, err error, skip int, extras map[string]interface{}, ) SetStackTracer(stackTracer rollbar.StackTracerFunc) }
Client abstracts rollbar.Client
type ClientMock ¶
type ClientMock struct { // ErrorWithStackSkipWithExtrasAndContextFunc mocks the ErrorWithStackSkipWithExtrasAndContext method. ErrorWithStackSkipWithExtrasAndContextFunc func(ctx context.Context, level string, err error, skip int, extras map[string]interface{}) // SetStackTracerFunc mocks the SetStackTracer method. SetStackTracerFunc func(stackTracer rollbar.StackTracerFunc) // contains filtered or unexported fields }
ClientMock is a mock implementation of Client.
func TestSomethingThatUsesClient(t *testing.T) { // make and configure a mocked Client mockedClient := &ClientMock{ ErrorWithStackSkipWithExtrasAndContextFunc: func(ctx context.Context, level string, err error, skip int, extras map[string]interface{}) { panic("mock out the ErrorWithStackSkipWithExtrasAndContext method") }, SetStackTracerFunc: func(stackTracer rollbar.StackTracerFunc) { panic("mock out the SetStackTracer method") }, } // use mockedClient in code that requires Client // and then make assertions. }
func (*ClientMock) ErrorWithStackSkipWithExtrasAndContext ¶
func (mock *ClientMock) ErrorWithStackSkipWithExtrasAndContext(ctx context.Context, level string, err error, skip int, extras map[string]interface{})
ErrorWithStackSkipWithExtrasAndContext calls ErrorWithStackSkipWithExtrasAndContextFunc.
func (*ClientMock) ErrorWithStackSkipWithExtrasAndContextCalls ¶
func (mock *ClientMock) ErrorWithStackSkipWithExtrasAndContextCalls() []struct { Ctx context.Context Level string Err error Skip int Extras map[string]interface{} }
ErrorWithStackSkipWithExtrasAndContextCalls gets all the calls that were made to ErrorWithStackSkipWithExtrasAndContext. Check the length with:
len(mockedClient.ErrorWithStackSkipWithExtrasAndContextCalls())
func (*ClientMock) SetStackTracer ¶
func (mock *ClientMock) SetStackTracer(stackTracer rollbar.StackTracerFunc)
SetStackTracer calls SetStackTracerFunc.
func (*ClientMock) SetStackTracerCalls ¶
func (mock *ClientMock) SetStackTracerCalls() []struct { StackTracer rollbar.StackTracerFunc }
SetStackTracerCalls gets all the calls that were made to SetStackTracer. Check the length with:
len(mockedClient.SetStackTracerCalls())
Click to show internal directories.
Click to hide internal directories.