Documentation
¶
Overview ¶
Package types provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Index ¶
- Variables
- func GetMedianInterval(data []time.Duration) time.Duration
- func IsImage(mimetype string) bool
- type FeedSource
- type HasAttribution
- type HasContent
- type HasID
- type HasLocalization
- type HasMedia
- type HasTaxonomy
- type ImageInfo
- type ItemSource
- type MediaEditable
- type ObjectCommon
- type ObjectMetadata
- type Source
- type SourceEditable
Constants ¶
This section is empty.
Variables ¶
var (
MimeTypesImage = []string{"image/avif", "image/gif", "image/jpeg", "image/png", "image/svg+xml", "image/webp"}
)
Functions ¶
func GetMedianInterval ¶
GetMedianInterval calculates the median of the given set of time.Duration values.
Types ¶
type FeedSource ¶
type FeedSource interface {
ObjectCommon
Source
SourceEditable
MediaEditable
GetUpdateInterval() time.Duration
GetItems() []ItemSource
Validate() error
}
FeedSource is an abstraction representing any type of Feed.
type HasAttribution ¶
type HasAttribution interface {
GetAuthors() []string
GetContributors() []string
GetRights() *string
}
HasAttribution contains methods for retrieving values that relate to the copyright, rights, authors and contributors of an Object.
type HasContent ¶
type HasContent interface {
GetContent() *string
}
HasContent contains methods for retrieving any embedded content of the Object.
type HasID ¶
type HasID interface {
GetID() string
}
HasID contains methods for retrieving an Objects unique ID.
type HasLocalization ¶
type HasLocalization interface {
GetLanguage() *string
}
HasLocalization contains methods for retrieving localization information of an Object.
type HasMedia ¶
type HasMedia interface {
GetImage() *ImageInfo
}
HasMedia contains methods for retrieving an Object's media, such as audio and video.
type HasTaxonomy ¶
type HasTaxonomy interface {
GetCategories() []string
}
HasTaxonomy contains methods for retrieving categorization and taxonomy values of an Object.
type ImageInfo ¶
type ImageInfo struct {
// Title the description of the image
Title string `json:"title,omitempty,omitzero"`
// URL is the URL to the image.
URL string `json:"url" validate:"required,url" xml:",chardata"`
}
ImageInfo is an abstraction of an Image across different types of specifications.
type ItemSource ¶
type ItemSource interface {
ObjectCommon
HasID
HasContent
}
ItemSource is an abstraction representing an individual Item from any type of Feed source.
type MediaEditable ¶
type MediaEditable interface {
SetImage(image *ImageInfo)
}
MediaEditable indicates that the media of the object can be changed.
type ObjectCommon ¶
type ObjectCommon interface {
ObjectMetadata
HasAttribution
HasLocalization
HasTaxonomy
HasMedia
}
ObjectCommon contains all methods common across all objects.
type ObjectMetadata ¶
type ObjectMetadata interface {
GetTitle() string
GetDescription() string
GetLink() string
GetPublishedDate() *time.Time
GetUpdatedDate() *time.Time
}
ObjectMetadata contains methods for retrieving the metadata information about the Object.
type Source ¶
type Source interface {
GetSourceURL() string
}
Source contains methods for retrieving or setting the source of the Object.
type SourceEditable ¶
type SourceEditable interface {
SetSourceURL(url string)
}
SourceEditable indicates the source URL for the object can be changed.