texth

package
v0.0.0-...-7893cc3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrZeroBytes is raised when the `io.Writer` in the handler
	// returns a zero-length of bytes written, when the `Write()`
	// method is called
	ErrZeroBytes error = errors.New("zero bytes written")
)

Functions

func New

func New(w io.Writer) handlers.Handler

New creates a text handler based on the input io.Writer `w`

func WithAttrSeparator

func WithAttrSeparator(h handlers.Handler, attrSeparator rune) handlers.Handler

WithWrapper creates a copy the Handler `h`, with the attribute key-value separator string `attrSeparator`. Returns nil if the Handler is not a textHandler

func WithKVSeparator

func WithKVSeparator(h handlers.Handler, kvSeparator string) handlers.Handler

WithWrapper creates a copy the Handler `h`, with the key-value separator string `kvSeparator`. Returns nil if the Handler is not a textHandler

func WithTimeFormat

func WithTimeFormat(h handlers.Handler, timeFmt string) handlers.Handler

WithWrapper creates a copy the Handler `h`, with the time format string `timeFmt`. Returns nil if the Handler is not a textHandler

func WithWhitespace

func WithWhitespace(h handlers.Handler, whitespace rune) handlers.Handler

WithWhitespace creates a copy the Handler `h`, with the whitespace rune `whitespace`. Returns nil if the Handler is not a textHandler

func WithWrapper

func WithWrapper(h handlers.Handler, leftWrapper, rightWrapper rune) handlers.Handler

WithWrapper creates a copy the Handler `h`, with the left and right wrapper runes `leftWrapper` and `rightWrapper`. Returns nil if the Handler is not a textHandler

Types

This section is empty.

Jump to

Keyboard shortcuts

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