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"`
InnerHTML map[string][]string `json:"innerHTML,omitempty"` // Raw HTML content for text-based properties
ID string `json:"id,omitempty"`
}
func (*Item) GetProperties ¶
func (*Item) GetProperty ¶
func (*Item) IsOfSchemaType ¶
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 ¶
GetFirstOfSchemaType returns the first item of the given type with possible https://schema.org/ context.
func (*Microdata) GetFirstOfType ¶
GetFirstOfType returns the first item of the given type.
type PropertyMap ¶
Click to show internal directories.
Click to hide internal directories.