utils

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const DEFAULT_TIMEOUT_SEC int64 = 5 // Same as the default timeout of go-micro.
View Source
const Epsilon float64 = 0.00000001

Epsilon ...

Variables

This section is empty.

Functions

func CompareDeleteAndAddList added in v1.3.2

func CompareDeleteAndAddList(addList, delList []string) []string

func Contained

func Contained(obj, target interface{}) bool

func GetTimeoutSec added in v0.12.0

func GetTimeoutSec(objSize int64) int64

func IsDuplicateItemExist added in v1.3.2

func IsDuplicateItemExist(itemList []string) []string

func IsEqual

func IsEqual(key string, value interface{}, reqValue interface{}) (bool, error)

IsEqual ...

func IsFloatEqual

func IsFloatEqual(a, b float64) bool

IsFloatEqual ...

func MergeGeneralMaps

func MergeGeneralMaps(maps ...map[string]interface{}) map[string]interface{}

func MergeStringMaps

func MergeStringMaps(maps ...map[string]string) map[string]string

func PathExists

func PathExists(path string) (bool, error)

func PrepareUpdateList added in v1.3.2

func PrepareUpdateList(currList, addList, delList []string) []string

func RandSeq

func RandSeq(n int, chs []rune) string

func RandSeqWithAlnum

func RandSeqWithAlnum(n int) string

func ReadBody added in v1.4.1

func ReadBody(r *restful.Request) []byte

func ResourcesAlreadyExists added in v1.3.2

func ResourcesAlreadyExists(currList, newList []string) []string

func ResourcesCheckBeforeRemove added in v1.3.2

func ResourcesCheckBeforeRemove(currList, newList []string) []string

func Retry

func Retry(retryNum int, desc string, silent bool, fn func(retryIdx int, lastErr error) error) error

func RvRepElement

func RvRepElement(arr []string) []string

remove redundant elements

func StructToMap

func StructToMap(structObj interface{}) (map[string]interface{}, error)

StructToMap ...

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