utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 ReplaceAll

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

func ToJson

func ToJson(object interface{}) string

func ToJsonByte

func ToJsonByte(object interface{}) []byte

func ToSimpleJson

func ToSimpleJson(object interface{}) *simplejson.Json

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