-
-
Notifications
You must be signed in to change notification settings - Fork 83
/
caps.go
43 lines (35 loc) · 1.09 KB
/
caps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package torznab
import "encoding/xml"
type Caps struct {
XMLName xml.Name `xml:"caps"`
Server CapsServer `xml:"server"`
Limits CapsLimits `xml:"limits"`
Searching CapsSearching `xml:"searching"`
Categories CapsCategories `xml:"categories"`
Tags string `xml:"tags"`
}
func (c Caps) Xml() ([]byte, error) {
return objToXml(c)
}
type CapsServer struct {
Title string `xml:"title,attr"`
}
type CapsLimits struct {
Max uint `xml:"max,attr,omitempty"`
Default uint `xml:"default,attr,omitempty"`
}
type CapsSearch struct {
Available string `xml:"available,attr"`
SupportedParams string `xml:"supportedParams,attr,omitempty"`
}
type CapsSearching struct {
Search CapsSearch `xml:"search,omitempty"`
TvSearch CapsSearch `xml:"tv-search,omitempty"`
MovieSearch CapsSearch `xml:"movie-search,omitempty"`
MusicSearch CapsSearch `xml:"music-search,omitempty"`
AudioSearch CapsSearch `xml:"audio-search,omitempty"`
BookSearch CapsSearch `xml:"book-search,omitempty"`
}
type CapsCategories struct {
Categories []Category `xml:"category"`
}