nntp

package
v0.0.0-...-539a64a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLimitExceeded = fmt.Errorf("Maximum client connection exceeded")

Functions

This section is empty.

Types

type ArticleRequest

type ArticleRequest struct {
	Groups  []string
	Id      string
	Handler func(Body) error
	OnError func(error)
}

type Auth

type Auth struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

type Body

type Body interface {
	io.Reader
	io.ByteReader
}

type Client

type Client struct {
	*Config
	Dialer    net.Dialer
	TLSConfig tls.Config
}

func New

func New(conf *Config) *Client

func (*Client) StartWorker

func (c *Client) StartWorker(ch chan *ArticleRequest) error

type Config

type Config struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
	Auth *Auth  `yaml:"auth"`

	MaxConn int `yaml:"maxConn"`

	TLS    bool     `yaml:"tls"`
	Cipher []string `yaml:"cipher"`
}

type Conn

type Conn struct {
	*textproto.Conn
	// contains filtered or unexported fields
}

func (*Conn) Auth

func (c *Conn) Auth(a *Auth) error

func (*Conn) Body

func (c *Conn) Body(article string, handler func(Body) error) error

func (*Conn) Capabilities

func (c *Conn) Capabilities(group string) ([]string, error)

func (*Conn) Group

func (c *Conn) Group(group string) (*Group, error)

func (*Conn) Groups

func (c *Conn) Groups(groups []string) (*Group, error)

func (*Conn) Head

func (c *Conn) Head(article string) (textproto.MIMEHeader, error)

func (*Conn) Name

func (c *Conn) Name() string

func (*Conn) Shutdown

func (c *Conn) Shutdown()

type Group

type Group struct {
	Name   string
	Number int
	Low    int
	High   int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL