Documentation
¶
Overview ¶
Package nntp provides the very beginning of an NNTP server implementation.
Index ¶
Constants ¶
View Source
const ( StatusHelpText = 100 StatusCapabilityList = 101 StatusServerDate = 111 StatusPostingAllowed = 200 StatusPostingProhibited = 201 StatusConnectionClosing = 205 StatusGroupSelected = 211 StatusInformationFollows = 215 StatusArticleFollows = 220 StatusArticleHeadersFollow = 221 StatusArticleBodyFollows = 222 StatusArticleSelected = 223 StatusOverviewFollows = 224 StatusHeadersFollow = 225 StatusNewArticlesFollow = 230 StatusNewNewsgroupsFollow = 231 StatusArticleTransferredOK = 235 StatusArticleReceivedOK = 240 StatusTransferArticle = 335 StatusPostArticle = 340 StatusServiceNotAvailable = 400 StatusWrongServerMode = 401 StatusInternalFault = 403 StatusNoSuchGroup = 411 StatusNoGroupSelected = 412 StatusCurrentArticleInvalid = 420 StatusNoNextArticle = 421 StatusNoPreviousArticle = 422 StatusNoSuchArticleNumber = 423 StatusNoSuchMessageID = 430 StatusArticleNotWanted = 435 StatusTransferFailed = 436 StatusTransferRejected = 437 StatusPostingNotPermitted = 440 StatusPostingFailed = 441 StatusNotAuthenticated = 480 StatusNotPrivate = 483 StatusUnknownCommand = 500 StatusSyntaxError = 501 StatusNotPermitted = 502 StatusFeatureNotSupported = 503 StatusEncodingError = 504 )
NNTP status codes as defined by RFC 3977.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { // Keyword specifies the type of command. Keyword string // Args are the arguments to the command. Args []string }
A Command represents an NNTP command received by a server or issued by a client.
type Handler ¶
type Handler interface {
ServeNNTP(ResponseWriter, *Command)
}
A Handler can be registered to serve a particular group hierarchy in the NNTP server.
type ResponseWriter ¶
type ResponseWriter interface { // Write writes the data to the connection as part of an NNTP // reply. If WriteHeader has not yet been called, Write calls // WriteHeader(nntp.StatusOK) before writing the data. Write([]byte) (int, error) // WriteHeader sends an NNTP response header with status code. // If WriteHeader is not called explicitly, the first call to Write // will trigger an implicit WriteHeader(nntp.StatusInternalFault). WriteHeader(int) }
A ResponseWriter interface is used by an NNTP handler to construct an NNTP response.
Click to show internal directories.
Click to hide internal directories.