Skip to content

Instantly share code, notes, and snippets.

@ru-rocker
Created February 20, 2017 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ru-rocker/2599b1cf86e04f98a6b6357625fa4407 to your computer and use it in GitHub Desktop.
Save ru-rocker/2599b1cf86e04f98a6b6357625fa4407 to your computer and use it in GitHub Desktop.
lorem-grpc client builder
package client
import (
"github.com/ru-rocker/gokit-playground/lorem-grpc"
"github.com/ru-rocker/gokit-playground/lorem-grpc/pb"
grpctransport "github.com/go-kit/kit/transport/grpc"
"google.golang.org/grpc"
)
// Return new lorem_grpc service
func New(conn *grpc.ClientConn) lorem_grpc.Service {
var loremEndpoint = grpctransport.NewClient(
conn, "Lorem", "Lorem",
lorem_grpc.EncodeGRPCLoremRequest,
lorem_grpc.DecodeGRPCLoremResponse,
pb.LoremResponse{},
).Endpoint()
return lorem_grpc.Endpoints{
LoremEndpoint: loremEndpoint,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment