util

package
v0.0.0-...-4972dd0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelInArrayString

func DelInArrayString(arr *[]string, index int) []string

func ExistsInMap

func ExistsInMap(sMap interface{}, index interface{}) bool

func ExtCall

func ExtCall(filename string, args ...string) (output []byte, err error)

运行操作系统命令

func FileExists

func FileExists(name string) bool

func InArrayString

func InArrayString(strArr *[]string, sep string) bool

func JsonEncode

func JsonEncode(v interface{}) (re []byte)

JsonEncode json编码. 不适用于普遍的数据类型,主要用于doveclient中 toml的转换。

func ListToJson

func ListToJson(list []interface{}) []byte

func Md5File

func Md5File(filePath string) (string, error)

func StringSliceUnique

func StringSliceUnique(s *[]string)

func StringSplit

func StringSplit(str string, sep string) []string

不包含空字符串的split

func TomlConfigValueToJson

func TomlConfigValueToJson(content string) (re []byte, err error)

解析配置系统中toml形式配置的值(即第一个key的值).

func TomlToJson

func TomlToJson(content string) ([]byte, error)

func TomlToMap

func TomlToMap(content string) (map[string]interface{}, error)

func TraverseTomlAsJson

func TraverseTomlAsJson(t *toml.TomlTree) []byte

将tomlTree转成json字节码。只适用于doveclient内部使用,非通用的json解码

func TraverseTomlTree

func TraverseTomlTree(t *toml.TomlTree) map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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