Documentation
¶
Overview ¶
Package nntpclient provides an NNTP Client.
Index ¶
- 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) 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) Post(r io.Reader) error
- func (c *Client) SetContext(ctx context.Context) func()
- func (c *Client) SetDeadline(t time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an NNTP client.
func (*Client) Authenticate ¶
Authenticate against an NNTP server using authinfo user/pass
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.
func (*Client) Post ¶
Post a new article
The reader should contain the entire article, headers and body in RFC822ish format.
func (*Client) SetContext ¶
Click to show internal directories.
Click to hide internal directories.