Documentation
¶
Overview ¶
Package nntp implements a dependency-free NNTP (Usenet) read client following RFC 3977. It uses only the Go standard library (CGO_ENABLED=0) and speaks the command/response protocol over net/textproto.
The client is intended for reading: connecting, authenticating, selecting groups, listing overviews, fetching articles and enumerating newsgroups.
Index ¶
- type Article
- type Conn
- func (c *Conn) Article(msgIDorNum string) (*Article, error)
- func (c *Conn) Authenticate(user, pass string) error
- func (c *Conn) Close() error
- func (c *Conn) Group(name string) (*Group, error)
- func (c *Conn) List(wildmat string) ([]NewsgroupInfo, error)
- func (c *Conn) Over(low, high int) ([]Overview, error)
- type Group
- type NewsgroupInfo
- type Overview
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a connection to an NNTP server. It wraps a *textproto.Conn layered over the underlying net.Conn. A Conn is not safe for concurrent use.
func Dial ¶
Dial connects (plaintext) to addr ("host:port"); if no port is present the default NNTP port 119 is used. The greeting is read and validated.
func DialTLS ¶
DialTLS connects with implicit TLS to addr; if no port is present the default NNTPS port 563 is used. tlsConfig may be nil, in which case the platform defaults are used.
func (*Conn) Article ¶
Article fetches a full article by message-id ("<...>") or by article number, using the ARTICLE command. Headers are split from the body on the first blank line and canonicalized.
func (*Conn) Authenticate ¶
Authenticate performs AUTHINFO USER/PASS authentication.
func (*Conn) Group ¶
Group selects the named newsgroup and returns its estimated article count and low/high water marks, parsed from a "211 count low high name" response.
type NewsgroupInfo ¶
NewsgroupInfo describes an available newsgroup as listed by LIST ACTIVE.