Documentation ¶
Index ¶
- func CreateFileStorageField(parsedValue builder.Interfacable, index *uint32, input builder.Interfacable, ...) (string, error)
- func FillArrayArrayField[T comparable](engine *engineParser[T], parent []T, size int, fn func(T, string) []T, ...) builder.Interfacable
- func FillArrayBaseField[T comparable](engine *engineParser[T], parent []T, size int, cfg *config.BaseField, ...) builder.Interfacable
- func FillArrayObjectField[T comparable](engine *engineParser[T], parent []T, size int, cfg *config.ObjectConfig, ...) builder.Interfacable
- 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 ProcessFileField(parsedValue builder.Interfacable, index *uint32, input builder.Interfacable, ...) (string, error)
- type Engine
- type Factory
- type ParseResult
- type Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFileStorageField ¶ added in v1.0.1
func CreateFileStorageField(parsedValue builder.Interfacable, index *uint32, input builder.Interfacable, cfg *config.FileStorageField, logger logger.Logger) (string, error)
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, input builder.Interfacable) builder.Interfacable
func FillArrayBaseField ¶ added in v0.0.34
func FillArrayBaseField[T comparable](engine *engineParser[T], parent []T, size int, cfg *config.BaseField, input builder.Interfacable) builder.Interfacable
func FillArrayObjectField ¶ added in v0.0.34
func FillArrayObjectField[T comparable](engine *engineParser[T], parent []T, size int, cfg *config.ObjectConfig, input builder.Interfacable) builder.Interfacable
func IsZero ¶ added in v0.0.34
func IsZero[T comparable](v T) bool
func ProcessFileField ¶ added in v0.0.23
func ProcessFileField(parsedValue builder.Interfacable, index *uint32, input builder.Interfacable, field *config.FileFieldConfig, logger logger.Logger) (string, error)
Types ¶
type Engine ¶ added in v0.0.29
type Engine interface {
Get(model *config.Model, parsedValue builder.Interfacable, index *uint32, input builder.Interfacable) (*ParseResult, error)
}
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 json.RawMessage }
func (*ParseResult) IsEmpty ¶ added in v0.0.6
func (p *ParseResult) IsEmpty() bool
func (*ParseResult) Raw ¶
func (p *ParseResult) Raw() json.RawMessage
func (*ParseResult) ToInterface ¶ added in v1.0.0
func (p *ParseResult) ToInterface() interface{}
func (*ParseResult) ToJson ¶
func (p *ParseResult) ToJson() string
type Parser ¶
type Parser interface {
Parse(model *config.Model, input builder.Interfacable) (*ParseResult, error)
}
Click to show internal directories.
Click to hide internal directories.