mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 17:32:25 +00:00
remove w and r fields from GatewayServer and change Handle method
This commit is contained in:
@@ -13,14 +13,11 @@ type serversApiVer string
|
|||||||
|
|
||||||
type ServerApiContract interface {
|
type ServerApiContract interface {
|
||||||
GetVersion() string
|
GetVersion() string
|
||||||
Handle(w http.ResponseWriter, r *http.Request, req rpc.RPCRequest)
|
Handle(r *http.Request, req *rpc.RPCRequest) *rpc.RPCResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
// GeneralServer implements the GeneralServerApiContract and serves as a router for different API versions.
|
// GeneralServer implements the GeneralServerApiContract and serves as a router for different API versions.
|
||||||
type GatewayServer struct {
|
type GatewayServer struct {
|
||||||
w http.ResponseWriter
|
|
||||||
r *http.Request
|
|
||||||
|
|
||||||
// servers holds the registered servers by their API version.
|
// servers holds the registered servers by their API version.
|
||||||
// The key is the version string, and the value is the server implementing GeneralServerApi
|
// The key is the version string, and the value is the server implementing GeneralServerApi
|
||||||
servers map[serversApiVer]ServerApiContract
|
servers map[serversApiVer]ServerApiContract
|
||||||
|
|||||||
Reference in New Issue
Block a user