radiot

package module
v0.0.0-...-7a56eb4 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2015 License: MIT Imports: 9 Imported by: 0

README

Go Radio-T package

  • Work in Progress

Documentation

Index

Constants

View Source
const (
	RADIOT_FLAG   string = "radio-t"
	RADIOT_DOMAIN string = "http://www.radio-t.com"

	PIRATES_FLAG   string = "pirates"
	PIRATES_DOMAIN string = "http://pirates.radio-t.com"

	PODCAST_PAGE string = "/categories/podcast/"
	TIME_FORMAT  string = "2006-01-02T15:04:05-07:00"
)
View Source
const (
	JSON_FILENAME string = "radiot.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Episode

type Episode struct {
	Title    string    `json:"title"`
	Link     string    `json:"link,omitempty"`
	Time     time.Time `json:"time"`
	Image    string    `json:"image,omitempty"`
	Download string    `json:"download,omitempty"`
	Pirates  *Pirates  `json:"pirates,omitempty"`
	Themes   []*Theme  `json:"themes,omitempty"`
	Sponsor  *Theme    `json:"sponsor,omitempty"`
}

type JsonFile

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

func NewJsonFile

func NewJsonFile(pathToFolder string) (rt *JsonFile, err error)

func (*JsonFile) GetEpisodeMessage

func (rt *JsonFile) GetEpisodeMessage(id int) (str string, err error)

func (*JsonFile) GetLatestEpisodeId

func (rt *JsonFile) GetLatestEpisodeId() int

func (*JsonFile) UpdateJsonFile

func (rt *JsonFile) UpdateJsonFile() (err error)

type Pirates

type Pirates struct {
	Link     string `json:"link,omitempty"`
	Download string `json:"download,omitempty"`
}

type Podcast

type Podcast struct {
	Name     string     `json:"-"`
	Domain   string     `json:"-"`
	Episodes []*Episode `json:"episodes"`
}

func NewPodcast

func NewPodcast(isRadioT bool) *Podcast

func (Podcast) Len

func (p Podcast) Len() int

Метод для интерфейса сортировкиsort.Sort

func (Podcast) Less

func (p Podcast) Less(i, j int) bool

Метод для интерфейса сортировкиsort.Sort

func (*Podcast) Show

func (podcast *Podcast) Show(episodeId int) (*Episode, error)

Возвращает подкаст номер episodeId

func (Podcast) Swap

func (p Podcast) Swap(i, j int)

Метод для интерфейса сортировкиsort.Sort

func (*Podcast) Update

func (podcast *Podcast) Update() (err error)

Загружает список подкатов

type Theme

type Theme struct {
	Title string `json:"title,omitempty"`
	Link  string `json:"link,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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