Documentation ¶
Overview ¶
Structs for wildcard schema, documented here: http://www.trywildcard.com/docs/schema/
Index ¶
- Variables
- type Article
- type ArticleCard
- type Card
- type CardType
- type GenericMetadata
- type GeoCoordinates
- type Hours
- type ImageCard
- type ImageDetails
- type ImageMedia
- type LinkCard
- type LinkTarget
- type MediaType
- type Place
- type PlaceCard
- type PostalAddress
- type Rating
- type Time
- type TimeRange
- type VideoCard
- type VideoMedia
- type Wildcard
Constants ¶
This section is empty.
Variables ¶
View Source
var TimeParseError = errors.New(`TimeParseError: should be a string formatted as "15:04:05"`)
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { Url string `json:"url"` AbstractContent string `json:"abstract_content" ogtag:"og:description"` IsBreaking bool `json:"is_breaking,omitempty"` Contributors []string `json:"contributors,omitempty"` Byline string `json:"byline,omitempty" ogtag:"byl"` GenericMetadata `ogtag:",squash"` }
type ArticleCard ¶
func NewArticleCard ¶
func NewArticleCard(webUrl, articleUrl string) *ArticleCard
type GenericMetadata ¶
type GenericMetadata struct { Title string `json:"title,omitempty" ogtag:"og:title"` PublicationDate *time.Time `json:"publication_date,omitempty" ogtag:"article:published_time"` Source string `json:"source,omitempty" ogtag:"og:site_name"` Keywords []string `json:"keywords,omitempty"` // Our own addition, wildcard has a neutered version AppLink *applink.AppLink `json:"app_link,omitempty" ogtag:",fill"` // Our own addition, is usually the favicon SourceIcon string `json:"source_icon,omitempty" ogtag:"favicon"` // Our own addition since why wouldn't everything have an image? Image *ImageDetails `json:"image,omitempty" ogtag:",fill"` }
Metadata that pretty much every topic has
type GeoCoordinates ¶
type Hours ¶
type Hours struct { Days []time.Weekday `json:"days"` // The indexes in the Open field match the indexes in the Days field. // Together they map when the place is open. Open []TimeRange `json:"open"` }
This is mostly borrowed from foursquare, not schema.org
type ImageCard ¶
type ImageCard struct { Card Media *ImageMedia `json:"media"` }
func NewImageCard ¶
type ImageDetails ¶
type ImageMedia ¶
type ImageMedia struct { Type MediaType `json:"type"` ImageDetails //Optional ImageCaption string `json:"image_caption,omitempty"` Author string `json:"author,omitempty"` GenericMetadata }
type LinkCard ¶
type LinkCard struct { Card Target *LinkTarget `json:"target" ogtag:",fill"` }
func NewLinkCard ¶
type LinkTarget ¶
type LinkTarget struct { Url string `json:"url"` Description string `json:"description,omitempty" ogtag:"og:description"` GenericMetadata `ogtag:",squash"` }
type Place ¶
type Place struct { Url string `json:"url,omitempty"` Description string `json:"description,omitempty"` // Despite the "PostalAddress" type, this should be a physical address. Address *PostalAddress `json:"address,omitempty"` Location *GeoCoordinates `json:"location,omitempty"` Rating *Rating `json:"rating,omitempty"` Hours *Hours `json:"hours,omitempty"` PhoneNumber string `json:"phone_number,omitempty"` FormattedPhoneNumber string `json:"formatted_phone_number,omitempty"` GenericMetadata `ogtag:",squash"` }
func (*Place) HasLocation ¶
type PlaceCard ¶
func NewPlaceCard ¶
type PostalAddress ¶
type PostalAddress struct { StreetAddress string `json:"street_address"` PostOfficeBoxNumber string `json:"post_office_box_number,omitempty"` // In the US, this is the city Locality string `json:"locality,omitempty"` // In the US, this is the state Region string `json:"region,omitempty"` PostalCode string `json:"postal_code,omitempty"` Country string `json:"country,omitempty"` }
Like, where to send snail mail. Quite possibly a physical address.
func (*PostalAddress) Formatted ¶
func (a *PostalAddress) Formatted() string
Returns the address as a nicely formatted string on a single line. TODO: Make this deal with missing data better
func (*PostalAddress) MultiLineFormatted ¶
func (a *PostalAddress) MultiLineFormatted() string
TODO: Make this deal with missing data better
type Rating ¶
type Rating struct { // What this is actually rated. Value string `json:"value"` // If this thing is perfect, this is what it would be rated. BestRating string `json:"best_rating,omitempty"` // This is almost always 1 (and should be assumed to be 1 if it's missing), // but it's the minimum rating. WorstRating string `json:"worst_rating,omitempty"` // Using an int32 here even though it limits things to 4 billion ratings. RatingCount int32 `json:"rating_count,omitempty"` ReviewCount int32 `json:"review_count,omitempty"` // An image that can be used to represent this rating. ImageUrl string `json:"image_url,omitempty"` }
type VideoCard ¶
type VideoCard struct { Card Media *VideoMedia `json:"media" ogtag:",fill"` }
func NewVideoCard ¶
type VideoMedia ¶
type VideoMedia struct { Type MediaType `json:"type"` // XXX: Perhaps pull these out for other embed types EmbeddedUrl string `json:"embedded_url"` EmbeddedUrlWidth string `json:"embedded_url_width" ogtag:"og:video:width"` EmbeddedUrlHeight string `json:"embedded_url_height" ogtag:"og:video:height"` // Optional Description string `json:"description,omitempty" ogtag:"og:description"` StreamUrl string `json:"stream_url,omitempty" ogtag:"og:video:url"` StreamContentType string `json:"stream_content_type,omitempty" ogtag:"og:video:type"` PosterImageUrl string `json:"poster_image_url,omitempty" ogtag:"og:image:url"` Creator string `json:"creator,omitempty"` GenericMetadata `ogtag:",squash"` }
Click to show internal directories.
Click to hide internal directories.