Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (cli *Client) Auth(u, p string) error
- func (cli *Client) Capabilities() ([]string, error)
- func (cli *Client) Do(format string, args ...interface{}) (*Response, error)
- func (cli *Client) GetArticle(group, id string) (res *Response, err error)
- func (cli *Client) Head(group, id string) (*Response, error)
- func (cli *Client) JoinGroup(name string) error
- func (cli *Client) List() ([]Group, error)
- func (cli *Client) ListGroup(gid string) ([]string, error)
- func (cli *Client) SetMaxConns(n int)
- type Conn
- type ConnErr
- type Group
- type Reader
- type Response
Constants ¶
View Source
const ( ArticleFound = 220 NoArticleWithId = 430 )
View Source
const ( AuthAccepted = 281 PasswordNeeded = 381 AuthNeeded = 480 BadAuth = 481 ConnsExceeded = 502 )
https://tools.ietf.org/html/rfc4643
View Source
const ( GroupJoined = 211 NoSuchGroup = 411 )
View Source
const (
CapabilitiesFollow = 101
)
View Source
const HeadersFollow = 221
View Source
const (
InfoFollows = 215
)
Variables ¶
View Source
var ( TooManyConns = ConnErr{ConnsExceeded, "too many connections"} AuthRejected = ConnErr{BadAuth, "credentials rejected"} )
View Source
var ( IllegalResponse = fmt.Errorf("illegal response") IllegalHeader = fmt.Errorf("illegal headers") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
MaxConns, Port int
Server, User, Pass string
TLS bool
// contains filtered or unexported fields
}
func (*Client) Capabilities ¶
func (*Client) GetArticle ¶
Client method GetArticle
func (*Client) SetMaxConns ¶
type Reader ¶
A Reader is a read/closer that strips NNTP newlines and will unescape characters.
type Response ¶
type Response struct { Code int `json:"code"xml:"code"` Message string `json:"message"xml:"message"` Headers textproto.MIMEHeader `json:"headers"xml:"headers"` Body io.ReadCloser `json:"body"xml:"body"` //Presence (non-nil) indicates multi-line response // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.