Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { // string describing who posted the NZB Poster string `xml:"poster,attr"` // unix formatted date that the NZB was posted Date int `xml:"date,attr"` // describes what the contents of the NZB file are Subject string `xml:"subject,attr"` // usenet groups associated with the NZB Groups []string `xml:"groups>group,internalxml"` // actual file segments to be downloaded Segments []Segment `xml:"segments>segment"` }
File describes the file elements within an NZB. It has appropriate tags and methods to enable deserialisation from XML.
func (*File) ApproximatedName ¶
ApproximatedName returns the approximated name of the file that an NZB file entry represents.
type Meta ¶
Meta is a map[string]string that implements UnmarshalXML to enable appropriate unmarshalling of XML metadata tags
func (Meta) MarshalXML ¶
MarshalXML implements xml.Marshaler for the Meta type
func (*Meta) UnmarshalXML ¶
UnmarshalXML implements xml.Unmarshaler for the Meta type
type NZB ¶
type NZB struct { // the name of the XML tag this represents (nzb) XMLName xml.Name `xml:"nzb"` // XML metadata associated with the NZB file Meta Meta `xml:"head>meta"` // NZB file entries contained within this NZB file Files []File `xml:"file"` }
NZB represents a usenet NZB file the struct has appropriate XML tags and methods to enable unmarshalling
func FromReader ¶
FromReader parses a NZB from an io.Reader
func (NZB) BytesReader ¶
BytesReader returns an io.Reader containing an NZB entry encoded in its original XML format
type Segment ¶
type Segment struct { // number of the segment relative to the file Number int `xml:"number,attr"` // size of the segment in bytes Size int `xml:"bytes,attr"` // identifier of the segment ID string `xml:",innerxml"` }
Segment describes a piece of an NZB file, to be downloaded separately. It has appropriate tags and methods to enable deserialisation from XML.