tlio

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v0.20.0

func Close(f interface{}) error

func CloseWrap added in v0.20.0

func CloseWrap(f interface{}, name string, errp *error)

func Fd

func Fd(f interface{}) uintptr

func Unwrap added in v0.21.2

func Unwrap(x interface{}) interface{}

func WrapCloser added in v0.14.1

func WrapCloser(c io.Closer, msg string, args ...interface{}) io.Closer

func WrapCloserFunc added in v0.14.1

func WrapCloserFunc(cf func() error, msg string, args ...interface{}) io.Closer

Types

type CloserFunc

type CloserFunc func() error

func (CloserFunc) Close

func (c CloserFunc) Close() error

type CountingIODiscard added in v0.20.0

type CountingIODiscard struct {
	Bytes, Writes atomic.Int64
}

CountingIODiscard discards data but counts writes and bytes. It's safe to use simultaneously (atomic operations are used).

func (*CountingIODiscard) ReportDisk added in v0.20.0

func (w *CountingIODiscard) ReportDisk(b *testing.B)

func (*CountingIODiscard) Write added in v0.20.0

func (w *CountingIODiscard) Write(p []byte) (int, error)

type DeLabels

type DeLabels struct {
	io.Writer
	// contains filtered or unexported fields
}

DeLabels removes repeating Labels from events.

func NewDeLabels

func NewDeLabels(w io.Writer) *DeLabels

func (*DeLabels) Unwrap added in v0.21.2

func (w *DeLabels) Unwrap() interface{}

func (*DeLabels) Write

func (w *DeLabels) Write(p []byte) (i int, err error)

type DumpReader

type DumpReader struct {
	io.Reader

	tlog.Span

	Pos int64
}

func (*DumpReader) Close added in v0.20.0

func (r *DumpReader) Close() (err error)

func (*DumpReader) Read

func (r *DumpReader) Read(p []byte) (n int, err error)

func (*DumpReader) Seek added in v0.20.0

func (r *DumpReader) Seek(off int64, whence int) (pos int64, err error)

type Flusher

type Flusher interface {
	Flush() error
}

func WrapFlusherNoError added in v0.14.1

func WrapFlusherNoError(f FlusherNoError) Flusher

type FlusherNoError added in v0.14.1

type FlusherNoError interface {
	Flush()
}

type HeadWriter

type HeadWriter struct {
	io.Writer
	N int
}

func NewHeadWriter

func NewHeadWriter(w io.Writer, n int) *HeadWriter

func (*HeadWriter) Unwrap added in v0.21.2

func (w *HeadWriter) Unwrap() interface{}

func (*HeadWriter) Write

func (w *HeadWriter) Write(p []byte) (int, error)

type MultiWriter added in v0.20.0

type MultiWriter []io.Writer

func NewMultiWriter added in v0.20.0

func NewMultiWriter(ws ...io.Writer) (w MultiWriter)

func (MultiWriter) Append added in v0.20.0

func (w MultiWriter) Append(ws ...io.Writer) MultiWriter

func (MultiWriter) Close added in v0.20.0

func (w MultiWriter) Close() (err error)

func (MultiWriter) String added in v0.20.0

func (w MultiWriter) String() string

func (MultiWriter) Write added in v0.20.0

func (w MultiWriter) Write(p []byte) (n int, err error)

type NopCloser

type NopCloser struct {
	io.Reader
	io.Writer
}

func (NopCloser) Close

func (NopCloser) Close() error

func (NopCloser) Fd

func (c NopCloser) Fd() uintptr

type ReReader

type ReReader struct {
	ReadSeeker

	Hook func(old, cur int64)
	// contains filtered or unexported fields
}

func NewReReader

func NewReReader(r ReadSeeker) (*ReReader, error)

func (*ReReader) Read

func (r *ReReader) Read(p []byte) (n int, err error)

type ReWriter

type ReWriter struct {
	io.Writer
	io.Closer

	Open func(io.Writer, error) (io.Writer, error)
}

func NewReWriter

func NewReWriter(open func(io.Writer, error) (io.Writer, error)) *ReWriter

func (*ReWriter) Close

func (w *ReWriter) Close() error

func (*ReWriter) Write

func (w *ReWriter) Write(p []byte) (n int, err error)

type ReadCloser

type ReadCloser struct {
	io.Reader
	io.Closer
}

type ReadSeeker

type ReadSeeker interface {
	io.Reader
	Seeker
}

type Seeker

type Seeker interface {
	Seek(off int64, whence int) (int64, error)
}

type TailWriter

type TailWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func NewTailWriter

func NewTailWriter(w io.Writer, n int) *TailWriter

func (*TailWriter) Flush

func (w *TailWriter) Flush() (err error)

func (*TailWriter) Unwrap added in v0.21.2

func (w *TailWriter) Unwrap() interface{}

func (*TailWriter) Write

func (w *TailWriter) Write(p []byte) (n int, err error)

type Unwrapper added in v0.21.2

type Unwrapper interface {
	Unwrap() interface{}
}

type WrappedCloser added in v0.20.0

type WrappedCloser struct {
	io.Closer
	Msg  string
	Args []interface{}
}

func (WrappedCloser) Close added in v0.20.0

func (c WrappedCloser) Close() (err error)

type WriteCloser

type WriteCloser struct {
	io.Writer
	io.Closer
}

func (WriteCloser) String

func (w WriteCloser) String() string

type WriteFlusher

type WriteFlusher struct {
	io.Writer
	Flusher
}

type WriterFunc

type WriterFunc func(p []byte) (int, error)

func (WriterFunc) Write

func (w WriterFunc) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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