Documentation
¶
Overview ¶
Package nntpclient provides an NNTP Client.
Index ¶
- Constants
- type Client
- func (c *Client) Article(specifier string) (int64, string, io.Reader, error)
- func (c *Client) Authenticate(user, pass string) (msg string, err error)
- func (c *Client) Body(specifier string) (int64, string, io.Reader, error)
- func (c *Client) Capabilities() ([]string, error)
- func (c *Client) Close() error
- func (c *Client) Command(cmd string, expectCode int) (int, string, error)
- func (c *Client) Group(name string) (rv nntp.Group, err error)
- func (c *Client) Head(specifier string) (int64, string, io.Reader, error)
- func (c *Client) List(sub string) (rv []nntp.Group, err error)
- func (c *Client) Over(start int64, end int64) ([]*nntp.ArticleOverview, error)
- func (c *Client) Post(r io.Reader) error
- func (c *Client) XOver(start int64, end int64) ([]*nntp.ArticleOverview, error)
- type OverHeader
Constants ¶
View Source
const ( OverHeaderSubject = OverHeader('s') OverHeaderFrm = OverHeader('f') OverHeaderXRefFull = OverHeader('x') OverHeaderDate = OverHeader('d') OverHeaderMsgId = OverHeader('m') OverHeaderReferences = OverHeader('r') OverHeaderBytes = OverHeader('b') OverHeaderLines = OverHeader('l') )
View Source
const ( SHORT_RFC1123 = "Mon, 02 Jan 06 15:04:05 MST" SHORT_RFC1123Z = "Mon, 02 Jan 06 15:04:05 -0700" // RFC1123 with numeric zone )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Banner string // contains filtered or unexported fields }
Client is an NNTP client.
func NewConn ¶
func NewConn(conn io.ReadWriteCloser) (*Client, error)
NewConn wraps an existing connection, for example one opened with tls.Dial
func (*Client) Authenticate ¶
Authenticate against an NNTP server using authinfo user/pass
func (*Client) Capabilities ¶
func (*Client) Command ¶
Command sends a low-level command and get a response.
This will return an error if the code doesn't match the expectCode prefix. For example, if you specify "200", the response code MUST be 200 or you'll get an error. If you specify "2", any code from 200 (inclusive) to 300 (exclusive) will be success. An expectCode of -1 disables this behavior.
type OverHeader ¶
type OverHeader byte
Click to show internal directories.
Click to hide internal directories.