util

package
v0.0.0-...-54d14c8 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BYTE     = 1.0
	KILOBYTE = float64(1024 * BYTE)
	MEGABYTE = float64(1024 * KILOBYTE)
	GIGABYTE = float64(1024 * MEGABYTE)
	TERABYTE = float64(1024 * GIGABYTE)
)

conversion units

Variables

View Source
var NotImplementedError = errors.New("not implemented yet")

Functions

func ConvertBytesFloatTo

func ConvertBytesFloatTo(s float64, convert string) (float64, error)

ConvertBytesFloatTo converts bytes to ...

func ConvertBytesTo

func ConvertBytesTo(s interface{}, convert string, precision int) (float64, error)

ConvertBytesTo and converts bytes to ..

func FloatDecimalPoint

func FloatDecimalPoint(num float64, precision int) (float64, error)

FloatDecimalPoint parses a float64

func FloatToString

func FloatToString(num float64) (string, error)

FloatToString - XXX

func GenerateMachineID

func GenerateMachineID() string

GenerateMachineID - generates unique machine id

func ReadLine

func ReadLine(fname string, line func(string) error) error

ReadLine savely reads the line and cleans up afterwards

Types

type Command

type Command struct {
	Command string `json:"command"`
	Name    string `json:"name"`
}

Command - XXX

type CommandResult

type CommandResult struct {
	Name     string `json:"name"`
	Command  string `json:"command"`
	ExitCode int    `json:"exit_code"`
	Output   string `json:"output"`
	Error    string `json:"error"`
}

CommandResult - XXX

func ExecWithExitCode

func ExecWithExitCode(command Command) CommandResult

ExecWithExitCode - XXX Source: http://stackoverflow.com/questions/10385551/get-exit-code-go

func (CommandResult) String

func (c CommandResult) String() string

Jump to

Keyboard shortcuts

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