Documentation
¶
Index ¶
- func AndCondition(execs ...func() bool) bool
- func Atoi(b []byte) (int, error)
- func BytesToString(b []byte) string
- func CronWithCtx(ctx context.Context, duration time.Duration, fn func(context.Context))
- func GetStackStringBySize(size int) []byte
- func PanicIfErr(err error, appendErrs ...error)
- func ParseFloat(b []byte, bitSize int) (float64, error)
- func ParseInt(b []byte, base int, bitSize int) (int64, error)
- func ParseUint(b []byte, base int, bitSize int) (uint64, error)
- func RecoverCallback(f func(e interface{}))
- func Retry(f func() error, times int) (err error)
- func RetryExponential(ctx context.Context, f func() error, times uint, scalar time.Duration) (err error)
- func RetryLinearJitter(ctx context.Context, f func() error, times int, waitBetween time.Duration, ...) (err error)
- func StopWithCtx(ctx context.Context, stopFn func())
- func StopWithTimeout(stopFn func(), timeout time.Duration)
- func StringToBytes(s string) []byte
- func VersionEq(a, b string, semantic VersionSemantic) bool
- func VersionGE(a, b string, semantic VersionSemantic) bool
- func VersionLE(a, b string, semantic VersionSemantic) bool
- func Xrecover(err *error, appendErrs ...error)
- type FuncStack
- type FuncStackFrame
- type OpenCircuitExec
- type SliceBuffer
- func (s *SliceBuffer) Read(b []byte) int
- func (s *SliceBuffer) Read1(b []byte) (int, error)
- func (s *SliceBuffer) ReadByte() byte
- func (s *SliceBuffer) ReadByte1() (byte, error)
- func (s *SliceBuffer) ReadUint16() uint16
- func (s *SliceBuffer) ReadUint24() uint32
- func (s *SliceBuffer) ReadUint32() uint32
- func (s *SliceBuffer) ReadUint64() uint64
- func (s *SliceBuffer) Seek(offset int64, whence int) int64
- func (s *SliceBuffer) Slice(n int) []byte
- func (s *SliceBuffer) Slice1(n int) ([]byte, error)
- type VersionSemantic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AndCondition ¶
func BytesToString ¶
BytesToString converts byte slice to string.
func CronWithCtx ¶
func GetStackStringBySize ¶
func PanicIfErr ¶
func RecoverCallback ¶
func RecoverCallback(f func(e interface{}))
func RetryExponential ¶
func RetryExponential(ctx context.Context, f func() error, times uint, scalar time.Duration) (err error)
The scalar is multiplied times 2 raised to the current attempt.
func RetryLinearJitter ¶
func RetryLinearJitter(ctx context.Context, f func() error, times int, waitBetween time.Duration, jitterFraction float64) (err error)
waitBetween=1s and jitter=0.10 can generate waits between 900ms and 1100ms.
func StopWithCtx ¶
func StopWithTimeout ¶
func StringToBytes ¶
StringToBytes converts string to byte slice.
func VersionEq ¶
func VersionEq(a, b string, semantic VersionSemantic) bool
func VersionLE ¶
func VersionLE(a, b string, semantic VersionSemantic) bool
Types ¶
type FuncStack ¶
type FuncStack struct {
Frames []*FuncStackFrame
}
func GetCallerStack ¶
func (*FuncStack) StringOneLine ¶
type FuncStackFrame ¶
func GetCallerStackFrame ¶
func GetCallerStackFrame(skip int) *FuncStackFrame
func (*FuncStackFrame) String ¶
func (r *FuncStackFrame) String() string
type OpenCircuitExec ¶
type OpenCircuitExec struct {
// contains filtered or unexported fields
}
func (*OpenCircuitExec) Do ¶
func (sce *OpenCircuitExec) Do(f func() error) error
type SliceBuffer ¶
type SliceBuffer struct {
// contains filtered or unexported fields
}
func NewSliceBuffer ¶
func NewSliceBuffer(s []byte) *SliceBuffer
func (*SliceBuffer) Read ¶
func (s *SliceBuffer) Read(b []byte) int
func (*SliceBuffer) ReadByte ¶
func (s *SliceBuffer) ReadByte() byte
func (*SliceBuffer) ReadByte1 ¶
func (s *SliceBuffer) ReadByte1() (byte, error)
func (*SliceBuffer) ReadUint16 ¶
func (s *SliceBuffer) ReadUint16() uint16
func (*SliceBuffer) ReadUint24 ¶
func (s *SliceBuffer) ReadUint24() uint32
func (*SliceBuffer) ReadUint32 ¶
func (s *SliceBuffer) ReadUint32() uint32
func (*SliceBuffer) ReadUint64 ¶
func (s *SliceBuffer) ReadUint64() uint64
func (*SliceBuffer) Slice ¶
func (s *SliceBuffer) Slice(n int) []byte
type VersionSemantic ¶
type VersionSemantic int
const ( VersionMajor VersionSemantic = 0 VersionMinor VersionSemantic = 1 VersionPatch VersionSemantic = 2 )
Click to show internal directories.
Click to hide internal directories.