Documentation ¶
Index ¶
- func BigBytesToInt(b []byte) int
- func BigIntToBytes(n int) []byte
- func FindServerConfig(servers map[string]*treaty.Server, serverId string) *treaty.Server
- func GenRangeInt(length int, from int) []int
- func GetEnvDefault(key, defVal string) string
- func InStringSlice(finder string, slice []string) bool
- func Int32ToString(val int32) string
- func Int64ToString(val int64) string
- func IntInSlice(finder int, slice []int) bool
- func IntToString(val int) string
- func IsSameSlice(slice1, slice2 []int) bool
- func JsonMarshal(data any) ([]byte, error)
- func JsonUnmarshal(data []byte, v any) error
- func LittleBytesToInt(b []byte) int
- func LittleBytesToInt32(b []byte) int32
- func LittleInt32ToBytes(n int32) []byte
- func LittleIntToBytes(n int) []byte
- func MapToSlice(m map[int]int) []int
- func Md5(str string) string
- func PathExists(path string) (bool, error)
- func RangeRand(min, max int) int
- func Recovery()
- func SafeRun(f func())
- func SetQuickCrash(crash bool)
- func ShuffleSliceInt(src []int) []int
- func SliceCopy(s []int) []int
- func SliceDel(slice []int, values ...int) []int
- func SliceDelString(slice []string, values ...string) []string
- func SliceJoin(s []int, joinString string) string
- func SliceMaxInt(s []int) int
- func SliceToMap(slice []int) map[int]int
- func SliceUniqueInt(s []int) []int
- func StringToInt(s string) int
- func StringToInt32(s string) int32
- func StringToInt64(s string) int64
- func StringToUint(s string) uint
- func Stringify(data any) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindServerConfig ¶
FindServerConfig 查找服务器配置
func GenRangeInt ¶ added in v2.0.2
GenRangeInt 创建一个长度为length的slice 值为连续的整形,第一个数为from
func InStringSlice ¶ added in v2.0.2
InStringSlice 判断某个string值是否在切片中
func IntInSlice ¶ added in v2.0.2
IntInSlice 判断某个int值是否在切片中
func IsSameSlice ¶ added in v2.0.2
IsSameSlice 判断两个slice是否相等
func JsonMarshal ¶ added in v2.1.1
func JsonUnmarshal ¶ added in v2.1.1
func LittleBytesToInt32 ¶
func LittleInt32ToBytes ¶
func MapToSlice ¶ added in v2.0.2
MapToSlice 将map[int]count 转成 []int
func PathExists ¶
func SetQuickCrash ¶ added in v2.3.5
func SetQuickCrash(crash bool)
func SliceDelString ¶ added in v2.0.2
SliceDelString 删除slice中的某些元素
func SliceToMap ¶ added in v2.0.2
SliceToMap 将[]int 转化成map[int]count
func StringToInt ¶
func StringToInt32 ¶ added in v2.0.3
func StringToInt64 ¶ added in v2.0.3
func StringToUint ¶ added in v2.0.5
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.