grpc

package
v0.0.0-...-4fe0d4a Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopularEncoder

func PopularEncoder(ctx context.Context, response interface{}) (grpcResponse interface{}, err error)

PopularEncoder encode popularResponse to pb message

func RegisterAutocompleteServer

func RegisterAutocompleteServer(grpcServer *goGRPC.Server, autocompleteServer ServerBinder)

RegisterAutocompleteServer register pb service to grpc server

func RequestDecoder

func RequestDecoder(ctx context.Context, req interface{}) (request interface{}, err error)

RequestDecoder request into autocompleteRequest

func SuggestionEncoder

func SuggestionEncoder(ctx context.Context, response interface{}) (grpcResponse interface{}, err error)

SuggestionEncoder encode suggestionResponse to pb message

Types

type ServerBinder

type ServerBinder struct {
	// contains filtered or unexported fields
}

ServerBinder Implement server interface from the protobuf definition it will be called by grpc server Why the name is server binder, it bind the tego server with the pb serve, hence the name is server binder

func MakeServerBinder

func MakeServerBinder(suggestionHandler grpc.Handler, popularHandler grpc.Handler) ServerBinder

MakeServerBinder returns autocomplete service grpc server binder

func (ServerBinder) GetPopular

GetPopular handler for popular service

func (ServerBinder) GetSuggestion

GetSuggestion handler for suggestion service

Jump to

Keyboard shortcuts

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