irc

package
v0.0.0-...-b457b73 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	NetworkConfiguration
	// contains filtered or unexported fields
}

Client stores connection information and metadata for a connection to an IRC network.

func NewClient

func NewClient(baseDir string, cfg NetworkConfiguration) *Client

func (*Client) Connect

func (c *Client) Connect() error

Connect opens a TCP connection to the IRC network and sends `NICK`, `USER`, and `PASS` commands to authenticate the connection.

func (*Client) Listen

func (c *Client) Listen() error

Listen loops through all IRC messages sent to the client as long as the connection remains open, dispatching to handlers. Will return an error if the connection is interrupted, or an unparseable message is returned.

type NetworkConfiguration

type NetworkConfiguration struct {
	Name                 string `json:"name"`
	Host                 string `json:"host"`
	Port                 int    `json:"port"`
	IsTLS                bool   `json:"is_tls"`
	SkipCertificateCheck bool   `json:"skip_certificate_check,omitempty"`

	Nick           string   `json:"nick"`
	RealName       string   `json:"real_name"`
	ServerPass     string   `json:"server_pass,omitempty"`
	OnConnect      []string `json:"on_connect"`
	RejoinExisting bool     `json:"rejoin_existing"`
}

NetworkConfiguration contains the configuration for a connection to a single IRC network. Used by Client.

Jump to

Keyboard shortcuts

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