1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 // versions: 3 // - protoc-gen-go-grpc v1.2.0 4 // - protoc (unknown) 5 // source: examples/internal/proto/examplepb/use_go_template.proto 6 7 package examplepb 8 9 import ( 10 context "context" 11 grpc "google.golang.org/grpc" 12 codes "google.golang.org/grpc/codes" 13 status "google.golang.org/grpc/status" 14 ) 15 16 // This is a compile-time assertion to ensure that this generated file 17 // is compatible with the grpc package it is being compiled against. 18 // Requires gRPC-Go v1.32.0 or later. 19 const _ = grpc.SupportPackageIsVersion7 20 21 // LoginServiceClient is the client API for LoginService service. 22 // 23 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 type LoginServiceClient interface { 25 // Login 26 // 27 // {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service. 28 // It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}". 29 // 30 // ## {{.RequestType.Name}} 31 // | Field ID | Name | Type | Description | 32 // | ----------- | --------- | --------------------------------------------------------- | ---------------------------- | {{range .RequestType.Fields}} 33 // | {{.Number}} | {{.Name}} | {{if eq .Label.String "LABEL_REPEATED"}}[]{{end}}{{.Type}} | {{fieldcomments .Message .}} | {{end}} 34 // 35 // ## {{.ResponseType.Name}} 36 // | Field ID | Name | Type | Description | 37 // | ----------- | --------- | ---------------------------------------------------------- | ---------------------------- | {{range .ResponseType.Fields}} 38 // | {{.Number}} | {{.Name}} | {{if eq .Label.String "LABEL_REPEATED"}}[]{{end}}{{.Type}} | {{fieldcomments .Message .}} | {{end}} 39 Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error) 40 // Logout 41 // 42 // {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service. 43 // It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}". 44 // 45 // ## {{.RequestType.Name}} 46 // | Field ID | Name | Type | Description | 47 // | ----------- | --------- | --------------------------------------------------------- | ---------------------------- | {{range .RequestType.Fields}} 48 // | {{.Number}} | {{.Name}} | {{if eq .Label.String "LABEL_REPEATED"}}[]{{end}}{{.Type}} | {{fieldcomments .Message .}} | {{end}} 49 // 50 // ## {{.ResponseType.Name}} 51 // | Field ID | Name | Type | Description | 52 // | ----------- | --------- | ---------------------------------------------------------- | ---------------------------- | {{range .ResponseType.Fields}} 53 // | {{.Number}} | {{.Name}} | {{if eq .Label.String "LABEL_REPEATED"}}[]{{end}}{{.Type}} | {{fieldcomments .Message .}} | {{end}} 54 Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutReply, error) 55 } 56 57 type loginServiceClient struct { 58 cc grpc.ClientConnInterface 59 } 60 61 func NewLoginServiceClient(cc grpc.ClientConnInterface) LoginServiceClient { 62 return &loginServiceClient{cc} 63 } 64 65 func (c *loginServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error) { 66 out := new(LoginReply) 67 err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.LoginService/Login", in, out, opts...) 68 if err != nil { 69 return nil, err 70 } 71 return out, nil 72 } 73 74 func (c *loginServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutReply, error) { 75 out := new(LogoutReply) 76 err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.LoginService/Logout", in, out, opts...) 77 if err != nil { 78 return nil, err 79 } 80 return out, nil 81 } 82 83 // LoginServiceServer is the server API for LoginService service. 84 // All implementations should embed UnimplementedLoginServiceServer 85 // for forward compatibility 86 type LoginServiceServer interface { 87 // Login 88 // 89 // {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service. 90 // It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}". 91 // 92 // ## {{.RequestType.Name}} 93 // | Field ID | Name | Type | Description | 94 // | ----------- | --------- | --------------------------------------------------------- | ---------------------------- | {{range .RequestType.Fields}} 95 // | {{.Number}} | {{.Name}} | {{if eq .Label.String "LABEL_REPEATED"}}[]{{end}}{{.Type}} | {{fieldcomments .Message .}} | {{end}} 96 // 97 // ## {{.ResponseType.Name}} 98 // | Field ID | Name | Type | Description | 99 // | ----------- | --------- | ---------------------------------------------------------- | ---------------------------- | {{range .ResponseType.Fields}} 100 // | {{.Number}} | {{.Name}} | {{if eq .Label.String "LABEL_REPEATED"}}[]{{end}}{{.Type}} | {{fieldcomments .Message .}} | {{end}} 101 Login(context.Context, *LoginRequest) (*LoginReply, error) 102 // Logout 103 // 104 // {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service. 105 // It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}". 106 // 107 // ## {{.RequestType.Name}} 108 // | Field ID | Name | Type | Description | 109 // | ----------- | --------- | --------------------------------------------------------- | ---------------------------- | {{range .RequestType.Fields}} 110 // | {{.Number}} | {{.Name}} | {{if eq .Label.String "LABEL_REPEATED"}}[]{{end}}{{.Type}} | {{fieldcomments .Message .}} | {{end}} 111 // 112 // ## {{.ResponseType.Name}} 113 // | Field ID | Name | Type | Description | 114 // | ----------- | --------- | ---------------------------------------------------------- | ---------------------------- | {{range .ResponseType.Fields}} 115 // | {{.Number}} | {{.Name}} | {{if eq .Label.String "LABEL_REPEATED"}}[]{{end}}{{.Type}} | {{fieldcomments .Message .}} | {{end}} 116 Logout(context.Context, *LogoutRequest) (*LogoutReply, error) 117 } 118 119 // UnimplementedLoginServiceServer should be embedded to have forward compatible implementations. 120 type UnimplementedLoginServiceServer struct { 121 } 122 123 func (UnimplementedLoginServiceServer) Login(context.Context, *LoginRequest) (*LoginReply, error) { 124 return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") 125 } 126 func (UnimplementedLoginServiceServer) Logout(context.Context, *LogoutRequest) (*LogoutReply, error) { 127 return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") 128 } 129 130 // UnsafeLoginServiceServer may be embedded to opt out of forward compatibility for this service. 131 // Use of this interface is not recommended, as added methods to LoginServiceServer will 132 // result in compilation errors. 133 type UnsafeLoginServiceServer interface { 134 mustEmbedUnimplementedLoginServiceServer() 135 } 136 137 func RegisterLoginServiceServer(s grpc.ServiceRegistrar, srv LoginServiceServer) { 138 s.RegisterService(&LoginService_ServiceDesc, srv) 139 } 140 141 func _LoginService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 142 in := new(LoginRequest) 143 if err := dec(in); err != nil { 144 return nil, err 145 } 146 if interceptor == nil { 147 return srv.(LoginServiceServer).Login(ctx, in) 148 } 149 info := &grpc.UnaryServerInfo{ 150 Server: srv, 151 FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.LoginService/Login", 152 } 153 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 154 return srv.(LoginServiceServer).Login(ctx, req.(*LoginRequest)) 155 } 156 return interceptor(ctx, in, info, handler) 157 } 158 159 func _LoginService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 160 in := new(LogoutRequest) 161 if err := dec(in); err != nil { 162 return nil, err 163 } 164 if interceptor == nil { 165 return srv.(LoginServiceServer).Logout(ctx, in) 166 } 167 info := &grpc.UnaryServerInfo{ 168 Server: srv, 169 FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.LoginService/Logout", 170 } 171 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 172 return srv.(LoginServiceServer).Logout(ctx, req.(*LogoutRequest)) 173 } 174 return interceptor(ctx, in, info, handler) 175 } 176 177 // LoginService_ServiceDesc is the grpc.ServiceDesc for LoginService service. 178 // It's only intended for direct use with grpc.RegisterService, 179 // and not to be introspected or modified (even as a copy) 180 var LoginService_ServiceDesc = grpc.ServiceDesc{ 181 ServiceName: "grpc.gateway.examples.internal.proto.examplepb.LoginService", 182 HandlerType: (*LoginServiceServer)(nil), 183 Methods: []grpc.MethodDesc{ 184 { 185 MethodName: "Login", 186 Handler: _LoginService_Login_Handler, 187 }, 188 { 189 MethodName: "Logout", 190 Handler: _LoginService_Logout_Handler, 191 }, 192 }, 193 Streams: []grpc.StreamDesc{}, 194 Metadata: "examples/internal/proto/examplepb/use_go_template.proto", 195 } 196