api/router: extend interface

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-01-10 01:54:21 +03:00
parent e6f870bda7
commit 8930c3fbb7

View File

@ -11,6 +11,8 @@ import (
type Router interface {
// Returns options
Options() Options
// Init initialize router
Init(...Option) error
// Stop the router
Close() error
// Endpoint returns an api.Service endpoint or an error if it does not exist
@ -21,4 +23,6 @@ type Router interface {
Deregister(ep *api.Endpoint) error
// Route returns an api.Service route
Route(r *http.Request) (*api.Service, error)
// String represenation of router
String() string
}