proxy

package
v0.0.0-...-0ace8a3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2017 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package proxy implements the IRC Idler proxy daemon proper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptLoop

func AcceptLoop(l net.Listener, acceptChan chan<- irc.ReadWriteCloser, logger *log.Logger)

AcceptLoop accepts connections from `l`, and sends them on `acceptChan`.

Types

type Connector

type Connector interface {
	Connect() (irc.ReadWriteCloser, error)
}

A Connector establishes an IRC connection.

type DialerConnector

type DialerConnector struct {
	netextra.Dialer
	Network string
	Addr    string
}

A DialerConnector is a Connector that uses a Dialer to establish connections to a specific destination.

func (*DialerConnector) Connect

func (dc *DialerConnector) Connect() (irc.ReadWriteCloser, error)

Connect establishes a connection by invoking dc.Dialer.Dial(dc.Network, dc.Addr)

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

A Proxy is a daemon implementing the core IRC Idler proxying functionality.

func NewProxy

func NewProxy(
	logger *log.Logger,
	store storage.Store,
	clientConns <-chan irc.ReadWriteCloser,
	serverConnector Connector) *Proxy

NewProxy creates a new proxy.

parameters:

`logger`, if non-nil, will be used for informational logging. `store` is the Store to use for persistent data. `clientConns` is a channel on which incoming client connections are sent. `serverConnector` is a `Connector` to be used to connect to the server.

func (*Proxy) Run

func (p *Proxy) Run()

Run the proxy daemon. Returns when the daemon shuts down.

func (*Proxy) Stop

func (p *Proxy) Stop()

Stop shuts down the daemon, which must be already running. Does not wait for the daemon to shut down completely before returning.

Directories

Path Synopsis
Package state provides support for modeling the state of objects affected by IRC messages
Package state provides support for modeling the state of objects affected by IRC messages

Jump to

Keyboard shortcuts

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