irc

package
v0.0.0-...-78066cc Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultNick                    = "freyabot"
	DefaultLoginDelaySeconds       = 5
	DefaultDialTimeoutSeconds      = 10
	DefaultKeepAliveSeconds        = 60
	DefaultMsgBufferSize           = 100
	DefaultTlsPort                 = 6697
	DefaultPlainPort               = 6667
	ReadDelimiter             byte = '\n'
)
View Source
const (
	AuthMethodNone = iota
	AuthMethodNickServ
	AuthMethodSASL
	AuthMethodCertFP
)
View Source
const ApiName = "irc"

Variables

This section is empty.

Functions

func Flags

func Flags(cmd *cobra.Command)

func Init

func Init() (*chatlib.Option, error)

Types

type API

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

func New

func New(opts ...Option) (*API, error)

func (*API) ApplyOptions

func (a *API) ApplyOptions(opts ...Option) error

func (*API) Ping

func (a *API) Ping() error

func (*API) ReceiveMessage

func (a *API) ReceiveMessage(c context.Context) (*chatlib.Message, error)

func (*API) SendMessage

func (a *API) SendMessage(c context.Context, msg *chatlib.Message) error

TODO Handle long messages

func (*API) Start

func (a *API) Start(c context.Context) error

func (*API) Stop

func (a *API) Stop(c context.Context) error

type Option

type Option func(*API) error

func CombineOptions

func CombineOptions(opts ...Option) Option

func WithAuthMethod

func WithAuthMethod(method int) Option

func WithChannel

func WithChannel(channel string) Option

func WithChannels

func WithChannels(channels []string) Option

func WithDialTimeout

func WithDialTimeout(seconds float64) Option

func WithKeepAlive

func WithKeepAlive(seconds float64) Option

func WithMessageBufferSize

func WithMessageBufferSize(size int) Option

func WithNetwork

func WithNetwork(host string, port int) Option

func WithNick

func WithNick(nick string) Option

func WithPassword

func WithPassword(password string) Option

func WithTLS

func WithTLS(cfg *tls.Config) Option

Jump to

Keyboard shortcuts

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