tradingdb2utils

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package tradingdb2utils is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendString

func AppendString(strs ...string) string

AppendString - append string

func ClearLogs

func ClearLogs() error

ClearLogs - clear logs

func Debug

func Debug(message string, fields ...zap.Field)

Debug logs a debug message with the given fields

func Error

func Error(message string, fields ...zap.Field)

Error logs a debug message with the given fields

func Fatal

func Fatal(message string, fields ...zap.Field)

Fatal logs a message than calls os.Exit(1)

func FormatNow

func FormatNow(t ITime) string

FormatNow - format time

func GetLogger

func GetLogger() *zap.Logger

GetLogger - get zap.Logger

func IndexOfInt2Slice

func IndexOfInt2Slice(arr []int, x, y int, start int) int

IndexOfInt2Slice - indexof for []int2, []int2 is like [x0, y0, x1, y1, ...]

start * 2 <--> len([]int)

func IndexOfIntSlice

func IndexOfIntSlice(arr []int, v int, start int) int

IndexOfIntSlice - indexof for []int

func IndexOfStringSlice

func IndexOfStringSlice(arr []string, v string, start int) int

IndexOfStringSlice - indexof for []string

func Info

func Info(message string, fields ...zap.Field)

Info logs a debug message with the given fields

func InitLogger

func InitLogger(logname string, appVersion string, level string, isConsole bool, logpath string)

InitLogger - initializes a thread-safe singleton logger

func JSON

func JSON(name string, jobj interface{}) zap.Field

JSON - It's like zap.String(name, str)

func SetLogger

func SetLogger(curLogger *zap.Logger) *zap.Logger

SetLogger - set zap.Logger, return last zap.Logger

func SyncLogger

func SyncLogger()

SyncLogger - sync logger

func Warn

func Warn(message string, fields ...zap.Field)

Warn logs a debug message with the given fields

Types

type ITime

type ITime interface {
	// Now - get now time
	Now() time.Time
}

ITime - Time

type MockITime

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

MockITime is a mock of ITime interface

func NewMockITime

func NewMockITime(ctrl *gomock.Controller) *MockITime

NewMockITime creates a new mock instance

func (*MockITime) EXPECT

func (m *MockITime) EXPECT() *MockITimeMockRecorder

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

func (*MockITime) Now

func (m *MockITime) Now() time.Time

Now mocks base method

type MockITimeMockRecorder

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

MockITimeMockRecorder is the mock recorder for MockITime

func (*MockITimeMockRecorder) Now

func (mr *MockITimeMockRecorder) Now() *gomock.Call

Now indicates an expected call of Now

type Time

type Time struct {
}

Time - default Time

func (Time) Now

func (t Time) Now() time.Time

Now - get now time

Jump to

Keyboard shortcuts

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