utils

package
v0.0.0-...-5207ebf Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APILogger = NewLogger("api", "./logs/api.log")
View Source
var EngineLogger = NewLogger("engine", "./logs/engine.log")
View Source
var ErrorLogger = NewErrorLogger()
View Source
var Logger = NewLogger("main", "./logs/main.log")
View Source
var MainLogger = NewMainLogger()
View Source
var OperatorMessagesLogger = NewFileLogger("operator", "./logs/operator.log")
View Source
var RabbitLogger = NewLogger("rabbitmq", "./logs/rabbit.log")
View Source
var StdoutLogger = NewStandardOutputLogger()
View Source
var TerminalLogger = NewColoredLogger()
View Source
var WebsocketMessagesLogger = NewFileLogger("websocket", "./logs/websocket.log")

Functions

func Contains

func Contains(s []string, e string) bool

func GetOHLCVChannelID

func GetOHLCVChannelID(bt, qt string, unit string, duration int64) string

func GetOrderBookChannelID

func GetOrderBookChannelID(bt, qt string) string

func GetPairKey

func GetPairKey(bt, qt string) string

GetPairKey return the pair key identifier corresponding to two

func GetTickChannelID

func GetTickChannelID(bt, qt string, unit string, duration int64) string

GetTickChannelID is used to get the channel id for OHLCV data streaming it takes pairname, duration and units of data streaming

func GetTradeChannelID

func GetTradeChannelID(bt, qt string) string

func JSON

func JSON(x interface{}) string

func MaxIntMap

func MaxIntMap(m map[string]int) (string, int)

func NewColoredLogger

func NewColoredLogger() *logging.Logger

func NewErrorLogger

func NewErrorLogger() *logging.Logger

func NewFileLogger

func NewFileLogger(module string, logFile string) *logging.Logger

NewFileLogger creates a logging utility that outputs to the file passed as argument but but does not output to stdout.

func NewLogger

func NewLogger(module string, logFile string) *logging.Logger

func NewMainLogger

func NewMainLogger() *logging.Logger

func NewStandardOutputLogger

func NewStandardOutputLogger() *logging.Logger

func PrintError

func PrintError(msg string, err error)

func PrintJSON

func PrintJSON(x interface{})

func Retry

func Retry(retries int, fn func() error) error

func UintToPaddedString

func UintToPaddedString(num int64) string

UintToPaddedString converts an int to string of length 19 by padding with 0

func Use

func Use(...interface{})

Util function to handle unused variables while testing

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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