types

package module
v0.0.0-...-24f9ebf Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 8 Imported by: 0

README

Types

This package provides a number of Go struct types with field tags for XML marshalling. There are standard RSS 2.0, iTunes and many of the Podcasting 2.0 tags available.

Install

There is no stable release yet, and backwards-incompatible changes may still be introduced. But if you want to try it, you can simply do

go get github.com/rssblue/types

Example

Code
package main

import (
  "encoding/xml"
  "fmt"
  "time"

  "github.com/rssblue/types"
)

func main() {
  rss := types.RSS{
    NamespaceITunes:  true,
    NamespacePodcast: true,
    Channel: types.Channel{
      Title: pointer("Bookworm Podcast"),
      Description: &types.Description{
        Description: "Podcast about <em>books</em>.",
        IsCDATA:     true,
      },
      Language:     pointer("en"),
      ITunesAuthor: pointer("John"),
      ITunesOwner: &types.ITunesOwner{
        Name:  "John",
        Email: "john@example.com",
      },
      ITunesImage: &types.ITunesImage{
        URL: "https://example.com/cover-art.png",
      },
      ITunesCategories: []types.ITunesCategory{
        {
          Category: "Arts",
        },
      },
      ITunesType:  pointer("episodic"),
      PodcastGUID: pointer(types.PodcastGUID("cda647ce-56b8-5d7c-9448-ba1993ab46b7")),
      Items: []types.Item{
        {
          Title: pointer("Book Review: Moby-Dick"),
          Enclosure: &types.Enclosure{
            URL:      "https://example.com/moby-dick.mp3",
            Length:   4096,
            Mimetype: "audio/mpeg",
          },
          GUID:              &types.GUID{GUID: "https://example.com/moby-dick"},
          ITunesEpisodeType: pointer("full"),
          PubDate:           pointer(types.Date(time.Date(2022, time.July, 23, 10, 30, 0, 0, time.UTC))),
          PodcastLocation: &types.PodcastLocation{
            OSM: &types.PodcastOSM{
              Type:      'R',
              FeatureID: 2396248,
            },
          },
        },
      },
    },
  }

  output, err := xml.MarshalIndent(&rss, "", "  ")
  if err != nil {
    panic(err)
  }

  fmt.Printf("%s%s\n", xml.Header, output)

}

func pointer[T any](v T) *T {
  return &v
}
Output
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://podcastindex.org/namespace/1.0">
  <channel>
    <description><![CDATA[Podcast about <em>books</em>.]]></description>
    <language>en</language>
    <title>Bookworm Podcast</title>
    <itunes:author>John</itunes:author>
    <itunes:category text="Arts"></itunes:category>
    <itunes:image href="https://example.com/cover-art.png"></itunes:image>
    <itunes:owner>
      <itunes:name>John</itunes:name>
      <itunes:email>john@example.com</itunes:email>
    </itunes:owner>
    <itunes:type>episodic</itunes:type>
    <podcast:guid>cda647ce-56b8-5d7c-9448-ba1993ab46b7</podcast:guid>
    <item>
      <enclosure url="https://example.com/moby-dick.mp3" length="4096" type="audio/mpeg"></enclosure>
      <guid>https://example.com/moby-dick</guid>
      <pubDate>Sat, 23 Jul 2022 10:30:00 GMT</pubDate>
      <title>Book Review: Moby-Dick</title>
      <itunes:episodeType>full</itunes:episodeType>
      <podcast:location osm="R2396248"></podcast:location>
    </item>
  </channel>
</rss>

Documentation

Index

Constants

View Source
const (
	Hour        = Duration(time.Hour)
	Minute      = Duration(time.Minute)
	Second      = Duration(time.Second)
	Millisecond = Duration(time.Millisecond)
	Microsecond = Duration(time.Microsecond)
	Nanosecond  = Duration(time.Nanosecond)
)
View Source
const NamespaceAtom string = "http://www.w3.org/2005/Atom"

NamespaceAtom is the Atom namespace.

View Source
const NamespaceContent string = "http://purl.org/rss/1.0/modules/content/"

NamespaceContent is the namespace for RSS format's content module.

View Source
const NamespaceGooglePlay string = "http://www.google.com/schemas/play-podcasts/1.0"

NamespaceGooglePlay is the Google Play namespace.

