media

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	URL      string `xml:"url,attr"`
	Type     string `xml:"type,attr"`
	FileSize string `xml:"fileSize,attr"`
	Medium   string `xml:"medium,attr"`
}

Content represents a XML element "media:content".

func (*Content) MimeType

func (mc *Content) MimeType() string

MimeType returns the attachment mime type.

func (*Content) Size

func (mc *Content) Size() int64

Size returns the attachment size.

type Description

type Description struct {
	Type        string `xml:"type,attr"`
	Description string `xml:",chardata"`
}

Description represents a XML element "media:description".

func (*Description) HTML

func (d *Description) HTML() string

HTML returns the description as HTML.

type DescriptionList

type DescriptionList []Description

DescriptionList represents a list of "media:description" XML elements.

func (DescriptionList) First

func (dl DescriptionList) First() string

First returns the first non-empty description.

type Group

type Group struct {
	MediaContents     []Content       `xml:"http://search.yahoo.com/mrss/ content"`
	MediaThumbnails   []Thumbnail     `xml:"http://search.yahoo.com/mrss/ thumbnail"`
	MediaDescriptions DescriptionList `xml:"http://search.yahoo.com/mrss/ description"`
	MediaPeerLinks    []PeerLink      `xml:"http://search.yahoo.com/mrss/ peerLink"`
}

Group represents a XML element "media:group".

type MediaCategory added in v2.1.2

type MediaCategory struct {
	Label string `xml:"label,attr"`
}

type MediaCategoryList added in v2.1.2

type MediaCategoryList []MediaCategory

func (MediaCategoryList) Labels added in v2.1.2

func (mcl MediaCategoryList) Labels() []string

type MediaItemElement added in v2.1.2

type MediaItemElement struct {
	MediaCategories   MediaCategoryList `xml:"http://search.yahoo.com/mrss/ category"`
	MediaGroups       []Group           `xml:"http://search.yahoo.com/mrss/ group"`
	MediaContents     []Content         `xml:"http://search.yahoo.com/mrss/ content"`
	MediaThumbnails   []Thumbnail       `xml:"http://search.yahoo.com/mrss/ thumbnail"`
	MediaDescriptions DescriptionList   `xml:"http://search.yahoo.com/mrss/ description"`
	MediaPeerLinks    []PeerLink        `xml:"http://search.yahoo.com/mrss/ peerLink"`
}

Specs: https://www.rssboard.org/media-rss

func (*MediaItemElement) AllMediaContents added in v2.1.2

func (e *MediaItemElement) AllMediaContents() []Content

AllMediaContents returns all content elements merged together.

func (e *MediaItemElement) AllMediaPeerLinks() []PeerLink

AllMediaPeerLinks returns all peer link elements merged together.

func (*MediaItemElement) AllMediaThumbnails added in v2.1.2

func (e *MediaItemElement) AllMediaThumbnails() []Thumbnail

AllMediaThumbnails returns all thumbnail elements merged together.

func (*MediaItemElement) FirstMediaDescription added in v2.1.2

func (e *MediaItemElement) FirstMediaDescription() string

FirstMediaDescription returns the first description element.

type PeerLink struct {
	URL  string `xml:"href,attr"`
	Type string `xml:"type,attr"`
}

PeerLink represents a XML element "media:peerLink".

func (*PeerLink) MimeType

func (p *PeerLink) MimeType() string

MimeType returns the attachment mime type.

func (*PeerLink) Size

func (p *PeerLink) Size() int64

Size returns the attachment size.

type Thumbnail

type Thumbnail struct {
	URL string `xml:"url,attr"`
}

Thumbnail represents a XML element "media:thumbnail".

func (*Thumbnail) MimeType

func (t *Thumbnail) MimeType() string

MimeType returns the attachment mime type.

func (*Thumbnail) Size

func (t *Thumbnail) Size() int64

Size returns the attachment size.

Jump to

Keyboard shortcuts

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