Documentation
¶
Overview ¶
Package filter provides fundamentals for each filters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustRegister ¶
MustRegister registers a filter, panic if failed.
Types ¶
type Base ¶
Base is base of filters. It provides common features for filter.
func (*Base) Init ¶
func (b *Base) Init(r io.ReadCloser, readNext BaseReadNext)
Init initializes Base object.
type BaseReadNext ¶
BaseReadNext is callback to read next data hunk to buf
type Cut ¶
type Cut struct { Base // contains filtered or unexported fields }
Cut represents cut filter.
type Grep ¶
type Grep struct { Base // contains filtered or unexported fields }
Grep represents grep like filter.
type Hash ¶
type Hash struct { Base // contains filtered or unexported fields }
Hash represents hash filter.
type Head ¶
type Head struct { Base // contains filtered or unexported fields }
Head is "head" like filter.
type LTSV ¶
type LTSV struct { Base // contains filtered or unexported fields }
LTSV represents a structure for LTSV (labeled tab separated value)
type LineFilter ¶
LineFilter is a line filter.
var TrimEOL LineFilter = func(b []byte) []byte { l := len(b) if l >= 1 && b[l-1] == '\n' { c := 1 if l >= 2 && b[len(b)-2] == '\r' { c++ } return b[:len(b)-c] } return b }
TrimEOL trims EOL bytes.
func NewCutLF ¶
func NewCutLF(sep []byte, n int) LineFilter
NewCutLF creates a cut line filter with sep and position.
func (LineFilter) Apply ¶
func (lf LineFilter) Apply(b []byte) []byte
Apply applies a filter to a line bytes.
func (LineFilter) Chain ¶
func (lf LineFilter) Chain(second LineFilter) LineFilter
Chain createa a new LineFilters which chains two LineFilters.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package count provides count filter.
|
Package count provides count filter. |
Package htmltable provides HTML table filter.
|
Package htmltable provides HTML table filter. |
Package indexhtml provides index HTML filter.
|
Package indexhtml provides index HTML filter. |
Package jsonarray provides JSON array filter.
|
Package jsonarray provides JSON array filter. |
Package markdown provides markdown filter which render HTML from Markdown.
|
Package markdown provides markdown filter which render HTML from Markdown. |
Package tail provides tail filter.
|
Package tail provides tail filter. |
Package texttable provides table formatter in plain text.
|
Package texttable provides table formatter in plain text. |
Package trdsql provides https://github.com/noborus/trdsql filter
|
Package trdsql provides https://github.com/noborus/trdsql filter |