Documentation ¶
Index ¶
- func HTMLFilter(input io.ReadCloser, filter string) ([]string, error)
- func JSONFilter(input io.ReadCloser, filter string) ([]interface{}, error)
- func New(urls []string, filter string, columns []types.ColumnSelector) (types.Source, error)
- func NewCSV(input []io.ReadCloser, filter string, columns []types.ColumnSelector) (types.Source, error)
- func NewHTML(input []io.ReadCloser, filter string, columns []types.ColumnSelector) (types.Source, error)
- func NewJSON(input []io.ReadCloser, filter string, columns []types.ColumnSelector) (types.Source, error)
- type CSV
- type Format
- type HTML
- type JSON
- type NewSource
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTMLFilter ¶
func HTMLFilter(input io.ReadCloser, filter string) ([]string, error)
HTMLFilter filters the input with the CSS selector string and returns the matching elements.
func JSONFilter ¶
func JSONFilter(input io.ReadCloser, filter string) ([]interface{}, error)
JSONFilter filters the input with the CSS selector string and returns the matching elements.
func NewCSV ¶
func NewCSV(input []io.ReadCloser, filter string, columns []types.ColumnSelector) (types.Source, error)
NewCSV creates a new CSV data source from the input.
func NewHTML ¶
func NewHTML(input []io.ReadCloser, filter string, columns []types.ColumnSelector) (types.Source, error)
NewHTML creates a new HTML data source from the input.
func NewJSON ¶
func NewJSON(input []io.ReadCloser, filter string, columns []types.ColumnSelector) (types.Source, error)
NewJSON creates a new JSON data source from the input.
Types ¶
type CSV ¶
type CSV struct {
// contains filtered or unexported fields
}
CSV implements a data source from comma-separated values (CSV).
func (*CSV) Columns ¶
func (c *CSV) Columns() []types.ColumnSelector
Columns implements the Source.Columns().
type HTML ¶
type HTML struct {
// contains filtered or unexported fields
}
HTML implements a data source from HTML data.
func (*HTML) Columns ¶
func (html *HTML) Columns() []types.ColumnSelector
Columns implements the Source.Columns().
type JSON ¶
type JSON struct {
// contains filtered or unexported fields
}
JSON implements a data source from JavaScript Object Notation (JSON).
func (*JSON) Columns ¶
func (src *JSON) Columns() []types.ColumnSelector
Columns implements the Source.Columns().
type NewSource ¶
type NewSource func(in []io.ReadCloser, filter string, columns []types.ColumnSelector) (types.Source, error)
NewSource defines a constructor for data sources.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves data format from input meta data.
func (*Resolver) ResolveMediaType ¶
ResolveMediaType resolves the input format from content media type.
func (*Resolver) ResolvePath ¶
ResolvePath resolves the input format from file path.