media

package
v1.0.46 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 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 Element

type Element struct {
	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"`
}

Element represents XML media elements.

func (*Element) AllMediaContents

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

AllMediaContents returns all content elements merged together.

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

AllMediaPeerLinks returns all peer link elements merged together.

func (*Element) AllMediaThumbnails

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

AllMediaThumbnails returns all thumbnail elements merged together.

func (*Element) FirstMediaDescription

func (e *Element) FirstMediaDescription() string

FirstMediaDescription returns the first description element.

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 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