Documentation
¶
Index ¶
- func CRC32(str string) uint32
- func IsHaveInvalidPwdChar(strChar string) bool
- func MD5(data string) string
- type BasePool
- type SyncMap
- func (m *SyncMap) Check(k interface{}) bool
- func (m *SyncMap) Clean()
- func (m *SyncMap) Delete(k interface{})
- func (m *SyncMap) Get(k interface{}) interface{}
- func (m *SyncMap) GetMap() map[interface{}]interface{}
- func (m *SyncMap) Lock()
- func (m *SyncMap) Set(k interface{}, v interface{}) bool
- func (m *SyncMap) Unlock()
- type SyncQueue
- func (q *SyncQueue) Close()
- func (q *SyncQueue) Len() (l int)
- func (q *SyncQueue) Pop() (v interface{})
- func (q *SyncQueue) PopAll() (v []interface{})
- func (q *SyncQueue) Push(v interface{})
- func (q *SyncQueue) TryPop() (v interface{}, ok bool)
- func (q *SyncQueue) TryPopAll() (v []interface{}, ok bool)
- type Work
- type WorkerPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SyncMap ¶
type SyncMap struct {
// contains filtered or unexported fields
}
func NewSyncMap ¶
func NewSyncMap() *SyncMap
func (*SyncMap) Get ¶
func (m *SyncMap) Get(k interface{}) interface{}
Get from maps return the k's value
type SyncQueue ¶
type SyncQueue struct {
// contains filtered or unexported fields
}
Synchronous FIFO queue
func (*SyncQueue) Close ¶
func (q *SyncQueue) Close()
Close SyncQueue
After close, Pop will return nil without block, and TryPop will return v=nil, ok=True
func (*SyncQueue) Pop ¶
func (q *SyncQueue) Pop() (v interface{})
Pop an item from SyncQueue, will block if SyncQueue is empty
func (*SyncQueue) PopAll ¶
func (q *SyncQueue) PopAll() (v []interface{})
PopAll all items from SyncQueue, will block if SyncQueue is empty
func (*SyncQueue) Push ¶
func (q *SyncQueue) Push(v interface{})
Push an item to SyncQueue. Always returns immediately without blocking
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
func NewWorkerPool ¶
func NewWorkerPool(maxGoroutines int, c interface{}) *WorkerPool
func (*WorkerPool) Run ¶
func (p *WorkerPool) Run(w Work)
func (*WorkerPool) Shutdown ¶
func (p *WorkerPool) Shutdown()
Click to show internal directories.
Click to hide internal directories.