{"id":24956862,"url":"https://github.com/andrewstuart/nntp","last_synced_at":"2025-04-10T19:05:09.343Z","repository":{"id":31034876,"uuid":"34593476","full_name":"andrewstuart/nntp","owner":"andrewstuart","description":"A golang library for nntp io, client, and response types for making NNTP easier.","archived":false,"fork":false,"pushed_at":"2024-01-24T04:08:06.000Z","size":1192,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:46:18.774Z","etag":null,"topics":["go","golang","nntp","reader","usenet"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewstuart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-26T01:37:30.000Z","updated_at":"2024-05-30T11:00:09.000Z","dependencies_parsed_at":"2024-06-20T02:59:04.079Z","dependency_job_id":"8e524103-0c44-4452-af03-39782bb1d17a","html_url":"https://github.com/andrewstuart/nntp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fnntp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fnntp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fnntp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fnntp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewstuart","download_url":"https://codeload.github.com/andrewstuart/nntp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248279196,"owners_count":21077406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","nntp","reader","usenet"],"created_at":"2025-02-03T06:41:26.752Z","updated_at":"2025-04-10T19:05:09.313Z","avatar_url":"https://github.com/andrewstuart.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nntp\n--\n    import \"github.com/andrewstuart/nntp\"\n\n\n## Usage\n\n```go\nconst (\n\tArticleFound    = 220\n\tNoArticleWithId = 430\n)\n```\n\n```go\nconst (\n\tAuthAccepted   = 281\n\tPasswordNeeded = 381\n\tAuthNeeded     = 480\n\tBadAuth        = 481\n\tConnsExceeded  = 502\n)\n```\nhttps://tools.ietf.org/html/rfc4643\n\n```go\nconst (\n\tGroupJoined = 211\n\tNoSuchGroup = 411\n)\n```\n\n```go\nconst (\n\tCapabilitiesFollow = 101\n)\n```\n\n```go\nconst HeadersFollow = 221\n```\n\n```go\nconst (\n\tInfoFollows = 215\n)\n```\n\n```go\nvar (\n\tTooManyConns = ConnErr{ConnsExceeded, \"too many connections\"}\n\tAuthRejected = ConnErr{BadAuth, \"credentials rejected\"}\n)\n```\n\n```go\nvar (\n\tIllegalResponse = fmt.Errorf(\"illegal response\")\n\tIllegalHeader   = fmt.Errorf(\"illegal headers\")\n)\n```\n\n#### type Client\n\n```go\ntype Client struct {\n\tMaxConns, Port     int\n\tServer, User, Pass string\n\tTls                bool\n}\n```\n\n\n#### func  NewClient\n\n```go\nfunc NewClient(server string, port int) *Client\n```\n\n#### func (*Client) Auth\n\n```go\nfunc (cli *Client) Auth(u, p string) error\n```\n\n#### func (*Client) Capabilities\n\n```go\nfunc (cli *Client) Capabilities() ([]string, error)\n```\n\n#### func (*Client) Do\n\n```go\nfunc (cli *Client) Do(format string, args ...interface{}) (*Response, error)\n```\n\n#### func (*Client) GetArticle\n\n```go\nfunc (cli *Client) GetArticle(group, id string) (res *Response, err error)\n```\nClient method GetArticle\n\n#### func (*Client) Head\n\n```go\nfunc (cli *Client) Head(group, id string) (*Response, error)\n```\n\n#### func (*Client) JoinGroup\n\n```go\nfunc (cli *Client) JoinGroup(name string) error\n```\n\n#### func (*Client) List\n\n```go\nfunc (cli *Client) List() ([]Group, error)\n```\n\n#### func (*Client) ListGroup\n\n```go\nfunc (cli *Client) ListGroup(gid string) ([]string, error)\n```\n\n#### func (*Client) SetMaxConns\n\n```go\nfunc (cli *Client) SetMaxConns(n int)\n```\n\n#### type Conn\n\n```go\ntype Conn struct {\n}\n```\n\n\n#### func  NewConn\n\n```go\nfunc NewConn(c io.ReadWriteCloser, wrappers ...func(io.Reader) io.Reader) *Conn\n```\n\n#### func (*Conn) Auth\n\n```go\nfunc (conn *Conn) Auth(u, p string) error\n```\n\n#### func (*Conn) Close\n\n```go\nfunc (c *Conn) Close() error\n```\n\n#### func (*Conn) Do\n\n```go\nfunc (c *Conn) Do(format string, is ...interface{}) (*Response, error)\n```\n\n#### func (*Conn) Wrap\n\n```go\nfunc (c *Conn) Wrap(fn ...func(io.Reader) io.Reader)\n```\n\n#### type ConnErr\n\n```go\ntype ConnErr struct {\n\tCode   int    `json:\"code\"xml:\"code\"`\n\tReason string `json:\"reason\"xml:\"reason\"`\n}\n```\n\n\n#### func (ConnErr) Error\n\n```go\nfunc (c ConnErr) Error() string\n```\n\n#### type Group\n\n```go\ntype Group struct {\n\tId           string\n\tCount, First int\n}\n```\n\n\n#### type Reader\n\n```go\ntype Reader struct {\n\tR *bufio.Reader\n}\n```\n\nA Reader is a read/closer that strips NNTP newlines and will unescape\ncharacters.\n\n#### func  NewReader\n\n```go\nfunc NewReader(r io.Reader) *Reader\n```\nNewReader returns an nntp.Reader for the body of the nttp article.\n\n#### func (*Reader) Close\n\n```go\nfunc (r *Reader) Close() error\n```\nClose allows users of a Reader to signal that they are done using the reader.\n\n#### func (*Reader) Read\n\n```go\nfunc (r *Reader) Read(p []byte) (bytesRead int, err error)\n```\nThe Read method handles translation of the NNTP escaping and marking EOF when\nthe end of a body is received.\n\n#### type Response\n\n```go\ntype Response struct {\n\tCode    int                  `json:\"code\"xml:\"code\"`\n\tMessage string               `json:\"message\"xml:\"message\"`\n\tHeaders textproto.MIMEHeader `json:\"headers\"xml:\"headers\"`\n\tBody    io.ReadCloser        `json:\"body\"xml:\"body\"` //Presence (non-nil) indicates multi-line response\n}\n```\n\n\n#### func  NewResponse\n\n```go\nfunc NewResponse(r io.Reader) (*Response, error)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewstuart%2Fnntp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewstuart%2Fnntp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewstuart%2Fnntp/lists"}