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

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