utils

package
v0.0.0-...-bf7e6f2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSON = jsoniter.ConfigCompatibleWithStandardLibrary

Functions

func CalMatchScores

func CalMatchScores(beMatchedData string, keyword []string) float32

func CalMatchScoresV2

func CalMatchScoresV2(beMatchedData string, beSplitedData string, matchType string) float32

func Exist

func Exist(key string, h map[string]interface{}) bool

func Exists

func Exists(keys []string, h map[string]interface{}) bool

func FormatMap

func FormatMap(data map[string]interface{}) string

func GenRandomBytes

func GenRandomBytes(size int) (blk []byte, err error)

func GetCurrentPath

func GetCurrentPath() (string, error)

func MD5

func MD5(data []byte) string

func ParseJson

func ParseJson(data []byte) map[string]interface{}

func ParseJsonV2

func ParseJsonV2(reader io.Reader) map[string]interface{}

func ParseSingerKeyWord

func ParseSingerKeyWord(data string) []string

func ParseSongNameKeyWord

func ParseSongNameKeyWord(data string) []string

func ReplaceAll

func ReplaceAll(str string, expr string, replaceStr string) string

func ToJson

func ToJson(object interface{}) string

func UnGzip

func UnGzip(gzipData []byte) ([]byte, error)

func UnGzipV2

func UnGzipV2(gzipData io.Reader) (io.Reader, error)

Types

type ByLenSort

type ByLenSort []string

func (ByLenSort) Len

func (a ByLenSort) Len() int

func (ByLenSort) Less

func (a ByLenSort) Less(i, j int) bool

func (ByLenSort) Swap

func (a ByLenSort) Swap(i, j int)

Jump to

Keyboard shortcuts

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