utils

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 18 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile added in v0.1.22

func CreateFile(contents []byte, filename string, location string) error

CreateFile creates a file with the given content on the given location with the given filename

func DownloadFile

func DownloadFile(filepath string, url string) error

func ErrGetBool

func ErrGetBool(key string, err error) error

func ErrMarshal

func ErrMarshal(err error) error

func ErrUnmarshal

func ErrUnmarshal(err error) error

func ErrUnmarshalInvalid added in v0.1.25

func ErrUnmarshalInvalid(err error, typ reflect.Type) error

func ErrUnmarshalSyntax added in v0.1.25

func ErrUnmarshalSyntax(err error, offset int64) error

func ErrUnmarshalType added in v0.1.25

func ErrUnmarshalType(err error, value string) error

func ErrUnmarshalUnsupportedType added in v0.1.25

func ErrUnmarshalUnsupportedType(err error, typ reflect.Type) error

func ErrUnmarshalUnsupportedValue added in v0.1.25

func ErrUnmarshalUnsupportedValue(err error, value reflect.Value) error

func Filepath

func Filepath() string

func GetBool

func GetBool(key string) (bool, error)

getBool function returns the boolean config data

func GetHome

func GetHome() string

GetHome returns the home path

func Git

func Git() (version, commitHead string)

git method which allows fetch the git HEAD tag version and commit number

func Marshal

func Marshal(obj interface{}) (string, error)

func NewUUID

func NewUUID() (string, error)

func ReadRemoteFile added in v0.1.24

func ReadRemoteFile(url string) (string, error)

func StrConcat

func StrConcat(s ...string) string

func TcpCheck

func TcpCheck(ip string, port int32) bool

func Unmarshal

func Unmarshal(obj string, result interface{}) error

unmarshal returns parses the JSON config data and stores the value in the reference to result

Types

type Endpoint added in v0.1.22

type Endpoint struct {
	Name    string
	Address string
	Port    int32
}

Endpoint represents the structure for an endpoint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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