mypod

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 21 Imported by: 0

README

mypod

Start your own podcast with just a folder of files.

Go Reference

Example configuration

The podcast-wide configuration can be placed in podcast.json in your storage directory:

{
  "BaseURL": "https://mypod.yourdomain.com",
  "Title": "My Personal Podcast",
  "Link": "https://mypod.yourdomain.com/",
  "Description": "A podcast of my favorite things.",
  "Language": "EN",
  "Copyright": "N/A",
  "Author": "Various",
  "Subtitle": "A subtitle",
  "Summary": "A summary",
  "Owner": {
    "Name": "Example Person",
    "Email": "you@example.com"
  },
  "Image": "/podcast.jpg",
  "Categories": ["Business", "News", "Technology"],
  "Explicit": false
}
  • Link – The HTML URL you want a visitor to see when they tap on the podcast URL
  • Image – The URL path to your podcast's image file (without the BaseURL)
MIME Types

Go builds in only a small number of MIME types, preferring instead to read the mime.types files commonly found on disk. On Unix, this includes /etc/mime.types, /etc/apache2/mime.types, /etc/apache/mime.types, and /etc/httpd/conf/mime.types. When running mypod in the provided Docker image, MIME types are downloaded from the Apache2 project. If you have custom MIME types on your server, mount them as a read-only volume to one of these paths. Note: MIME types must be in the format <type> <ext>, with no semi-colons or any other text. For example, the nginx mime.types file is an nginx directive and not a strict MIME types file so the Go MIME parsing will fail to read this properly.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdditionalLogContextHandler

func AdditionalLogContextHandler(h http.Handler) http.Handler

This injects additional context into the grohl context

func NewFeedHandler

func NewFeedHandler(dir string, logger *grohl.Context) http.Handler

Types

type Config

type Config struct {
	BaseURL     string
	Title       string
	Description string
	Link        string
	Language    string
	Copyright   string
	Author      string
	Subtitle    string
	Summary     string
	Owner       struct {
		Name  string
		Email string
	}
	Image      string
	Categories []string
	Explicit   bool
}

func ReadConfig

func ReadConfig(filepath string) (Config, error)

type DownloadService

type DownloadService struct {
	// contains filtered or unexported fields
}

func NewDownloadService

func NewDownloadService(storageDir string) DownloadService

func (DownloadService) Create

func (ds DownloadService) Create(ctx context.Context, m radar.RadarItem) error

Create adds a RadarItem to the database.

func (DownloadService) Shutdown

func (ds DownloadService) Shutdown(ctx context.Context)

Shutdown closes the database connection.

type FeedHandler

type FeedHandler struct {
	// contains filtered or unexported fields
}

func (*FeedHandler) GetFeed

func (h *FeedHandler) GetFeed() (*podcasts.Feed, error)

func (*FeedHandler) ReadPodcastEpisodes

func (h *FeedHandler) ReadPodcastEpisodes(conf Config) ([]*podcasts.Item, error)

func (*FeedHandler) ServeHTTP

func (h *FeedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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