utils

package module
v0.0.0-...-660d58f Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KiB = 1 << (10 * iota)
	MiB
	GiB
	TiB
	PiB

	BASHResultBegin = `:RsjSixT:`
	BASHResultEnd   = `:RjaSmeT:`
	KVDelimiter     = `:KdfgV:`
	ItemDelimiter   = `:IiajT:`
)
View Source
const (
	PTInt = iota
	PTFloat
	PTBool
	PTString
)

Variables

This section is empty.

Functions

func Dash2DigitsList

func Dash2DigitsList(dashedstr string) ([]string, error)

func DelItemInSlice

func DelItemInSlice(slice interface{}, idx int)

func ExpressionEvaluate

func ExpressionEvaluate(e string, ps ...Parameter) (interface{}, error)

func FiveTimeIntToOneChar

func FiveTimeIntToOneChar(i int64) string

func GetGRPCConn

func GetGRPCConn(ctx context.Context, endpoint string) (*grpc.ClientConn, error)

func GetKVsFromBashResult

func GetKVsFromBashResult(rstr string) *map[string]string

func OneCharToFiveTimeInt

func OneCharToFiveTimeInt(c string) int

func UnitStrToBytes

func UnitStrToBytes(s string) (int64, error)

Types

type BashOutput

type BashOutput struct {
	Stdout  string
	Stderr  string
	Exitcod int
}

func LocalBashRun

func LocalBashRun(script string, timeout_s int) (*BashOutput, error)

type Parameter

type Parameter struct {
	Name  string
	Ptype ParameterType
	Value interface{}
}

type ParameterType

type ParameterType byte

Jump to

Keyboard shortcuts

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