tlio

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(f interface{}) error

func CloseWrap

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

func Fd

func Fd(f interface{}) uintptr

func Unwrap

func Unwrap(x interface{}) interface{}

func WalkWriter added in v0.23.2

func WalkWriter(w io.Writer, f func(io.Writer) error) error

func WrapCloser

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

func WrapCloserFunc

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

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

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

func (*CountingIODiscard) Write

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

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

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

func (*DumpReader) Read

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

func (*DumpReader) Seek

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

type Flusher

type Flusher interface {
	Flush() error
}

func WrapFlusherNoError

func WrapFlusherNoError(f FlusherNoError) Flusher

type FlusherNoError

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

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

func (*HeadWriter) Write

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

type MultiWriter

type MultiWriter []io.Writer

func NewMultiWriter

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

func (MultiWriter) Append

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

func (MultiWriter) Close

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

func (MultiWriter) String

func (w MultiWriter) String() string

func (MultiWriter) WalkWriter added in v0.23.2

func (w MultiWriter) WalkWriter(f func(w io.Writer) error) error

func (MultiWriter) Write

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 SandwichWriter added in v0.22.1

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

func NewSandwichWriter added in v0.22.1

func NewSandwichWriter(filling io.Writer) *SandwichWriter

func (*SandwichWriter) Inner added in v0.22.1

func (w *SandwichWriter) Inner() io.Writer

func (*SandwichWriter) Unwrap added in v0.22.1

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

func (*SandwichWriter) Write added in v0.22.1

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

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

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

func (*TailWriter) Write

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

type Unwrapper

type Unwrapper interface {
	Unwrap() interface{}
}

type WrappedCloser

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

func (WrappedCloser) Close

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
JackTT - Gopher 🇻🇳