Documentation ¶
Index ¶
- Constants
- func AppendPrettyHexDump(dump *strings.Builder, b []byte)
- func CloneBytes(b []byte) []byte
- func CountBorrowed() int64
- func PrettyHexDump(b []byte) string
- func RandAlphabetic(n int) (s string)
- func RandAlphanumeric(n int) (s string)
- func RandFloat64() (v float64)
- func RandIntn(n int) (v int)
- func ReturnByteBuff(b *ByteBuff)
- func SafeCloseDoneChan(c chan<- struct{}) (ok bool)
- func ToMilliseconds(duration time.Duration) int64
- func TryRelease(input interface{})
- type ByteBuff
- type Cond
- type Releasable
Constants ¶
View Source
const ( // DefaultKeepaliveInterval is default keepalive interval duration. DefaultKeepaliveInterval = 20 * time.Second // DefaultKeepaliveMaxLifetime is default keepalive max lifetime. DefaultKeepaliveMaxLifetime = 90 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func AppendPrettyHexDump ¶ added in v0.6.0
AppendPrettyHexDump appends bytes to string builder.
func CloneBytes ¶ added in v0.7.0
func CountBorrowed ¶ added in v0.7.0
func CountBorrowed() int64
CountBorrowed returns borrowed ByteBuff amount.
func PrettyHexDump ¶ added in v0.6.0
PrettyHexDump converts bytes to pretty hex dump string.
func RandAlphabetic ¶
RandAlphabetic returns a string with random alphabets.
func RandAlphanumeric ¶
RandAlphanumeric returns a string with random alphabets and numbers.
func ReturnByteBuff ¶ added in v0.7.0
func ReturnByteBuff(b *ByteBuff)
ReturnByteBuff returns a ByteBuff to pool.
func SafeCloseDoneChan ¶ added in v0.7.0
func SafeCloseDoneChan(c chan<- struct{}) (ok bool)
func ToMilliseconds ¶ added in v0.7.0
func TryRelease ¶ added in v0.7.0
func TryRelease(input interface{})
Types ¶
type ByteBuff ¶
ByteBuff provides byte buffer, which can be used for minimizing.
func BorrowByteBuff ¶ added in v0.7.0
func BorrowByteBuff() *ByteBuff
BorrowByteBuff borrows a ByteBuff from pool.
func (*ByteBuff) WriteString ¶ added in v0.6.0
WriteString writes a string to current ByteBuff.
type Cond ¶ added in v0.6.0
Cond is a customized Cond which support context. See https://gist.github.com/zviadm/c234426882bfc8acba88f3503edaaa36#file-cond2-go
func (*Cond) NotifyChan ¶ added in v0.6.0
func (c *Cond) NotifyChan() <-chan struct{}
NotifyChan returns readonly notify chan.
type Releasable ¶ added in v0.7.0
Click to show internal directories.
Click to hide internal directories.