types

package
v0.0.0-...-939e56e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 3 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var (
	MimeTypesImage = []string{"image/avif", "image/gif", "image/jpeg", "image/png", "image/svg+xml", "image/webp"}
)

Functions

func GetMedianInterval

func GetMedianInterval(data []time.Duration) time.Duration

GetMedianInterval calculates the median of the given set of time.Duration values.

func IsImage

func IsImage(mimetype string) bool

IsImage will return a boolean indicating whether the given mimetype represents an image.

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.

func (*ImageInfo) GetTitle

func (i *ImageInfo) GetTitle() string

GetTitle returns the title (if any) of the image.

func (*ImageInfo) GetURL

func (i *ImageInfo) GetURL() string

GetURL returns the URL of the image.

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL