textproc

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteEncoder

type ByteEncoder interface {
	Encode(rest []byte, fw WriteFlusher) (cnt []byte, e error)
}

type DiscardEncoder

type DiscardEncoder struct{}

func (DiscardEncoder) Encode

func (r DiscardEncoder) Encode(rest []byte, fw WriteFlusher) (cnt []byte, e error)

type Encoder

type Encoder struct {
	Encoding *Encoding
	Writer   WriteFlusher
}

func (*Encoder) Write

func (r *Encoder) Write(p []byte) (n int, err error)

type Encoding

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

func NewEncoding

func NewEncoding() *Encoding

func (*Encoding) Clone

func (r *Encoding) Clone() *Encoding

func (*Encoding) EncodePart

func (r *Encoding) EncodePart(b []byte, w WriteFlusher) (e error)

func (*Encoding) ForEach

func (r *Encoding) ForEach(f func(b byte, r ByteEncoder))

func (*Encoding) Index

func (r *Encoding) Index(b []byte) (idx int, e ByteEncoder)

func (*Encoding) NewBufferedWriter

func (e *Encoding) NewBufferedWriter(w io.Writer) *Encoder

func (*Encoding) NewEncoder

func (e *Encoding) NewEncoder(w WriteFlusher) *Encoder

func (*Encoding) With

func (r *Encoding) With(b byte, h ByteEncoder) *Encoding

func (*Encoding) WithDiscard

func (r *Encoding) WithDiscard(b byte) *Encoding

func (*Encoding) WithDiscardSet

func (r *Encoding) WithDiscardSet(k string) *Encoding

func (*Encoding) WithFlush

func (r *Encoding) WithFlush(b byte) *Encoding

func (*Encoding) WithFunc

func (r *Encoding) WithFunc(b byte, h FuncEncoder) *Encoding

func (*Encoding) WithJSONEscaped

func (r *Encoding) WithJSONEscaped(b ...byte) *Encoding

func (*Encoding) WithLineFlush

func (r *Encoding) WithLineFlush() *Encoding

func (*Encoding) WithLiteral

func (r *Encoding) WithLiteral(b byte, d []byte) *Encoding

func (*Encoding) WithNoANSI

func (r *Encoding) WithNoANSI() *Encoding

func (*Encoding) WithString

func (r *Encoding) WithString(b byte, with string) *Encoding

func (*Encoding) WithTabWidth

func (r *Encoding) WithTabWidth(n int) *Encoding

type FlushEncoder

type FlushEncoder struct{}

func (FlushEncoder) Encode

func (FlushEncoder) Encode(rest []byte, fw WriteFlusher) (cnt []byte, e error)

type FuncEncoder

type FuncEncoder func(rest []byte, fw WriteFlusher) (cnt []byte, e error)

func (FuncEncoder) Encode

func (f FuncEncoder) Encode(rest []byte, fw WriteFlusher) (cnt []byte, e error)

type LiteralEncoder

type LiteralEncoder struct {
	Value []byte
}

func (LiteralEncoder) Encode

func (r LiteralEncoder) Encode(rest []byte, fw WriteFlusher) (cnt []byte, e error)

type WriteFlusher

type WriteFlusher interface {
	Write(p []byte) (nn int, err error)
	Flush() error
}

Jump to

Keyboard shortcuts

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