utils

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDir

func CheckDir(path string) (bool, error)

func CidrSubnet

func CidrSubnet(netCidr string, newbits int, netnum interface{}) (ret string, err error)

func Diff

func Diff(structA, structB interface{}, colored bool) string

func FileExists

func FileExists(filename string) bool

FileExists check if file exists.

func GetTemplate

func GetTemplate(gitURL, targetDir, templateName string) (string, error)

func IsAbsolutePath

func IsAbsolutePath(path string) bool

func IsDir

func IsDir(path string) bool

func IsLocalPath

func IsLocalPath(path string) bool

func JSONDecode

func JSONDecode(in []byte, out interface{}) error

JSONDecode decode in to .

func JSONEncode

func JSONEncode(in interface{}) ([]byte, error)

JSONEncode encode in to JSON.

func JSONInterfaceToType

func JSONInterfaceToType(in, out interface{}) error

JSONInterfaceToType - convert interface data in to type of out with JSON tags.

func Md5

func Md5(data string) string

func RandString added in v0.4.5

func RandString(n int) string

func ReadFilesToExistentsList

func ReadFilesToExistentsList(filesPath, baseDir string, filesList map[string][]byte) (err error)

func ReadFilesToList

func ReadFilesToList(filesPath, baseDir string) (filesList map[string][]byte, err error)

func ReadYAML

func ReadYAML(objData []byte) (res map[string]interface{}, err error)

ReadYAML same as ReadYAMLObjects but parse only data with 1 yaml object.

func ReadYAMLObjects

func ReadYAMLObjects(objData []byte) ([]map[string]interface{}, error)

func TruncateString

func TruncateString(src string, maxLen int) string

TruncateString - truncate string src to maxLen.

func WriteFilesFromList

func WriteFilesFromList(path string, filesList map[string][]byte) (err error)

Types

type GitRepo added in v0.4.6

type GitRepo struct {
	URL     string
	Subdir  string
	Version string
}

func ParseGitUrl added in v0.4.6

func ParseGitUrl(gitURL string) (repo GitRepo, err error)

Jump to

Keyboard shortcuts

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