Documentation ¶
Index ¶
- func BytesFromData(data interface{}) ([]byte, error)
- func DetermineType(data interface{}) (int, error)
- func Parse(r io.Reader) (value interface{}, size int, err error)
- type Client
- type CloseHandler
- type ConnectHandler
- type Connection
- type DisconnectHandler
- type ErrorHandler
- type Packet
- type PacketHandler
- type ReadyHandler
- type Server
- func (s Server) Broadcast(p Packet) error
- func (s Server) Close()
- func (s *Server) Listen(port string) error
- func (s *Server) OnClose(handler CloseHandler)
- func (s *Server) OnConnect(handler ConnectHandler)
- func (s *Server) OnData(handler PacketHandler)
- func (s *Server) OnDisconnect(handler DisconnectHandler)
- func (s *Server) OnError(handler ErrorHandler)
- func (s *Server) OnReady(handler ReadyHandler)
- type ServerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesFromData ¶
func DetermineType ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) Disconnect ¶
type CloseHandler ¶
type CloseHandler func(Server)
type ConnectHandler ¶
type ConnectHandler func(Connection)
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(conn net.Conn, serv Server) *Connection
func (Connection) Close ¶
func (c Connection) Close() error
func (Connection) Write ¶
func (c Connection) Write(p Packet) (err error)
type DisconnectHandler ¶
type DisconnectHandler func(Connection)
type ErrorHandler ¶
type ErrorHandler func(ServerError)
type PacketHandler ¶
type PacketHandler func(Connection, Packet)
type ReadyHandler ¶
type ReadyHandler func(Server)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) OnClose ¶
func (s *Server) OnClose(handler CloseHandler)
func (*Server) OnConnect ¶
func (s *Server) OnConnect(handler ConnectHandler)
func (*Server) OnData ¶
func (s *Server) OnData(handler PacketHandler)
func (*Server) OnDisconnect ¶
func (s *Server) OnDisconnect(handler DisconnectHandler)
func (*Server) OnError ¶
func (s *Server) OnError(handler ErrorHandler)
func (*Server) OnReady ¶
func (s *Server) OnReady(handler ReadyHandler)
type ServerError ¶
type ServerError struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.