torznab

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIncorrectUserCreds     = err{100, "Incorrect user credentials"}
	ErrAccountSuspended       = err{101, "Account suspended"}
	ErrInsufficientPrivs      = err{102, "Insufficient privileges/not authorized"}
	ErrRegistrationDenied     = err{103, "Registration denied"}
	ErrRegistrationsAreClosed = err{104, "Registrations are closed"}
	ErrEmailAddressTaken      = err{105, "Invalid registration (Email Address Taken)"}
	ErrEmailAddressBadFormat  = err{106, "Invalid registration (Email Address Bad Format)"}
	ErrRegistrationFailed     = err{107, "Registration Failed (Data error)"}
	ErrMissingParameter       = err{200, "Missing parameter"}
	ErrIncorrectParameter     = err{201, "Incorrect parameter"}
	ErrNoSuchFunction         = err{202, "No such function. (Function not defined in this specification)."}
	ErrFunctionNotAvailable   = err{203, "Function not available. (Optional function is not implemented)."}
	ErrNoSuchItem             = err{300, "No such item."}
	ErrItemAlreadyExists      = err{300, "Item already exists."}
	ErrUnknownError           = err{900, "Unknown error"}
	ErrAPIDisabled            = err{910, "API Disabled"}
)

Functions

func Error

func Error(c *gin.Context, description string, err err)

Types

type Capabilities

type Capabilities struct {
	SearchModes []search.SearchMode
	Categories  categories.Categories
}

func (Capabilities) HasCategories

func (c Capabilities) HasCategories(cats []categories.Category) bool

func (Capabilities) HasCategory

func (c Capabilities) HasCategory(cat categories.Category) bool

func (Capabilities) HasMovies

func (c Capabilities) HasMovies() bool

func (Capabilities) HasSearchMode

func (c Capabilities) HasSearchMode(key string) (bool, []string)

func (Capabilities) HasTVShows

func (c Capabilities) HasTVShows() bool

func (Capabilities) MarshalXML

func (c Capabilities) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (Capabilities) ServeHTTP

func (c Capabilities) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Info

type Info struct {
	ID          string
	Title       string
	Description string
	Link        string
	Language    string
	Category    string
}

type Query

type Query struct {
	*search.PaginationSearch
	Type                               string
	Q, Series, Ep, Season, Movie, Year string
	Limit, Offset                      int
	Extended                           bool
	Categories                         []int
	APIKey                             string

	// identifier types
	TVDBID   string
	TVRageID string
	IMDBID   string
	TVMazeID string
	TraktID  string
	Page     uint
}

Query represents a torznab query

func ParseQuery

func ParseQuery(v url.Values) (*Query, error)

ParseQuery takes the query string parameters for a torznab query and parses them

func ParseQueryString

func ParseQueryString(query string) Query

func (*Query) AddCategory

func (query *Query) AddCategory(cat categories.Category)

AddCategory adds a category to the query

func (Query) Encode

func (query Query) Encode() string

Encode returns the query as a url query string

func (Query) Episode

func (query Query) Episode() (s string)

Episode returns either the season + episode in the format S00E00 or just the season as S00 if no episode has been specified.

func (Query) Keywords

func (query Query) Keywords() string

Keywords returns the query formatted as search keywords

func (Query) String

func (query Query) String() string

func (Query) UniqueKey

func (query Query) UniqueKey() interface{}

type ResultFeed

type ResultFeed struct {
	Info  Info
	Items []search.ExternalResultItem
}

func (ResultFeed) MarshalXML

func (rf ResultFeed) MarshalXML(e *xml.Encoder, start xml.StartElement) error

Jump to

Keyboard shortcuts

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