utils

package
v0.0.0-...-2c32341 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License: MIT Imports: 13 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 E36

func E36() *big.Int

func Ethers

func Ethers(value int64) *big.Int

func GetOHLCVChannelID

func GetOHLCVChannelID(bt, qt common.Address, unit string, duration int64) string

func GetOrderBookChannelID

func GetOrderBookChannelID(bt, qt common.Address) string

func GetPairKey

func GetPairKey(bt, qt common.Address) string

GetPairKey return the pair key identifier corresponding to two

func GetTickChannelID

func GetTickChannelID(bt, qt common.Address, 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 common.Address) 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 ToDecimal

func ToDecimal(value *big.Int) float64

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