View Source
const NamespaceITunes string = "http://www.itunes.com/dtds/podcast-1.0.dtd"

NamespaceITunes is the iTunes namespace.

View Source
const NamespacePSC string = "http://podlove.org/simple-chapters"

NamespacePSC is the namespace for Podlove Simple Chapters.

View Source
const NamespacePodcast string = "https://podcastindex.org/namespace/1.0"

NamespacePodcast is the Podcasting 2.0 namespace.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomLink struct {
	XMLName xml.Name `xml:"atom:link"`
	Href    string   `xml:"href,attr"`
	Rel     *string  `xml:"rel,attr,omitempty"`
	Type    *string  `xml:"type,attr,omitempty"`
}

AtomLink defines a reference from an entry or feed to a Web resource.

type Channel

type Channel struct {
	XMLName            xml.Name     `xml:"channel"`
	Copyright          *string      `xml:"copyright"`
	Description        *Description `xml:"description"`
	Generator          *string      `xml:"generator"`
	Language           *string      `xml:"language"`
	LastBuildDate      *Date        `xml:"lastBuildDate"`
	Link               *string      `xml:"link"`
	Title              *string      `xml:"title"`
	AtomLink           *AtomLink    `xml:"atom:link"`
	ContentEncoded     *ContentEncoded
	ITunesAuthor       *string `xml:"itunes:author"`
	ITunesCategories   []ITunesCategory
	ITunesExplicit     *bool `xml:"itunes:explicit"`
	ITunesImage        *ITunesImage
	ITunesNewFeedURL   *string `xml:"itunes:new-feed-url"`
	ITunesOwner        *ITunesOwner
	ITunesType         *string `xml:"itunes:type"`
	PodcastFundings    []PodcastFunding
	PodcastGUID        *PodcastGUID `xml:"podcast:guid"`
	PodcastLicense     *PodcastLicense
	PodcastLocation    *PodcastLocation
	PodcastLocked      *PodcastLocked
	PodcastMedium      *PodcastMedium `xml:"podcast:medium"`
	PodcastPersons     []PodcastPerson
	PodcastPodping     *PodcastPodping
	PodcastPublisher   *PodcastPublisher
	PodcastRemoteItems []PodcastRemoteItem
	PodcastSingleItem  *PodcastSingleItem
	PodcastTXTs        []PodcastTXT
	PodcastTrailers    []PodcastTrailer
	PodcastValue       *PodcastValue
	PodcastLiveItems   []PodcastLiveItem
	Items              []Item
}

Channel represents the podcast's feed.

type ContentEncoded

type ContentEncoded struct {
	XMLName xml.Name `xml:"content:encoded"`
	Encoded string
	IsCDATA bool
}

ContentEncoded is used for podcast's or episode's description.

func (ContentEncoded) MarshalXML

func (encoded ContentEncoded) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type Date

type Date time.Time

Date is used to format the publish date of an episode.

func (Date) MarshalXML

func (pd Date) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (Date) MarshalXMLAttr

func (pd Date) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

type Description

type Description struct {
	XMLName     xml.Name `xml:"description"`
	Description string
	IsCDATA     bool
}

Description is used for podcast's or episode's description.

func (Description) MarshalXML

func (d Description) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type Duration

type Duration time.Duration

Duration denotes timestamps and durations during a podcast episode.

func (Duration) MarshalXMLAttr

func (duration Duration) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

type DurationInteger

type DurationInteger time.Duration

DurationInteger denotes timestamps and durations during a podcast episode, but which are converted to integer seconds.

func (DurationInteger) MarshalXMLAttr

func (duration DurationInteger) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

type Enclosure

type Enclosure struct {
	XMLName  xml.Name `xml:"enclosure"`
	URL      string   `xml:"url,attr"`
	Length   int64    `xml:"length,attr"`
	Mimetype string   `xml:"type,attr"`
}

Enclosure is used to link to the episode's media file.

type GUID

type GUID struct {
	XMLName     xml.Name `xml:"guid"`
	GUID        string   `xml:",chardata"`
	IsPermaLink *bool    `xml:"isPermaLink,attr"`
}

GUID is a unique identifier for an episode.

type ITunesCategory

type ITunesCategory struct {
	XMLName     xml.Name           `xml:"itunes:category"`
	Category    string             `xml:"text,attr"`
	Subcategory *ITunesSubcategory `xml:"itunes:category"`
}

