util4go

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 5

README

boot4go-util

a utility toolkit for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinarySearch

func BinarySearch(a []string, v interface{}) int

func BuildFormatString

func BuildFormatString(format string, a ...any) string

func BuildString

func BuildString(a ...any) string

func ElmType

func ElmType(value reflect.Value) reflect.Type

func Int64ToStr

func Int64ToStr(i int64) string

Int64ToStr int64 to str

func IsEmpty

func IsEmpty(str string) bool

func LeftPad

func LeftPad(str string, limit int, placeholder rune) string

func MD5

func MD5(data string) string

func NewInstanceValue

func NewInstanceValue(t reflect.Type) reflect.Value

func ParseParameterName

func ParseParameterName(str string) []string

func Reduce

func Reduce[T any, R any](source []T, fn func(one T) (R, bool)) []R

func ReplaceParameterValue

func ReplaceParameterValue(str string, keyAndValue map[string]string) string

func ReplaceParameterWithKeyValue

func ReplaceParameterWithKeyValue(str string, keyAndValue map[string]string) string

func SaltMd5

func SaltMd5(data, salt string) string

func Str2Bool

func Str2Bool(source string) (any, error)

func Str2Float32

func Str2Float32(source string) (any, error)

func Str2Float64

func Str2Float64(source string) (any, error)

func Str2Int

func Str2Int(source string) (any, error)

func Str2Int16

func Str2Int16(source string) (any, error)

func Str2Int32

func Str2Int32(source string) (any, error)

func Str2Int64

func Str2Int64(source string) (any, error)

func Str2Int8

func Str2Int8(source string) (any, error)

func Str2Object

func Str2Object(v string, k reflect.Kind) (any, error)

func Str2UInt64

func Str2UInt64(source string) (any, error)

func Str2Uint

func Str2Uint(source string) (any, error)

func Str2Uint16

func Str2Uint16(source string) (any, error)

func Str2Uint32

func Str2Uint32(source string) (any, error)

func Str2Uint8

func Str2Uint8(source string) (any, error)

func StrNumSuffixInt

func StrNumSuffixInt(str string, mult int) int

StrNumSuffixInt Parse a number with K/M/G suffixes based on thousands (1000) or 2^10 (1024)

func String

func String(obj any) string

func Substring

func Substring(source string, start int, end int) string

func Type2Str

func Type2Str(t reflect.Type) (string, error)

func TypeOf

func TypeOf(obj any) reflect.Type

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