Documentation ¶
Index ¶
- func FillArrayArrayField[T comparable](engine *engineParser[T], parent []T, size int, fn func(T, string) []T, ...) builder.Jsonable
- func FillArrayBaseField[T comparable](engine *engineParser[T], parent []T, size int, cfg *config.BaseField) builder.Jsonable
- func FillArrayObjectField[T comparable](engine *engineParser[T], parent []T, size int, cfg *config.ObjectConfig) builder.Jsonable
- func IsZero[T comparable](v T) bool
- func NewHTML(body []byte, logger logger.Logger) *engineParser[*goquery.Selection]
- func NewJson(body []byte, logger logger.Logger) *engineParser[*gjson.Result]
- func NewXML(body []byte, logger logger.Logger) *engineParser[*xmlquery.Node]
- func NewXPath(body []byte, logger logger.Logger) *engineParser[*html.Node]
- func ProcessExpression(expression string, result builder.Jsonable, index *uint32) (interface{}, error)
- func ProcessFileField(parsedValue builder.Jsonable, index *uint32, field *config.FileFieldConfig, ...) (string, error)
- type Engine
- type Factory
- type ParseResult
- type Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FillArrayArrayField ¶ added in v0.0.34
func FillArrayArrayField[T comparable](engine *engineParser[T], parent []T, size int, fn func(T, string) []T, cfg *config.ArrayConfig) builder.Jsonable
func FillArrayBaseField ¶ added in v0.0.34
func FillArrayObjectField ¶ added in v0.0.34
func FillArrayObjectField[T comparable](engine *engineParser[T], parent []T, size int, cfg *config.ObjectConfig) builder.Jsonable
func IsZero ¶ added in v0.0.34
func IsZero[T comparable](v T) bool
func ProcessExpression ¶ added in v0.0.19
Types ¶
type Engine ¶ added in v0.0.29
type Factory ¶
var ( JsonFactory Factory = func(bytes []byte, logger logger.Logger) Parser { return NewJson(bytes, logger.With("parser", "json")) } HTMLFactory Factory = func(bytes []byte, logger logger.Logger) Parser { return NewHTML(bytes, logger.With("parser", "html")) } XPathFactory Factory = func(bytes []byte, logger logger.Logger) Parser { return NewXPath(bytes, logger.With("parser", "xpath")) } XMLFactory Factory = func(bytes []byte, logger logger.Logger) Parser { return NewXML(bytes, logger.With("parser", "xml")) } )
type ParseResult ¶
type ParseResult struct { Json string `json:"raw"` RawResult interface{} }
func (*ParseResult) IsEmpty ¶ added in v0.0.6
func (p *ParseResult) IsEmpty() bool
func (*ParseResult) Raw ¶
func (p *ParseResult) Raw() interface{}
func (*ParseResult) ToJson ¶
func (p *ParseResult) ToJson() string
Click to show internal directories.
Click to hide internal directories.