Documentation ¶
Index ¶
- type Item
- func (i *Item) CountPaths(prefix string, paths *map[string]int)
- func (i *Item) GetNested(keys ...string) (data Microdata, ok bool)
- func (i *Item) GetNestedItem(keys ...string) (val *Item, ok bool)
- func (i *Item) GetProperties(keys ...string) (arr []interface{}, ok bool)
- func (i *Item) GetProperty(keys ...string) (val interface{}, ok bool)
- func (i *Item) IsOfSchemaType(itemType string) bool
- func (i *Item) IsOfType(itemType ...string) bool
- type Microdata
- type PropertyMap
- type ValueList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { Types []string `json:"type"` Properties PropertyMap `json:"properties"` ID string `json:"id,omitempty"` }
func (*Item) CountPaths ¶ added in v1.0.0
func (*Item) GetNestedItem ¶ added in v1.0.0
func (*Item) GetProperties ¶ added in v1.0.0
func (*Item) GetProperty ¶ added in v1.0.0
func (*Item) IsOfSchemaType ¶ added in v1.0.1
type Microdata ¶
type Microdata struct {
Items []*Item `json:"items"`
}
func ParseHTML ¶
ParseHTML parses the HTML document available in the given reader and returns the microdata. The given url is used to resolve the URLs in the attributes. The given contentType is used to convert the content of r to UTF-8. When the given contentType is equal to "", the content type will be detected using `http.DetectContentType`.
func ParseURL ¶
ParseURL parses the HTML document available at the given URL and returns the microdata.
func (*Microdata) GetFirstOfSchemaType ¶ added in v1.0.1
GetFirstOfSchemaType returns the first item of the given type with possible https://schema.org/ context.
func (*Microdata) GetFirstOfType ¶ added in v1.0.0
GetFirstOfType returns the first item of the given type.
type PropertyMap ¶
Click to show internal directories.
Click to hide internal directories.