Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Version the version of goes. Version = 0.1 // MaxUDPPackageSize max udp package size. MaxUDPPackageSize = 65536 // StatusStarting the status of starting. StatusStarting = 1 // StatusRunning the status of running. StatusRunning = 2 // StatusShutdown the status of shutdown. StatusShutdown = 4 // StatusReloading the status of reloading. StatusReloading = 8 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Goer ¶
type Goer struct { // Transport the protocol of transport layer, if transport layer protocol is empty, // the default protocol is tcp. Transport string // Protocol the protocol of application layer, the type is interface of protocol, // if no set, the default protocol is tcp. Protocol protocols.Protocol // Daemon daemon start. Daemon bool // StdoutFile stdout file. StdoutFile string // LogFile log file. LogFile string // PidFile pid file. PidFile string // Connections store all Connections of client. Connections connections.CStore // OnConnect emitted when a socket connection is successfully established. OnConnect func(connection connections.Connection) // OnMessage emitted when data is received. OnMessage func(connection connections.Connection, data []byte) // OnClose emitted when other end of the socket sends a FIN packet. OnClose func(connection connections.Connection) // OnError emitted when an error occurs with connection. OnError func(connection connections.Connection, code int, message string) // OnBufferFull emitted when the send buffer becomes full. OnBufferFull func(connection connections.Connection) // OnBufferDrain emitted when the send buffer is empty. OnBufferDrain func(connection connections.Connection) // OnStop emitted when goer process stop. OnStop func() // OnReload emitted when goer process get reload signal. OnReload func() // contains filtered or unexported fields }
Goer the main-goroutine server.
Directories ¶
Path | Synopsis |
---|---|
base struct of connection.
|
base struct of connection. |
Package Timer is timed contain, base on Time wheel algorithm.
|
Package Timer is timed contain, base on Time wheel algorithm. |
frame protocol Protocol the interface of protocol, include three method, you can define custom protocol through implement three method.
|
frame protocol Protocol the interface of protocol, include three method, you can define custom protocol through implement three method. |
http
http this simple http protocol.
|
http this simple http protocol. |
Click to show internal directories.
Click to hide internal directories.