utils

package
v0.0.0-...-bec4141 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NopCloser

func NopCloser(w io.Writer) io.WriteCloser

NopCloser returns a WriteCloser with a no-op Close method wrapping the provided Writer w.

func NopReadWrapper

func NopReadWrapper(r io.Reader) (io.ReadCloser, error)

func NopWriteWrapper

func NopWriteWrapper(w io.Writer) io.WriteCloser

func Unprefix

func Unprefix(path string, prefix string) (string, error)

func ZlibReader

func ZlibReader(r io.Reader) (io.ReadCloser, error)

ZlibReader wraps a reader with a new zlib.Reader.

func ZlibWriter

func ZlibWriter(w io.Writer) io.WriteCloser

ZlibWrier wraps a writer with a new zlib.Writer.

Types

type ReadWrapper

type ReadWrapper func(r io.Reader) (io.ReadCloser, error)

type WriteCounter

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

func NewWriteCounter

func NewWriteCounter(writer io.Writer) *WriteCounter

func (*WriteCounter) Count

func (c *WriteCounter) Count() int

func (*WriteCounter) Write

func (c *WriteCounter) Write(p []byte) (n int, err error)

type WriteWrapper

type WriteWrapper func(w io.Writer) io.WriteCloser

Jump to

Keyboard shortcuts

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