util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Age

func Age(unixTime int64) string

Age returns a string representing the time elapsed since unixTime in the form "1d", "2h", "3m", or "4s".

func Clear

func Clear(v interface{})

func DownloadFile

func DownloadFile(url string, filepath string) error

func ExistDir

func ExistDir(dirname string) bool

func FileExists

func FileExists(filePath string) (bool, error)

func GenerateTmpFile

func GenerateTmpFile() (string, error)

func GetJiraKeys

func GetJiraKeys(title string) (keys []string)

func GetJsonData

func GetJsonData(jsonValues map[string]interface{}) map[string]string

func GetRequestBody

func GetRequestBody(body interface{}) io.Reader

func GetURLHostName

func GetURLHostName(urlAddr string) string

GetURLHostName ...

func GetUrl

func GetUrl(URL string) (string, error)

func JsonToYaml

func JsonToYaml(json map[string]interface{}) (string, error)

func RecursionGetKeyAndValue

func RecursionGetKeyAndValue(jsonValues map[string]interface{}, mapKey string)

RecursionGetKeyAndValue 递归获取map中的key和value

func RecursionReplaceValue

func RecursionReplaceValue(jsonValues map[string]interface{}, replaceKeyArr []string, replaceValue interface{})

RecursionReplaceValue 递归替换map中的value

func ReplaceMapValue

func ReplaceMapValue(jsonValues map[string]interface{}, replaceMap map[string]interface{}) map[string]interface{}

ReplaceMapValue 拿匹配到的key和value去替换原始的map中的key和value

func ReplaceRepo

func ReplaceRepo(origin, addr, namespace string) string

func ReplaceWrapLine

func ReplaceWrapLine(script string) string

func SendRequest

func SendRequest(url, method string, header http.Header, body []byte) ([]byte, error)

func Tar

func Tar(src, dst string) (err error)

func UnTar

func UnTar(dst, src string) (err error)

func ValidateObjectId

func ValidateObjectId(id string) (oid bson.ObjectId, err error)

func WriteFile

func WriteFile(filename string, data []byte, perm os.FileMode) error

func YamlToJson

func YamlToJson(valuesYaml string) (map[string]interface{}, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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