basal

package module
v0.0.0-...-da43305 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 28 Imported by: 2

README

basal

基础模块

Documentation

Index

Constants

View Source
const ERR_PID_ITOA = -2 //查找错误
View Source
const ERR_PID_NETWORK = -4 //网络协议错误
View Source
const ERR_PID_NOT_FOUND = -1 //没有找到进程
View Source
const ERR_PID_OS = -3 //系统错误
View Source
const HANDLE_FILE_FLAG_WRITER = os.O_WRONLY | os.O_APPEND | os.O_CREATE
View Source
const HANDLE_FILE_PERM_ALL = 0777
View Source
const JSON_APPEND = -1 //追加
View Source
const JSON_APPEND_IN_FRONT = -2 //追加在前面
View Source
const JSON_INDEX_FIRST = -4 //第一的位置
View Source
const JSON_INDEX_LAST = -3 //最后的位置
View Source
const LINUX = `linux`
View Source
const WINDOWS = `windows`

Variables

View Source
var BigEndian = bigEndian{}
View Source
var BufferPool = internal.BufferPool
View Source
var Compress compress
View Source
var ErrNotFile = log.NewError("not file")
View Source
var ErrNotFolder = log.NewError("not folder")
View Source
var LittleEndian = littleEndian{}
View Source
var Path = fpath{}
View Source
var RuneCJKA = RuneRange{'\uFF00', '\uFFEF'} //全角ASCII、全角中英文标点、半宽片假名、半宽平假名、半宽韩文字母

中日韩

View Source
var RuneChineseBasic = RuneRange{'\u4E00', '\u9FA5'} //基本汉字
View Source
var RuneChineseBasicEx = RuneRange{'\u9FA6', '\u9FFF'} //基本汉字补充
View Source
var RuneChineseBh = RuneRange{'\u31C0', '\u31E3'} //汉字笔画
View Source
var RuneChineseExA = RuneRange{'\u3400', '\u4DBF'} //汉字扩展A
View Source
var RuneChineseExB = RuneRange{ToRune("\\u20000"), ToRune("\\u2A6DF")} //汉字扩展B
View Source
var RuneChineseExC = RuneRange{ToRune("\\u2A700"), ToRune("\\u2B738")} //汉字扩展C
View Source
var RuneChineseExD = RuneRange{ToRune("\\u2B740"), ToRune("\\u2B81D")} //汉字扩展D
View Source
var RuneChineseExE = RuneRange{ToRune("\\u2B820"), ToRune("\\u2CEA1")} //汉字扩展E
View Source
var RuneChineseExF = RuneRange{ToRune("\\u2CEB0"), ToRune("\\u2EBE0")} //汉字扩展F
View Source
var RuneChineseExG = RuneRange{ToRune("\\u30000"), ToRune("\\u3134A")} //汉字扩展G
View Source
var RuneChineseJg = RuneRange{'\u2FF0', '\u2FFB'} //汉字结构
View Source
var RuneChineseJr = RuneRange{'\uF900', '\uFAD9'} //兼容汉字
View Source
var RuneChineseJrEx = RuneRange{ToRune("\\u2F800"), ToRune("\\u2FA1D")} //兼容扩展
View Source
var RuneChineseKx = RuneRange{'\u2F00', '\u2FD5'} //康熙部首
View Source
var RuneChineseKxEx = RuneRange{'\u2E80', '\u2EF3'} //部首扩展
View Source
var RuneChinesePua = RuneRange{'\uE815', '\uE86F'} //PUA(GBK)部件
View Source
var RuneChinesePuaEx = RuneRange{'\uE400', '\uE5E8'} //部件扩展
View Source
var RuneChinesePuaSup = RuneRange{'\uE600', '\uE6CF'} //PUA增补
View Source
var RuneChineseYq = RuneRange{'\u3007', '\u3007'} //〇
View Source
var RuneChineseZy = RuneRange{'\u3105', '\u312F'} //汉语注音
View Source
var RuneChineseZyEx = RuneRange{'\u31A0', '\u31BA'} //注音扩展
View Source
var RuneJapaneseHir = RuneRange{'\u3040', '\u309F'} //平假名

