Documentation ¶
Index ¶
- func BeforeOnce(beforeBlock func())
- func CreateClanNameTextIndexInMongo(getTestMongo func() (interfaces.MongoDB, error), gameID string) error
- func WaitForFunc(timeout int, f func() error) error
- 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 ¶ added in v1.1.0
func BeforeOnce(beforeBlock func())
BeforeOnce runs the before each block only once
func CreateClanNameTextIndexInMongo ¶
func CreateClanNameTextIndexInMongo(getTestMongo func() (interfaces.MongoDB, error), gameID string) error
CreateClanNameTextIndexInMongo creates the necessary text index for clan search in mongo
func WaitForFunc ¶ added in v1.1.0
WaitForFunc waits for a given function to finish without error or a timeout
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 ¶ added in v0.10.0
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 // 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