util

package
v2.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPathBuilder

func GetPathBuilder() *fastpath.Builder

GetPathBuilder fetches a fastpath.Builder object from the pool.

func NopReadCloser

func NopReadCloser(r io.Reader) io.ReadCloser

NopReadCloser turns a supplied io.Reader into io.ReadCloser with a nop Close() implementation.

func NopWriteCloser

func NopWriteCloser(w io.Writer) io.WriteCloser

NopWriteCloser turns a supplied io.Writer into io.WriteCloser with a nop Close() implementation.

func PutPathBuilder

func PutPathBuilder(pb *fastpath.Builder)

PutPathBuilder places supplied fastpath.Builder back in the pool.

func ReadCloserWithCallback

func ReadCloserWithCallback(rc io.ReadCloser, cb func()) io.ReadCloser

ReadCloserWithCallback adds a customizable callback to be called upon Close() of a supplied io.ReadCloser. Note that the callback will never be called more than once, after execution this will remove the func reference.

func WriteCloserWithCallback

func WriteCloserWithCallback(wc io.WriteCloser, cb func()) io.WriteCloser

WriteCloserWithCallback adds a customizable callback to be called upon Close() of a supplied io.WriteCloser. Note that the callback will never be called more than once, after execution this will remove the func reference.

Types

type ByteReaderSize

type ByteReaderSize struct {
	bytes.Reader
	// contains filtered or unexported fields
}

ByteReaderSize ...

func NewByteReaderSize

func NewByteReaderSize(b []byte) *ByteReaderSize

NewByteReaderSize ...

func (*ByteReaderSize) Reset

func (rs *ByteReaderSize) Reset(b []byte)

Reset resets the ReaderSize to be reading from b.

func (ByteReaderSize) Size

func (rs ByteReaderSize) Size() int64

Size implements ReaderSize.Size().

type ReaderSize

type ReaderSize interface {
	io.Reader

	// Size ...
	Size() int64
}

ReaderSize ...

Jump to

Keyboard shortcuts

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