irc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConnectionConfig = ConnectionConfig{
		KeepAlive: 4 * time.Minute,
		Timeout:   1 * time.Minute,
	}
)

Functions

func NewCapabilityHandler

func NewCapabilityHandler() *capabilityHandler

func NewDebugHandler

func NewDebugHandler(debug bool) *debugHandler

func NewErrorHandler

func NewErrorHandler() *errorHandler

func NewNickHandler

func NewNickHandler(preferredNickname string) *nickHandler

func NewPingHandler

func NewPingHandler() *pingHandler

Types

type CapabilityStruct

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

type Channel

type Channel struct {
	Name string
}

type ClientConfig

type ClientConfig struct {
	Server   string
	Nick     string
	User     string
	Password string
	UseTLS   bool
	Realname string
}

type Connection

type Connection struct {
	Server       string
	Password     string
	Nickname     string
	UseTLS       bool
	Debug        bool
	SASLAuth     bool
	SASLUser     string
	SASLPass     string
	ConnConfig   ConnectionConfig
	ClientConfig ClientConfig

	Finished chan bool
	// contains filtered or unexported fields
}

func NewIRC

func NewIRC(server string, password string, nickname string, useTLS bool, useSasl bool, saslUser, saslPass string, debug bool) *Connection

func (*Connection) AddInboundHandler

func (irc *Connection) AddInboundHandler(s string, f func(c *Connection, m *Message))

func (*Connection) AddInboundHandlers

func (irc *Connection) AddInboundHandlers(handlers map[string]func(c *Connection, m *Message))

func (*Connection) AddOutboundHandler

func (irc *Connection) AddOutboundHandler(f func(c *Connection, m string))

func (*Connection) AddRawHandler

func (irc *Connection) AddRawHandler(f func(c *Connection, m RawMessage))

func (*Connection) AddRawHandlers

func (irc *Connection) AddRawHandlers(handlers []func(c *Connection, m RawMessage))

func (*Connection) Connect

func (irc *Connection) Connect() error

func (*Connection) ConnectAndWait

func (irc *Connection) ConnectAndWait() error

func (*Connection) ConnectAndWaitWithRetry added in v1.1.0

func (irc *Connection) ConnectAndWaitWithRetry(maxRetries int) error

func (*Connection) Init

func (irc *Connection) Init()

func (*Connection) PublishCapAdd

func (irc *Connection) PublishCapAdd(conn *Connection, capability *CapabilityStruct)

func (*Connection) PublishCapDel

func (irc *Connection) PublishCapDel(conn *Connection, capability *CapabilityStruct)

func (*Connection) PublishChannelMessage

func (irc *Connection) PublishChannelMessage(message Message)

func (*Connection) PublishChannelPart

func (irc *Connection) PublishChannelPart(channel Channel)

func (*Connection) Quit

func (irc *Connection) Quit()

func (*Connection) SendRaw

func (irc *Connection) SendRaw(line string)

func (*Connection) SendRawf

func (irc *Connection) SendRawf(formatLine string, args ...interface{})

func (*Connection) SubscribeCapAdd

func (irc *Connection) SubscribeCapAdd(receiver func(*Connection, *CapabilityStruct))

func (*Connection) SubscribeCapDel

func (irc *Connection) SubscribeCapDel(receiver func(*Connection, *CapabilityStruct))

func (*Connection) SubscribeChannelMessage

func (irc *Connection) SubscribeChannelMessage(receiver func(Message))

func (*Connection) SubscribeChannelPart

func (irc *Connection) SubscribeChannelPart(receiver func(Channel))

func (*Connection) UnsubscribeCapAdd

func (irc *Connection) UnsubscribeCapAdd(receiver func(*Connection, *CapabilityStruct))

func (*Connection) UnsubscribeCapDel

func (irc *Connection) UnsubscribeCapDel(receiver func(*Connection, *CapabilityStruct))

func (*Connection) UnsubscribeChannelMessage

func (irc *Connection) UnsubscribeChannelMessage(receiver func(Message))

func (*Connection) UnsubscribeChannelPart

func (irc *Connection) UnsubscribeChannelPart(receiver func(Channel))

func (*Connection) Wait

func (irc *Connection) Wait()

type ConnectionConfig

type ConnectionConfig struct {
	KeepAlive time.Duration
	Timeout   time.Duration
}

type InboundHandler

type InboundHandler struct {
	Verb    string
	Handler func(*Connection, *Message)
}

type Message

type Message struct {
	Raw    string
	Tags   string
	Source string
	Verb   string
	Params []string
}

type RawMessage

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

type SaslHandler

type SaslHandler struct {
	SASLAuth bool
	SASLUser string
	SASLPass string
	// contains filtered or unexported fields
}

func NewSASLHandler

func NewSASLHandler(useSasl bool, saslUser string, saslPass string) *SaslHandler

func (*SaslHandler) Install

func (h *SaslHandler) Install(c *Connection)

Jump to

Keyboard shortcuts

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