api/router: extend interface
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
e6f870bda7
commit
8930c3fbb7
@ -11,6 +11,8 @@ import (
|
|||||||
type Router interface {
|
type Router interface {
|
||||||
// Returns options
|
// Returns options
|
||||||
Options() Options
|
Options() Options
|
||||||
|
// Init initialize router
|
||||||
|
Init(...Option) error
|
||||||
// Stop the router
|
// Stop the router
|
||||||
Close() error
|
Close() error
|
||||||
// Endpoint returns an api.Service endpoint or an error if it does not exist
|
// 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
|
Deregister(ep *api.Endpoint) error
|
||||||
// Route returns an api.Service route
|
// Route returns an api.Service route
|
||||||
Route(r *http.Request) (*api.Service, error)
|
Route(r *http.Request) (*api.Service, error)
|
||||||
|
// String represenation of router
|
||||||
|
String() string
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user