irc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: BSD-2-Clause Imports: 10 Imported by: 2

Documentation

Overview

Package irc is an IRC-over-websocket client implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn added in v0.2.0

type Conn interface {
	Read() (*Message, error)
	Send(string) error
	Close() error
}

A Conn is an IRC connection.

type Dialer added in v0.3.0

type Dialer interface {
	// Dial connects with a given context. The context does not (only) govern
	// the Dial itself, but also the established connection.
	Dial(context.Context) (Conn, error)
}

Dialer is a preconfigured IRC connector.

func New

func New(addr string) (Dialer, error)

New creates a new Dialer from a URL.

func NewTLS added in v0.3.0

func NewTLS(addr string, options ...TLSOpt) Dialer

NewTLS is an extended initializer for TLS-based IRC.

type Message

type Message struct {
	Tags       map[string]string `json:"tags"`
	Source     string            `json:"source"`
	Command    string            `json:"command"`
	Args       []string          `json:"args"`
	HasTrailer bool              `json:"trailer,omitempty"` // Useful to know.. usually
	// contains filtered or unexported fields
}

func ParseMessage

func ParseMessage(line string) *Message

func (*Message) Arg

func (m *Message) Arg(i int) string

Arg returns the given argument, even if it is not set.

func (*Message) Raw

func (m *Message) Raw() string

func (*Message) String

func (m *Message) String() string

func (*Message) Trailer

func (m *Message) Trailer(i int) string

Trailer returns the argument at position i, even if it is not strictly the final argument.

type TLSConfig added in v0.3.0

type TLSConfig struct{ *tls.Config }

TLSConfig is a TLSOpt for specifying a tls.Config.

type TLSOpt added in v0.3.0

type TLSOpt interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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