Vasiliy Tolstov
4470cb69a2
All checks were successful
test / test (push) Successful in 2m40s
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
30 lines
406 B
Go
30 lines
406 B
Go
package tcp
|
|
|
|
import (
|
|
"net"
|
|
|
|
"go.unistack.org/micro/v3/server"
|
|
)
|
|
|
|
type Handler interface {
|
|
Serve(net.Conn)
|
|
}
|
|
|
|
type tcpHandler struct {
|
|
opts server.HandlerOptions
|
|
hd interface{}
|
|
maxMsgSize int
|
|
}
|
|
|
|
func (h *tcpHandler) Name() string {
|
|
return "handler"
|
|
}
|
|
|
|
func (h *tcpHandler) Handler() interface{} {
|
|
return h.hd
|
|
}
|
|
|
|
func (h *tcpHandler) Options() server.HandlerOptions {
|
|
return h.opts
|
|
}
|