showrss

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIServer

func APIServer(db *DB, tc *transmission.Client, bindAddr string) error

func ClientTTL

func ClientTTL(ttl time.Duration) clientOpt

func String

func String(s string) *string

Types

type Channel

type Channel struct {
	XMLName  xml.Name  `xml:"channel"`
	Title    string    `xml:"title"`
	TTL      int       `xml:"ttl"`
	Episodes []Episode `xml:"item"`

	URL string // request url
}

func ParseRSS

func ParseRSS(data []byte) (*Channel, error)

func (Channel) TTLDuration

func (c Channel) TTLDuration() time.Duration

type Client

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

Client .

func NewClient

func NewClient(opts ...clientOpt) *Client

func (*Client) GetShowFeed

func (c *Client) GetShowFeed(ctx context.Context, ID int) (*Channel, error)

func (*Client) GetUserFeed

func (c *Client) GetUserFeed(ctx context.Context, ID int) (*Channel, error)

func (*Client) MonitorChannel

func (c *Client) MonitorChannel(ctx context.Context, channel Channel, episodeCh chan<- Episode) error

type DB

type DB struct {
	*bolt.DB
}

DB .

func NewDB

func NewDB(filename string) (*DB, error)

type Enclosure

type Enclosure struct {
	MimeType string `xml:"type,attr" json:"type"`
	URL      string `xml:"url,attr" json:"attr"`
}

Enclosure .

type Episode

type Episode struct {
	Title      string      `xml:"title" json:"title"`
	InfoHash   string      `xml:"info_hash" json:"info_hash"`
	Enclosures []Enclosure `xml:"enclosure" json:"enclosures"`
	ShowID     int         `xml:"show_id" json:"show_id"`
	ExternalID int         `xml:"external_id" json:"external_id"`
	ShowName   string      `xml:"show_name" json:"show_name"`
	EpisodeID  string      `xml:"episode_id" json:"episode_id"`
	RawTitle   string      `xml:"raw_title" json:"raw_title"`
}

Episode .

func (Episode) Key

func (i Episode) Key() []byte

func (Episode) ShowDirectoryName

func (i Episode) ShowDirectoryName() string

func (Episode) String

func (i Episode) String() string

func (Episode) URL

func (i Episode) URL() string

type FeedError

type FeedError string

func (FeedError) Error

func (fe FeedError) Error() string

type FeedSelection

type FeedSelection struct {
	Shows []int
	Users []int
}

func (FeedSelection) IsEmtpy

func (f FeedSelection) IsEmtpy() bool

type ShowDirs

type ShowDirs struct {
	Path string
	Dirs bool
}

type ShowRSSDownloader

type ShowRSSDownloader struct {
	TC        *transmission.Client
	Selection FeedSelection
	ShowDirs  ShowDirs
	DB        *DB
	// contains filtered or unexported fields
}

func (*ShowRSSDownloader) Start

func (d *ShowRSSDownloader) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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