controllers

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

type CapCategory

type CapCategory struct {
	ID      int         `xml:"id,attr"`
	Name    string      `xml:"name,attr"`
	SubCats []CapSubCat `xml:"subcat"`
}

type CapSubCat

type CapSubCat struct {
	ID   int    `xml:"id,attr"`
	Name string `xml:"name,attr"`
}

type Channel

type Channel struct {
	Title       string    `xml:"title"`
	Description string    `xml:"description"`
	Link        string    `xml:"link"`
	Items       []RSSItem `xml:"item"`
	Response    Response  `xml:"newznab:response"`
}

type Enclosure

type Enclosure struct {
	URL    string `xml:"url,attr"`
	Length int64  `xml:"length,attr"`
	Type   string `xml:"type,attr"`
}

type Limits

type Limits struct {
	Max int `xml:"max,attr"`
}

type NewznabCaps

type NewznabCaps struct {
	XMLName    xml.Name      `xml:"caps"`
	Server     ServerInfo    `xml:"server"`
	Limits     Limits        `xml:"limits"`
	Retention  Retention     `xml:"retention"`
	Categories []CapCategory `xml:"categories>category"`
}

-- CAPABILITIES (t=caps) ---

type NewznabController

type NewznabController struct {
	App *app.Context
}

func (*NewznabController) Handle

func (ctrl *NewznabController) Handle(c *echo.Context) error

Handle is the main Newznab entry point

func (*NewznabController) HandleDownload

func (ctrl *NewznabController) HandleDownload(c *echo.Context) error

handleDownload serves the actual NZB file from cache or source

type NewznabRSS

type NewznabRSS struct {
	XMLName xml.Name `xml:"rss"`
	Version string   `xml:"version,attr"`
	NS      string   `xml:"xmlns:newznab,attr"`
	Channel Channel  `xml:"channel"`
}

-- SEARCH RESULTS (t=search/tv/movie)

type RSSGUID

type RSSGUID struct {
	Value       string `xml:",chardata"`
	IsPermaLink bool   `xml:"isPermaLink,attr"`
}

type RSSItem

type RSSItem struct {
	Title      string    `xml:"title"`
	GUID       RSSGUID   `xml:"guid"`
	Link       string    `xml:"link"`
	Category   string    `xml:"category"`
	PubDate    string    `xml:"pubDate"`
	Enclosure  Enclosure `xml:"enclosure"`
	Attributes []Attr    `xml:"newznab:attr"`
}

type Response

type Response struct {
	Offset int `xml:"offset,attr"`
	Total  int `xml:"total,attr"`
}

type Retention

type Retention struct {
	Days int `xml:"days,attr"`
}

type ServerInfo

type ServerInfo struct {
	Version string `xml:"version,attr"`
	Title   string `xml:"title,attr"`
}

Jump to

Keyboard shortcuts

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