server: mask router

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-03-24 13:26:36 +03:00
parent 8742b55305
commit dcdf133d5b
2 changed files with 10 additions and 2 deletions

View File

@ -39,8 +39,12 @@ type Options struct {
Meter meter.Meter Meter meter.Meter
// Transport holds the transport // Transport holds the transport
Transport transport.Transport Transport transport.Transport
// Router for requests
Router Router /*
// Router for requests
Router Router
*/
// Listener may be passed if already created // Listener may be passed if already created
Listener net.Listener Listener net.Listener
// Wait group // Wait group
@ -262,12 +266,14 @@ func TLSConfig(t *tls.Config) Option {
} }
} }
/*
// WithRouter sets the request router // WithRouter sets the request router
func WithRouter(r Router) Option { func WithRouter(r Router) Option {
return func(o *Options) { return func(o *Options) {
o.Router = r o.Router = r
} }
} }
*/
// Wait tells the server to wait for requests to finish before exiting // Wait tells the server to wait for requests to finish before exiting
// If `wg` is nil, server only wait for completion of rpc handler. // If `wg` is nil, server only wait for completion of rpc handler.

View File

@ -65,6 +65,7 @@ type Server interface {
String() string String() string
} }
/*
// Router handle serving messages // Router handle serving messages
type Router interface { type Router interface {
// ProcessMessage processes a message // ProcessMessage processes a message
@ -72,6 +73,7 @@ type Router interface {
// ServeRequest processes a request to completion // ServeRequest processes a request to completion
ServeRequest(ctx context.Context, req Request, rsp Response) error ServeRequest(ctx context.Context, req Request, rsp Response) error
} }
*/
// Message is an async message interface // Message is an async message interface
type Message interface { type Message interface {