Documentation ¶
Index ¶
- func PopularEncoder(ctx context.Context, response interface{}) (grpcResponse interface{}, err error)
- func RegisterAutocompleteServer(grpcServer *goGRPC.Server, autocompleteServer ServerBinder)
- func RequestDecoder(ctx context.Context, req interface{}) (request interface{}, err error)
- func SuggestionEncoder(ctx context.Context, response interface{}) (grpcResponse interface{}, err error)
- type ServerBinder
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 ¶
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 ¶
func (s ServerBinder) GetPopular(ctx context.Context, req *pb.AutocompleteRequest) (*pb.PopularResponse, error)
GetPopular handler for popular service
func (ServerBinder) GetSuggestion ¶
func (s ServerBinder) GetSuggestion(ctx context.Context, req *pb.AutocompleteRequest) (*pb.SuggestionResponse, error)
GetSuggestion handler for suggestion service
Click to show internal directories.
Click to hide internal directories.