ITunesCategory denotes podcast's category information.

type ITunesDuration

type ITunesDuration time.Duration

ITunesDuration denotesthe duration of an episode.

func (ITunesDuration) MarshalXML

func (d ITunesDuration) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type ITunesImage

type ITunesImage struct {
	XMLName xml.Name `xml:"itunes:image"`
	URL     string   `xml:"href,attr"`
}

ITunesImage is podcast's or episode's artwork.

type ITunesOwner

type ITunesOwner struct {
	XMLName xml.Name `xml:"itunes:owner"`
	Name    string   `xml:"itunes:name"`
	Email   string   `xml:"itunes:email"`
}

ITunesOwner is used for owner's contact information.

type ITunesSubcategory

type ITunesSubcategory string

ITunesSubcategory is more granural; it is a subset of Category.

func (ITunesSubcategory) MarshalXML

func (s ITunesSubcategory) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type Item

type Item struct {
	XMLName                    xml.Name     `xml:"item"`
	Description                *Description `xml:"description"`
	Enclosure                  *Enclosure
	GUID                       *GUID
	Link                       *string `xml:"link"`
	PubDate                    *Date   `xml:"pubDate"`
	Title                      *string `xml:"title"`
	ContentEncoded             *ContentEncoded
	ITunesDuration             *ITunesDuration `xml:"itunes:duration"`
	ITunesEpisodeNumber        *int64          `xml:"itunes:episode"`
	ITunesEpisodeType          *string         `xml:"itunes:episodeType"`
	ITunesExplicit             *bool           `xml:"itunes:explicit"`
	ITunesImage                *ITunesImage
	ITunesSeasonNumber         *int64 `xml:"itunes:season"`
	PodcastAlternateEnclosures []PodcastAlternateEnclosure
	PodcastChapters            *PodcastChapters
	PodcastEpisode             *PodcastEpisode
	PodcastISRC                *PodcastISRC
	PodcastLicense             *PodcastLicense
	PodcastLocation            *PodcastLocation
	PodcastPersons             []PodcastPerson
	PodcastSeason              *PodcastSeason
	PodcastSoundbites          []PodcastSoundbite
	PodcastTXTs                []PodcastTXT
	PodcastTranscripts         []PodcastTranscript
	PodcastValue               *PodcastValue
	PSCChapters                *PSCChapters
}

Item represents episode of a podcast.

type NSBool

type NSBool bool

func (*NSBool) MarshalXMLAttr

func (isPresent *NSBool) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

type PSCChapter

type PSCChapter struct {
	Start time.Duration
	Title string
	Href  *url.URL
	Image *url.URL
}

PSCChapter is a single chapter in Podlove Simple Chapters.

func (PSCChapter) MarshalXML

func (encoded PSCChapter) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type PSCChapters

type PSCChapters struct {
	XMLName  xml.Name `xml:"psc:chapters"`
	Version  string   `xml:"version,attr"`
	Chapters []PSCChapter
}

PSCChapters is the root element for Podlove Simple Chapters.

type PodcastAlternateEnclosure

type PodcastAlternateEnclosure struct {
	XMLName      xml.Name `xml:"podcast:alternateEnclosure"`
	Mimetype     string   `xml:"type,attr"`
	Length       *int64   `xml:"length,attr"`
	Bitrate      *int64   `xml:"bitrate,attr"`
	Height       *int64   `xml:"height,attr"`
	LanguageCode *string  `xml:"lang,attr"`
	Title        *string  `xml:"title,attr"`
	Rel          *string  `xml:"rel,attr"`
	Default      *bool    `xml:"default,attr"`
	Sources      []PodcastSource
}

PodcastAlternateEnclosure provides different versions of, or companion media to the main `<enclosure>` file. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#alternate-enclosure

type PodcastChapters

type PodcastChapters struct {
	XMLName  xml.Name `xml:"podcast:chapters"`
	URL      string   `xml:"url,attr"`
	Mimetype string   `xml:"type,attr"`
}

PodcastChapters denotes episode's chapters. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#chapters

type PodcastChat

type PodcastChat struct {
	XMLName   xml.Name `xml:"podcast:chat"`
	Server    string   `xml:"server,attr"`
	Protocol  string   `xml:"protocol,attr"`
	AccountID *string  `xml:"accountId,attr"`
	Space     *string  `xml:"space,attr"`
	EmbedURL  *string  `xml:"embedUrl,attr"`
}

