nzb

package
v0.0.0-...-fc716ca Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2016 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteNZB

func WriteNZB(b *types.Binary) (string, error)

WriteNZB takes a Binary and returns a NZB document as a string.

Types

type File

type File struct {
	Groups   []string  `xml:"groups>group"`
	Segments []Segment `xml:"segments>segment"`
	Poster   string    `xml:"poster,attr"`
	Date     int64     `xml:"date,attr"`
	Subject  string    `xml:"subject,attr"`
	Part     int       `xml:"-"`
}

File wraps the file structure in the nzb xml

type Meta

type Meta struct {
	Type  string `xml:"type,attr"`
	Value string `xml:",innerxml"`
}

Meta information for the header

type NZB

type NZB struct {
	XMLName  xml.Name `xml:"nzb"`
	Xmlns    string   `xml:"xmlns,attr,omitempty"`
	Metadata []Meta   `xml:"head>meta"`
	Files    []File   `xml:"file"` // xml:tag name doesn't work?
}

NZB is the top level structure

type Segment

type Segment struct {
	XMLName xml.Name `xml:"segment"`
	Bytes   int64    `xml:"bytes,attr"`
	Number  int      `xml:"number,attr"`
	ID      string   `xml:",innerxml"`
}

Segment represents each segment of a file

Jump to

Keyboard shortcuts

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