functions

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteConfigFile

func DeleteConfigFile(sessionData *types.Session)

DeleteConfigFile Delete configuration file for ThreadID

func ExecuteTemplate

func ExecuteTemplate(
	wr io.Writer,
	data interface{},
	sessionData *types.Session)

ExecuteTemplate is responsible for executing any templates

func Float64ToStr

func Float64ToStr(value float64, prec int) string

Float64ToStr function

This public function convert float64 to string with variable precision

func GetConfigData

func GetConfigData(
	viperData *types.ViperData,
	sessionData *types.Session) *types.Config

GetConfigData Retrieve or create config file based on ThreadID

func GetExchangeLatency

func GetExchangeLatency(sessionData *types.Session) (latency int64, err error)

GetExchangeLatency retrieve the latency between the exchange and client

func GetFunctionName

func GetFunctionName() string

GetFunctionName Retrieve current function name

func GetIP

func GetIP(r *http.Request) string

GetIP gets a requests IP address by reading off the forwarded-for header (for proxies) and falls back to use the remote address.

func GetPort

func GetPort() (port string)

GetPort Determine port for HTTP service.

func GetThreadID

func GetThreadID() string

GetThreadID Return random thread ID

func IntToFloat64

func IntToFloat64(value int) float64

IntToFloat64 convert Int to Float64

func IsFundsAvailable

func IsFundsAvailable(
	configData *types.Config,
	sessionData *types.Session) bool

IsFundsAvailable Validate available funds to buy

func IsInTimeRange

func IsInTimeRange(startTimeString string, endTimeString string) bool

IsInTimeRange Check if time is in a specific range

func LoadConfigTemplate

func LoadConfigTemplate(
	viperData *types.ViperData,
	sessionData *types.Session) *types.Config

LoadConfigTemplate Load the selected configuration template Three's a BUG where it only works before the first UPDATE

func MustGetenv

func MustGetenv(k string) string

MustGetenv is a helper function for getting environment variables. Displays a warning if the environment variable is not set.

func SaveConfigData

func SaveConfigData(
	viperData *types.ViperData,
	r *http.Request,
	sessionData *types.Session)

SaveConfigData save viper configuration from html

func SaveConfigGlobalData added in v1.9.2

func SaveConfigGlobalData(
	viperData *types.ViperData,
	r *http.Request,
	sessionData *types.Session)

SaveConfigGlobalData save viper configuration from html

func StrToFloat64

func StrToFloat64(value string) (r float64)

StrToFloat64 function

This public function convert string to float64

func StrToInt

func StrToInt(value string) (r int)

StrToInt convert string to int

Types

This section is empty.

Jump to

Keyboard shortcuts

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