日语

View Source
var RuneJapaneseKPE = RuneRange{'\u31F0', '\u31FF'} //片假名音标扩展集
View Source
var RuneJapaneseKat = RuneRange{'\u30A0', '\u30FF'} //片假名
View Source
var RuneKoreanHJ = RuneRange{'\u1100', '\u11FF'} //谚文字母
View Source
var RuneKoreanPCL = RuneRange{'\u3130', '\u318F'} //谚文相容字母
View Source
var RuneKoreanPSC = RuneRange{'\uAC00', '\uD7AF'} //谚文音节字符

韩语

View Source
var RuneLower = RuneRange{'a', 'z'} //小写
View Source
var RuneNumber = RuneRange{'0', '9'} //数字

汉字

View Source
var RuneUpper = RuneRange{'A', 'Z'} //大写
View Source
var SystemCmder = &systemCommand{}

系统命令

Functions

func Abs

func Abs[T Number](n T) T

func AbsInt16

func AbsInt16(n int16) int16

func AbsInt32

func AbsInt32(n int32) int32

func AbsInt64

func AbsInt64(n int64) int64

func AbsInt8

func AbsInt8(n int8) int8

func AddRemain

func AddRemain[T Number](oldNum, addNum, numMax T) (newNum, added, remained T)

添加剩余

func AtoInt

func AtoInt(s string) (int, error)

func AtoInt32

func AtoInt32(s string) (int32, error)

func AtoInt64

func AtoInt64(s string) (x int64, err error)

有小数的直接忽略

func BytesPtrToStr

func BytesPtrToStr(bs []byte) string

bytes转字符串

func Caller

func Caller(skip int) (file string, line int)

func CallerInFunc

func CallerInFunc(skip int) (name string, file string, line int)

func CallerLineStack

func CallerLineStack(stack string) (name string, file string)

func CallerShort

func CallerShort(skip int) (file string, line int)

func DumpJson

func DumpJson(v interface{}, indent bool) string

func Exception

func Exception(catch ...func(stack string, e error))

func ExceptionError

func ExceptionError(catch func(e error))

func Format

func Format(format string, sign, startByte, endByte byte, kws KwArgs, ignore bool) string

func GetBitByte

func GetBitByte(v byte, offset int) bool

func GetBitUint16

func GetBitUint16(v uint16, offset int) bool

func GetBitUint32

func GetBitUint32(v uint32, offset int) bool

func GetBitUint64

func GetBitUint64(v uint64, offset int) bool

func GetBitUint8

func GetBitUint8(v uint8, offset int) bool

func GetFuncFullName

func GetFuncFullName(i interface{}) string

func GetFuncName

func GetFuncName(i interface{}, seps ...rune) string

func GetFuncShortName

func GetFuncShortName(i interface{}) string

func IsExist

func IsExist(path string) (bool, error)

文件或文件夹是否存在

func IsExistBy

func IsExistBy(f *os.File, err error) bool

文件是否存在

func IsExistByFileInfo

func IsExistByFileInfo(info os.FileInfo) bool

IsExistByFileInfo

@Description: 文件是否存在
@param info 文件信息
@return bool 是否存在

func IsExistFile

func IsExistFile(path string) (bool, error)

文件是否存在

func IsExistFolder

func IsExistFolder(path string) (bool, error)

文件夹是否存在

func IsNilPointer

func IsNilPointer(value interface{}) bool

func IsPointer

func IsPointer(value interface{}) bool

func IsUTF8

func IsUTF8(buf []byte) bool

func ItoA

func ItoA(dst *[]byte, i int, w int)

ItoA w>数字宽度时补0, w <=数字宽度时不补

func ItoAW

func ItoAW(dst *[]byte, i int, w int)

