1 cd9ed713 2024-03-28 o // Package nntp implements the Network News Transfer Protocol as defined in RFC 3977.
2 c95413d6 2012-02-22 dustin package nntp
7 3f2ad062 2012-02-23 dustin "net/textproto"
10 4ef66cd9 2014-02-26 dustin // PostingStatus type for groups.
11 c95413d6 2012-02-22 dustin type PostingStatus byte
14 c95413d6 2012-02-22 dustin Unknown = PostingStatus(0)
15 c95413d6 2012-02-22 dustin PostingPermitted = PostingStatus('y')
16 c95413d6 2012-02-22 dustin PostingNotPermitted = PostingStatus('n')
17 c95413d6 2012-02-22 dustin PostingModerated = PostingStatus('m')
20 3f2ad062 2012-02-23 dustin func (ps PostingStatus) String() string {
21 3f2ad062 2012-02-23 dustin return fmt.Sprintf("%c", ps)
24 cd9ed713 2024-03-28 o // Group represents a newsgroup.
25 c95413d6 2012-02-22 dustin type Group struct {
26 3f2ad062 2012-02-23 dustin Name string
27 3f2ad062 2012-02-23 dustin Description string
28 3f2ad062 2012-02-23 dustin Count int64
29 3f2ad062 2012-02-23 dustin High int64
31 3f2ad062 2012-02-23 dustin Posting PostingStatus
34 4ef66cd9 2014-02-26 dustin // An Article that may appear in one or more groups.
35 3f2ad062 2012-02-23 dustin type Article struct {
36 fac72dc3 2012-02-23 dustin // The article's headers
37 3f2ad062 2012-02-23 dustin Header textproto.MIMEHeader
38 fac72dc3 2012-02-23 dustin // The article's body
39 fac72dc3 2012-02-23 dustin Body io.Reader
40 fac72dc3 2012-02-23 dustin // Number of bytes in the article body (used by OVER/XOVER)
42 fac72dc3 2012-02-23 dustin // Number of lines in the article body (used by OVER/XOVER)
46 4ef66cd9 2014-02-26 dustin // MessageID provides convenient access to the article's Message ID.
47 4ef66cd9 2014-02-26 dustin func (a *Article) MessageID() string {
48 3f2ad062 2012-02-23 dustin return a.Header.Get("Message-Id")