utils

package
v0.0.0-...-b1bd2f5 Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcSpread

func CalcSpread(bidMax float64, askMin float64) (spread float64, midPoint float64)

CalcSpread calculates the spread stats for the given bidMax and askMin orderbook values

func GetAssetString

func GetAssetString(assetType string, code string, issuer string) string

GetAssetString returns a string representation of an asset

func PanicIfError

func PanicIfError(e error)

PanicIfError is an utility function that panics if err != nil

func SliceDiff

func SliceDiff(a, b []string) (diff []string)

SliceDiff returns the elements in `a` that aren't in `b`.

func TimeToUnixEpoch

func TimeToUnixEpoch(t time.Time) int64

TimeToTimestamp converts a time.Time into a Unix epoch

func WriteJSONToFile

func WriteJSONToFile(jsonBytes []byte, filename string) (numBytes int, err error)

WriteJSONToFile wrtites a json []byte dump to <filename>

Types

This section is empty.

Jump to

Keyboard shortcuts

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