Documentation ¶
Index ¶
- Constants
- Variables
- func HookRegister(hookName string, p interface{})
- func Ipv4ToHex(ip string) string
- type Client
- func (c *Client) IsShuttingDown() bool
- func (c *Client) Log(level int, format string, args ...interface{})
- func (c *Client) ProcessLineFromClient(line string) (string, error)
- func (c *Client) ProcessLineFromUpstream(data string) string
- func (c *Client) Ready()
- func (c *Client) SendClientSignal(signal string, args ...string)
- func (c *Client) SendIrcError(message string)
- func (c *Client) SendIrcFail(params ...string)
- func (c *Client) StartShutdown(reason string)
- func (c *Client) TrafficLog(isUpstream bool, toGateway bool, traffic string)
- type ClientSignal
- type Config
- type ConfigProxy
- type ConfigServer
- type ConfigUpstream
- type Gateway
- func (s *Gateway) Close()
- func (s *Gateway) GetRemoteAddressFromRequest(req *http.Request) net.IP
- func (s *Gateway) IsClientOriginAllowed(originHeader string) bool
- func (s *Gateway) Log(level int, format string, args ...interface{})
- func (s *Gateway) NewClient() *Client
- func (s *Gateway) Start()
- func (s *Gateway) WaitClose()
- type Hook
- type HookClientInit
- type HookClientState
- type HookGatewayClosing
- type HookIrcConnectionPre
- type HookIrcLine
- type HookStatus
- type LEManager
- type MessageTagManager
- func (tags *MessageTagManager) AddTagsFromMessage(client *Client, fromNick string, msg *irc.Message)
- func (tags *MessageTagManager) CanMessageContainClientTags(msg *irc.Message) bool
- func (tags *MessageTagManager) GetTagsFromMessage(client *Client, fromNick string, msg *irc.Message) (MessageTags, bool)
- func (tags *MessageTagManager) RunGarbageCollectionLoop()
- type MessageTags
- type ThrottledStringChannel
- type TransportKiwiirc
- type TransportKiwiircChannel
- type TransportSockjs
- type TransportTcp
- type TransportWebsocket
Constants ¶
View Source
const ( // ClientStateIdle - Client connected and just sat there ClientStateIdle = "idle" // ClientStateConnecting - Connecting upstream ClientStateConnecting = "connecting" // ClientStateRegistering - Registering to the IRC network ClientStateRegistering = "registering" // ClientStateConnected - Connected upstream ClientStateConnected = "connected" // ClientStateEnding - Client is ending its connection ClientStateEnding = "ending" )
Variables ¶
View Source
var MAX_EXTJWT_SIZE = 200
View Source
var (
Version = "-"
)
Functions ¶
func HookRegister ¶
func HookRegister(hookName string, p interface{})
Types ¶
type Client ¶
type Client struct { Gateway *Gateway Id uint64 State string EndWG sync.WaitGroup SeenQuit bool Recv chan string ThrottledRecv *ThrottledStringChannel UpstreamRecv chan string UpstreamSend chan string UpstreamStarted bool UpstreamConfig *ConfigUpstream RemoteAddr string RemoteHostname string RemotePort int DestHost string DestPort int DestTLS bool IrcState *irc.State Encoding string // Tags get passed upstream via the WEBIRC command Tags map[string]string // Captchas may be needed to verify a client RequiresVerification bool Verified bool SentPass bool // Signals for the transport to make use of (data, connection state, etc) Signals chan ClientSignal Features struct { Messagetags bool Metadata bool ExtJwt bool } // The specific message-tags CAP that the client has requested if we are wrapping it RequestedMessageTagsCap string // Prefix used by the server when sending its own messages ServerMessagePrefix irc.Mask // contains filtered or unexported fields }
Client - Connecting client struct
func (*Client) IsShuttingDown ¶
func (*Client) ProcessLineFromClient ¶
* ProcessLineFromClient * Processes and makes any changes to a line of data sent from a client
func (*Client) ProcessLineFromUpstream ¶
* ProcessLineFromUpstream * Processes and makes any changes to a line of data sent from an upstream
func (*Client) SendClientSignal ¶
func (*Client) SendIrcError ¶
func (*Client) SendIrcFail ¶
func (*Client) StartShutdown ¶
type ClientSignal ¶
type ClientSignal [3]string
type Config ¶
type Config struct { ConfigFile string LogLevel int Gateway bool GatewayName string GatewayWhitelist []glob.Glob GatewayThrottle int GatewayTimeout int GatewayWebircPassword map[string]string GatewayProtocol string GatewayLocalAddr string Proxy ConfigServer Upstreams []ConfigUpstream Servers []ConfigServer ServerTransports []string RemoteOrigins []glob.Glob ReverseProxies []net.IPNet Webroot string ClientRealname string ClientUsername string ClientHostname string Identd bool RequiresVerification bool SendQuitOnClientClose string ReCaptchaURL string ReCaptchaSecret string ReCaptchaKey string Secret string Plugins []string DnsblServers []string // DnsblAction - "deny" = deny the connection. "verify" = require verification DnsblAction string // contains filtered or unexported fields }
Config - Config options for the running app
func (*Config) CurrentConfigFile ¶
CurrentConfigFile - Return the full path or command for the config file in use
func (*Config) ResolvePath ¶
ConfigResolvePath - If relative, resolve a path to it's full absolute path relative to the config file
func (*Config) SetConfigFile ¶
type ConfigProxy ¶
type ConfigServer ¶
type ConfigServer struct { LocalAddr string BindMode os.FileMode Port int TLS bool CertFile string KeyFile string LetsEncryptCacheDir string }
ConfigServer - A web server config
type ConfigUpstream ¶
type ConfigUpstream struct { // Plugins may assign an arbitary address to an upstream network NetworkCommonAddress string Hostname string Port int TLS bool Timeout int Throttle int WebircPassword string ServerPassword string GatewayName string Proxy *ConfigProxy Protocol string LocalAddr string }
ConfigUpstream - An upstream config
type Gateway ¶
type Gateway struct { Config *Config HttpRouter *http.ServeMux LogOutput chan string Clients cmap.ConcurrentMap Acme *LEManager Function string // contains filtered or unexported fields }
func NewGateway ¶
func (*Gateway) GetRemoteAddressFromRequest ¶
func (*Gateway) IsClientOriginAllowed ¶
type HookClientInit ¶
*
- HookClientInit
- Dispatched directly after a new Client instance has been created
- Types: client.init
func (*HookClientInit) Dispatch ¶
func (h *HookClientInit) Dispatch(eventType string)
type HookClientState ¶
*
- HookClientState
- Dispatched after a client connects or disconnects
- Types: client.state
func (*HookClientState) Dispatch ¶
func (h *HookClientState) Dispatch(eventType string)
type HookGatewayClosing ¶
type HookGatewayClosing struct {
Hook
}
*
- HookGatewayClosing
- Dispatched when the gateway has been told to shutdown
- Types: gateway.closing
func (*HookGatewayClosing) Dispatch ¶
func (h *HookGatewayClosing) Dispatch(eventType string)
type HookIrcConnectionPre ¶
type HookIrcConnectionPre struct { Hook Client *Client UpstreamConfig *ConfigUpstream }
*
- HookIrcConnectionPre
- Dispatched just before an IRC connection is attempted
- Types: irc.connection.pre
func (*HookIrcConnectionPre) Dispatch ¶
func (h *HookIrcConnectionPre) Dispatch(eventType string)
type HookIrcLine ¶
type HookIrcLine struct { Hook Client *Client UpstreamConfig *ConfigUpstream Line string Message *irc.Message ToServer bool }
*
- HookIrcLine
- Dispatched when either:
- * A line arrives from the IRCd, before sending to the client
- * A line arrives from the client, before sending to the IRCd
- Types: irc.line
func (*HookIrcLine) Dispatch ¶
func (h *HookIrcLine) Dispatch(eventType string)
type HookStatus ¶
*
- HookStatus
- Dispatched for each line output of the _status HTTP request
- Types: status.client
func (*HookStatus) Dispatch ¶
func (h *HookStatus) Dispatch(eventType string)
type LEManager ¶
type LEManager struct { // ensure only one instance of the manager and handler is running // while allowing multiple listeners to use it Mutex sync.Mutex Manager *autocert.Manager // contains filtered or unexported fields }
func NewLetsEncryptManager ¶
type MessageTagManager ¶
func NewMessageTagManager ¶
func NewMessageTagManager() *MessageTagManager
func (*MessageTagManager) AddTagsFromMessage ¶
func (tags *MessageTagManager) AddTagsFromMessage(client *Client, fromNick string, msg *irc.Message)
func (*MessageTagManager) CanMessageContainClientTags ¶
func (tags *MessageTagManager) CanMessageContainClientTags(msg *irc.Message) bool
func (*MessageTagManager) GetTagsFromMessage ¶
func (tags *MessageTagManager) GetTagsFromMessage(client *Client, fromNick string, msg *irc.Message) (MessageTags, bool)
func (*MessageTagManager) RunGarbageCollectionLoop ¶
func (tags *MessageTagManager) RunGarbageCollectionLoop()
type MessageTags ¶
type ThrottledStringChannel ¶
type ThrottledStringChannel struct { Input chan<- string Output <-chan string *rate.Limiter // contains filtered or unexported fields }
func NewThrottledStringChannel ¶
func NewThrottledStringChannel(wrappedChan chan string, limiter *rate.Limiter) *ThrottledStringChannel
type TransportKiwiirc ¶
type TransportKiwiirc struct {
// contains filtered or unexported fields
}
func (*TransportKiwiirc) Init ¶
func (t *TransportKiwiirc) Init(g *Gateway)
type TransportKiwiircChannel ¶
type TransportSockjs ¶
type TransportSockjs struct {
// contains filtered or unexported fields
}
func (*TransportSockjs) Init ¶
func (t *TransportSockjs) Init(g *Gateway)
type TransportTcp ¶
type TransportTcp struct {
// contains filtered or unexported fields
}
func (*TransportTcp) Init ¶
func (t *TransportTcp) Init(g *Gateway)
func (*TransportTcp) Start ¶
func (t *TransportTcp) Start(lAddr string)
type TransportWebsocket ¶
type TransportWebsocket struct {
// contains filtered or unexported fields
}
func (*TransportWebsocket) Init ¶
func (t *TransportWebsocket) Init(g *Gateway)
Click to show internal directories.
Click to hide internal directories.