micro-server-tcp/handler.go
Vasiliy Tolstov 4d9270dd9b update for latest micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-01-29 15:16:03 +03:00

36 lines
565 B
Go

package tcp
import (
"net"
"github.com/unistack-org/micro/v3/register"
"github.com/unistack-org/micro/v3/server"
)
type Handler interface {
Serve(net.Conn)
}
type tcpHandler struct {
opts server.HandlerOptions
eps []*register.Endpoint
hd interface{}
maxMsgSize int
}
func (h *tcpHandler) Name() string {
return "handler"
}
func (h *tcpHandler) Handler() interface{} {
return h.hd
}
func (h *tcpHandler) Endpoints() []*register.Endpoint {
return h.eps
}
func (h *tcpHandler) Options() server.HandlerOptions {
return h.opts
}