client

package
v0.0.0-...-8d1baa2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MPL-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client manages a WebSocket connection to an IRC server.

func New

func New(dispatch func(any), opts ...Option) *Client

New creates a Client that will send tea.Msg values through dispatch.

func (*Client) Close

func (c *Client) Close() error

Close cleanly shuts down the connection.

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, addr, nick string) error

Connect dials the WebSocket server and performs IRC registration with CAP negotiation.

func (*Client) HasCap

func (c *Client) HasCap(name string) bool

HasCap reports whether the server acknowledged the named capability.

func (*Client) Nick

func (c *Client) Nick() string

Nick returns the current nickname.

func (*Client) Send

func (c *Client) Send(ctx context.Context, line string) error

Send writes a raw IRC line to the WebSocket.

func (*Client) SetNick

func (c *Client) SetNick(nick string)

SetNick updates the stored nickname (called when server confirms a nick change).

type ConnectedMsg

type ConnectedMsg struct{}

ConnectedMsg signals that the WebSocket connection is established.

type DisconnectedMsg

type DisconnectedMsg struct {
	Err error
}

DisconnectedMsg signals that the connection was closed.

type ErrorMsg

type ErrorMsg struct {
	Err error
}

ErrorMsg carries a non-fatal error from the client.

type IRCMsg

type IRCMsg struct {
	ircmsg.Message
}

IRCMsg wraps a parsed IRC message for the TUI.

type Option

type Option func(*Client)

Option configures a Client.

func WithPass

func WithPass(pass string) Option

WithPass sets the server password sent during registration.

Jump to

Keyboard shortcuts

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