nzb

package
v0.0.0-...-4deb2f9 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2017 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package nzb provides a function for parsing NZB files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	//The person who posted this to usenet
	Poster string `xml:"poster,attr"`
	//The date of the post in unix time
	Date int `xml:"date,attr"`
	//A subject line. This normally contains the filename
	Subject Subject `xml:"subject,attr"`
	//Which groups it was posted on
	Groups []string `xml:"groups>group"`
	//The Segments comprising this file
	Segments []*Segment `xml:"segments>segment"`
}

File represents a single file in the NZB file.

type Nzb

type Nzb struct {
	//The files described in the NZB file
	File []*File `xml:"file"`
}

Nzb represents the top level for a NZB file It's just a dumb struct to contain all the files.

func Parse

func Parse(r io.Reader) (n *Nzb, err error)

Parse parses an nzb document from the reader and returns a Nzb struct and an error if any.

type Segment

type Segment struct {
	//The amount of bytes
	Bytes int `xml:"bytes,attr"`
	//The sequence number
	Number int `xml:"number,attr"`
	//The Message-ID
	MsgId string `xml:",chardata"`
}

Segment represents a single segment in a file.

type Subject

type Subject string

func (Subject) Filename

func (s Subject) Filename() string

Jump to

Keyboard shortcuts

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