utils

package
v0.0.0-...-91afd93 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: GPL-3.0 Imports: 24 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalMatchScores

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

func CalMatchScoresV2

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

func Combination

func Combination(WordList []string) (result []string)

func Exist

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

func Exists

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

func GenRandomBytes

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

func GetCurrentPath

func GetCurrentPath() (string, error)

func LogInterface

func LogInterface(i interface{}) string

func MD5

func MD5(data []byte) string

func PanicWrapper

func PanicWrapper(f func())

func ParseCookies

func ParseCookies(file string) []*http.Cookie

func ParseJson

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

func ParseJsonV2

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

func ParseJsonV3

func ParseJsonV3(data []byte, dest interface{}) error

func ParseJsonV4

func ParseJsonV4(reader io.Reader, dest interface{}) error

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 ToFixed

func ToFixed(num float64, precision int) float64

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