Documentation ¶
Index ¶
- Constants
- Variables
- func AutoGrow(enable bool) optionFunc
- func Copy(dst io.Writer, src io.Reader) (int64, error)
- func MaxBufSizeFactor(factor float64) optionFunc
- func MultiBufferPoolOption(funcs ...optionFunc) multiBufferPoolOptionFunc
- func MultiBufferPoolSize(poolSize int, bufSize int) multiBufferPoolOptionFunc
- func MultiBytePoolOption(funcs ...optionFunc) multiBytePoolOptionFunc
- func MultiBytePoolSize(poolSize int, bufSize int) multiBytePoolOptionFunc
- func MultiImagePoolOption(funcs ...optionFunc) multiImageBufferPoolOptionFunc
- func MultiImagePoolSize(poolSize int, rect image.Rectangle) multiImageBufferPoolOptionFunc
- func MultiMmapBytePoolOption(funcs ...optionFunc) multiMmapBytePoolOptionFunc
- func MultiMmapBytePoolSize(poolSize int, bufSize int) multiMmapBytePoolOptionFunc
- func Preload(enable bool) optionFunc
- func PreloadRate(rate float64) optionFunc
- func ReadAll(src io.Reader) ([]byte, error)
- type BufferPool
- type BufferRef
- type BufioReaderGetPut
- type BufioReaderPool
- type BufioReaderRef
- type BufioWriterGetPut
- type BufioWriterPool
- type BufioWriterRef
- type ByteGetPut
- type BytePool
- type ByteRef
- type BytesBufferGetPut
- type CopyIOPool
- type ImageNRGBAGetPut
- type ImageNRGBAPool
- type ImageNRGBARef
- type ImageRGBAGetPut
- type ImageRGBAPool
- type ImageRGBARef
- type ImageYCbCrGetPut
- type ImageYCbCrPool
- type ImageYCbCrRef
- type MmapBytePool
- type MultiBufferPool
- type MultiBytePool
- type MultiImageNRGBAPool
- type MultiImageRGBAPool
- type MultiImageYCbCrPool
- type MultiMmapBytePool
- type PoolSize
- type Ref
- type TickerGetPut
- type TickerPool
- type TickerRef
- type TimerGetPut
- type TimerPool
- type TimerRef
Constants ¶
View Source
const (
DefaultMmapAlignment int = 8
)
View Source
const (
Version string = "1.2.1"
)
Variables ¶
View Source
var (
ErrIOReadNagativeRead = errors.New("negative count from io.Read")
)
Functions ¶
func MaxBufSizeFactor ¶
func MaxBufSizeFactor(factor float64) optionFunc
func MultiBufferPoolOption ¶
func MultiBufferPoolOption(funcs ...optionFunc) multiBufferPoolOptionFunc
func MultiBufferPoolSize ¶
func MultiBytePoolOption ¶
func MultiBytePoolOption(funcs ...optionFunc) multiBytePoolOptionFunc
func MultiBytePoolSize ¶
func MultiImagePoolOption ¶
func MultiImagePoolOption(funcs ...optionFunc) multiImageBufferPoolOptionFunc
func MultiImagePoolSize ¶
func MultiMmapBytePoolOption ¶ added in v1.1.1
func MultiMmapBytePoolOption(funcs ...optionFunc) multiMmapBytePoolOptionFunc
func MultiMmapBytePoolSize ¶ added in v1.1.1
func PreloadRate ¶
func PreloadRate(rate float64) optionFunc
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
func NewBufferPool ¶
func NewBufferPool(poolSize int, bufSize int, funcs ...optionFunc) *BufferPool
func (*BufferPool) Cap ¶
func (b *BufferPool) Cap() int
func (*BufferPool) Get ¶
func (b *BufferPool) Get() *bytes.Buffer
func (*BufferPool) GetRef ¶
func (b *BufferPool) GetRef() *BufferRef
func (*BufferPool) Len ¶
func (b *BufferPool) Len() int
type BufioReaderGetPut ¶ added in v1.1.0
type BufioReaderPool ¶
type BufioReaderPool struct {
// contains filtered or unexported fields
}
func NewBufioReaderPool ¶
func NewBufioReaderPool(poolSize int, funcs ...optionFunc) *BufioReaderPool
func NewBufioReaderSizePool ¶
func NewBufioReaderSizePool(poolSize int, bufSize int, funcs ...optionFunc) *BufioReaderPool
func (*BufioReaderPool) Cap ¶
func (b *BufioReaderPool) Cap() int
func (*BufioReaderPool) GetRef ¶
func (b *BufioReaderPool) GetRef(r io.Reader) *BufioReaderRef
func (*BufioReaderPool) Len ¶
func (b *BufioReaderPool) Len() int
type BufioReaderRef ¶
func (*BufioReaderRef) Reader ¶
func (b *BufioReaderRef) Reader() *bufio.Reader
func (*BufioReaderRef) Release ¶
func (b *BufioReaderRef) Release()
type BufioWriterGetPut ¶ added in v1.1.0
type BufioWriterPool ¶
type BufioWriterPool struct {
// contains filtered or unexported fields
}
func NewBufioWriterPool ¶
func NewBufioWriterPool(poolSize int, funcs ...optionFunc) *BufioWriterPool
func NewBufioWriterSizePool ¶
func NewBufioWriterSizePool(poolSize int, bufSize int, funcs ...optionFunc) *BufioWriterPool
func (*BufioWriterPool) Cap ¶
func (b *BufioWriterPool) Cap() int
func (*BufioWriterPool) GetRef ¶
func (b *BufioWriterPool) GetRef(w io.Writer) *BufioWriterRef
func (*BufioWriterPool) Len ¶
func (b *BufioWriterPool) Len() int
type BufioWriterRef ¶
func (*BufioWriterRef) Release ¶
func (b *BufioWriterRef) Release()
func (*BufioWriterRef) Writer ¶
func (b *BufioWriterRef) Writer() *bufio.Writer
type ByteGetPut ¶ added in v1.1.0
type BytePool ¶
type BytePool struct {
// contains filtered or unexported fields
}
func NewBytePool ¶
type BytesBufferGetPut ¶ added in v1.1.0
type CopyIOPool ¶ added in v1.0.4
type CopyIOPool struct {
// contains filtered or unexported fields
}
func NewCopyIOPool ¶ added in v1.0.4
func NewCopyIOPool(poolSize int, bufSize int, funcs ...optionFunc) *CopyIOPool
func (*CopyIOPool) Cap ¶ added in v1.0.4
func (c *CopyIOPool) Cap() int
func (*CopyIOPool) Len ¶ added in v1.0.4
func (c *CopyIOPool) Len() int
type ImageNRGBAGetPut ¶ added in v1.1.0
type ImageNRGBAGetPut interface { GetRef() *ImageNRGBARef Put([]byte) bool }
type ImageNRGBAPool ¶ added in v1.0.9
type ImageNRGBAPool struct {
ImageRGBAPool
}
func NewImageNRGBAPool ¶ added in v1.0.9
func NewImageNRGBAPool(poolSize int, rect image.Rectangle, funcs ...optionFunc) *ImageNRGBAPool
func (*ImageNRGBAPool) GetRef ¶ added in v1.0.9
func (b *ImageNRGBAPool) GetRef() *ImageNRGBARef
type ImageNRGBARef ¶ added in v1.0.9
func (*ImageNRGBARef) Image ¶ added in v1.0.9
func (b *ImageNRGBARef) Image() *image.NRGBA
func (*ImageNRGBARef) Release ¶ added in v1.0.9
func (b *ImageNRGBARef) Release()
type ImageRGBAGetPut ¶ added in v1.1.0
type ImageRGBAGetPut interface { GetRef() *ImageRGBARef Put([]byte) bool }
type ImageRGBAPool ¶
type ImageRGBAPool struct {
// contains filtered or unexported fields
}
func NewImageRGBAPool ¶
func NewImageRGBAPool(poolSize int, rect image.Rectangle, funcs ...optionFunc) *ImageRGBAPool
func (*ImageRGBAPool) Cap ¶
func (b *ImageRGBAPool) Cap() int
func (*ImageRGBAPool) GetRef ¶
func (b *ImageRGBAPool) GetRef() *ImageRGBARef
func (*ImageRGBAPool) Len ¶
func (b *ImageRGBAPool) Len() int
func (*ImageRGBAPool) Put ¶
func (b *ImageRGBAPool) Put(pix []byte) bool
type ImageRGBARef ¶
func (*ImageRGBARef) Image ¶
func (b *ImageRGBARef) Image() *image.RGBA
func (*ImageRGBARef) Release ¶
func (b *ImageRGBARef) Release()
type ImageYCbCrGetPut ¶ added in v1.1.0
type ImageYCbCrGetPut interface { GetRef() *ImageYCbCrRef Put([]byte) bool }
type ImageYCbCrPool ¶
type ImageYCbCrPool struct {
// contains filtered or unexported fields
}
func NewImageYCbCrPool ¶
func NewImageYCbCrPool(poolSize int, rect image.Rectangle, sample image.YCbCrSubsampleRatio, funcs ...optionFunc) *ImageYCbCrPool
func (*ImageYCbCrPool) Cap ¶
func (b *ImageYCbCrPool) Cap() int
func (*ImageYCbCrPool) GetRef ¶
func (b *ImageYCbCrPool) GetRef() *ImageYCbCrRef
func (*ImageYCbCrPool) Len ¶
func (b *ImageYCbCrPool) Len() int
func (*ImageYCbCrPool) Put ¶
func (b *ImageYCbCrPool) Put(pix []byte) bool
func (*ImageYCbCrPool) UVStride ¶ added in v1.0.10
func (b *ImageYCbCrPool) UVStride(stride int)
func (*ImageYCbCrPool) YStride ¶ added in v1.0.10
func (b *ImageYCbCrPool) YStride(stride int)
type ImageYCbCrRef ¶
func (*ImageYCbCrRef) Image ¶
func (b *ImageYCbCrRef) Image() *image.YCbCr
func (*ImageYCbCrRef) Release ¶
func (b *ImageYCbCrRef) Release()
type MmapBytePool ¶ added in v1.1.0
type MmapBytePool struct {
// contains filtered or unexported fields
}
func NewMmapBytePool ¶ added in v1.1.0
func NewMmapBytePool(poolSize, bufSize int, funcs ...optionFunc) *MmapBytePool
func (*MmapBytePool) Cap ¶ added in v1.1.0
func (b *MmapBytePool) Cap() int
func (*MmapBytePool) Get ¶ added in v1.1.0
func (b *MmapBytePool) Get() []byte
func (*MmapBytePool) GetRef ¶ added in v1.1.0
func (b *MmapBytePool) GetRef() *ByteRef
func (*MmapBytePool) Len ¶ added in v1.1.0
func (b *MmapBytePool) Len() int
func (*MmapBytePool) Put ¶ added in v1.1.0
func (b *MmapBytePool) Put(data []byte) bool
type MultiBufferPool ¶
type MultiBufferPool struct {
// contains filtered or unexported fields
}
func NewMultiBufferPool ¶
func NewMultiBufferPool(funcs ...multiBufferPoolOptionFunc) *MultiBufferPool
func (*MultiBufferPool) GetRef ¶
func (b *MultiBufferPool) GetRef(size int) *BufferRef
type MultiBytePool ¶
type MultiBytePool struct {
// contains filtered or unexported fields
}
func NewMultiBytePool ¶
func NewMultiBytePool(funcs ...multiBytePoolOptionFunc) *MultiBytePool
func (*MultiBytePool) Get ¶
func (b *MultiBytePool) Get(size int) []byte
func (*MultiBytePool) GetRef ¶
func (b *MultiBytePool) GetRef(size int) *ByteRef
func (*MultiBytePool) Put ¶
func (b *MultiBytePool) Put(data []byte) bool
type MultiImageNRGBAPool ¶ added in v1.0.9
type MultiImageNRGBAPool struct {
// contains filtered or unexported fields
}
func NewMultiImageNRGBAPool ¶ added in v1.0.9
func NewMultiImageNRGBAPool(funcs ...multiImageBufferPoolOptionFunc) *MultiImageNRGBAPool
func (*MultiImageNRGBAPool) GetRef ¶ added in v1.0.9
func (b *MultiImageNRGBAPool) GetRef(r image.Rectangle) *ImageNRGBARef
type MultiImageRGBAPool ¶
type MultiImageRGBAPool struct {
// contains filtered or unexported fields
}
func NewMultiImageRGBAPool ¶
func NewMultiImageRGBAPool(funcs ...multiImageBufferPoolOptionFunc) *MultiImageRGBAPool
func (*MultiImageRGBAPool) GetRef ¶
func (b *MultiImageRGBAPool) GetRef(r image.Rectangle) *ImageRGBARef
type MultiImageYCbCrPool ¶
type MultiImageYCbCrPool struct {
// contains filtered or unexported fields
}
func NewMultiImageYCbCrPool ¶
func NewMultiImageYCbCrPool(sample image.YCbCrSubsampleRatio, funcs ...multiImageBufferPoolOptionFunc) *MultiImageYCbCrPool
func (*MultiImageYCbCrPool) GetRef ¶
func (b *MultiImageYCbCrPool) GetRef(r image.Rectangle) *ImageYCbCrRef
type MultiMmapBytePool ¶ added in v1.1.1
type MultiMmapBytePool struct {
// contains filtered or unexported fields
}
func NewMultiMmapBytePool ¶ added in v1.1.1
func NewMultiMmapBytePool(funcs ...multiMmapBytePoolOptionFunc) *MultiMmapBytePool
func (*MultiMmapBytePool) Get ¶ added in v1.1.1
func (b *MultiMmapBytePool) Get(size int) []byte
func (*MultiMmapBytePool) GetRef ¶ added in v1.1.1
func (b *MultiMmapBytePool) GetRef(size int) *ByteRef
func (*MultiMmapBytePool) Put ¶ added in v1.1.1
func (b *MultiMmapBytePool) Put(data []byte) bool
type TickerGetPut ¶ added in v1.2.0
type TickerPool ¶ added in v1.2.0
type TickerPool struct {
// contains filtered or unexported fields
}
func NewTickerPool ¶ added in v1.2.0
func NewTickerPool(poolSize int, funcs ...optionFunc) *TickerPool
func (*TickerPool) Cap ¶ added in v1.2.0
func (b *TickerPool) Cap() int
func (*TickerPool) GetRef ¶ added in v1.2.0
func (b *TickerPool) GetRef(dur time.Duration) *TickerRef
func (*TickerPool) Len ¶ added in v1.2.0
func (b *TickerPool) Len() int
type TimerGetPut ¶ added in v1.2.0
type TimerPool ¶ added in v1.2.0
type TimerPool struct {
// contains filtered or unexported fields
}
func NewTimerPool ¶ added in v1.2.0
Click to show internal directories.
Click to hide internal directories.