server-go/servlet.go

17 lines
433 B
Go
Raw Normal View History

2018-04-03 08:55:48 +00:00
package server
2018-04-04 04:01:26 +00:00
import (
"git.loafle.net/commons/server-go/internal"
)
2018-04-03 08:55:48 +00:00
type Servlet interface {
2018-04-04 04:01:26 +00:00
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)
2018-04-03 08:55:48 +00:00
}