utils

package
v2.10.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsciiEncode added in v2.8.6

func AsciiEncode(s string) string

func Chtime

func Chtime(filename string) bool

func CleanSpiltCFLR added in v2.9.0

func CleanSpiltCFLR(s string) []string

func Fatal

func Fatal(s string)

func GetExcPath

func GetExcPath() string

func GetFdLimit

func GetFdLimit() int

func IsRoot

func IsRoot() bool

func IsWin

func IsWin() bool

func MaptoString

func MaptoString(m map[string]interface{}) string

转为字符串

func MergeMaps

func MergeMaps(m1, m2 map[string]interface{}) map[string]interface{}

MergeMaps merges two maps into a New map

func SliceContains

func SliceContains(s []string, e string) bool

func SliceUnique

func SliceUnique(ss []string) []string

切片去重

func Str2uintlist

func Str2uintlist(s string) []uint

func ToInt

func ToInt(s string) int

func ToString

func ToString(data interface{}) string

func ToStringMap

func ToStringMap(i interface{}) map[string]string

转为map[string]string

func UintSlice2str

func UintSlice2str(i []uint) []string

func Unique

func Unique(data interface{}) interface{}

Types

type SafeMap

type SafeMap struct {
	sync.RWMutex // 读写锁保护下面的map字段
	// contains filtered or unexported fields
}

func NewRWMap

func NewRWMap(n int) *SafeMap

新建一个RWMap

func (*SafeMap) Delete

func (m *SafeMap) Delete(k int)

func (*SafeMap) Each

func (m *SafeMap) Each(f func(k, v int) bool)

func (*SafeMap) Get

func (m *SafeMap) Get(k int) (int, bool)

func (*SafeMap) Len

func (m *SafeMap) Len() int

func (*SafeMap) Set

func (m *SafeMap) Set(k int, v int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL