Documentation
¶
Index ¶
Constants ¶
View Source
const ( // xml header for nzb files Header = `<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE nzb PUBLIC "-//newzBin//DTD NZB 1.1//EN" "http://www.newzbin.com/DTD/nzb/nzb-1.1.dtd">` + "\n" // xml namespace for nzb files Xmlns = "http://www.newzbin.com/DTD/2003/nzb" )
Variables ¶
This section is empty.
Functions ¶
func MakeUnique ¶
func MakeUnique(nzb *Nzb)
clean up nzb files by merging duplicate file entries and removing duplicate segments
Types ¶
type Nzb ¶
type Nzb struct {
Comment string // comment tag
Meta map[string]string // meta data as map
Files NzbFiles // files structure
TotalFiles int // number of total files
Segments int // number of available segments
TotalSegments int // number of total segments
Bytes int64 // total size of all files
}
nzb file structure with additional information
type NzbFile ¶
type NzbFile struct {
Groups []string `xml:"groups>group"`
Segments NzbSegments `xml:"segments>segment"`
Poster string `xml:"poster,attr"`
Date int `xml:"date,attr"`
Subject string `xml:"subject,attr"`
Number int `xml:"-"` // number of the file (if indicated in the subject)
Filename string `xml:"-"` // filename of the file (if indicated in the subject)
Basefilename string `xml:"-"` // basefilename of the file (if indicated in the subject)
TotalSegments int `xml:"-"` // number of total segments
Bytes int64 `xml:"-"` // total size of the file
}
individual file structure with additional information
type NzbSegment ¶
type NzbSegment struct {
Bytes int `xml:"bytes,attr"`
Number int `xml:"number,attr"`
Id string `xml:",innerxml"`
}
individual segment structure
type NzbSegments ¶
type NzbSegments []NzbSegment
a slice of NzbSegments extended to allow sorting
func (NzbSegments) Len ¶
func (s NzbSegments) Len() int
func (NzbSegments) Less ¶
func (s NzbSegments) Less(i, j int) bool
func (NzbSegments) Swap ¶
func (s NzbSegments) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.