Documentation ¶
Overview ¶
Package server contains the server functionality.
Index ¶
Constants ¶
const ( // SoftwareName is the server software's name. SoftwareName = "excessiveircd" // SoftwareVersion is the server's software version. SoftwareVersion = "0.0.1" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CClose ¶
type CClose struct {
Reason string
}
CClose is used to inform the Client that it must immediately close the connection. Reason is used in QUIT messages and sent to the connection, if possible.
type CInitialize ¶
type CInitialize struct{}
CInitialize is used to inform the Client that it needs to initialize. These include pre-registration tasks such as looking up the hostname and checking identd.
type CMessage ¶
CMessage is used to inform the Client of an incoming message that has been parsed and is ready to be acted upon.
type Client ¶
type Client struct { ID uuid.UUID Server *Server Logger *log.Logger Info struct { *irc.Prefix // Client's real name/GECOS Real string // The time at which the client began owning this nickname. This is // primarily used for collision resolution. ChangeTime time.Time } // The time at which this client finished registration. ConnectTime time.Time Registered bool Closed bool IP net.IP Events chan interface{} *sync.RWMutex // contains filtered or unexported fields }
Client represents a client connection.
type Command ¶
type Command struct { Func func(client *Client, message *irc.Message) *CommandError MinimumParams int Registered bool Unregistered bool }
Command represents a command specification.
type CommandError ¶
type CommandError struct { // Numeric is the numeric to use when sending the CommandError to the // Client. // If Numeric is an empty string, Param[0] is sent as a server notification // instead of a numeric. Numeric string Params []string }
CommandError is an error returned by a Command Func.
type ListenPort ¶
ListenPort represents a port to be listened on. IP specifies the local IP address to listen on. Port specifies the port number to listen on. TLS specifies the TLS configuration to use. If nil, the port listens for cleartext traffic.
type SChangeNick ¶
SChangeNick is used to inform the server that a client has changed their nickname and needs to be reregistered.
type SDeregisterClient ¶
type SDeregisterClient struct { Client *Client Reply chan struct{} }
SDeregisterClient is used to inform the server that a client has disconnected and registration information needs to be discarded.
type SRegisterClient ¶
SRegisterClient is used to inform the server that a client has sent all registration information and is ready to be registered. A boolean is sent on the reply channel stating whether or not this registration was successful.
type Server ¶
type Server struct { ID uuid.UUID Name string Network string Logger *log.Logger Events chan interface{} Clients map[string]*Client Listeners []net.Listener }
Server represents a local server.
func (*Server) FriendlyName ¶
FriendlyName is a convenience function to return the server's display name.