xreopen

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Stdout  = NopWriter(os.Stdout)
	Stderr  = NopWriter(os.Stderr)
	Discard = NopWriter(ioutil.Discard)
)

Functions

This section is empty.

Types

type BufferedFileWriter

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

func NewBufferedFileWriter

func NewBufferedFileWriter(w *FileWriter) *BufferedFileWriter

func NewBufferedFileWriterSize

func NewBufferedFileWriterSize(w *FileWriter, size int, flush time.Duration) *BufferedFileWriter

func (*BufferedFileWriter) Close

func (bw *BufferedFileWriter) Close() error

func (*BufferedFileWriter) Flush

func (bw *BufferedFileWriter) Flush()

func (*BufferedFileWriter) Reopen

func (bw *BufferedFileWriter) Reopen() error

func (*BufferedFileWriter) Write

func (bw *BufferedFileWriter) Write(p []byte) (int, error)

type FileWriter

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

func NewFileWriter

func NewFileWriter(name string) (*FileWriter, error)

func NewFileWriterMode

func NewFileWriterMode(name string, mode os.FileMode) (*FileWriter, error)

func (*FileWriter) Close

func (f *FileWriter) Close() error

func (*FileWriter) Fd

func (f *FileWriter) Fd() uintptr

func (*FileWriter) Reopen

func (f *FileWriter) Reopen() error

Reopen the file

func (*FileWriter) Write

func (f *FileWriter) Write(p []byte) (int, error)

Write implements the stander io.Writer interface

type Reopener

type Reopener interface {
	Reopen() error
}

type WriteCloser

type WriteCloser interface {
	Reopener
	io.WriteCloser
}

func NopWriter

func NopWriter(w io.Writer) WriteCloser

type Writer

type Writer interface {
	Reopener
	io.Writer
}

func MultiWriter

func MultiWriter(writers ...Writer) Writer

Jump to

Keyboard shortcuts

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