Documentation ¶
Overview ¶
AtomicIdGen
most reference from github.com/realint/dbgutil
idgen
Index ¶
- Variables
- func AddHealthCheck(name string, hc HealthChecker)
- func AppendEmptySliceField(slice reflect.Value) reflect.Value
- func Avg(items []time.Duration) time.Duration
- func CatchPanic(f func()) (err interface{})
- func Clone(src interface{}) (dst interface{})
- func DeleteEmptySliceElements(slice interface{}) interface{}
- func DeleteEmptySliceElementsVal(sliceVal reflect.Value) reflect.Value
- func DeleteSliceElement(slice interface{}, idx int) interface{}
- func DeleteSliceElementVal(sliceVal reflect.Value, idx int) reflect.Value
- func Display(data ...interface{})
- func DumpStack(f string)
- func DumpStackIfPanic(f string)
- func GetCallStack() string
- func GetDisplayString(data ...interface{}) string
- func GetPanicStats() map[string]PanicStackInfo
- func IntRange(min, max int) (int, error)
- func MemProf()
- func PrintGCSummary(w io.Writer)
- func ProcessInput(input string, w io.Writer)
- func RandChoice(choices []interface{}) (interface{}, error)
- func RandCode(codelen int) string
- func RandNumCode(codelen int) string
- func RepeatUntilPanicless(f func())
- func RunPanicless(f func()) (panicless bool)
- func SetSliceLengh(slice reflect.Value, length int) reflect.Value
- func SortInterfaceSlice(slice []interface{}, lessFunc func(a, b interface{}) bool)
- func StartCPUProfile()
- func StopCPUProfile()
- func ToH(bytes uint64) string
- func ToS(d time.Duration) string
- type AtomicIdGen
- type HealthChecker
- type HealthCheckerWrapper
- type IdGen
- type PanicStackInfo
- type PanicStackMgr
- type RuntimeStats
- type SortableInterfaceSlice
- type Waitor
Constants ¶
This section is empty.
Variables ¶
View Source
var AdminCheckList map[string]HealthChecker
View Source
var Char_Buff = [26]string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
"t", "u", "v", "w", "x", "y", "z"}
View Source
var MinMaxError = errors.New("Min cannot be greater than max.")
Functions ¶
func AddHealthCheck ¶
func AddHealthCheck(name string, hc HealthChecker)
func CatchPanic ¶
func CatchPanic(f func()) (err interface{})
func Clone ¶
func Clone(src interface{}) (dst interface{})
unsupport [Complex64,Complex128,Chan,Func,Interface,UnsafePointer]
func DeleteEmptySliceElements ¶
func DeleteEmptySliceElements(slice interface{}) interface{}
func DeleteSliceElement ¶
func DeleteSliceElement(slice interface{}, idx int) interface{}
func DeleteSliceElementVal ¶
func DumpStackIfPanic ¶
func DumpStackIfPanic(f string)
func GetCallStack ¶
func GetCallStack() string
func GetPanicStats ¶
func GetPanicStats() map[string]PanicStackInfo
func PrintGCSummary ¶
func ProcessInput ¶
func RandChoice ¶
func RandChoice(choices []interface{}) (interface{}, error)
func RandNumCode ¶
func RepeatUntilPanicless ¶
func RepeatUntilPanicless(f func())
func RunPanicless ¶
func RunPanicless(f func()) (panicless bool)
func SortInterfaceSlice ¶
func SortInterfaceSlice(slice []interface{}, lessFunc func(a, b interface{}) bool)
func StartCPUProfile ¶
func StartCPUProfile()
func StopCPUProfile ¶
func StopCPUProfile()
Types ¶
type AtomicIdGen ¶
type AtomicIdGen struct {
// contains filtered or unexported fields
}
func (*AtomicIdGen) CurrId ¶
func (this *AtomicIdGen) CurrId() uint32
func (*AtomicIdGen) NextId ¶
func (this *AtomicIdGen) NextId() uint32
func (*AtomicIdGen) Reset ¶
func (this *AtomicIdGen) Reset()
func (*AtomicIdGen) SetStartPoint ¶
func (this *AtomicIdGen) SetStartPoint(startPoint uint32)
type HealthChecker ¶
type HealthChecker interface {
Check() error
}
type HealthCheckerWrapper ¶
type HealthCheckerWrapper func() error
func (HealthCheckerWrapper) Check ¶
func (hcw HealthCheckerWrapper) Check() error
type IdGen ¶
type IdGen struct {
// contains filtered or unexported fields
}
func (*IdGen) SetStartPoint ¶
type PanicStackInfo ¶
type PanicStackMgr ¶
type RuntimeStats ¶
func StatsRuntime ¶
func StatsRuntime() RuntimeStats
type SortableInterfaceSlice ¶
type SortableInterfaceSlice struct { Slice []interface{} LessFunc func(a, b interface{}) bool }
Implements sort.Interface
func (*SortableInterfaceSlice) Len ¶
func (self *SortableInterfaceSlice) Len() int
func (*SortableInterfaceSlice) Less ¶
func (self *SortableInterfaceSlice) Less(i, j int) bool
func (*SortableInterfaceSlice) Sort ¶
func (self *SortableInterfaceSlice) Sort()
func (*SortableInterfaceSlice) Swap ¶
func (self *SortableInterfaceSlice) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.