Documentation ¶
Index ¶
- func TypeDeref(t reflect.Type) reflect.Type
- func Unmarshal(bs []byte, v interface{}) error
- func UnmarshalSelection(doc *Document, iface interface{}) error
- type CannotUnmarshalError
- type Decoder
- type Document
- func (doc *Document) Attr(attrName string) (val string, exists bool)
- func (doc *Document) Eq(index int) *Document
- func (doc *Document) Find(selector string) *Document
- func (doc *Document) FindOne(selector string) (*Document, error)
- func (doc *Document) Html() (ret string, e error)
- func (doc *Document) IsEmpty() bool
- func (doc *Document) Length() int
- func (doc *Document) Slice(start, end int) *Document
- func (doc *Document) Text() string
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unmarshal ¶
Unmarshal takes a byte slice and a destination pointer to any interface{}, and unmarshals the document into the destination based on the rules above. Any error returned here will likely be of type CannotUnmarshalError, though an initial htmlquery error will pass through directly.
func UnmarshalSelection ¶
Types ¶
type CannotUnmarshalError ¶
type CannotUnmarshalError struct { Err error Val string FldOrIdx interface{} V reflect.Value Reason string XPath string }
CannotUnmarshalError represents an error returned by the goqxtag Unmarshaler and helps consumers in programmatically diagnosing the cause of their error.
func (*CannotUnmarshalError) Error ¶
func (e *CannotUnmarshalError) Error() string
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder implements the same API you will see in encoding/xml and encoding/json except that we do not currently support proper streaming decoding as it is not supported by goquery upstream.
func NewDecoder ¶
NewDecoder returns a new decoder given an io.Reader