capab

package
v0.0.0-...-df918ef Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: ISC Imports: 9 Imported by: 0

Documentation

Overview

Package capab implements IRCv3 Capability negotiation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSASLFailed           = errors.New("SASL Failed")
	ErrSASLNotSupported     = errors.New("SASL not supported by server")
	ErrSASLMechNotSupported = errors.New("SASL mechanism not supported by server")
)

Various SASL error messages

Functions

This section is empty.

Types

type Capability

type Capability struct {
	Name         string
	Value        string
	Available    bool
	Request      bool
	Acknowledged bool
}

Capability represents a single IRCv3 capability

func (*Capability) String

func (c *Capability) String() string

type Config

type Config struct {
	ToRequest []string
	SASL      bool

	SASLUsername string
	SASLPassword string
	SASLMech     string
}

Config contains the configuration options for the Negotiator struct

type Negotiator

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

Negotiator negotiates IRCv3 capabilities over a Client instance

func New

func New(conf *Config, writeToIRC func(string, ...string) error, eventManager eventManager) *Negotiator

New creates a new Negotiator instance

func (*Negotiator) AvailableCaps

func (n *Negotiator) AvailableCaps() []Capability

AvailableCaps returns a list of capabilities that have been requested and acknowledged by the server

func (*Negotiator) Negotiate

func (n *Negotiator) Negotiate()

Negotiate negotiates IRCv3 capabilities with a server, and optionally performs sasl authentication

Jump to

Keyboard shortcuts

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