ItoAW 强制取数字宽度的w,足够时截断,不足时补0

func LoadJsonBytesTo

func LoadJsonBytesTo(js []byte, toPtr interface{}) error

func LoadJsonFileTo

func LoadJsonFileTo(jsFileName string, toPtr interface{}) error

func LoadJsonStringTo

func LoadJsonStringTo(js string, toPtr interface{}) error

func MD5Bytes

func MD5Bytes(s []byte) string

func MD5File

func MD5File(filename string) (string, error)

func MD5String

func MD5String(s string) string

func NewBuffer

func NewBuffer(size int) *internal.Buffer

func NewError

func NewError(format string, a ...interface{}) error

func NumberToBool

func NumberToBool[T Number](value T) bool

func OpenFile

func OpenFile(folderPath string, fileName string, flag int, perm os.FileMode) (file *os.File, err error)

打开文件 自动创建目录

func OpenFileB

func OpenFileB(filePath string, flag int, perm os.FileMode) (file *os.File, err error)

打开文件 自动创建目录

func PowInt64

func PowInt64(m int64, n int) int64

func Reverse

func Reverse[T any](arr []T)

func Round

func Round(value float64, digit int) float64

func SamePointer

func SamePointer(pointers ...unsafe.Pointer) bool

func SamePtr

func SamePtr(ptrs ...interface{}) bool

func SetBitByte

func SetBitByte(v byte, t bool, offset int) byte

func SetBitUint16

func SetBitUint16(v uint16, t bool, offset int) uint16

func SetBitUint32

func SetBitUint32(v uint32, t bool, offset int) uint32

func SetBitUint64

func SetBitUint64(v uint64, t bool, offset int) uint64

func SetBitUint8

func SetBitUint8(v uint8, t bool, offset int) uint8

func Shuffle

func Shuffle[T any](arr []T)

func Slot

func Slot(key string) int

func Sprintf

func Sprintf(format string, a ...interface{}) string

func StrAddBeforeNotHas

func StrAddBeforeNotHas(s string, old rune, add rune) string

字符串中字符前(不存在此字符就加此字符) 一般mysql语句拼接使用 eg: old '\”, before add '\\'

func StrPtrToBytes

func StrPtrToBytes(s string) []byte

字符串转bytes 慎修改转换后的值

func ToError

func ToError(r interface{}) (err error)

func ToFloat32

func ToFloat32(value interface{}) (float32, error)

func ToFloat64

func ToFloat64(value interface{}) (float64, error)

func ToInt

func ToInt(value interface{}) (int, error)

func ToInt16

func ToInt16(value interface{}) (int16, error)

func ToInt32

func ToInt32(value interface{}) (int32, error)

func ToInt64

func ToInt64(value interface{}) (int64, error)

func ToInt8

func ToInt8(value interface{}) (int8, error)

func ToLowerLine

func ToLowerLine(s string) string

驼峰写法转下划线小写 eg: LevelAbc=>level_abc

func ToRune

func ToRune(s string) rune

转换为unicode编码

func ToString

func ToString(value interface{}, indent bool) (string, error)

func ToUint

func ToUint(value interface{}) (uint, error)

func ToUint16

func ToUint16(value interface{}) (uint16, error)

func ToUint32

func ToUint32(value interface{}) (uint32, error)

func ToUint64

func ToUint64(value interface{}) (uint64, error)

func ToUint8

func ToUint8(value interface{}) (uint8, error)

func Try

func Try(f func(), catch func(stack string, e error))

func TryDumpJson

func TryDumpJson(v interface{}, indent bool) (string, error)

func Type

func Type(value interface{}) reflect.Type

Types

type Buffer

type Buffer = internal.Buffer

type BytesBinary

type BytesBinary []byte

func (*BytesBinary) Clear

func (m *BytesBinary) Clear()

func (*BytesBinary) Get

func (m *BytesBinary) Get(offset int) bool

func (*BytesBinary) GetBinaryString

