Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { ID string // Article ID Groups []string // Groups which holds the article // Result Exists bool // Flag which defines if article exists on NNTP server Content []byte // Content of fetched article, filled on operation fetch, otherwise NIL }
Article describes the article information
type Conn ¶
type Conn interface { Connect() (bool, error) Close() error SwitchGroup(group string) error ArticleExists(id string) (bool, error) FetchArticle(id string) ([]byte, error) }
Conn represent(s) a single connection to a NNTP Server
func NewConn ¶
func NewConn(id int, i *ServerInfo) Conn
NewConn create a new NNTP connection based on provided ServerInfo
type ConnectionPool ¶
type ConnectionPool struct { Info *ServerInfo // contains filtered or unexported fields }
ConnectionPool to NNTP server
func NewConnectionPool ¶
func NewConnectionPool(i *ServerInfo, reqQueue chan *Request, maxConnections int) *ConnectionPool
NewConnectionPool create new connection pool to NNTP Server
func (*ConnectionPool) Collect ¶
func (cp *ConnectionPool) Collect() chan *Response
Collect *Response(s) from ConnectionPool
type Operation ¶
type Operation uint8
Operation defines what kind of operation to perform for provided article on the connection
type Request ¶
type Request struct { Article *Article // Article Information Command Operation // Command Operation to perform }
Request on connection
type Response ¶
type Response struct { Article *Article Commmand Operation // Operation which was executed Error error // Error of operation if any Source string // source of response HOST:PORT of connection }
Response of work on connection
type ServerAuth ¶
ServerAuth authentication info for ServerInfo
type ServerInfo ¶
type ServerInfo struct { Host string Port uint16 TLS bool Auth *ServerAuth }
ServerInfo for nntp connection
Click to show internal directories.
Click to hide internal directories.