Documentation ¶
Index ¶
- func BeforeOnce(beforeBlock func())
- func FHTTPMeasure(description string, setup func(map[string]interface{}), ...) bool
- func HTTPMeasure(description string, setup func(map[string]interface{}), ...) bool
- func HaveLogMessage(expectedLevel zap.Level, expectedMessage string, expectedFields ...interface{}) types.GomegaMatcher
- func XHTTPMeasure(description string, setup func(map[string]interface{}), ...) bool
- type MockKeyValue
- func (m *MockKeyValue) AddBool(key string, value bool)
- func (m *MockKeyValue) AddFloat64(key string, value float64)
- func (m *MockKeyValue) AddInt(key string, value int)
- func (m *MockKeyValue) AddInt64(key string, value int64)
- func (m *MockKeyValue) AddMarshaler(key string, marshaler zap.LogMarshaler) error
- func (m *MockKeyValue) AddObject(key string, value interface{}) error
- func (m *MockKeyValue) AddString(key, value string)
- func (m *MockKeyValue) AddUint(key string, value uint)
- func (m *MockKeyValue) AddUint64(key string, value uint64)
- func (m *MockKeyValue) AddUintptr(key string, value uintptr)
- type MockLogger
- func (m *MockLogger) Check(level zap.Level, msg string) *zap.CheckedMessage
- func (m *MockLogger) DFatal(message string, fields ...zap.Field)
- func (m *MockLogger) Debug(message string, fields ...zap.Field)
- func (m *MockLogger) Error(message string, fields ...zap.Field)
- func (m *MockLogger) Fatal(message string, fields ...zap.Field)
- func (m *MockLogger) Info(message string, fields ...zap.Field)
- func (m *MockLogger) Level() zap.Level
- func (m *MockLogger) Log(level zap.Level, message string, fields ...zap.Field)
- func (m *MockLogger) Panic(message string, fields ...zap.Field)
- func (m *MockLogger) SetLevel(level zap.Level)
- func (m *MockLogger) StubTime()
- func (m *MockLogger) Warn(message string, fields ...zap.Field)
- func (m *MockLogger) With(fields ...zap.Field) zap.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeforeOnce ¶
func BeforeOnce(beforeBlock func())
BeforeOnce runs the before each block only once
func FHTTPMeasure ¶
func FHTTPMeasure(description string, setup func(map[string]interface{}), f func(*httptest.Server, map[string]interface{}), timeout float64) bool
FHTTPMeasure runs the specified specs in an http test
func HTTPMeasure ¶
func HTTPMeasure(description string, setup func(map[string]interface{}), f func(*httptest.Server, map[string]interface{}), timeout float64) bool
HTTPMeasure runs the specified specs in an http test
func HaveLogMessage ¶
func HaveLogMessage(expectedLevel zap.Level, expectedMessage string, expectedFields ...interface{}) types.GomegaMatcher
HaveLogMessage gomega matcher
Types ¶
type MockKeyValue ¶
type MockKeyValue struct {
Values map[string]interface{}
}
MockKeyValue store
func (*MockKeyValue) AddBool ¶
func (m *MockKeyValue) AddBool(key string, value bool)
AddBool to the kv
func (*MockKeyValue) AddFloat64 ¶
func (m *MockKeyValue) AddFloat64(key string, value float64)
AddFloat64 to the kv
func (*MockKeyValue) AddInt64 ¶
func (m *MockKeyValue) AddInt64(key string, value int64)
AddInt64 to the kv
func (*MockKeyValue) AddMarshaler ¶
func (m *MockKeyValue) AddMarshaler(key string, marshaler zap.LogMarshaler) error
AddMarshaler to the kv
func (*MockKeyValue) AddObject ¶
func (m *MockKeyValue) AddObject(key string, value interface{}) error
AddObject to the kv
func (*MockKeyValue) AddString ¶
func (m *MockKeyValue) AddString(key, value string)
AddString to the kv
func (*MockKeyValue) AddUint ¶
func (m *MockKeyValue) AddUint(key string, value uint)
AddUint to the kv
func (*MockKeyValue) AddUint64 ¶
func (m *MockKeyValue) AddUint64(key string, value uint64)
AddUint64 to the kv
func (*MockKeyValue) AddUintptr ¶
func (m *MockKeyValue) AddUintptr(key string, value uintptr)
AddUintptr to the kv
type MockLogger ¶
type MockLogger struct { DefaultFields []zap.Field Messages []map[string]interface{} Parent *MockLogger WriteToStdOut bool // contains filtered or unexported fields }
MockLogger implements the zap logger interface but stores all the logged messages for inspection
func NewMockLogger ¶
func NewMockLogger(defaultFields ...zap.Field) *MockLogger
NewMockLogger returns a mock logger for tests
func (*MockLogger) Check ¶
func (m *MockLogger) Check(level zap.Level, msg string) *zap.CheckedMessage
Check created a checked message
func (*MockLogger) DFatal ¶
func (m *MockLogger) DFatal(message string, fields ...zap.Field)
DFatal logs
func (*MockLogger) Debug ¶
func (m *MockLogger) Debug(message string, fields ...zap.Field)
Debug debugs
func (*MockLogger) Error ¶
func (m *MockLogger) Error(message string, fields ...zap.Field)
Error logs
func (*MockLogger) Fatal ¶
func (m *MockLogger) Fatal(message string, fields ...zap.Field)
Fatal logs
func (*MockLogger) Panic ¶
func (m *MockLogger) Panic(message string, fields ...zap.Field)
Panic logs
func (*MockLogger) SetLevel ¶
func (m *MockLogger) SetLevel(level zap.Level)
SetLevel sets the level
Click to show internal directories.
Click to hide internal directories.