Skip to content

Instantly share code, notes, and snippets.

@KamilLelonek
Last active April 29, 2019 19:48
Show Gist options
  • Select an option

  • Save KamilLelonek/4e2f359f22b9885f3db2637b38c1b671 to your computer and use it in GitHub Desktop.

Select an option

Save KamilLelonek/4e2f359f22b9885f3db2637b38c1b671 to your computer and use it in GitHub Desktop.
+ import (
+ context "golang.org/x/net/context"
+ grpc "google.golang.org/grpc"
+ )
+ // Reference imports to suppress errors if they are not otherwise used.
+ var _ context.Context
+ var _ grpc.ClientConn
+
+ // This is a compile-time assertion to ensure that this generated file
+ // is compatible with the grpc package it is being compiled against.
+ const _ = grpc.SupportPackageIsVersion4
+
+ // GravatarServiceClient is the client API for GravatarService service.
+ //
+ // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+ type GravatarServiceClient interface {
+ Generate(ctx context.Context, in *GravatarRequest, opts ...grpc.CallOption) (*GravatarResponse, error)
+ }
+
+ type gravatarServiceClient struct {
+ cc *grpc.ClientConn
+ }
+
+ func NewGravatarServiceClient(cc *grpc.ClientConn) GravatarServiceClient {
+ return &gravatarServiceClient{cc}
+ }
+
+ func (c *gravatarServiceClient) Generate(ctx context.Context, in *GravatarRequest, opts ...grpc.CallOption) (*GravatarResponse, error) {
+ out := new(GravatarResponse)
+ err := c.cc.Invoke(ctx, "/gravatar.GravatarService/Generate", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+ }
+
+ // GravatarServiceServer is the server API for GravatarService service.
+ type GravatarServiceServer interface {
+ Generate(context.Context, *GravatarRequest) (*GravatarResponse, error)
+ }
+
+ func RegisterGravatarServiceServer(s *grpc.Server, srv GravatarServiceServer) {
+ s.RegisterService(&_GravatarService_serviceDesc, srv)
+ }
+
+ func _GravatarService_Generate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GravatarRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(GravatarServiceServer).Generate(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/gravatar.GravatarService/Generate",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(GravatarServiceServer).Generate(ctx, req.(*GravatarRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+ }
+
+ var _GravatarService_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "gravatar.GravatarService",
+ HandlerType: (*GravatarServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "Generate",
+ Handler: _GravatarService_Generate_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "gravatar.proto",
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment