irc

package
v0.0.0-...-81ce28d Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxLineLen = 512
)

Variables

View Source
var (
	InvalidIRCSyntax = errors.New("invalid IRC syntax")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Listeners    map[string]listenerConfigBlock
	UnixBindMode os.FileMode `yaml:"unix-bind-mode"`

	GatewayName string `yaml:"gateway-name"`

	Upstreams   []reverseProxyUpstream
	DialTimeout time.Duration `yaml:"dial-timeout"`

	LookupHostnames         bool `yaml:"lookup-hostnames"`
	ForwardConfirmHostnames bool `yaml:"forward-confirm-hostnames"`

	ProxyAllowedFrom []string `yaml:"proxy-allowed-from"`

	MaxLineLen int `yaml:"max-line-len"`

	AllowedOrigins []string `yaml:"allowed-origins"`

	PprofListener string `yaml:"pprof-listener"`

	LogLevel string `yaml:"log-level"`

	Transcoding struct {
		EnableChardet bool `yaml:"enable-chardet"`

		Encodings []string
		// contains filtered or unexported fields
	}

	Filename string
	// contains filtered or unexported fields
}

Config defines the overall configuration.

func LoadConfig

func LoadConfig(filename string) (config *Config, err error)

LoadConfig loads the given YAML configuration file.

func LoadRawConfig

func LoadRawConfig(filename string) (config *Config, err error)

LoadRawConfig loads the config without doing any consistency checks or postprocessing

type LogLevel

type LogLevel uint
const (
	LogLevelError LogLevel = iota
	LogLevelWarn
	LogLevelInfo
	LogLevelDebug
)

type ReverseProxyConn

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

func NewReverseProxyConn

func NewReverseProxyConn(server *Server, webConn *websocket.Conn, uConn net.Conn, messageType int, maxLineLen, maxReadQ int, debug bool) *ReverseProxyConn

func (*ReverseProxyConn) Close

func (r *ReverseProxyConn) Close()

type Server

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

Server is the main Oragono server.

func NewServer

func NewServer(config *Config) (*Server, error)

NewServer returns a new Oragono server.

func (*Server) Config

func (server *Server) Config() (config *Config)

func (*Server) HandlePanic

func (server *Server) HandlePanic()

func (*Server) Log

func (server *Server) Log(level LogLevel, message string)

func (*Server) Run

func (server *Server) Run()

Run starts the server.

func (*Server) RunReverseProxyConn

func (server *Server) RunReverseProxyConn(webConn *websocket.Conn, proxiedIP net.IP, secure bool, config *Config)

func (*Server) SetConfig

func (server *Server) SetConfig(config *Config)

func (*Server) Shutdown

func (server *Server) Shutdown()

Shutdown shuts down the server.

type TLSListenConfig

type TLSListenConfig struct {
	Cert string
	Key  string
}

TLSListenConfig defines configuration options for listening on TLS.

type WSListener

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

WSListener is a listener for IRC-over-websockets (initially HTTP, then upgraded to a different application protocol that provides a message-based API, possibly with TLS)

func NewListener

func NewListener(server *Server, addr string, config utils.ListenerConfig, bindMode os.FileMode) (result *WSListener, err error)

NewListener creates a new listener according to the specifications in the config file

func NewWSListener

func NewWSListener(server *Server, addr string, listener *utils.ReloadableListener, config utils.ListenerConfig) (result *WSListener, err error)

func (*WSListener) Reload

func (wl *WSListener) Reload(config utils.ListenerConfig) error

func (*WSListener) Stop

func (wl *WSListener) Stop() error

Jump to

Keyboard shortcuts

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