gen

package
v0.0.0-...-a864060 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL