Documentation ¶
Overview ¶
Package types has structs for the sports news api and for its poller of news
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { ArticleKey `json:",inline"` Content string `json:"content,omitempty"` GalleryUrls string `json:"galleryUrls,omitempty"` Id ArticleId `json:"id"` // id should be generated from ArticleKey fields ImageURL string `json:"imageUrl,omitempty"` OptaMatchId string `json:"optaMatchId,omitempty"` Title string `json:"title,omitempty"` Type []string `json:"type,omitempty"` URL string `json:"url,omitempty"` VideoURL string `json:"videoUrl,omitempty"` HasDetails bool `json:"hasDetails"` }
Article is representing a single article served by API
Use SetGeneratedId after creating the object with empty Id to set it based on ArticleKey.
func (*Article) SetGeneratedId ¶
SetGeneratedId is used for setting the ID in article after creation
type ArticleDetailed ¶
type ArticleDetailed struct { Status string `json:"status"` Data *Article `json:"data,omitempty"` Message string `json:"message,omitempty"` Metadata ArticleDetailedMetadata `json:"metadata"` }
ArticleDetailed is struct that will be returned by sports news api.
It was generated with the help of:
go install github.com/twpayne/go-jsonstruct/v2/cmd/gojsonstruct@latest cat examples/hullcityArticleDetailed.json | gojsonstruct
func (ArticleDetailed) GetMessage ¶
func (d ArticleDetailed) GetMessage() string
type ArticleDetailedMetadata ¶
type ArticleKey ¶
type ArticleKey struct { TeamId string `json:"teamId"` NewsId string `json:"-"` Published time.Time `json:"published"` }
ArticleKey represents fields that are used to generate hash from article.
type ArticleList ¶
type ArticleList struct { Status string `json:"status"` Data []Article `json:"data,omitempty"` Message string `json:"message,omitempty"` Metadata ArticleListMetadata `json:"metadata"` }
ArticleList is struct that will be returned by sports news api.
It was generated with the help of:
go install github.com/twpayne/go-jsonstruct/v2/cmd/gojsonstruct@latest cat examples/hullcityArticleList.json | gojsonstruct
func (ArticleList) GetMessage ¶
func (d ArticleList) GetMessage() string
Click to show internal directories.
Click to hide internal directories.