prefixwriter

package
v0.0.0-...-14dca07 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrefixWriter

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

PrefixWriter is io.Writer interface implementation where the specified prefix will be added to the beginning of a new line.

func NewWriter

func NewWriter(writer io.Writer, prefix string) *PrefixWriter

NewWriter wrappers passed io.Writer to PrefixWriter with passed prefix.

func (*PrefixWriter) Write

func (writer *PrefixWriter) Write(payload []byte) (int, error)

Write is io.Writer interface implementation.

Write writes len(payload) bytes from payload to the underlying data stream. It returns the number of bytes written from payload (0 <= n <= len(payload)) and any error encountered that caused the write to stop early. Write returns a non-nil error if it returns n < len(payload). Write does not modify the slice data, even temporarily. Write does not retain payload.

Jump to

Keyboard shortcuts

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