Documentation
¶
Index ¶
- Variables
- func B32ToNum(s string) int64
- func B32ToString(n int64) string
- func BytesToStr(b []byte) string
- func CheckSingleProc()
- func ClearTx(tx *sql.Tx)
- func CopyFile(dstName, srcName string) (written int64, err error)
- func Float2String(v interface{}) map[string]interface{}
- func GBKToUTF8(src string) string
- func GZipCompress(data []byte) []byte
- func GZipUnCompress(data []byte) ([]byte, error)
- func GetProcName() string
- func GetStacks(args ...interface{}) string
- func Go(cb func())
- func HandlePanic()
- func HandleSignal(handler func(sig os.Signal))
- func Hash(str string) uint64
- func IsChineseName(str string) bool
- func IsEmail(str string) bool
- func IsMobilePhone(str string) bool
- func IsOnlyChinese(str string) bool
- func JsonAToB(a, b interface{}) error
- func MsgpackAToB(a, b interface{}) error
- func OnPanic(h func(string))
- func PathExist(path string) bool
- func ProcExist(name string) bool
- func RandBytes(n int) []byte
- func RandCodeString(n int) string
- func RandString(n int) string
- func Safe(cb func())
- func SetAnalyzerDebug(d bool)
- func SetErrorLinePrefix(prefix string)
- func SetMaxErrorStack(max int)
- func ShuffleBytes(b []byte) []byte
- func ShuffleString(s string) string
- func StrToBytes(s string) []byte
- func TestTimeID()
- func TimeID(n int) (string, error)
- func TrimComment(data []byte) []byte
- func TrimJson(data []byte, args ...interface{}) ([]byte, error)
- func TrimJsonComma(data []byte, args ...interface{}) ([]byte, error)
- func UTF8ToGBK(src string) string
- func ZlibCompress(data []byte) []byte
- func ZlibUnCompress(data []byte) ([]byte, error)
- type Analyzer
- type ConfigLoader
- type Empty
- type Error
- type LinkTask
- type Qps
- type TimeCOunt
- type WorkerPool
- type WorkerPoolLink
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWorkerPoolTimeout = errors.New("timeout") ErrWorkerPoolStopped = errors.New("worker pool has stopped") )
View Source
var ( MAX_ERROR_STACK = 128 ERROR_LINE_PREFIX = "\n\t" )
Functions ¶
func CheckSingleProc ¶
func CheckSingleProc()
func Go ¶
func Go(cb func())
func HandlePanic ¶
func HandlePanic()
func Safe ¶
func Safe(cb func())
func TestTimeID ¶
func TestTimeID()
Types ¶
type Analyzer ¶
type ConfigLoader ¶
func NewConfigLoader ¶
func (*ConfigLoader) Add ¶
func (loader *ConfigLoader) Add(configKey string, configFieled string, onUpdate func() error)
type Empty ¶
type Empty struct{}
type Error ¶
type LinkTask ¶
type LinkTask struct {
// contains filtered or unexported fields
}
type Qps ¶
type TimeCOunt ¶
type WorkerPool ¶
func NewWorkerPool ¶
func NewWorkerPool(tag string, qCap int, corNum int) *WorkerPool
func (*WorkerPool) Go ¶
func (c *WorkerPool) Go(h func(), to time.Duration) error
func (*WorkerPool) Stop ¶
func (c *WorkerPool) Stop()
type WorkerPoolLink ¶
type WorkerPoolLink struct {
sync.RWMutex
sync.WaitGroup
// contains filtered or unexported fields
}
func NewWorkerPoolLink ¶
func NewWorkerPoolLink(tag string, qCap int, corNum int) *WorkerPoolLink
func (*WorkerPoolLink) Go ¶
func (c *WorkerPoolLink) Go(h func(task *LinkTask)) error
func (*WorkerPoolLink) Stop ¶
func (c *WorkerPoolLink) Stop()
Source Files
¶
- analyzer.go
- b32num.go
- bytestr.go
- coding.go
- compress.go
- configloader.go
- coroutine.go
- database.go
- encoding.go
- error.go
- file.go
- hash.go
- panic.go
- process.go
- qps.go
- regexp.go
- signal.go
- stack.go
- timecount.go
- timeid.go
- trim.go
- type.go
Click to show internal directories.
Click to hide internal directories.