Versions in this module Expand all Collapse all v0 v0.9.2 May 24, 2021 Changes in this version + var ErrAlreadyStarted = errors.New("already started") + var ErrAlreadyStopped = errors.New("already stopped") + var ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrNotStarted = errors.New("not started") + func ASCIITrim(s string) string + func Connect(protoAddr string) (net.Conn, error) + func EnsureDir(dir string, mode os.FileMode) error + func Exit(s string) + func FileExists(filePath string) bool + func Fingerprint(slice []byte) []byte + func GetFreePort() (int, error) + func IntInSlice(a int, list []int) bool + func IsASCIIText(s string) bool + func IsEmpty(o interface{}) bool + func IsTypedNil(o interface{}) bool + func Kill() error + func MaxInt(a, b int) int + func MaxInt64(a, b int64) int64 + func MinInt(a, b int) int + func MinInt64(a, b int64) int64 + func MustReadFile(filePath string) []byte + func MustWriteFile(filePath string, contents []byte, mode os.FileMode) + func ProtocolAndAddress(listenAddr string) (string, string) + func RandBool() bool + func RandBytes(n int) []byte + func RandFloat32() float32 + func RandFloat64() float64 + func RandInt() int + func RandInt16() int16 + func RandInt31() int32 + func RandInt31n(n int32) int32 + func RandInt32() int32 + func RandInt63() int64 + func RandInt63n(n int64) int64 + func RandInt64() int64 + func RandIntn(n int) int + func RandPerm(n int) []int + func RandStr(length int) string + func RandTime() time.Time + func RandUint() uint + func RandUint16() uint16 + func RandUint32() uint32 + func RandUint64() uint64 + func ReadFile(filePath string) ([]byte, error) + func Seed(seed int64) + func SplitAndTrim(s, sep, cutset string) []string + func StringInSlice(a string, list []string) bool + func StringSliceEqual(a, b []string) bool + func TrapSignal(logger logger, cb func()) + func WriteFile(filePath string, contents []byte, mode os.FileMode) error + func WriteFileAtomic(filename string, data []byte, perm os.FileMode) (err error) + type BaseService struct + Logger log.Logger + func NewBaseService(logger log.Logger, 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) SetLogger(l log.Logger) + func (bs *BaseService) Start() error + func (bs *BaseService) Stop() error + func (bs *BaseService) String() string + func (bs *BaseService) Wait() + type BitArray struct + Bits int + Elems []uint64 + func NewBitArray(bits int) *BitArray + func (bA *BitArray) And(o *BitArray) *BitArray + func (bA *BitArray) Bytes() []byte + func (bA *BitArray) Copy() *BitArray + func (bA *BitArray) GetIndex(i int) 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() (int, bool) + func (bA *BitArray) SetIndex(i int, v bool) bool + func (bA *BitArray) Size() int + 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 Error interface + Data func() interface{} + Error func() string + Stacktrace func() Error + Trace func(offset int, format string, args ...interface{}) Error + func ErrorWrap(cause interface{}, format string, args ...interface{}) Error + func NewError(format string, args ...interface{}) Error + func NewErrorWithData(data interface{}) Error + type FmtError struct + func (fe FmtError) Error() string + func (fe FmtError) Format() string + func (fe FmtError) String() string + type HexBytes []byte + func (bz *HexBytes) Unmarshal(data []byte) error + func (bz *HexBytes) UnmarshalJSON(data []byte) error + func (bz HexBytes) Bytes() []byte + func (bz HexBytes) Format(s fmt.State, verb rune) + func (bz HexBytes) Marshal() ([]byte, error) + func (bz HexBytes) MarshalJSON() ([]byte, error) + func (bz HexBytes) String() string + type KI64Pair struct + Key []byte + Value int64 + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func NewPopulatedKI64Pair(r randyTypes, easy bool) *KI64Pair + func (*KI64Pair) Descriptor() ([]byte, []int) + func (*KI64Pair) ProtoMessage() + func (m *KI64Pair) GetKey() []byte + func (m *KI64Pair) GetValue() int64 + func (m *KI64Pair) Marshal() (dAtA []byte, err error) + func (m *KI64Pair) MarshalTo(dAtA []byte) (int, error) + func (m *KI64Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *KI64Pair) Reset() + func (m *KI64Pair) Size() (n int) + func (m *KI64Pair) String() string + func (m *KI64Pair) Unmarshal(dAtA []byte) error + func (m *KI64Pair) XXX_DiscardUnknown() + func (m *KI64Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *KI64Pair) XXX_Merge(src proto.Message) + func (m *KI64Pair) XXX_Size() int + func (m *KI64Pair) XXX_Unmarshal(b []byte) error + func (r *KI64Pair) MarshalJSON() ([]byte, error) + func (r *KI64Pair) UnmarshalJSON(b []byte) error + func (this *KI64Pair) Equal(that interface{}) bool + type KI64Pairs []KI64Pair + func (kvs KI64Pairs) Len() int + func (kvs KI64Pairs) Less(i, j int) bool + func (kvs KI64Pairs) Sort() + func (kvs KI64Pairs) Swap(i, j int) + type KVPair struct + Key []byte + Value []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func NewPopulatedKVPair(r randyTypes, easy bool) *KVPair + func (*KVPair) Descriptor() ([]byte, []int) + func (*KVPair) ProtoMessage() + func (m *KVPair) GetKey() []byte + func (m *KVPair) GetValue() []byte + func (m *KVPair) Marshal() (dAtA []byte, err error) + func (m *KVPair) MarshalTo(dAtA []byte) (int, error) + func (m *KVPair) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *KVPair) Reset() + func (m *KVPair) Size() (n int) + func (m *KVPair) String() string + func (m *KVPair) Unmarshal(dAtA []byte) error + func (m *KVPair) XXX_DiscardUnknown() + func (m *KVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *KVPair) XXX_Merge(src proto.Message) + func (m *KVPair) XXX_Size() int + func (m *KVPair) XXX_Unmarshal(b []byte) error + func (r *KVPair) MarshalJSON() ([]byte, error) + func (r *KVPair) UnmarshalJSON(b []byte) error + func (this *KVPair) Equal(that interface{}) bool + type KVPairs []KVPair + func (kvs KVPairs) Len() int + func (kvs KVPairs) Less(i, j int) bool + func (kvs KVPairs) Sort() + func (kvs KVPairs) Swap(i, j int) + type Rand struct + func NewRand() *Rand + func (r *Rand) Bool() bool + func (r *Rand) Bytes(n int) []byte + func (r *Rand) Float32() float32 + func (r *Rand) Float64() float64 + func (r *Rand) Int() int + func (r *Rand) Int16() int16 + func (r *Rand) Int31() int32 + func (r *Rand) Int31n(n int32) int32 + func (r *Rand) Int32() int32 + func (r *Rand) Int63() int64 + func (r *Rand) Int63n(n int64) int64 + func (r *Rand) Int64() int64 + func (r *Rand) Intn(n int) int + func (r *Rand) Perm(n int) []int + func (r *Rand) Seed(seed int64) + func (r *Rand) Str(length int) string + func (r *Rand) Time() time.Time + func (r *Rand) Uint() uint + func (r *Rand) Uint16() uint16 + func (r *Rand) Uint32() uint32 + func (r *Rand) Uint64() uint64 + type Service interface + IsRunning func() bool + OnReset func() error + OnStart func() error + OnStop func() + Quit func() <-chan struct{} + Reset func() error + SetLogger func(log.Logger) + Start func() error + Stop func() error + String func() string + 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()