Documentation ¶
Index ¶
- func FormatDate(t time.Time) string
- func FormatTimestamp(t int64) string
- func HandleCrash(handlers ...func(interface{}))
- func Max(a, b uint64) uint64
- func Min(a, b uint64) uint64
- func PutUvarint64(buf []byte, x uint64) int
- func RunWorker(f func(), handlers ...func(interface{}))
- func RunWorkerUtilStop(f func(), stopCh <-chan struct{}, handlers ...func(interface{}))
- func Uvarint64(buf []byte) (uint64, int)
- type AtomicBool
- type AtomicUInt64
- type BufferReader
- type BufferWriter
- type ConnTimeout
- func (c *ConnTimeout) Close() error
- func (c *ConnTimeout) Read(p []byte) (n int, err error)
- func (c *ConnTimeout) RemoteAddr() string
- func (c *ConnTimeout) SetReadTimeout(timeout time.Duration)
- func (c *ConnTimeout) SetWriteTimeout(timeout time.Duration)
- func (c *ConnTimeout) Write(p []byte) (n int, err error)
- type Uint64Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDate ¶
func FormatTimestamp ¶
func HandleCrash ¶
func HandleCrash(handlers ...func(interface{}))
func PutUvarint64 ¶
func RunWorkerUtilStop ¶
func RunWorkerUtilStop(f func(), stopCh <-chan struct{}, handlers ...func(interface{}))
Types ¶
type AtomicBool ¶
type AtomicBool struct {
// contains filtered or unexported fields
}
func (*AtomicBool) CompareAndSet ¶
func (b *AtomicBool) CompareAndSet(expect, update bool) bool
func (*AtomicBool) Get ¶
func (b *AtomicBool) Get() bool
func (*AtomicBool) Set ¶
func (b *AtomicBool) Set(newValue bool)
type AtomicUInt64 ¶
type AtomicUInt64 struct {
// contains filtered or unexported fields
}
func (*AtomicUInt64) Add ¶
func (a *AtomicUInt64) Add(v uint64) uint64
func (*AtomicUInt64) CompareAndSwap ¶
func (a *AtomicUInt64) CompareAndSwap(o, n uint64) bool
func (*AtomicUInt64) Get ¶
func (a *AtomicUInt64) Get() uint64
func (*AtomicUInt64) Incr ¶
func (a *AtomicUInt64) Incr() uint64
func (*AtomicUInt64) Set ¶
func (a *AtomicUInt64) Set(v uint64)
type BufferReader ¶
type BufferReader struct {
// contains filtered or unexported fields
}
func NewBufferReader ¶
func NewBufferReader(reader io.Reader, size int) *BufferReader
func (*BufferReader) Grow ¶
func (br *BufferReader) Grow(n int)
func (*BufferReader) Reset ¶
func (br *BufferReader) Reset()
type BufferWriter ¶
func NewBufferWriter ¶
func NewBufferWriter(wr io.Writer, size int) *BufferWriter
type ConnTimeout ¶
type ConnTimeout struct {
// contains filtered or unexported fields
}
func DialTimeout ¶
func DialTimeout(addr string, connTime time.Duration) (*ConnTimeout, error)
func NewConnTimeout ¶
func NewConnTimeout(conn net.Conn) *ConnTimeout
func (*ConnTimeout) Close ¶
func (c *ConnTimeout) Close() error
func (*ConnTimeout) RemoteAddr ¶
func (c *ConnTimeout) RemoteAddr() string
func (*ConnTimeout) SetReadTimeout ¶
func (c *ConnTimeout) SetReadTimeout(timeout time.Duration)
func (*ConnTimeout) SetWriteTimeout ¶
func (c *ConnTimeout) SetWriteTimeout(timeout time.Duration)
type Uint64Slice ¶
type Uint64Slice []uint64
func (Uint64Slice) Len ¶
func (p Uint64Slice) Len() int
func (Uint64Slice) Less ¶
func (p Uint64Slice) Less(i, j int) bool
func (Uint64Slice) Swap ¶
func (p Uint64Slice) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.