pagebuf

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxIdlePages = 4
	DefaultPageSize     = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PageBuffer

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

PageBuffer ...

func NewPageBuffer

func NewPageBuffer() *PageBuffer

NewPageBuffer creates a PageBuffer with default options

func NewPageBufferSize

func NewPageBufferSize(maxIdlePages, pageSize int) *PageBuffer

NewPageBufferSize creates a PageBuffer with specified options

func (*PageBuffer) Format

func (p *PageBuffer) Format() string

Format formats the buffer as a string

func (*PageBuffer) Len

func (p *PageBuffer) Len() int

Len returns the length of buffer

func (*PageBuffer) PageSize

func (p *PageBuffer) PageSize() int

PageSize returns size per page

func (*PageBuffer) Read

func (p *PageBuffer) Read(data []byte) (n int, err error)

Read implements io.Reader Read method

func (*PageBuffer) Reset

func (p *PageBuffer) Reset()

Reset clears the buffer

func (*PageBuffer) Write

func (p *PageBuffer) Write(data []byte) (n int, err error)

Write implements io.Writer Write method

Jump to

Keyboard shortcuts

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