updating docs for github

This commit is contained in:
Eric Duncan 2017-02-05 09:56:54 -05:00
parent be97745228
commit 66475cdb95
3 changed files with 70 additions and 177 deletions

View File

@ -1,5 +1,11 @@
README: README:
godoc2md github.com/eduncan911/podcast > README.md.tmp godoc2ghmd github.com/eduncan911/podcast > README.md.tmp
echo "[![GoDoc](https://godoc.org/github.com/eduncan911/podcast?status.svg)](https://godoc.org/github.com/eduncan911/podcast) [![Build Status](https://travis-ci.org/eduncan911/podcast.svg?branch=master)](https://travis-ci.org/eduncan911/podcast) [![Coverage Status](https://coveralls.io/repos/github/eduncan911/podcast/badge.svg?branch=master)](https://coveralls.io/github/eduncan911/podcast?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/eduncan911/podcast)](https://goreportcard.com/report/github.com/eduncan911/podcast)" > README.md echo "[![GoDoc](https://godoc.org/github.com/eduncan911/podcast?status.svg)](https://godoc.org/github.com/eduncan911/podcast)" > README.md
echo "[![Build Status](https://travis-ci.org/eduncan911/podcast.svg?branch=master)](https://travis-ci.org/eduncan911/podcast)" >> README.md
echo "[![Coverage Status](https://coveralls.io/repos/github/eduncan911/podcast/badge.svg?branch=master)](https://coveralls.io/github/eduncan911/podcast?branch=master)" >> README.md
echo "[![Go Report Card](https://goreportcard.com/badge/github.com/eduncan911/podcast)](https://goreportcard.com/report/github.com/eduncan911/podcast)" >> README.md
echo "[![GoDoc](https://godoc.org/github.com/eduncan911/podcast?status.svg)](https://godoc.org/github.com/eduncan911/podcast)"
echo "[![MIT License](https://img.shields.io/npm/l/mediaelement.svg)](https://eduncan911.mit-license.org/)" >> README.md
echo >>README.md
cat README.md.tmp >> README.md cat README.md.tmp >> README.md
rm README.md.tmp rm README.md.tmp

221
README.md
View File

