Documentation
¶
Index ¶
- func NewListener(port string) (net.Listener, error)
- func SendMessage(conn net.Conn, msg []byte) error
- type ConnectedUser
- type Server
- func (s *Server) ActionKeepAlive(username string)
- func (s *Server) ActionMessageType(p encoding.MsgProtocol, data []byte) error
- func (s *Server) AddMsgToHistory(msg []byte)
- func (s *Server) AddToLiveConns(userKey string, conn *ConnectedUser) error
- func (s *Server) AwaitClientAESKey(conn net.Conn, cliPubKey *rsa.PublicKey) ([]byte, error)
- func (s *Server) AwaitHandshake(conn net.Conn) (encoding.MsgProtocol, error)
- func (s *Server) AwaitMessage(user *ConnectedUser)
- func (s *Server) BanUser(username string) bool
- func (s *Server) BroadcastActiveUsers()
- func (s *Server) BroadcastMessage(sentBy string, message []byte) []error
- func (s *Server) CloseConnection(user *ConnectedUser)
- func (s *Server) CloseConnectionForUser(username string)
- func (s *Server) DenyConnection(conn net.Conn, errMsg string)
- func (s *Server) GetAllActiveUsers() []UserInfo
- func (s *Server) IsActiveUser(username string) (*ConnectedUser, bool)
- func (s *Server) NewConnection(newUser ConnectedUser) (*ConnectedUser, error)
- func (s *Server) ProcessGroupMessage(sentBy string, msg []byte)
- func (s *Server) SendAESKey(conn net.Conn, cliPubKey *rsa.PublicKey) error
- func (s *Server) SendDisconnectionNotification(user *ConnectedUser)
- func (s *Server) SendHandshakeResponse(conn net.Conn) error
- func (s *Server) SendHistory(user *ConnectedUser) error
- func (s *Server) SentMessageToClient(client string, msg []byte) error
- func (s *Server) SetHostUser(username string)
- func (s *Server) StartListening()
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnectedUser ¶
type ConnectedUser struct { AESKey []byte // contains filtered or unexported fields }
func (*ConnectedUser) ProcessMessage ¶
func (cu *ConnectedUser) ProcessMessage(s *Server)
type Server ¶
type Server struct { LiveConns map[string]*ConnectedUser Listener net.Listener MsgHistory [][]byte MaxMsgHistorySize uint MaxConnectionLimit uint Blacklist []string // contains filtered or unexported fields }
func (*Server) ActionKeepAlive ¶
func (*Server) ActionMessageType ¶
func (s *Server) ActionMessageType(p encoding.MsgProtocol, data []byte) error
func (*Server) AddMsgToHistory ¶
func (*Server) AddToLiveConns ¶
func (s *Server) AddToLiveConns(userKey string, conn *ConnectedUser) error
func (*Server) AwaitClientAESKey ¶
func (*Server) AwaitHandshake ¶
func (*Server) AwaitMessage ¶
func (s *Server) AwaitMessage(user *ConnectedUser)
func (*Server) BroadcastActiveUsers ¶
func (s *Server) BroadcastActiveUsers()
func (*Server) BroadcastMessage ¶
func (*Server) CloseConnection ¶
func (s *Server) CloseConnection(user *ConnectedUser)
func (*Server) CloseConnectionForUser ¶
func (*Server) GetAllActiveUsers ¶
func (*Server) IsActiveUser ¶
func (s *Server) IsActiveUser(username string) (*ConnectedUser, bool)
func (*Server) NewConnection ¶
func (s *Server) NewConnection(newUser ConnectedUser) (*ConnectedUser, error)
func (*Server) ProcessGroupMessage ¶
func (*Server) SendAESKey ¶
func (*Server) SendDisconnectionNotification ¶
func (s *Server) SendDisconnectionNotification(user *ConnectedUser)
func (*Server) SendHistory ¶
func (s *Server) SendHistory(user *ConnectedUser) error
func (*Server) SentMessageToClient ¶
func (*Server) SetHostUser ¶
func (*Server) StartListening ¶
func (s *Server) StartListening()
Click to show internal directories.
Click to hide internal directories.