func (m *BytesBinary) GetBinaryString() string

func (*BytesBinary) ReSize

func (m *BytesBinary) ReSize(size int)

func (*BytesBinary) Set

func (m *BytesBinary) Set(t bool, offset int)

type Float

type Float interface {
	float32 | float64
}

type Formatter

type Formatter struct {
	// contains filtered or unexported fields
}

格式器

func NewFormatter

func NewFormatter(signByte, startByte, endByte byte, ignore bool) *Formatter

新建格式器 signByte标志字符 startByte 开始字符 endByte 结束字符 ignore: true 忽略非完整格式, false 不忽略出现非完整格式后panic

func (*Formatter) Format

func (m *Formatter) Format(format string, kws KwArgs) string

type HandleFile

type HandleFile struct {
	// contains filtered or unexported fields
}

func NewHandleFile

func NewHandleFile(flag int, perm os.FileMode) *HandleFile

func OpenHandleFile

func OpenHandleFile(folderPath string, fileName string, flag int, perm os.FileMode) (*HandleFile, error)

func (*HandleFile) Close

func (my *HandleFile) Close()

func (*HandleFile) PathName

func (my *HandleFile) PathName() string

func (*HandleFile) SetPathName

func (my *HandleFile) SetPathName(folderPath, fileName string) bool

func (*HandleFile) Write

func (my *HandleFile) Write(b []byte) (n int, err error)

func (*HandleFile) WriteString

func (my *HandleFile) WriteString(s string) (n int, err error)

type Integer

type Integer interface {
	int | int64 | int32 | int16 | int8 | uint | uint64 | uint32 | uint16 | uint8
}

type Json

type Json struct {
	// contains filtered or unexported fields
}

func LoadJson

func LoadJson(js interface{}) *Json

LoadJson

@Description: 加载为json对象
@param js  map[string] interface, []interface, struct, json string, json []byte, *os.File
@return *Json

func TryLoadJson

func TryLoadJson(js interface{}) (*Json, error)

func (*Json) Bool

func (my *Json) Bool() bool

func (*Json) Clear

func (my *Json) Clear()

func (*Json) Delete

func (my *Json) Delete(keys ...interface{}) bool

func (*Json) Get

func (my *Json) Get(keys ...interface{}) interface{}

func (*Json) GetJson

func (my *Json) GetJson(keys ...interface{}) *Json

func (*Json) Int32

func (my *Json) Int32() int32

func (*Json) Int64

func (my *Json) Int64() int64

func (*Json) Interface

func (my *Json) Interface() interface{}

func (*Json) IsNil

func (my *Json) IsNil() bool

func (*Json) Load

func (my *Json) Load(js interface{}) error

func (*Json) RangeSliceJson

func (my *Json) RangeSliceJson(f func(i int, elem *Json) bool)

func (*Json) Set

func (my *Json) Set(args ...interface{}) error

func (*Json) Slice

func (my *Json) Slice() []interface{}

func (*Json) String

func (my *Json) String() string

func (*Json) ToBool

func (my *Json) ToBool() (bool, error)

func (*Json) ToFloat32

func (my *Json) ToFloat32() (float32, error)

func (*Json) ToFloat64

func (my *Json) ToFloat64() (float64, error)

func (*Json) ToInt32

func (my *Json) ToInt32() (int32, error)

func (*Json) ToInt64

func (my *Json) ToInt64() (int64, error)

func (*Json) ToString

func (my *Json) ToString(indent bool) (string, error)

func (*Json) TryBool

func (my *Json) TryBool() (v bool, ok bool)

func (*Json) TryBytes

func (my *Json) TryBytes() ([]byte, error)

func (*Json) TryFloat32

func (my *Json) TryFloat32() (float32, error)

func (*Json) TryFloat64

func (my *Json) TryFloat64() (float64, error)

func (*Json) TryInt

func (my *Json) TryInt() (int, error)

func (*Json) TryInt32

func (my *Json) TryInt32() (int32, error)