PodcastChat is an experimental tag to enable chat during a livestream.

type PodcastContentLink struct {
	XMLName xml.Name `xml:"podcast:contentLink"`
	Href    string   `xml:"href,attr"`
	Text    string   `xml:",chardata"`
}

type PodcastEpisode

type PodcastEpisode struct {
	XMLName xml.Name `xml:"podcast:episode"`
	Number  float64  `xml:",chardata"`
	Display *string  `xml:"display,attr"`
}

PodcastEpisode exists largely for compatibility with PodcastSeason. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#season

type PodcastFunding

type PodcastFunding struct {
	XMLName xml.Name `xml:"podcast:funding"`
	URL     string   `xml:"url,attr"`
	Caption string   `xml:",chardata"`
}

PodcastFunding denotes donation/funding links. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#value

type PodcastGUID

type PodcastGUID string

PodcastGUID is the global identifier for a podcast. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#guid

type PodcastGeo

type PodcastGeo struct {
	Latitude    float64
	Longitude   float64
	Altitude    *float64
	Uncertainty *float64
}

func (PodcastGeo) MarshalXMLAttr

func (geo PodcastGeo) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

PodcastGeo is a geo URI, conforming to RFC 5870.

type PodcastISRC

type PodcastISRC struct {
	XMLName xml.Name `xml:"podcast:isrc"`
	ISRC    string   `xml:",chardata"`
}

PodcastISRC is an experimental tag to store International Standard Recording Codes. Read more at https://isrc.ifpi.org

type PodcastLicense

type PodcastLicense struct {
	XMLName xml.Name `xml:"podcast:license"`
	Value   string   `xml:",chardata"`
	URL     *string  `xml:"url,attr"`
}

PodcastLicense defines a license that is applied to the audio/video content of a single episode, or the audio/video of the podcast as a whole.

type PodcastLiveItem

type PodcastLiveItem struct {
	XMLName xml.Name `xml:"podcast:liveItem"`

	Status    PodcastLiveStatus `xml:"status,attr"`
	StartTime time.Time         `xml:"start,attr"`
	EndTime   *time.Time        `xml:"end,attr,omitempty"`

	Description                *Description `xml:"description"`
	Enclosure                  *Enclosure
	GUID                       *GUID
	Link                       *string `xml:"link"`
	Title                      *string `xml:"title"`
	ContentEncoded             *ContentEncoded
	ITunesEpisodeNumber        *int64  `xml:"itunes:episode"`
	ITunesEpisodeType          *string `xml:"itunes:episodeType"`
	ITunesExplicit             *bool   `xml:"itunes:explicit"`
	ITunesImage                *ITunesImage
	ITunesSeasonNumber         *int64 `xml:"itunes:season"`
	PodcastAlternateEnclosures []PodcastAlternateEnclosure
	PodcastChat                *PodcastChat
	PodcastContentLinks        []PodcastContentLink
	PodcastEpisode             *PodcastEpisode
	PodcastISRC                *PodcastISRC
	PodcastLiveValue           *PodcastLiveValue
	PodcastLocation            *PodcastLocation
	PodcastPersons             []PodcastPerson
	PodcastSeason              *PodcastSeason
	PodcastSoundbites          []PodcastSoundbite
	PodcastTXTs                []PodcastTXT
	PodcastTranscripts         []PodcastTranscript
	PodcastValue               *PodcastValue
}

type PodcastLiveStatus

type PodcastLiveStatus string
var (
	PodcastLiveStatusPending PodcastLiveStatus = "pending"
	PodcastLiveStatusLive    PodcastLiveStatus = "live"
	PodcastLiveStatusEnded   PodcastLiveStatus = "ended"
)

type PodcastLiveValue

type PodcastLiveValue struct {
	XMLName  xml.Name `xml:"podcast:liveValue"`
	URI      string   `xml:"uri,attr"`
	Protocol string   `xml:"protocol,attr"`
}

PodcastLiveValue is an experimental tag to transmit updates during a livestream.

type PodcastLocation

type PodcastLocation struct {
	XMLName  xml.Name    `xml:"podcast:location"`
	Geo      *PodcastGeo `xml:",attr,omitempty"`
	OSM      *PodcastOSM `xml:",attr,omitempty"`
	Location string      `xml:",chardata"`
}

