17 lines
433 B
Go
17 lines
433 B
Go
package server
|
|
|
|
import (
|
|
"git.loafle.net/commons/server-go/internal"
|
|
)
|
|
|
|
type Servlet interface {
|
|
ServletCtx(serverCtx ServerCtx) ServletCtx
|
|
|
|
Init(serverCtx ServerCtx) error
|
|
Destroy(serverCtx ServerCtx)
|
|
|
|
OnConnect(servletCtx ServletCtx, conn *internal.Conn)
|
|
Handle(servletCtx ServletCtx, stopChan <-chan struct{}, doneChan chan<- struct{}, readChan <-chan []byte, writeChan chan<- []byte)
|
|
OnDisconnect(servletCtx ServletCtx)
|
|
}
|