bufferpool

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Get 从全局 _pool 中获取 buffer
	Get = _pool.Get
)

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

Buffer buffer

func (*Buffer) Base64

func (b *Buffer) Base64() string

Base64 base64编码后输出

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

Bytes 以 []byte 格式输出

func (*Buffer) Cap

func (b *Buffer) Cap() int

Cap 获取cap

func (*Buffer) Free

func (b *Buffer) Free()

Free 释放 buffer

func (*Buffer) Len

func (b *Buffer) Len() int

Len 获取 len

func (*Buffer) Reset

func (b *Buffer) Reset()

Reset 清除内容

func (*Buffer) String

func (b *Buffer) String() string

String 以 string 格式输出

func (*Buffer) Write

func (b *Buffer) Write(bs []byte) (int, error)

Writer 写入数据

func (*Buffer) WriteBool

func (b *Buffer) WriteBool(v bool)

WriteBool 写入 bool

func (*Buffer) WriteByte

func (b *Buffer) WriteByte(v byte)

WriteByte 写入 一个 byte

func (*Buffer) WriteBytes

func (b *Buffer) WriteBytes(bs []byte)

WriteBytes 写入 []byte

func (*Buffer) WriteFloat

func (b *Buffer) WriteFloat(f float64)

WriteFloat 写入 float

func (*Buffer) WriteInt

func (b *Buffer) WriteInt(i int)

WriteInt 写入 int

func (*Buffer) WriteInt64

func (b *Buffer) WriteInt64(i int64)

WriteInt64 写入 int64

func (*Buffer) WriteString

func (b *Buffer) WriteString(s string)

WriteString 写入 string

func (*Buffer) WriteTime

func (b *Buffer) WriteTime(t time.Time, layout ...string)

WriteTime 写入时间

func (*Buffer) WriteUint

func (b *Buffer) WriteUint(i uint)

WriteUint 写入 uint

func (*Buffer) WriteUint64

func (b *Buffer) WriteUint64(i uint64)

WriteUint64 写入 uint64

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool buffer pool

func NewPool

func NewPool() Pool

NewPool create a pool

func (Pool) Get

func (p Pool) Get() *Buffer

Get get a buffer from pool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL