writer

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Switcher

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

Switcher is a writer proxy, which can switch the writer to another in running.

func NewSwitcher

func NewSwitcher(writer io.Writer) *Switcher

NewSwitcher returns a new Switcher with w.

func (*Switcher) Close

func (w *Switcher) Close() error

Close implements the interface io.Closer.

func (*Switcher) Get

func (w *Switcher) Get() io.Writer

Get returns the wrapped writer, which is equal to Unwrap.

func (*Switcher) Set

func (w *Switcher) Set(new io.Writer)

Set sets the writer to new.

func (*Switcher) Swap

func (w *Switcher) Swap(new io.Writer) (old io.Writer)

Swap swaps the old writer with the new writer.

func (*Switcher) Unwrap

func (w *Switcher) Unwrap() io.Writer

Unwrap returns the wrapped writer.

func (*Switcher) Write

func (w *Switcher) Write(b []byte) (int, error)

Write implements the interface io.Writer.

Jump to

Keyboard shortcuts

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