Versions in this module Expand all Collapse all v1 v1.0.1 Jul 31, 2020 v1.0.0 Jul 3, 2020 Changes in this version + var DurationStat = newDurationStat() + var ErrAlreadyStarted = errors.New("already started") + var ErrAlreadyStopped = errors.New("already stopped") + var MaxLockTime = 60 + var MaxWatchInChan = 20000 + var WatchFinishTime = 3 + func ASCIITrim(s string) string + func BeginWatchMgr() + func CRandBytes(numBytes int) []byte + func CRandHex(numDigits int) string + func CReader() io.Reader + func CheckAndPrintError(err error) + func EncodeUvarint(w io.Writer, u uint64) (err error) + func EndWatchMgr() + func EnsureDir(dir string, mode os.FileMode) error + func EqualHashes(hash1, hash2 []byte) bool + func Fingerprint(slice []byte) []byte + func IsASCIIText(s string) bool + func IsZeros(slice []byte) bool + func Kill() error + func LeftPadBytes(slice []byte, l int) []byte + func MaxInt(a, b int) int + func MaxUint(a, b uint) uint + func MinInt(a, b int) int + func MinUint(a, b uint) uint + func MixEntropy(seedBytes []byte) + func PanicSanity(v interface{}) + func PrefixEndBytes(prefix []byte) []byte + func ProtocolAndAddress(listenAddr string) (string, string) + func RandFloat64() float64 + func RandInt() int + func RandInt31n(n int32) int32 + func RandInt63n(n int64) int64 + func RandIntn(n int) int + func RandPerm(n int) []int + func RandStr(length int) string + func RightPadBytes(slice []byte, l int) []byte + func RlpHash(x interface{}) (h common.Hash) + func SplitAndTrim(s, sep, cutset string) []string + func TrimmedString(b []byte) string + func WatchsCountInMgr() uint64 + func WriteFileAtomic(filename string, data []byte, perm os.FileMode) (err error) + type Address = HexBytes + type BaseService struct + func NewBaseService(name string, impl Service) *BaseService + func (bs *BaseService) IsRunning() bool + func (bs *BaseService) OnReset() error + func (bs *BaseService) OnStart() error + func (bs *BaseService) OnStop() + func (bs *BaseService) Quit() <-chan struct{} + func (bs *BaseService) Reset() error + func (bs *BaseService) Start() error + func (bs *BaseService) Stop() error + func (bs *BaseService) String() string + func (bs *BaseService) Wait() + type BitArray struct + Bits uint + Elems []uint64 + Mtx sync.Mutex + func NewBitArray(bits uint) *BitArray + func (bA *BitArray) And(o *BitArray) *BitArray + func (bA *BitArray) Bytes() []byte + func (bA *BitArray) Copy() *BitArray + func (bA *BitArray) GetIndex(i uint) bool + func (bA *BitArray) IsEmpty() bool + func (bA *BitArray) IsFull() bool + func (bA *BitArray) MarshalJSON() ([]byte, error) + func (bA *BitArray) Not() *BitArray + func (bA *BitArray) Or(o *BitArray) *BitArray + func (bA *BitArray) PickRandom() (uint, bool) + func (bA *BitArray) SetIndex(i uint, v bool) bool + func (bA *BitArray) Size() uint + func (bA *BitArray) String() string + func (bA *BitArray) StringIndented(indent string) string + func (bA *BitArray) Sub(o *BitArray) *BitArray + func (bA *BitArray) UnmarshalJSON(bz []byte) error + func (bA *BitArray) Update(o *BitArray) + type CMap struct + func NewCMap() *CMap + func (cm *CMap) Clear() + func (cm *CMap) Delete(key string) + func (cm *CMap) Get(key string) interface{} + func (cm *CMap) Has(key string) bool + func (cm *CMap) Keys() []string + func (cm *CMap) Set(key string, value interface{}) + func (cm *CMap) Size() int + func (cm *CMap) Values() []interface{} + type Comparable interface + Less func(o interface{}) bool + type Heap struct + func NewHeap() *Heap + func (h *Heap) Len() int64 + func (h *Heap) Peek() interface{} + func (h *Heap) Pop() interface{} + func (h *Heap) Push(value interface{}, priority int) + func (h *Heap) PushBytes(value interface{}, priority []byte) + func (h *Heap) PushComparable(value interface{}, priority Comparable) + func (h *Heap) Update(value interface{}, priority Comparable) + type HexBytes []byte + type PeerInValidators interface + HasPeerID func(id string) error + type RepeatTimer struct + func NewRepeatTimer(name string, dur time.Duration) *RepeatTimer + func NewRepeatTimerWithTickerMaker(name string, dur time.Duration, tm TickerMaker) *RepeatTimer + func (t *RepeatTimer) Chan() <-chan time.Time + func (t *RepeatTimer) Reset() + func (t *RepeatTimer) Stop() + type Service interface + IsRunning func() bool + OnReset func() error + OnStart func() error + OnStop func() + Quit func() <-chan struct{} + Reset func() error + Start func() error + Stop func() error + String func() string + type SimpleProof struct + Aunts [][]byte + Index int + LeafHash []byte + Total int + func SimpleProofsFromByteSlices(items [][]byte) (rootHash []byte, proofs []*SimpleProof) + func (sp *SimpleProof) ComputeRootHash() []byte + func (sp *SimpleProof) String() string + func (sp *SimpleProof) StringIndented(indent string) string + func (sp *SimpleProof) Verify(rootHash []byte, leafHash []byte) error + type SimpleProofNode struct + Hash []byte + Left *SimpleProofNode + Parent *SimpleProofNode + Right *SimpleProofNode + func (spn *SimpleProofNode) FlattenAunts() [][]byte + type TWatch struct + ID uint64 + func NewTWatch(e float64, s string) *TWatch + func (in *TWatch) EndWatch() + func (in *TWatch) Finish(comment interface{}) + type Task func(i int) (val interface{}, err error, abort bool) + type TaskResult struct + Error error + Value interface{} + type TaskResultCh <-chan TaskResult + type TaskResultSet struct + func Parallel(tasks ...Task) (trs *TaskResultSet, ok bool) + func (trs *TaskResultSet) Channels() []TaskResultCh + func (trs *TaskResultSet) FirstError() error + func (trs *TaskResultSet) FirstValue() interface{} + func (trs *TaskResultSet) LatestResult(index int) (TaskResult, bool) + func (trs *TaskResultSet) Reap() *TaskResultSet + func (trs *TaskResultSet) Wait() *TaskResultSet + type ThrottleTimer struct + Ch chan struct{} + Name string + func NewThrottleTimer(name string, dur time.Duration) *ThrottleTimer + func (t *ThrottleTimer) Set() + func (t *ThrottleTimer) Stop() bool + func (t *ThrottleTimer) Unset() + type Ticker interface + Chan func() <-chan time.Time + Stop func() + type TickerMaker func(dur time.Duration) Ticker + func NewLogicalTickerMaker(source chan time.Time) TickerMaker + type WatchMgr struct