helpers

package
v0.0.0-...-8556144 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheInstance = cache.New(20*time.Second, 72*time.Hour)

CacheInstance is an instance of cache.

Functions

func DownloadBinary

func DownloadBinary()

DownloadBinary downloads the Electra daemon binary.

func GenerateToken

func GenerateToken(length uint8) (string, error)

GenerateToken generates a base64-encoded securely generated random string.

func GetJSON

func GetJSON(url string, target interface{}) bool

GetJSON fetches a JSON response from the given <url>.

func Log

func Log(s string)

Log logs in green.

func LogErr

func LogErr(s string)

LogErr logs in red.

func LogInfo

func LogInfo(s string)

LogInfo logs in magenta.

func LogWarn

func LogWarn(s string)

LogWarn logs in yellow.

func StringToFloat

func StringToFloat(s string) float64

StringToFloat converts a string to a float64.

func Substring

func Substring(s string, startIndex uint8) string

Substring returns a string containing the specified part of the given string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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