PodcastLocation describes editorial focus of podcast's or episode's content. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#location

type PodcastLocked

type PodcastLocked struct {
	XMLName  xml.Name `xml:"podcast:locked"`
	Owner    *string
	IsLocked bool
}

PodcastLocked tells podcast hosting platforms whether they are allowed to import the feed. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#locked

func (PodcastLocked) MarshalXML

func (l PodcastLocked) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type PodcastMedium

type PodcastMedium string

PodcastMedium tells what the content contained within the feed is. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#medium

var (
	PodcastMediumPodcast    PodcastMedium = "podcast"
	PodcastMediumMusic      PodcastMedium = "music"
	PodcastMediumVideo      PodcastMedium = "video"
	PodcastMediumFilm       PodcastMedium = "film"
	PodcastMediumAudioBook  PodcastMedium = "audiobook"
	PodcastMediumNewsletter PodcastMedium = "newsletter"
	PodcastMediumBlog       PodcastMedium = "blog"

	PodcastMediumPublisher PodcastMedium = "publisher"

	PodcastMediumPodcastList    PodcastMedium = "podcastL"
	PodcastMediumMusicList      PodcastMedium = "musicL"
	PodcastMediumVideoList      PodcastMedium = "videoL"
	PodcastMediumFilmList       PodcastMedium = "filmL"
	PodcastMediumAudioBookList  PodcastMedium = "audiobookL"
	PodcastMediumNewsletterList PodcastMedium = "newsletterL"
	PodcastMediumBlogList       PodcastMedium = "blogL"
	PodcastMediumPublisherList  PodcastMedium = "publisherL"
	PodcastMediumMixedList      PodcastMedium = "mixed"
)

type PodcastOSM

type PodcastOSM struct {
	Type      rune
	FeatureID uint
	Revision  *uint
}

PodcastOSM encodes OpenStreetMap location information.

func (PodcastOSM) MarshalXMLAttr

func (osm PodcastOSM) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

type PodcastPerson

type PodcastPerson struct {
	XMLName  xml.Name `xml:"podcast:person"`
	Name     string   `xml:",chardata"`
	Group    *string  `xml:"group,attr"`
	Role     *string  `xml:"role,attr"`
	URL      *string  `xml:"href,attr"`
	ImageURL *string  `xml:"img,attr"`
}

PodcastPerson specifies a person of interest to the podcast. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#person

type PodcastPodping

type PodcastPodping struct {
	XMLName     xml.Name `xml:"podcast:podping"`
	UsesPodping *bool    `xml:"usesPodping,attr"`
}

PodcastPodping allows feed owners to signal to aggregators that the feed sends out Podping notifications when changes are made to it. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#podping

type PodcastPublisher

type PodcastPublisher struct {
	XMLName     xml.Name `xml:"podcast:publisher"`
	RemoteItems []PodcastRemoteItem
}

PodcastPublisher allows a podcast feed to link to it's "publisher feed" parent. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#publisher

type PodcastRemoteItem

type PodcastRemoteItem struct {
	XMLName  xml.Name       `xml:"podcast:remoteItem"`
	ItemGUID *string        `xml:"itemGuid,attr"`
	FeedGUID uuid.UUID      `xml:"feedGuid,attr"`
	FeedURL  *string        `xml:"feedUrl,attr"`
	Medium   *PodcastMedium `xml:"medium,attr"`
}

PodcastRemoteItem provides a way to "point" to another feed or item in it. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#remote-item

type PodcastSeason

type PodcastSeason struct {
	XMLName xml.Name `xml:"podcast:season"`
	Number  int      `xml:",chardata"`
	Name    *string  `xml:"name,attr"`
}

PodcastSeason is used for identifying which episodes in a podcast are part of a particular "season". Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#season

type PodcastSingleItem

type PodcastSingleItem struct {
	XMLName xml.Name `xml:"podcast:singleItem"`
	Value   bool     `xml:",chardata"`
}

PodcastSingleItem denotes whether the feed contains a single item or multiple items. It's a proposal described at https://github.com/Podcastindex-org/podcast-namespace/discussions/578

type PodcastSoundbite

