ws

package
v0.0.0-...-3db37ce Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WriterSeeker

type WriterSeeker struct {
	Buf bytes.Buffer
	Pos int
}

WriterSeeker is an in-memory io.WriteSeeker implementation.

func (*WriterSeeker) BytesReader

func (ws *WriterSeeker) BytesReader() *bytes.Reader

BytesReader returns a *bytes.Reader. Use it when you need a reader that implements the io.ReadSeeker interface.

func (*WriterSeeker) Close

func (ws *WriterSeeker) Close() error

Close is a no-op function that satisfies the io.Closer interface.

func (*WriterSeeker) Reader

func (ws *WriterSeeker) Reader() io.Reader

Reader returns an io.Reader. Use it, for example, with io.Copy, to copy the content of the WriterSeeker buffer to an io.Writer.

func (*WriterSeeker) Seek

func (ws *WriterSeeker) Seek(offset int64, whence int) (int64, error)

Seek seeks in the buffer of this WriterSeeker instance.

func (*WriterSeeker) Write

func (ws *WriterSeeker) Write(p []byte) (n int, err error)

Write writes to the buffer of this WriterSeeker instance.

Jump to

Keyboard shortcuts

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