1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-18 22:17:44 +02:00
Files
agent
api
handler
internal
proto
resolver
router
registry
options.go
router.go
server
api.go
api_test.go
broker
client
codec
config
debug
errors
metadata
monitor
network
plugin
proxy
registry
router
runtime
server
service
store
sync
transport
tunnel
util
web
.gitignore
.travis.yml
LICENSE
README.md
README.zh-cn.md
common_test.go
function.go
function_test.go
go.mod
go.sum
micro.go
options.go
publisher.go
service.go
service_test.go
wrapper.go
wrapper_test.go
go-micro/api/router/router.go

21 lines
490 B
Go
Raw Normal View History

2019-06-03 18:44:43 +01:00
// Package router provides api service routing
package router
import (
"net/http"
"github.com/micro/go-micro/api"
)
// Router is used to determine an endpoint for a request
type Router interface {
// Returns options
Options() Options
// Stop the router
Close() error
// Endpoint returns an api.Service endpoint or an error if it does not exist
Endpoint(r *http.Request) (*api.Service, error)
// Route returns an api.Service route
Route(r *http.Request) (*api.Service, error)
}