type PodcastSoundbite struct {
	XMLName   xml.Name `xml:"podcast:soundbite"`
	StartTime Duration `xml:"startTime,attr"`
	Duration  Duration `xml:"duration,attr"`
	Title     *string  `xml:",chardata"`
}

PodcastSoundbite denotes soundbite associated with an episode. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#soundbite

type PodcastSource

type PodcastSource struct {
	XMLName     xml.Name `xml:"podcast:source"`
	URI         string   `xml:"uri,attr"`
	ContentType *string  `xml:"contentType,attr"`
}

PodcastSource defines a uri location for a `<podcast:alternateEnclosure>` media file. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#source

type PodcastTXT

type PodcastTXT struct {
	XMLName xml.Name `xml:"podcast:txt"`
	TXT     string   `xml:",chardata"`
	Purpose *string  `xml:"purpose,attr"`
}

PodcastTXT is intended for free-form text and is modeled after the DNS "TXT" record. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#txt

type PodcastTrailer

type PodcastTrailer struct {
	XMLName  xml.Name `xml:"podcast:trailer"`
	Title    string   `xml:",chardata"`
	PubDate  Date     `xml:"pubdate,attr"`
	URL      string   `xml:"url,attr"`
	Length   *int64   `xml:"length,attr"`
	Mimetype *string  `xml:"type,attr"`
	Season   *int     `xml:"season,attr"`
}

PodcastTrailer is used to define the location of an audio or video file to be used as a trailer for the entire podcast or a specific season. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#trailer

type PodcastTranscript

type PodcastTranscript struct {
	XMLName  xml.Name `xml:"podcast:transcript"`
	URL      string   `xml:"url,attr"`
	Mimetype string   `xml:"type,attr"`
	Language *string  `xml:"language,attr"`
	Rel      *string  `xml:"rel,attr"`
}

PodcastTranscript denotes episode's transcript. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#transcript

type PodcastValue

type PodcastValue struct {
	XMLName         xml.Name `xml:"podcast:value"`
	Type            string   `xml:"type,attr"`
	Method          string   `xml:"method,attr"`
	Suggested       *float64 `xml:"suggested,attr,omitempty"`
	Recipients      []PodcastValueRecipient
	ValueTimeSplits []PodcastValueTimeSplit
}

PodcastValue enables to describe Value 4 Value payments. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#value

type PodcastValueRecipient

type PodcastValueRecipient struct {
	XMLName     xml.Name `xml:"podcast:valueRecipient"`
	Name        *string  `xml:"name,attr"`
	CustomKey   *string  `xml:"customKey,attr"`
	CustomValue *string  `xml:"customValue,attr"`
	Type        string   `xml:"type,attr"`
	Address     string   `xml:"address,attr"`
	Split       uint     `xml:"split,attr"`
	Fee         *bool    `xml:"bool,attr"`
}

PodcastValueRecipient describes the recipient of Value 4 Value payments. Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#value

type PodcastValueTimeSplit

type PodcastValueTimeSplit struct {
	XMLName          xml.Name         `xml:"podcast:valueTimeSplit"`
	StartTime        DurationInteger  `xml:"startTime,attr"`
	Duration         DurationInteger  `xml:"duration,attr"`
	RemoteStartTime  *DurationInteger `xml:"remoteStartTime,attr,omitempty"`
	RemotePercentage *uint            `xml:"remotePercentage,attr,omitempty"`
	Recipients       []PodcastValueRecipient
	RemoteItem       PodcastRemoteItem
}

PodcastValueTimeSplit describes value splits that are valid for a certain period of time Read more at https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#value-time-split

type RSS

type RSS struct {
	XMLName             xml.Name   `xml:"rss"`
	Version             RSSVersion `xml:",attr"`
	NamespaceAtom       NSBool     `xml:",attr"`
	NamespaceContent    NSBool     `xml:",attr"`
	NamespaceGooglePlay NSBool     `xml:",attr"`
	NamespaceITunes     NSBool     `xml:",attr"`
	NamespacePodcast    NSBool     `xml:",attr"`
	NamespacePSC        NSBool     `xml:",attr"`
	Channel             Channel
}

RSS is the root element of podcast's RSS feed, denoting the namespaces and the version of the protocol.

type RSSVersion

type RSSVersion string

RSSVersion denotes the RSS version.

func (RSSVersion) MarshalXMLAttr

func (rssVersion RSSVersion) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

Jump to

Keyboard shortcuts

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