Documentation ¶
Overview ¶
Code generated by turbo. DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GrpcSwitcher = func(s turbo.Servable, methodName string, resp http.ResponseWriter, req *http.Request) (rpcResponse interface{}, err error) { callOptions, header, trailer, peer := turbo.CallOptions(methodName, req) switch methodName { case "SayHello": request := &g.SayHelloRequest{} err = turbo.BuildRequest(s, request, req) if err != nil { return nil, err } rpcResponse, err = s.Service().(g.HelloClient).SayHello(req.Context(), request, callOptions...) case "SayWorld": request := &g.SayWorldRequest{} err = turbo.BuildRequest(s, request, req) if err != nil { return nil, err } rpcResponse, err = s.Service().(g.WorldClient).SayWorld(req.Context(), request, callOptions...) default: return nil, errors.New("No such method[" + methodName + "]") } turbo.WithCallOptions(req, header, trailer, peer) return }
GrpcSwitcher is a runtime func with which a server starts.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.