Documentation ¶
Index ¶
- Variables
- func NewCapabilityHandler(logger *zap.SugaredLogger) *capabilityHandler
- func NewDebugHandler(logger *zap.SugaredLogger) *debugHandler
- func NewErrorHandler() *errorHandler
- func NewNickHandler(preferredNickname string, logger *zap.SugaredLogger) *nickHandler
- func NewPingHandler() *pingHandler
- func NewSupportHandler() *supportParser
- type CapabilityListener
- type CapabilityPublisher
- type CapabilityStruct
- type Channel
- type ClientConfig
- type Connection
- func (irc *Connection) AddInboundHandler(s string, f func(em *EventManager, c *Connection, m *Message))
- func (irc *Connection) AddInboundHandlers(handlers map[string]func(em *EventManager, c *Connection, m *Message))
- func (irc *Connection) AddOutboundHandler(f func(em *EventManager, c *Connection, m string))
- func (irc *Connection) AddRawHandler(f func(c *Connection, m RawMessage))
- func (irc *Connection) AddRawHandlers(handlers []func(c *Connection, m RawMessage))
- func (irc *Connection) Connect() error
- func (irc *Connection) ConnectAndWait() error
- func (irc *Connection) ConnectAndWaitWithRetry(maxRetries int) error
- func (irc *Connection) Init()
- func (irc *Connection) NewRateLimiter(w io.Writer, floodProfile string) *RateLimiter
- func (irc *Connection) Quit()
- func (irc *Connection) SendRaw(line string)
- func (irc *Connection) SendRawf(formatLine string, args ...interface{})
- func (irc *Connection) Wait()
- type ConnectionConfig
- type EventManager
- func (irc *EventManager) PublishCapAdd(conn *Connection, capability *CapabilityStruct)
- func (irc *EventManager) PublishCapDel(conn *Connection, capability *CapabilityStruct)
- func (irc *EventManager) PublishChannelMessage(message Message)
- func (irc *EventManager) PublishChannelPart(channel Channel)
- func (irc *EventManager) SubscribeCapAdd(receiver func(*Connection, *CapabilityStruct))
- func (irc *EventManager) SubscribeCapDel(receiver func(*Connection, *CapabilityStruct))
- func (irc *EventManager) SubscribeChannelMessage(receiver func(Message))
- func (irc EventManager) SubscribeChannelPart(receiver func(Channel))
- func (irc *EventManager) UnsubscribeCapAdd(receiver func(*Connection, *CapabilityStruct))
- func (irc *EventManager) UnsubscribeCapDel(receiver func(*Connection, *CapabilityStruct))
- func (irc *EventManager) UnsubscribeChannelMessage(receiver func(Message))
- func (irc *EventManager) UnsubscribeChannelPart(receiver func(Channel))
- type InboundHandler
- type Message
- type RateLimiter
- type RawMessage
- type SaslHandler
- type Sender
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultConnectionConfig = ConnectionConfig{ KeepAlive: 4 * time.Minute, Timeout: 1 * time.Minute, } )
Functions ¶
func NewCapabilityHandler ¶
func NewCapabilityHandler(logger *zap.SugaredLogger) *capabilityHandler
func NewDebugHandler ¶
func NewDebugHandler(logger *zap.SugaredLogger) *debugHandler
func NewErrorHandler ¶
func NewErrorHandler() *errorHandler
func NewNickHandler ¶
func NewNickHandler(preferredNickname string, logger *zap.SugaredLogger) *nickHandler
func NewPingHandler ¶
func NewPingHandler() *pingHandler
func NewSupportHandler ¶
func NewSupportHandler() *supportParser
Types ¶
type CapabilityListener ¶
type CapabilityListener interface { SubscribeCapAdd(receiver func(*Connection, *CapabilityStruct)) UnsubscribeCapAdd(receiver func(*Connection, *CapabilityStruct)) SubscribeCapDel(receiver func(*Connection, *CapabilityStruct)) UnsubscribeCapDel(receiver func(*Connection, *CapabilityStruct)) }
type CapabilityPublisher ¶
type CapabilityPublisher interface { PublishCapAdd(conn *Connection, capability *CapabilityStruct) PublishCapDel(conn *Connection, capability *CapabilityStruct) }
type CapabilityStruct ¶
type CapabilityStruct struct {
// contains filtered or unexported fields
}
type ClientConfig ¶
type Connection ¶
type Connection struct { Server string Password string Nickname string UseTLS bool SASLAuth bool SASLUser string SASLPass string ConnConfig ConnectionConfig ClientConfig ClientConfig Finished chan bool FloodProfile string // contains filtered or unexported fields }
func NewIRC ¶
func NewIRC(server, password, nickname, realname string, useTLS, useSasl bool, saslUser, saslPass string, log *zap.SugaredLogger, floodProfile string, eventManager *EventManager) *Connection
func (*Connection) AddInboundHandler ¶
func (irc *Connection) AddInboundHandler(s string, f func(em *EventManager, c *Connection, m *Message))
func (*Connection) AddInboundHandlers ¶
func (irc *Connection) AddInboundHandlers(handlers map[string]func(em *EventManager, c *Connection, m *Message))
func (*Connection) AddOutboundHandler ¶
func (irc *Connection) AddOutboundHandler(f func(em *EventManager, 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 ¶
func (irc *Connection) ConnectAndWaitWithRetry(maxRetries int) error
func (*Connection) Init ¶
func (irc *Connection) Init()
func (*Connection) NewRateLimiter ¶
func (irc *Connection) NewRateLimiter(w io.Writer, floodProfile string) *RateLimiter
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) Wait ¶
func (irc *Connection) Wait()
type ConnectionConfig ¶
type EventManager ¶
type EventManager struct {
// contains filtered or unexported fields
}
func NewEventManager ¶
func NewEventManager() *EventManager
func (*EventManager) PublishCapAdd ¶
func (irc *EventManager) PublishCapAdd(conn *Connection, capability *CapabilityStruct)
func (*EventManager) PublishCapDel ¶
func (irc *EventManager) PublishCapDel(conn *Connection, capability *CapabilityStruct)
func (*EventManager) PublishChannelMessage ¶
func (irc *EventManager) PublishChannelMessage(message Message)
func (*EventManager) PublishChannelPart ¶
func (irc *EventManager) PublishChannelPart(channel Channel)
func (*EventManager) SubscribeCapAdd ¶
func (irc *EventManager) SubscribeCapAdd(receiver func(*Connection, *CapabilityStruct))
func (*EventManager) SubscribeCapDel ¶
func (irc *EventManager) SubscribeCapDel(receiver func(*Connection, *CapabilityStruct))
func (*EventManager) SubscribeChannelMessage ¶
func (irc *EventManager) SubscribeChannelMessage(receiver func(Message))
func (EventManager) SubscribeChannelPart ¶
func (irc EventManager) SubscribeChannelPart(receiver func(Channel))
func (*EventManager) UnsubscribeCapAdd ¶
func (irc *EventManager) UnsubscribeCapAdd(receiver func(*Connection, *CapabilityStruct))
func (*EventManager) UnsubscribeCapDel ¶
func (irc *EventManager) UnsubscribeCapDel(receiver func(*Connection, *CapabilityStruct))
func (*EventManager) UnsubscribeChannelMessage ¶
func (irc *EventManager) UnsubscribeChannelMessage(receiver func(Message))
func (*EventManager) UnsubscribeChannelPart ¶
func (irc *EventManager) UnsubscribeChannelPart(receiver func(Channel))
type InboundHandler ¶
type InboundHandler struct { Verb string Handler func(*Connection, *Message) }
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func (*RateLimiter) Init ¶
func (r *RateLimiter) Init(profile 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, logger *zap.SugaredLogger) *SaslHandler
func (*SaslHandler) Install ¶
func (h *SaslHandler) Install(em *EventManager, c *Connection)
Click to show internal directories.
Click to hide internal directories.