@ -1,34 +1,31 @@
[![GoDoc](https://godoc.org/github.com/eduncan911/podcast?status.svg)](https://godoc.org/github.com/eduncan911/podcast) [![Build Status](https://travis-ci.org/eduncan911/podcast.svg?branch=master)](https://travis-ci.org/eduncan911/podcast) [![Coverage Status](https://coveralls.io/repos/github/eduncan911/podcast/badge.svg?branch=master)](https://coveralls.io/github/eduncan911/podcast?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/eduncan911/podcast)](https://goreportcard.com/report/github.com/eduncan911/podcast) [![GoDoc](https://godoc.org/github.com/eduncan911/podcast?status.svg)](https://godoc.org/github.com/eduncan911/podcast)
[![Build Status](https://travis-ci.org/eduncan911/podcast.svg?branch=master)](https://travis-ci.org/eduncan911/podcast)
[![Coverage Status](https://coveralls.io/repos/github/eduncan911/podcast/badge.svg?branch=master)](https://coveralls.io/github/eduncan911/podcast?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/eduncan911/podcast)](https://goreportcard.com/report/github.com/eduncan911/podcast)
[![MIT License](https://img.shields.io/npm/l/mediaelement.svg)](https://eduncan911.mit-license.org/)
# podcast # podcast
`import "github.com/eduncan911/podcast"` Package podcast generates a fully compliant iTunes and RSS 2.0 podcast feed
for GoLang using a simple API.
* [Overview](#pkg-overview)
* [Index](#pkg-index)
* [Examples](#pkg-examples)
* [Subdirectories](#pkg-subdirectories)
## <a name="pkg-overview">Overview</a>
Package podcast is an iTunes and RSS 2.0 podcast generator for GoLang that
enforces strict compliance by using its simple interface.
Full documentation with detailed examples located at <a href="https://godoc.org/github.com/eduncan911/podcast">https://godoc.org/github.com/eduncan911/podcast</a> Full documentation with detailed examples located at <a href="https://godoc.org/github.com/eduncan911/podcast">https://godoc.org/github.com/eduncan911/podcast</a>
Usage ### Usage
To use, `go get` and `import` the package like your typical GoLang library.
$ go get -u github.com/eduncan911/podcast $ go get -u github.com/eduncan911/podcast
import "github.com/eduncan911/podcast"
The API exposes a number of method receivers on structs that implements the The API exposes a number of method receivers on structs that implements the
logic required to comply with the specifications and ensure a compliant feed. logic required to comply with the specifications and ensure a compliant feed.
A number of overrides occur to help with iTunes visibility of your episodes. A number of overrides occur to help with iTunes visibility of your episodes.
Notably, the [Podcast.AddItem(i Item)](#Podcast.AddItem) function performs most of the Notably, the [Podcast.AddItem(i Item)](#Podcast.AddItem) function performs most
heavy lifting by taking the [Item](#Item) input and performing validation, overrides of the heavy lifting by taking the [Item](#Item) input and performing
and duplicate setters through the feed. validation, overrides and duplicate setters through the feed.
See the detailed Examples in the GoDocs for complete usage. See the detailed Examples of the API at <a href="https://godoc.org/github.com/eduncan911/podcast">https://godoc.org/github.com/eduncan911/podcast</a>.
### Extensibility ### Extensibility
In no way are you restricted in having full control over your feeds. You may In no way are you restricted in having full control over your feeds. You may
@ -47,8 +44,15 @@ Podcasts: <a href="https://help.apple.com/itc/podcasts_connect/#/itca5b22233">ht
* Initial release. * Initial release.
* Full documentation, full examples and complete code coverage. * Full documentation, full examples and complete code coverage.
## Table of Contents
* [Imported Packages](#pkg-imports)
* [Index](#pkg-index)
* [Examples](#pkg-examples)
## <a name="pkg-imports">Imported Packages</a>
- [github.com/pkg/errors](https://godoc.org/github.com/pkg/errors)
## <a name="pkg-index">Index</a> ## <a name="pkg-index">Index</a>
* [type Author](#Author) * [type Author](#Author)
@ -59,16 +63,16 @@ Podcasts: <a href="https://help.apple.com/itc/podcasts_connect/#/itca5b22233">ht
* [type IImage](#IImage) * [type IImage](#IImage)
* [type Image](#Image) * [type Image](#Image)
* [type Item](#Item) * [type Item](#Item)
* [func (i *Item) AddEnclosure(url string, enclosureType EnclosureType, lengthInSeconds int64)](#Item.AddEnclosure) * [func (i \*Item) AddEnclosure(url string, enclosureType EnclosureType, lengthInSeconds int64)](#Item.AddEnclosure)
* [type Podcast](#Podcast) * [type Podcast](#Podcast)
* [func New(title, link, description string, pubDate, lastBuildDate *time.Time) Podcast](#New) * [func New(title, link, description string, pubDate, lastBuildDate \*time.Time) Podcast](#New)
* [func (p *Podcast) AddAuthor(name, email string)](#Podcast.AddAuthor) * [func (p \*Podcast) AddAuthor(name, email string)](#Podcast.AddAuthor)
* [func (p *Podcast) AddCategory(category string, subCategories []string)](#Podcast.AddCategory) * [func (p \*Podcast) AddCategory(category string, subCategories []string)](#Podcast.AddCategory)
* [func (p *Podcast) AddImage(url string)](#Podcast.AddImage) * [func (p \*Podcast) AddImage(url string)](#Podcast.AddImage)
* [func (p *Podcast) AddItem(i Item) (int, error)](#Podcast.AddItem) * [func (p \*Podcast) AddItem(i Item) (int, error)](#Podcast.AddItem)
* [func (p *Podcast) Bytes() []byte](#Podcast.Bytes) * [func (p \*Podcast) Bytes() []byte](#Podcast.Bytes)
* [func (p *Podcast) Encode(w io.Writer) error](#Podcast.Encode) * [func (p \*Podcast) Encode(w io.Writer) error](#Podcast.Encode)
* [func (p *Podcast) String() string](#Podcast.String) * [func (p \*Podcast) String() string](#Podcast.String)
* [type TextInput](#TextInput) * [type TextInput](#TextInput)
#### <a name="pkg-examples">Examples</a> #### <a name="pkg-examples">Examples</a>
@ -82,14 +86,9 @@ Podcasts: <a href="https://help.apple.com/itc/podcasts_connect/#/itca5b22233">ht
* [Package (IoWriter)](#example__ioWriter) * [Package (IoWriter)](#example__ioWriter)
#### <a name="pkg-files">Package files</a> #### <a name="pkg-files">Package files</a>
[author.go](/src/github.com/eduncan911/podcast/author.go) [doc.go](/src/github.com/eduncan911/podcast/doc.go) [enclosure.go](/src/github.com/eduncan911/podcast/enclosure.go) [image.go](/src/github.com/eduncan911/podcast/image.go) [item.go](/src/github.com/eduncan911/podcast/item.go) [itunes.go](/src/github.com/eduncan911/podcast/itunes.go) [podcast.go](/src/github.com/eduncan911/podcast/podcast.go) [textinput.go](/src/github.com/eduncan911/podcast/textinput.go) [author.go](./author.go) [doc.go](./doc.go) [enclosure.go](./enclosure.go) [image.go](./image.go) [item.go](./item.go) [itunes.go](./itunes.go) [podcast.go](./podcast.go) [textinput.go](./textinput.go)
## <a name="Author">type</a> [Author](./author.go#L8-L12)
## <a name="Author">type</a> [Author](/src/target/author.go?s=150:288#L1)
``` go ``` go
type Author struct { type Author struct {
XMLName xml.Name `xml:"itunes:owner"` XMLName xml.Name `xml:"itunes:owner"`
@ -101,16 +100,7 @@ Author represents a named author and email.
For iTunes compliance, both Name and Email are required. For iTunes compliance, both Name and Email are required.
## <a name="Enclosure">type</a> [Enclosure](./enclosure.go#L46-L53)
## <a name="Enclosure">type</a> [Enclosure](/src/target/enclosure.go?s=814:1118#L36)
``` go ``` go
type Enclosure struct { type Enclosure struct {
XMLName xml.Name `xml:"enclosure"` XMLName xml.Name `xml:"enclosure"`
@ -123,22 +113,12 @@ type Enclosure struct {
``` ```
Enclosure represents a download enclosure. Enclosure represents a download enclosure.
## <a name="EnclosureType">type</a> [EnclosureType](./enclosure.go#L21)
## <a name="EnclosureType">type</a> [EnclosureType](/src/target/enclosure.go?s=274:296#L11)
``` go ``` go
type EnclosureType int type EnclosureType int
``` ```
EnclosureType specifies the type of the enclosure. EnclosureType specifies the type of the enclosure.
``` go ``` go
const ( const (
M4A EnclosureType = iota M4A EnclosureType = iota
@ -152,25 +132,13 @@ const (
``` ```
EnclosureType specifies the type of the enclosure. EnclosureType specifies the type of the enclosure.
### <a name="EnclosureType.String">func</a> (EnclosureType) [String](./enclosure.go#L24)
### <a name="EnclosureType.String">func</a> (EnclosureType) [String](/src/target/enclosure.go?s=371:410#L14)
``` go ``` go
func (et EnclosureType) String() string func (et EnclosureType) String() string
``` ```
String returns the MIME type encoding of the specified EnclosureType. String returns the MIME type encoding of the specified EnclosureType.
## <a name="ICategory">type</a> [ICategory](./itunes.go#L22-L26)
## <a name="ICategory">type</a> [ICategory](/src/target/itunes.go?s=645:782#L12)
``` go ``` go
type ICategory struct { type ICategory struct {
XMLName xml.Name `xml:"itunes:category"` XMLName xml.Name `xml:"itunes:category"`
@ -180,16 +148,7 @@ type ICategory struct {
``` ```
ICategory is a 2-tier classification system for iTunes. ICategory is a 2-tier classification system for iTunes.
## <a name="IImage">type</a> [IImage](./itunes.go#L16-L19)
## <a name="IImage">type</a> [IImage](/src/target/itunes.go?s=487:584#L6)
``` go ``` go
type IImage struct { type IImage struct {
XMLName xml.Name `xml:"itunes:image"` XMLName xml.Name `xml:"itunes:image"`
@ -205,16 +164,7 @@ extensions (.jpg, .png), and in the RGB colorspace. To optimize
images for mobile devices, Apple recommends compressing your images for mobile devices, Apple recommends compressing your
image files. image files.
## <a name="Image">type</a> [Image](./image.go#L13-L21)
## <a name="Image">type</a> [Image](/src/target/image.go?s=398:676#L3)
``` go ``` go
type Image struct { type Image struct {
XMLName xml.Name `xml:"image"` XMLName xml.Name `xml:"image"`
@ -235,16 +185,7 @@ extensions (.jpg, .png), and in the RGB colorspace. To optimize
images for mobile devices, Apple recommends compressing your images for mobile devices, Apple recommends compressing your
image files. image files.
## <a name="Item">type</a> [Item](./item.go#L25-L50)
## <a name="Item">type</a> [Item](/src/target/item.go?s=606:1746#L15)
``` go ``` go
type Item struct { type Item struct {
XMLName xml.Name `xml:"item"` XMLName xml.Name `xml:"item"`
@ -291,26 +232,14 @@ Recommendations:
- Always set an Enclosure.Length, to be nice to your downloaders. - Always set an Enclosure.Length, to be nice to your downloaders.
- Use Enclosure.Type instead of setting TypeFormatted for valid extensions. - Use Enclosure.Type instead of setting TypeFormatted for valid extensions.
### <a name="Item.AddEnclosure">func</a> (\*Item) [AddEnclosure](./item.go#L53-L54)
### <a name="Item.AddEnclosure">func</a> (\*Item) [AddEnclosure](/src/target/item.go?s=1813:1906#L43)
``` go ``` go
func (i *Item) AddEnclosure( func (i *Item) AddEnclosure(
url string, enclosureType EnclosureType, lengthInSeconds int64) url string, enclosureType EnclosureType, lengthInSeconds int64)
``` ```
AddEnclosure adds the downloadable asset to the podcast Item. AddEnclosure adds the downloadable asset to the podcast Item.
## <a name="Podcast">type</a> [Podcast](./podcast.go#L19-L58)
## <a name="Podcast">type</a> [Podcast](/src/target/podcast.go?s=176:1822#L9)
``` go ``` go
type Podcast struct { type Podcast struct {
XMLName xml.Name `xml:"channel"` XMLName xml.Name `xml:"channel"`
@ -354,13 +283,7 @@ type Podcast struct {
``` ```
Podcast represents a podcast. Podcast represents a podcast.
### <a name="New">func</a> [New](./podcast.go#L64-L65)
### <a name="New">func</a> [New](/src/target/podcast.go?s=1988:2073#L54)
``` go ``` go
func New(title, link, description string, func New(title, link, description string,
pubDate, lastBuildDate *time.Time) Podcast pubDate, lastBuildDate *time.Time) Podcast
@ -370,20 +293,13 @@ New instantiates a Podcast with required parameters.
Nil-able fields are optional but recommended as they are formatted Nil-able fields are optional but recommended as they are formatted
to the expected proper formats. to the expected proper formats.
### <a name="Podcast.AddAuthor">func</a> (\*Podcast) [AddAuthor](./podcast.go#L89)
### <a name="Podcast.AddAuthor">func</a> (\*Podcast) [AddAuthor](/src/target/podcast.go?s=2719:2766#L79)
``` go ``` go
func (p *Podcast) AddAuthor(name, email string) func (p *Podcast) AddAuthor(name, email string)
``` ```
AddAuthor adds the specified Author to the podcast. AddAuthor adds the specified Author to the podcast.
### <a name="Podcast.AddCategory">func</a> (\*Podcast) [AddCategory](./podcast.go#L100)
### <a name="Podcast.AddCategory">func</a> (\*Podcast) [AddCategory](/src/target/podcast.go?s=2998:3068#L90)
``` go ``` go
func (p *Podcast) AddCategory(category string, subCategories []string) func (p *Podcast) AddCategory(category string, subCategories []string)
``` ```
@ -391,10 +307,7 @@ AddCategory adds the categories to the Podcast in comma delimited format.
subCategories are optional. subCategories are optional.
### <a name="Podcast.AddImage">func</a> (\*Podcast) [AddImage](./podcast.go#L128)
### <a name="Podcast.AddImage">func</a> (\*Podcast) [AddImage](/src/target/podcast.go?s=3845:3883#L118)
``` go ``` go
func (p *Podcast) AddImage(url string) func (p *Podcast) AddImage(url string)
``` ```
@ -407,10 +320,7 @@ extensions (.jpg, .png), and in the RGB colorspace. To optimize
images for mobile devices, Apple recommends compressing your images for mobile devices, Apple recommends compressing your
image files. image files.
### <a name="Podcast.AddItem">func</a> (\*Podcast) [AddItem](./podcast.go#L176)
### <a name="Podcast.AddItem">func</a> (\*Podcast) [AddItem](/src/target/podcast.go?s=5354:5400#L166)
``` go ``` go
func (p *Podcast) AddItem(i Item) (int, error) func (p *Podcast) AddItem(i Item) (int, error)
``` ```
@ -452,45 +362,31 @@ Recommendations:
* Always set an Enclosure.Length, to be nice to your downloaders. * Always set an Enclosure.Length, to be nice to your downloaders.
* Follow Apple's best practices to enrich your podcasts: * Follow Apple's best practices to enrich your podcasts:
<a href="https://help.apple.com/itc/podcasts_connect/#/itc2b3780e76">https://help.apple.com/itc/podcasts_connect/#/itc2b3780e76</a> <a href="https://help.apple.com/itc/podcasts_connect/#/itc2b3780e76">https://help.apple.com/itc/podcasts_connect/#/itc2b3780e76</a>
* For specifications of itunes tags, see: * For specifications of itunes tags, see:
<a href="https://help.apple.com/itc/podcasts_connect/#/itcb54353390">https://help.apple.com/itc/podcasts_connect/#/itcb54353390</a> <a href="https://help.apple.com/itc/podcasts_connect/#/itcb54353390">https://help.apple.com/itc/podcasts_connect/#/itcb54353390</a>
### <a name="Podcast.Bytes">func</a> (\*Podcast) [Bytes](./podcast.go#L244)
### <a name="Podcast.Bytes">func</a> (\*Podcast) [Bytes](/src/target/podcast.go?s=7223:7255#L234)
``` go ``` go
func (p *Podcast) Bytes() []byte func (p *Podcast) Bytes() []byte
``` ```
Bytes returns an encoded []byte slice. Bytes returns an encoded []byte slice.
### <a name="Podcast.Encode">func</a> (\*Podcast) [Encode](./podcast.go#L249)
### <a name="Podcast.Encode">func</a> (\*Podcast) [Encode](/src/target/podcast.go?s=7365:7408#L239)
``` go ``` go
func (p *Podcast) Encode(w io.Writer) error func (p *Podcast) Encode(w io.Writer) error
``` ```
Encode writes the bytes to the io.Writer stream in RSS 2.0 specification. Encode writes the bytes to the io.Writer stream in RSS 2.0 specification.
### <a name="Podcast.String">func</a> (\*Podcast) [String](./podcast.go#L260)
### <a name="Podcast.String">func</a> (\*Podcast) [String](/src/target/podcast.go?s=7677:7710#L250)
``` go ``` go
func (p *Podcast) String() string func (p *Podcast) String() string
``` ```
String encodes the Podcast state to a string. String encodes the Podcast state to a string.
## <a name="TextInput">type</a> [TextInput](./textinput.go#L6-L12)
## <a name="TextInput">type</a> [TextInput](/src/target/textinput.go?s=77:290#L1)
``` go ``` go
type TextInput struct { type TextInput struct {
XMLName xml.Name `xml:"textInput"` XMLName xml.Name `xml:"textInput"`
@ -502,18 +398,5 @@ type TextInput struct {
``` ```
TextInput represents text inputs. TextInput represents text inputs.
- - - - - -
Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md) Generated by [godoc2ghmd](https://github.com/eduncan911/godoc2ghmd)

16
doc.go
View File

@ -1,21 +1,25 @@
// Package podcast is an iTunes and RSS 2.0 podcast generator for GoLang that // Package podcast generates a fully compliant iTunes and RSS 2.0 podcast feed
// enforces strict compliance by using its simple interface. // for GoLang using a simple API.
// //
// Full documentation with detailed examples located at https://godoc.org/github.com/eduncan911/podcast // Full documentation with detailed examples located at https://godoc.org/github.com/eduncan911/podcast
// //
// Usage // Usage
// //
// To use, `go get` and `import` the package like your typical GoLang library.
//
// $ go get -u github.com/eduncan911/podcast // $ go get -u github.com/eduncan911/podcast
// //
// import "github.com/eduncan911/podcast"
//
// The API exposes a number of method receivers on structs that implements the // The API exposes a number of method receivers on structs that implements the
// logic required to comply with the specifications and ensure a compliant feed. // logic required to comply with the specifications and ensure a compliant feed.
// A number of overrides occur to help with iTunes visibility of your episodes. // A number of overrides occur to help with iTunes visibility of your episodes.
// //
// Notably, the [Podcast.AddItem(i Item)](#Podcast.AddItem) function performs most of the // Notably, the [Podcast.AddItem(i Item)](#Podcast.AddItem) function performs most
// heavy lifting by taking the [Item](#Item) input and performing validation, overrides // of the heavy lifting by taking the [Item](#Item) input and performing
// and duplicate setters through the feed. // validation, overrides and duplicate setters through the feed.
// //
// See the detailed Examples in the GoDocs for complete usage. // See the detailed Examples of the API at https://godoc.org/github.com/eduncan911/podcast.
// //
// Extensibility // Extensibility
// //