Categorygithub.com/yrpc/util
modulepackage
0.0.0-20191229105456-04e44c1bb858
Repository: https://github.com/yrpc/util.git
Documentation: pkg.go.dev

# README

util

useful toolkit

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

CRC32 computes the Castagnoli CRC32 of the given data.
FindOnceNum find the number that appears only once caller should make sure only one num appears once.
FNV32 returns a new 32-bit FNV-1 hash.Hash.
FNV32a returns a new 32-bit FNV-1a hash.Hash.
Func2Value wraps a func with reflect.Value.
FuncInputTypes for retrieve func input types.
FuncOutputTypes for retrieve func output types.
GoFunc runs a goroutine under WaitGroup.
InstanceByType returns a instance of reflect.Type wrapped in interface{}.
InstancePtrByClone creates an instance ptr by clone.
InstancePtrByType returns a pointer to instance.
IsPalindrome checks whether n is palindrome.
LongestConsecutive finds longest consecutive in nums.
Madvise uses the madvise system call to give advise about the use of memory when using a slice that is memory-mapped to a file.
ManacherFallback when all byte values are used in s.
ManacherWithFallback tries Manacher if possible.
Max for int.
MaxLengthOfUniqueSubstring returns the max length of unique sub string.
Min for int.
MinCoveringSubstr finds min substr of s that covers t.
MLock mmaped bytes.
Mmap uses the mmap system call to memory-map a file.
MSync for flush mmaped bytes.
MUnlock mmaped bytes.
Munmap unmaps a previously mapped slice.
NewByteArena is ctor for ByteArena.
PatternMatchAllBU matches p against the whole s pattern supprts .
PatternMatchAllRec is the recursive version for PatternMatchAll.
PatternMatchAllTD matches p against the whole s pattern supprts .
PoorManUUID generate a uint64 uuid.
PoorManUUID2 doesn't care whether client/server side.
ReplaceFuncVar for replace funcVar with fn.
ReverseDigits for reverse digits.
ScanMethods for scan methods of s.
Slice does no copy to change string to slice.
StackSize calculates current stack size.
String does no copy to change slice to string use your own risk.
StructFields for general struct field info.
StructFieldValues for manipulate field values.
TryUntilSuccess will try f until success.
TypeByPointer for retrieve reflect.Type by a pointer value.

# Variables

ErrWorkerPoolClosed when run on closed pool.

# Structs

ByteArena for reduce GC pressure, not concurrent safe.
WorkerPool is pool of workers.