func (*Json) TryInt64

func (my *Json) TryInt64() (int64, error)

func (*Json) TryMap

func (my *Json) TryMap() (map[string]interface{}, error)

func (*Json) TrySlice

func (my *Json) TrySlice() ([]interface{}, error)

type JsonINumber

type JsonINumber interface {
	String() string
	Float64() (float64, error)
	Int64() (int64, error)
}

type KVPair

type KVPair[K comparable, V any] struct {
	Key   K
	Value V
}

type KwArgs

type KwArgs map[string]interface{}

type LRUCache

type LRUCache[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache[K comparable, V any](size int) *LRUCache[K, V]

func (*LRUCache[K, V]) Get

func (m *LRUCache[K, V]) Get(key K) (v V, ok bool)

func (*LRUCache[K, V]) Len

func (m *LRUCache[K, V]) Len() int

func (*LRUCache[K, V]) Remove

func (m *LRUCache[K, V]) Remove(key K)

func (*LRUCache[K, V]) Set

func (m *LRUCache[K, V]) Set(key K, value V)

func (*LRUCache[K, V]) SetSize

func (m *LRUCache[K, V]) SetSize(size int)

func (*LRUCache[K, V]) Size

func (m *LRUCache[K, V]) Size() int
type LinkList struct {
	// contains filtered or unexported fields
}
func NewLinkList() *LinkList

func (*LinkList) Back

func (m *LinkList) Back() *LinkListNode

func (*LinkList) Front

func (m *LinkList) Front() *LinkListNode

func (*LinkList) Init

func (m *LinkList) Init() *LinkList

func (*LinkList) InsertAfter

func (m *LinkList) InsertAfter(v unsafe.Pointer, mark *LinkListNode) *LinkListNode

func (*LinkList) InsertBefore

func (m *LinkList) InsertBefore(v unsafe.Pointer, mark *LinkListNode) *LinkListNode

func (*LinkList) Len

func (m *LinkList) Len() int

func (*LinkList) MoveAfter

func (m *LinkList) MoveAfter(node, mark *LinkListNode)

func (*LinkList) MoveBefore

func (m *LinkList) MoveBefore(node, mark *LinkListNode)

func (*LinkList) MoveToBack

func (m *LinkList) MoveToBack(node *LinkListNode)

func (*LinkList) MoveToFront

func (m *LinkList) MoveToFront(node *LinkListNode)

func (*LinkList) PushBack

func (m *LinkList) PushBack(v unsafe.Pointer) *LinkListNode

func (*LinkList) PushBackList

func (m *LinkList) PushBackList(other *LinkList)

func (*LinkList) PushFront

func (m *LinkList) PushFront(v unsafe.Pointer) *LinkListNode

func (*LinkList) PushFrontList

func (m *LinkList) PushFrontList(other *LinkList)

func (*LinkList) Remove

func (m *LinkList) Remove(node *LinkListNode) bool

type LinkListNode

type LinkListNode struct {
	Value unsafe.Pointer
	// contains filtered or unexported fields
}

func (*LinkListNode) Next

func (m *LinkListNode) Next() *LinkListNode

func (*LinkListNode) Prev

func (m *LinkListNode) Prev() *LinkListNode

type Map

type Map[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*Map[K, V]) Delete

func (m *Map[K, V]) Delete(key K, f func(value V) bool) bool

Delete

@Description: 函数内不可再调本Map方法
@receiver m
@param key
@param f
@return bool

func (*Map[K, V]) Get

func (m *Map[K, V]) Get(key K) (value V, ok bool)

func (*Map[K, V]) Len

func (m *Map[K, V]) Len() int

func (*Map[K, V]) Range

func (m *Map[K, V]) Range(f func(key K, value V) bool) bool

Range

@Description: 函数内不可再调本Map方法
@receiver m
@param f
@return bool

func (*Map[K, V]) Set

func (m *Map[K, V]) Set(key K, value V) (old V)

type Mutex

type Mutex struct {
	// contains filtered or unexported fields
}

func (*Mutex) Exec

func (m *Mutex) Exec(f func())

func (*Mutex) Lock

func (m *Mutex) Lock()

func (*Mutex) Unlock

func (m *Mutex) Unlock()

type NextNumber

type NextNumber = internal.NextNumber

func NewNextNumber

func NewNextNumber(s string) *NextNumber

type Number

type Number interface {
	Integer | Float
}

type OnceSuccess

type OnceSuccess struct {
	// contains filtered or unexported fields
}

func (*OnceSuccess) Do

func (m *OnceSuccess) Do(f func() bool) bool

func (*OnceSuccess) DoError

func (m *OnceSuccess) DoError(f func() error) error

func (*OnceSuccess) Success

func (m *OnceSuccess) Success() bool

type PARALLEL_ACQUIRE_STATE

type PARALLEL_ACQUIRE_STATE int8
const PARALLEL_ACQUIRE_CLOSED PARALLEL_ACQUIRE_STATE = 3 //关闭
const PARALLEL_ACQUIRE_MAX PARALLEL_ACQUIRE_STATE = 1 //达到最大并发
const PARALLEL_ACQUIRE_SUCCESS PARALLEL_ACQUIRE_STATE = 0 //正常
const PARALLEL_ACQUIRE_TIMEOUT PARALLEL_ACQUIRE_STATE = 2 //超时

type ParallelController

type ParallelController struct {
	// contains filtered or unexported fields
}

ParallelController 并发控制器

func NewParallelController

func NewParallelController(max int32, block bool, timeout time.Duration) *ParallelController

func (*ParallelController) Acquire

func (m *ParallelController) Acquire() (state PARALLEL_ACQUIRE_STATE)

Acquire

@Description: 获取
@receiver m
@return state 状态

func (*ParallelController) Release

func (m *ParallelController) Release() bool

Release

@Description: 释放
@receiver m
@return bool

type ParallelLimiter

type ParallelLimiter struct {
	// contains filtered or unexported fields
}

ParallelLimiter @Description: 并发限制器

func (*ParallelLimiter) Acquire

func (m *ParallelLimiter) Acquire() (releaser ParallelReleaser, state PARALLEL_ACQUIRE_STATE)

Acquire

@Description: 获取并发权限
@receiver m
@return releaser 返回释放器
@return state 状态

func (*ParallelLimiter) Init

func (m *ParallelLimiter) Init(max int32, block bool, timeout time.Duration)

Init

@Description: 初始化
@receiver m
@param max 最大并发数
@param block 是否苏塞
@param timeout 超时时间

type ParallelReleaser

type ParallelReleaser interface {
	Release() bool
}

type RWMutex

type RWMutex struct {
	// contains filtered or unexported fields
}

func (*RWMutex) Exec

func (m *RWMutex) Exec(f func())

func (*RWMutex) Lock

func (m *RWMutex) Lock()

func (*RWMutex) RExec

func (m *RWMutex) RExec(f func())

func (*RWMutex) RLock

func (m *RWMutex) RLock()

func (*RWMutex) RLocker

func (m *RWMutex) RLocker() sync.Locker

func (*RWMutex) RUnlock

func (m *RWMutex) RUnlock()

func (*RWMutex) Unlock

func (m *RWMutex) Unlock()

type RuneRange

type RuneRange [2]rune

字符编码范围

func (*RuneRange) Check

func (m *RuneRange) Check(r rune) bool

type SortedList

type SortedList struct {
	// contains filtered or unexported fields
}

有序列表

func NewSortedList

func NewSortedList(scoreRepeat, reverse bool, getScore func(v interface{}) int64, getKey func(v interface{}) int64) *SortedList

func (*SortedList) Add

func (my *SortedList) Add(v interface{}) bool

func (*SortedList) Back

func (my *SortedList) Back() (v interface{}, found bool)

func (*SortedList) Cap

func (my *SortedList) Cap() int

func (*SortedList) Clear

func (my *SortedList) Clear()

func (*SortedList) Front

func (my *SortedList) Front() (v interface{}, found bool)

func (*SortedList) Get

func (my *SortedList) Get(index int) (v interface{}, found bool)

func (*SortedList) Len

func (my *SortedList) Len() int

func (*SortedList) PopBack

func (my *SortedList) PopBack() (v interface{}, found bool)

func (*SortedList) PopFront

func (my *SortedList) PopFront() (v interface{}, found bool)

func (*SortedList) RemoveByIndex

func (my *SortedList) RemoveByIndex(index int) bool

func (*SortedList) RemoveByKey

func (my *SortedList) RemoveByKey(key int64) bool

func (*SortedList) RemoveByScore

func (my *SortedList) RemoveByScore(score int64) bool

func (*SortedList) SearchByKey

func (my *SortedList) SearchByKey(key int64) (int, bool)

func (*SortedList) SearchByScore

func (my *SortedList) SearchByScore(score int64) (index int, found bool)

func (*SortedList) Slice

func (my *SortedList) Slice() []interface{}

func (*SortedList) String

func (my *SortedList) String() string

type SortedSet

type SortedSet struct {
	*SortedList
}

有序集合

func NewSortedSet

func NewSortedSet(reverse bool, getScore func(v interface{}) int64, getKey func(v interface{}) int64) *SortedSet

func NewSortedSetInt

func NewSortedSetInt(reverse bool) *SortedSet

func (*SortedSet) Add

func (my *SortedSet) Add(v interface{}) bool

func (*SortedSet) Difference

func (my *SortedSet) Difference(b *SortedSet) *SortedSet

my与b的差集

func (*SortedSet) Intersection

func (my *SortedSet) Intersection(b *SortedSet) *SortedSet

交集

func (*SortedSet) Union

func (my *SortedSet) Union(b *SortedSet) *SortedSet

并集

type TypeValue

type TypeValue struct {
	// contains filtered or unexported fields
}

func TypeValueOf

func TypeValueOf(ptr interface{}) *TypeValue

func (*TypeValue) GetElem

func (m *TypeValue) GetElem() (tElem reflect.Type, vElem reflect.Value, ok bool)

func (*TypeValue) GetMethodByName

func (m *TypeValue) GetMethodByName(name string) interface{}

func (*TypeValue) RangeFields

func (m *TypeValue) RangeFields(f func(tField reflect.StructField, vField reflect.Value) bool)

func (*TypeValue) RangeMethods

func (m *TypeValue) RangeMethods(f func(name string, method interface{}) bool)

func (*TypeValue) SetFieldByName

func (m *TypeValue) SetFieldByName(v interface{}, name string) bool

func (*TypeValue) SetFieldByType

func (m *TypeValue) SetFieldByType(v interface{}) (ok bool)

func (*TypeValue) SetFieldValueByName

func (m *TypeValue) SetFieldValueByName(value reflect.Value, name string) bool

func (*TypeValue) SetFieldValueByType

func (m *TypeValue) SetFieldValueByType(value reflect.Value) (ok bool)

func (*TypeValue) Type

func (m *TypeValue) Type() reflect.Type

func (*TypeValue) Value

func (m *TypeValue) Value() reflect.Value

type UnicodeChecker

type UnicodeChecker []func(r rune) bool

字符串编码检查

func (*UnicodeChecker) Check

func (m *UnicodeChecker) Check(s string) bool

func (*UnicodeChecker) Replace

func (m *UnicodeChecker) Replace(s string, rep rune) string

type Waiter

type Waiter struct {
	// contains filtered or unexported fields
}

func (*Waiter) Add

func (m *Waiter) Add(n uint32)

func (*Waiter) Done

func (m *Waiter) Done()

func (*Waiter) Wait

func (m *Waiter) Wait(timeout time.Duration) bool

返回false表示超时

Jump to

Keyboard shortcuts

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