Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeGbk(v interface{}, body []byte) error
- func GbkToUtf8(s []byte) ([]byte, error)
- func Get() *bytes.Buffer
- func NewError(err error, params ...interface{}) error
- func PrintStack()
- func Put(b *bytes.Buffer)
- func RandNum16String(n int) string
- func RandNumString(n int) string
- func RandString(n int) string
- func ResolveSelfIP() (net.IP, error)
- func ToJSONString(v interface{}) string
- func ToPrettyString(v interface{}) string
- type Error
- type IOBuffer
- func (b *IOBuffer) Len() int
- func (b *IOBuffer) Next(n int) []byte
- func (b *IOBuffer) ReadByte() (byte, error)
- func (b *IOBuffer) ReadN(length int) ([]byte, error)
- func (b *IOBuffer) Reset()
- func (b *IOBuffer) Skip(n int) (err error)
- func (b *IOBuffer) Uint16() (uint16, error)
- func (b *IOBuffer) Uint32() (uint32, error)
- func (b *IOBuffer) Write(p []byte) (n int, err error)
- type Pool
- type PriorityQueueRtp
- type ZapLogger
- func (l *ZapLogger) Debug(args ...interface{})
- func (l *ZapLogger) Debugf(format string, args ...interface{})
- func (l *ZapLogger) Error(args ...interface{})
- func (l *ZapLogger) Errorf(format string, args ...interface{})
- func (l *ZapLogger) Fatal(args ...interface{})
- func (l *ZapLogger) Fatalf(format string, args ...interface{})
- func (l *ZapLogger) Fields() log.Fields
- func (l *ZapLogger) Info(args ...interface{})
- func (l *ZapLogger) Infof(format string, args ...interface{})
- func (l *ZapLogger) Panic(args ...interface{})
- func (l *ZapLogger) Panicf(format string, args ...interface{})
- func (l *ZapLogger) Prefix() string
- func (l *ZapLogger) Print(args ...interface{})
- func (l *ZapLogger) Printf(format string, args ...interface{})
- func (l *ZapLogger) SetLevel(level uint32)
- func (l *ZapLogger) Trace(args ...interface{})
- func (l *ZapLogger) Tracef(format string, args ...interface{})
- func (l *ZapLogger) Warn(args ...interface{})
- func (l *ZapLogger) Warnf(format string, args ...interface{})
- func (l *ZapLogger) WithFields(fields map[string]interface{}) log.Logger
- func (l *ZapLogger) WithPrefix(prefix string) log.Logger
Constants ¶
View Source
const MaxRtpDiff = 65000 //相邻两个包之间的最大差值
Variables ¶
View Source
var ErrTooLarge = errors.New("IOBuffer: too large")
Functions ¶
func Get ¶
Get returns an empty byte buffer from the pool.
Got byte buffer may be returned to the pool via Put call. This reduces the number of memory allocations required for byte buffer management.
func PrintStack ¶
func PrintStack()
func Put ¶
Put returns byte buffer to the pool.
bytes.Buffer.B mustn't be touched after returning it to the pool. Otherwise data races will occur.
func RandNum16String ¶
func RandNumString ¶
func RandString ¶
func ToJSONString ¶
func ToJSONString(v interface{}) string
func ToPrettyString ¶
func ToPrettyString(v interface{}) string
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents byte buffer pool.
Distinct pools may be used for distinct types of byte buffers. Properly determined byte buffer types with their own pools may help reducing memory waste.
type PriorityQueueRtp ¶
type PriorityQueueRtp struct {
// contains filtered or unexported fields
}
func NewPqRtp ¶
func NewPqRtp() *PriorityQueueRtp
func (*PriorityQueueRtp) Empty ¶
func (p *PriorityQueueRtp) Empty()
func (*PriorityQueueRtp) Len ¶
func (p *PriorityQueueRtp) Len() int
func (*PriorityQueueRtp) Push ¶
func (p *PriorityQueueRtp) Push(v rtp.Packet)
type ZapLogger ¶
type ZapLogger struct {
// contains filtered or unexported fields
}
func NewZapLogger ¶
func (*ZapLogger) WithFields ¶
Click to show internal directories.
Click to hide internal directories.