chore: rename simple_bank to api_tmpl and clean up for template use
Rename the module, proto service, and all identifiers from simple_bank/ SimpleBank to api_tmpl/ApiTmpl, and regenerate the gRPC/gateway/swagger/ mock code accordingly. - Scrub real secrets (SMTP password, auth token secret) from api.env/ api_test.env, untrack them, and add api.env.example/api_test.env.example - Remove committed build artifacts (tmp/main, tmp/build-errors.log, dbml-error.log) and gitignore them going forward - Fix Dockerfile paths (build target, migrations copy) that referenced a stale project layout - Rewrite README to match the actual cmd/ + internal/ structure and add a "using this as a template" section
This commit is contained in:
1 parent
961bdd81d4
commit
c4ee0ce4dc
71 files changed
+744
-743
No files matched your search
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v6.33.1
|
||||
// protoc v7.36.0
|
||||
// source: rpc_create_user.proto
|
||||
|
||||
package pb
|
||||
@@ -145,7 +145,7 @@ const file_rpc_create_user_proto_rawDesc = "" +
|
||||
"\x05email\x18\x03 \x01(\tR\x05email\x12\x1a\n" +
|
||||
"\bpassword\x18\x04 \x01(\tR\bpassword\"2\n" +
|
||||
"\x12CreateUserResponse\x12\x1c\n" +
|
||||
"\x04user\x18\x01 \x01(\v2\b.pb.UserR\x04userB,Z*github.com/FernandoJVideira/simple_bank/pbb\x06proto3"
|
||||
"\x04user\x18\x01 \x01(\v2\b.pb.UserR\x04userB)Z'github.com/FernandoJVideira/api_tmpl/pbb\x06proto3"
|
||||
|
||||
var (
|
||||
file_rpc_create_user_proto_rawDescOnce sync.Once
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v6.33.1
|
||||
// protoc v7.36.0
|
||||
// source: rpc_login_user.proto
|
||||
|
||||
package pb
|
||||
@@ -174,7 +174,7 @@ const file_rpc_login_user_proto_rawDesc = "" +
|
||||
"\x17access_token_expires_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\x14accessTokenExpiresAt\x12#\n" +
|
||||
"\rrefresh_token\x18\x04 \x01(\tR\frefreshToken\x12S\n" +
|
||||
"\x18refresh_token_expires_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\x15refreshTokenExpiresAt\x12\x1c\n" +
|
||||
"\x04user\x18\x06 \x01(\v2\b.pb.UserR\x04userB,Z*github.com/FernandoJVideira/simple_bank/pbb\x06proto3"
|
||||
"\x04user\x18\x06 \x01(\v2\b.pb.UserR\x04userB)Z'github.com/FernandoJVideira/api_tmpl/pbb\x06proto3"
|
||||
|
||||
var (
|
||||
file_rpc_login_user_proto_rawDescOnce sync.Once
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v6.33.1
|
||||
// protoc v7.36.0
|
||||
// source: rpc_update_user.proto
|
||||
|
||||
package pb
|
||||
@@ -149,7 +149,7 @@ const file_rpc_update_user_proto_rawDesc = "" +
|
||||
"\x06_emailB\v\n" +
|
||||
"\t_password\"2\n" +
|
||||
"\x12UpdateUserResponse\x12\x1c\n" +
|
||||
"\x04user\x18\x01 \x01(\v2\b.pb.UserR\x04userB,Z*github.com/FernandoJVideira/simple_bank/pbb\x06proto3"
|
||||
"\x04user\x18\x01 \x01(\v2\b.pb.UserR\x04userB)Z'github.com/FernandoJVideira/api_tmpl/pbb\x06proto3"
|
||||
|
||||
var (
|
||||
file_rpc_update_user_proto_rawDescOnce sync.Once
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v6.33.1
|
||||
// protoc v7.36.0
|
||||
// source: rpc_verify_email.proto
|
||||
|
||||
package pb
|
||||
@@ -127,7 +127,7 @@ const file_rpc_verify_email_proto_rawDesc = "" +
|
||||
"\x04code\x18\x02 \x01(\tR\x04code\"6\n" +
|
||||
"\x13VerifyEmailResponse\x12\x1f\n" +
|
||||
"\vis_verified\x18\x01 \x01(\bR\n" +
|
||||
"isVerifiedB,Z*github.com/FernandoJVideira/simple_bank/pbb\x06proto3"
|
||||
"isVerifiedB)Z'github.com/FernandoJVideira/api_tmpl/pbb\x06proto3"
|
||||
|
||||
var (
|
||||
file_rpc_verify_email_proto_rawDescOnce sync.Once
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v7.36.0
|
||||
// source: service_api_tmpl.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
var File_service_api_tmpl_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_service_api_tmpl_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x16service_api_tmpl.proto\x12\x02pb\x1a\x1cgoogle/api/annotations.proto\x1a\x15rpc_create_user.proto\x1a\x14rpc_login_user.proto\x1a\x15rpc_update_user.proto\x1a\x16rpc_verify_email.proto\x1a.protoc-gen-openapiv2/options/annotations.proto2\x8b\x04\n" +
|
||||
"\aApiTmpl\x12{\n" +
|
||||
"\n" +
|
||||
"CreateUser\x12\x15.pb.CreateUserRequest\x1a\x16.pb.CreateUserResponse\">\x92A!\x12\vCreate User\x1a\x12Create a new user.\x82\xd3\xe4\x93\x02\x14:\x01*\"\x0f/v1/create_user\x12{\n" +
|
||||
"\tLoginUser\x12\x14.pb.LoginUserRequest\x1a\x15.pb.LoginUserResponse\"A\x92A%\x12\n" +
|
||||
"Login User\x1a\x17Login an existing user.\x82\xd3\xe4\x93\x02\x13:\x01*\"\x0e/v1/login_user\x12\x81\x01\n" +
|
||||
"\vVerifyEmail\x12\x16.pb.VerifyEmailRequest\x1a\x17.pb.VerifyEmailResponse\"A\x92A&\x12\fVerify Email\x1a\x16Verify a user's email.\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/verify_email\x12\x81\x01\n" +
|
||||
"\n" +
|
||||
"UpdateUser\x12\x15.pb.UpdateUserRequest\x1a\x16.pb.UpdateUserResponse\"D\x92A'\x12\vUpdate User\x1a\x18Update an existing user.\x82\xd3\xe4\x93\x02\x14:\x01*2\x0f/v1/update_userB\x92\x01\x92Af\x12d\n" +
|
||||
"\fAPI Template\"M\n" +
|
||||
"\bfvideira\x12,https://github.com/FernandoJVideira/api_tmpl\x1a\[email protected]\x050.0.1Z'github.com/FernandoJVideira/api_tmpl/pbb\x06proto3"
|
||||
|
||||
var file_service_api_tmpl_proto_goTypes = []any{
|
||||
(*CreateUserRequest)(nil), // 0: pb.CreateUserRequest
|
||||
(*LoginUserRequest)(nil), // 1: pb.LoginUserRequest
|
||||
(*VerifyEmailRequest)(nil), // 2: pb.VerifyEmailRequest
|
||||
(*UpdateUserRequest)(nil), // 3: pb.UpdateUserRequest
|
||||
(*CreateUserResponse)(nil), // 4: pb.CreateUserResponse
|
||||
(*LoginUserResponse)(nil), // 5: pb.LoginUserResponse
|
||||
(*VerifyEmailResponse)(nil), // 6: pb.VerifyEmailResponse
|
||||
(*UpdateUserResponse)(nil), // 7: pb.UpdateUserResponse
|
||||
}
|
||||
var file_service_api_tmpl_proto_depIdxs = []int32{
|
||||
0, // 0: pb.ApiTmpl.CreateUser:input_type -> pb.CreateUserRequest
|
||||
1, // 1: pb.ApiTmpl.LoginUser:input_type -> pb.LoginUserRequest
|
||||
2, // 2: pb.ApiTmpl.VerifyEmail:input_type -> pb.VerifyEmailRequest
|
||||
3, // 3: pb.ApiTmpl.UpdateUser:input_type -> pb.UpdateUserRequest
|
||||
4, // 4: pb.ApiTmpl.CreateUser:output_type -> pb.CreateUserResponse
|
||||
5, // 5: pb.ApiTmpl.LoginUser:output_type -> pb.LoginUserResponse
|
||||
6, // 6: pb.ApiTmpl.VerifyEmail:output_type -> pb.VerifyEmailResponse
|
||||
7, // 7: pb.ApiTmpl.UpdateUser:output_type -> pb.UpdateUserResponse
|
||||
4, // [4:8] is the sub-list for method output_type
|
||||
0, // [0:4] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_service_api_tmpl_proto_init() }
|
||||
func file_service_api_tmpl_proto_init() {
|
||||
if File_service_api_tmpl_proto != nil {
|
||||
return
|
||||
}
|
||||
file_rpc_create_user_proto_init()
|
||||
file_rpc_login_user_proto_init()
|
||||
file_rpc_update_user_proto_init()
|
||||
file_rpc_verify_email_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_service_api_tmpl_proto_rawDesc), len(file_service_api_tmpl_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_service_api_tmpl_proto_goTypes,
|
||||
DependencyIndexes: file_service_api_tmpl_proto_depIdxs,
|
||||
}.Build()
|
||||
File_service_api_tmpl_proto = out.File
|
||||
file_service_api_tmpl_proto_goTypes = nil
|
||||
file_service_api_tmpl_proto_depIdxs = nil
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: service_simple_bank.proto
|
||||
// source: service_api_tmpl.proto
|
||||
|
||||
/*
|
||||
Package pb is a reverse proxy.
|
||||
@@ -35,7 +35,7 @@ var (
|
||||
_ = metadata.Join
|
||||
)
|
||||
|
||||
func request_SimpleBank_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, client SimpleBankClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
func request_ApiTmpl_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, client ApiTmplClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq CreateUserRequest
|
||||
metadata runtime.ServerMetadata
|
||||
@@ -50,7 +50,7 @@ func request_SimpleBank_CreateUser_0(ctx context.Context, marshaler runtime.Mars
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_SimpleBank_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, server SimpleBankServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
func local_request_ApiTmpl_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, server ApiTmplServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq CreateUserRequest
|
||||
metadata runtime.ServerMetadata
|
||||
@@ -62,7 +62,7 @@ func local_request_SimpleBank_CreateUser_0(ctx context.Context, marshaler runtim
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func request_SimpleBank_LoginUser_0(ctx context.Context, marshaler runtime.Marshaler, client SimpleBankClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
func request_ApiTmpl_LoginUser_0(ctx context.Context, marshaler runtime.Marshaler, client ApiTmplClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq LoginUserRequest
|
||||
metadata runtime.ServerMetadata
|
||||
@@ -77,7 +77,7 @@ func request_SimpleBank_LoginUser_0(ctx context.Context, marshaler runtime.Marsh
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_SimpleBank_LoginUser_0(ctx context.Context, marshaler runtime.Marshaler, server SimpleBankServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
func local_request_ApiTmpl_LoginUser_0(ctx context.Context, marshaler runtime.Marshaler, server ApiTmplServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq LoginUserRequest
|
||||
metadata runtime.ServerMetadata
|
||||
@@ -89,9 +89,9 @@ func local_request_SimpleBank_LoginUser_0(ctx context.Context, marshaler runtime
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
var filter_SimpleBank_VerifyEmail_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
var filter_ApiTmpl_VerifyEmail_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
|
||||
func request_SimpleBank_VerifyEmail_0(ctx context.Context, marshaler runtime.Marshaler, client SimpleBankClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
func request_ApiTmpl_VerifyEmail_0(ctx context.Context, marshaler runtime.Marshaler, client ApiTmplClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq VerifyEmailRequest
|
||||
metadata runtime.ServerMetadata
|
||||
@@ -102,14 +102,14 @@ func request_SimpleBank_VerifyEmail_0(ctx context.Context, marshaler runtime.Mar
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SimpleBank_VerifyEmail_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApiTmpl_VerifyEmail_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
msg, err := client.VerifyEmail(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_SimpleBank_VerifyEmail_0(ctx context.Context, marshaler runtime.Marshaler, server SimpleBankServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
func local_request_ApiTmpl_VerifyEmail_0(ctx context.Context, marshaler runtime.Marshaler, server ApiTmplServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq VerifyEmailRequest
|
||||
metadata runtime.ServerMetadata
|
||||
@@ -117,14 +117,14 @@ func local_request_SimpleBank_VerifyEmail_0(ctx context.Context, marshaler runti
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SimpleBank_VerifyEmail_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApiTmpl_VerifyEmail_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
msg, err := server.VerifyEmail(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func request_SimpleBank_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, client SimpleBankClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
func request_ApiTmpl_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, client ApiTmplClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq UpdateUserRequest
|
||||
metadata runtime.ServerMetadata
|
||||
@@ -139,7 +139,7 @@ func request_SimpleBank_UpdateUser_0(ctx context.Context, marshaler runtime.Mars
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_SimpleBank_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, server SimpleBankServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
func local_request_ApiTmpl_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, server ApiTmplServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq UpdateUserRequest
|
||||
metadata runtime.ServerMetadata
|
||||
@@ -151,99 +151,99 @@ func local_request_SimpleBank_UpdateUser_0(ctx context.Context, marshaler runtim
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
// RegisterSimpleBankHandlerServer registers the http handlers for service SimpleBank to "mux".
|
||||
// UnaryRPC :call SimpleBankServer directly.
|
||||
// RegisterApiTmplHandlerServer registers the http handlers for service ApiTmpl to "mux".
|
||||
// UnaryRPC :call ApiTmplServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSimpleBankHandlerFromEndpoint instead.
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterApiTmplHandlerFromEndpoint instead.
|
||||
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
|
||||
func RegisterSimpleBankHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SimpleBankServer) error {
|
||||
mux.Handle(http.MethodPost, pattern_SimpleBank_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
func RegisterApiTmplHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ApiTmplServer) error {
|
||||
mux.Handle(http.MethodPost, pattern_ApiTmpl_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.SimpleBank/CreateUser", runtime.WithHTTPPathPattern("/v1/create_user"))
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ApiTmpl/CreateUser", runtime.WithHTTPPathPattern("/v1/create_user"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_SimpleBank_CreateUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
resp, md, err := local_request_ApiTmpl_CreateUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_SimpleBank_CreateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_ApiTmpl_CreateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPost, pattern_SimpleBank_LoginUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle(http.MethodPost, pattern_ApiTmpl_LoginUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.SimpleBank/LoginUser", runtime.WithHTTPPathPattern("/v1/login_user"))
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ApiTmpl/LoginUser", runtime.WithHTTPPathPattern("/v1/login_user"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_SimpleBank_LoginUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
resp, md, err := local_request_ApiTmpl_LoginUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_SimpleBank_LoginUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_ApiTmpl_LoginUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodGet, pattern_SimpleBank_VerifyEmail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle(http.MethodGet, pattern_ApiTmpl_VerifyEmail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.SimpleBank/VerifyEmail", runtime.WithHTTPPathPattern("/v1/verify_email"))
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ApiTmpl/VerifyEmail", runtime.WithHTTPPathPattern("/v1/verify_email"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_SimpleBank_VerifyEmail_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
resp, md, err := local_request_ApiTmpl_VerifyEmail_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_SimpleBank_VerifyEmail_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_ApiTmpl_VerifyEmail_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPatch, pattern_SimpleBank_UpdateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle(http.MethodPatch, pattern_ApiTmpl_UpdateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.SimpleBank/UpdateUser", runtime.WithHTTPPathPattern("/v1/update_user"))
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ApiTmpl/UpdateUser", runtime.WithHTTPPathPattern("/v1/update_user"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_SimpleBank_UpdateUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
resp, md, err := local_request_ApiTmpl_UpdateUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_SimpleBank_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_ApiTmpl_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterSimpleBankHandlerFromEndpoint is same as RegisterSimpleBankHandler but
|
||||
// RegisterApiTmplHandlerFromEndpoint is same as RegisterApiTmplHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterSimpleBankHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
func RegisterApiTmplHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.NewClient(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -262,102 +262,102 @@ func RegisterSimpleBankHandlerFromEndpoint(ctx context.Context, mux *runtime.Ser
|
||||
}
|
||||
}()
|
||||
}()
|
||||
return RegisterSimpleBankHandler(ctx, mux, conn)
|
||||
return RegisterApiTmplHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterSimpleBankHandler registers the http handlers for service SimpleBank to "mux".
|
||||
// RegisterApiTmplHandler registers the http handlers for service ApiTmpl to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterSimpleBankHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterSimpleBankHandlerClient(ctx, mux, NewSimpleBankClient(conn))
|
||||
func RegisterApiTmplHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterApiTmplHandlerClient(ctx, mux, NewApiTmplClient(conn))
|
||||
}
|
||||
|
||||
// RegisterSimpleBankHandlerClient registers the http handlers for service SimpleBank
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SimpleBankClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SimpleBankClient"
|
||||
// RegisterApiTmplHandlerClient registers the http handlers for service ApiTmpl
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ApiTmplClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ApiTmplClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "SimpleBankClient" to call the correct interceptors. This client ignores the HTTP middlewares.
|
||||
func RegisterSimpleBankHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SimpleBankClient) error {
|
||||
mux.Handle(http.MethodPost, pattern_SimpleBank_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
// "ApiTmplClient" to call the correct interceptors. This client ignores the HTTP middlewares.
|
||||
func RegisterApiTmplHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ApiTmplClient) error {
|
||||
mux.Handle(http.MethodPost, pattern_ApiTmpl_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.SimpleBank/CreateUser", runtime.WithHTTPPathPattern("/v1/create_user"))
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.ApiTmpl/CreateUser", runtime.WithHTTPPathPattern("/v1/create_user"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_SimpleBank_CreateUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_ApiTmpl_CreateUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_SimpleBank_CreateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_ApiTmpl_CreateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPost, pattern_SimpleBank_LoginUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle(http.MethodPost, pattern_ApiTmpl_LoginUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.SimpleBank/LoginUser", runtime.WithHTTPPathPattern("/v1/login_user"))
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.ApiTmpl/LoginUser", runtime.WithHTTPPathPattern("/v1/login_user"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_SimpleBank_LoginUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_ApiTmpl_LoginUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_SimpleBank_LoginUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_ApiTmpl_LoginUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodGet, pattern_SimpleBank_VerifyEmail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle(http.MethodGet, pattern_ApiTmpl_VerifyEmail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.SimpleBank/VerifyEmail", runtime.WithHTTPPathPattern("/v1/verify_email"))
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.ApiTmpl/VerifyEmail", runtime.WithHTTPPathPattern("/v1/verify_email"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_SimpleBank_VerifyEmail_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_ApiTmpl_VerifyEmail_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_SimpleBank_VerifyEmail_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_ApiTmpl_VerifyEmail_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPatch, pattern_SimpleBank_UpdateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle(http.MethodPatch, pattern_ApiTmpl_UpdateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.SimpleBank/UpdateUser", runtime.WithHTTPPathPattern("/v1/update_user"))
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.ApiTmpl/UpdateUser", runtime.WithHTTPPathPattern("/v1/update_user"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_SimpleBank_UpdateUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_ApiTmpl_UpdateUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_SimpleBank_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_ApiTmpl_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_SimpleBank_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_user"}, ""))
|
||||
pattern_SimpleBank_LoginUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "login_user"}, ""))
|
||||
pattern_SimpleBank_VerifyEmail_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "verify_email"}, ""))
|
||||
pattern_SimpleBank_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "update_user"}, ""))
|
||||
pattern_ApiTmpl_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_user"}, ""))
|
||||
pattern_ApiTmpl_LoginUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "login_user"}, ""))
|
||||
pattern_ApiTmpl_VerifyEmail_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "verify_email"}, ""))
|
||||
pattern_ApiTmpl_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "update_user"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_SimpleBank_CreateUser_0 = runtime.ForwardResponseMessage
|
||||
forward_SimpleBank_LoginUser_0 = runtime.ForwardResponseMessage
|
||||
forward_SimpleBank_VerifyEmail_0 = runtime.ForwardResponseMessage
|
||||
forward_SimpleBank_UpdateUser_0 = runtime.ForwardResponseMessage
|
||||
forward_ApiTmpl_CreateUser_0 = runtime.ForwardResponseMessage
|
||||
forward_ApiTmpl_LoginUser_0 = runtime.ForwardResponseMessage
|
||||
forward_ApiTmpl_VerifyEmail_0 = runtime.ForwardResponseMessage
|
||||
forward_ApiTmpl_UpdateUser_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
@@ -0,0 +1,235 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.36.0
|
||||
// source: service_api_tmpl.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
ApiTmpl_CreateUser_FullMethodName = "/pb.ApiTmpl/CreateUser"
|
||||
ApiTmpl_LoginUser_FullMethodName = "/pb.ApiTmpl/LoginUser"
|
||||
ApiTmpl_VerifyEmail_FullMethodName = "/pb.ApiTmpl/VerifyEmail"
|
||||
ApiTmpl_UpdateUser_FullMethodName = "/pb.ApiTmpl/UpdateUser"
|
||||
)
|
||||
|
||||
// ApiTmplClient is the client API for ApiTmpl service.
|
||||
//
|
||||
// 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.
|
||||
type ApiTmplClient interface {
|
||||
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
|
||||
LoginUser(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error)
|
||||
VerifyEmail(ctx context.Context, in *VerifyEmailRequest, opts ...grpc.CallOption) (*VerifyEmailResponse, error)
|
||||
UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error)
|
||||
}
|
||||
|
||||
type apiTmplClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewApiTmplClient(cc grpc.ClientConnInterface) ApiTmplClient {
|
||||
return &apiTmplClient{cc}
|
||||
}
|
||||
|
||||
func (c *apiTmplClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateUserResponse)
|
||||
err := c.cc.Invoke(ctx, ApiTmpl_CreateUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *apiTmplClient) LoginUser(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(LoginUserResponse)
|
||||
err := c.cc.Invoke(ctx, ApiTmpl_LoginUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *apiTmplClient) VerifyEmail(ctx context.Context, in *VerifyEmailRequest, opts ...grpc.CallOption) (*VerifyEmailResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(VerifyEmailResponse)
|
||||
err := c.cc.Invoke(ctx, ApiTmpl_VerifyEmail_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *apiTmplClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateUserResponse)
|
||||
err := c.cc.Invoke(ctx, ApiTmpl_UpdateUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ApiTmplServer is the server API for ApiTmpl service.
|
||||
// All implementations must embed UnimplementedApiTmplServer
|
||||
// for forward compatibility.
|
||||
type ApiTmplServer interface {
|
||||
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
|
||||
LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error)
|
||||
VerifyEmail(context.Context, *VerifyEmailRequest) (*VerifyEmailResponse, error)
|
||||
UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
|
||||
mustEmbedUnimplementedApiTmplServer()
|
||||
}
|
||||
|
||||
// UnimplementedApiTmplServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedApiTmplServer struct{}
|
||||
|
||||
func (UnimplementedApiTmplServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented")
|
||||
}
|
||||
func (UnimplementedApiTmplServer) LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method LoginUser not implemented")
|
||||
}
|
||||
func (UnimplementedApiTmplServer) VerifyEmail(context.Context, *VerifyEmailRequest) (*VerifyEmailResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method VerifyEmail not implemented")
|
||||
}
|
||||
func (UnimplementedApiTmplServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateUser not implemented")
|
||||
}
|
||||
func (UnimplementedApiTmplServer) mustEmbedUnimplementedApiTmplServer() {}
|
||||
func (UnimplementedApiTmplServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeApiTmplServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ApiTmplServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeApiTmplServer interface {
|
||||
mustEmbedUnimplementedApiTmplServer()
|
||||
}
|
||||
|
||||
func RegisterApiTmplServer(s grpc.ServiceRegistrar, srv ApiTmplServer) {
|
||||
// If the following call panics, it indicates UnimplementedApiTmplServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&ApiTmpl_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ApiTmpl_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ApiTmplServer).CreateUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ApiTmpl_CreateUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ApiTmplServer).CreateUser(ctx, req.(*CreateUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ApiTmpl_LoginUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LoginUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ApiTmplServer).LoginUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ApiTmpl_LoginUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ApiTmplServer).LoginUser(ctx, req.(*LoginUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ApiTmpl_VerifyEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(VerifyEmailRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ApiTmplServer).VerifyEmail(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ApiTmpl_VerifyEmail_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ApiTmplServer).VerifyEmail(ctx, req.(*VerifyEmailRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ApiTmpl_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ApiTmplServer).UpdateUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ApiTmpl_UpdateUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ApiTmplServer).UpdateUser(ctx, req.(*UpdateUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ApiTmpl_ServiceDesc is the grpc.ServiceDesc for ApiTmpl service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ApiTmpl_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "pb.ApiTmpl",
|
||||
HandlerType: (*ApiTmplServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateUser",
|
||||
Handler: _ApiTmpl_CreateUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoginUser",
|
||||
Handler: _ApiTmpl_LoginUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "VerifyEmail",
|
||||
Handler: _ApiTmpl_VerifyEmail_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateUser",
|
||||
Handler: _ApiTmpl_UpdateUser_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "service_api_tmpl.proto",
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v6.33.1
|
||||
// source: service_simple_bank.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
var File_service_simple_bank_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_service_simple_bank_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x19service_simple_bank.proto\x12\x02pb\x1a\x1cgoogle/api/annotations.proto\x1a\x15rpc_create_user.proto\x1a\x14rpc_login_user.proto\x1a\x15rpc_update_user.proto\x1a\x16rpc_verify_email.proto\x1a.protoc-gen-openapiv2/options/annotations.proto2\xf6\x04\n" +
|
||||
"\n" +
|
||||
"SimpleBank\x12\x95\x01\n" +
|
||||
"\n" +
|
||||
"CreateUser\x12\x15.pb.CreateUserRequest\x1a\x16.pb.CreateUserResponse\"X\x92A;\x12\vCreate User\x1a,Create a new user in the Simple Bank system.\x82\xd3\xe4\x93\x02\x14:\x01*\"\x0f/v1/create_user\x12\x95\x01\n" +
|
||||
"\tLoginUser\x12\x14.pb.LoginUserRequest\x1a\x15.pb.LoginUserResponse\"[\x92A?\x12\n" +
|
||||
"Login User\x1a1Login an existing user in the Simple Bank system.\x82\xd3\xe4\x93\x02\x13:\x01*\"\x0e/v1/login_user\x12\x99\x01\n" +
|
||||
"\vVerifyEmail\x12\x16.pb.VerifyEmailRequest\x1a\x17.pb.VerifyEmailResponse\"Y\x92A>\x12\fVerify Email\x1a.Verify user's email in the Simple Bank system.\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/verify_email\x12\x9b\x01\n" +
|
||||
"\n" +
|
||||
"UpdateUser\x12\x15.pb.UpdateUserRequest\x1a\x16.pb.UpdateUserResponse\"^\x92AA\x12\vUpdate User\x1a2Update an existing user in the Simple Bank system.\x82\xd3\xe4\x93\x02\x14:\x01*2\x0f/v1/update_userB\xa5\x01\x92Av\x12t\n" +
|
||||
"\x0fSimple Bank API\"Z\n" +
|
||||
"\bfvideira\x12/https://github.com/FernandoJVideira/simple_bank\x1a\[email protected]\x050.0.1Z*github.com/FernandoJVideira/simple_bank/pbb\x06proto3"
|
||||
|
||||
var file_service_simple_bank_proto_goTypes = []any{
|
||||
(*CreateUserRequest)(nil), // 0: pb.CreateUserRequest
|
||||
(*LoginUserRequest)(nil), // 1: pb.LoginUserRequest
|
||||
(*VerifyEmailRequest)(nil), // 2: pb.VerifyEmailRequest
|
||||
(*UpdateUserRequest)(nil), // 3: pb.UpdateUserRequest
|
||||
(*CreateUserResponse)(nil), // 4: pb.CreateUserResponse
|
||||
(*LoginUserResponse)(nil), // 5: pb.LoginUserResponse
|
||||
(*VerifyEmailResponse)(nil), // 6: pb.VerifyEmailResponse
|
||||
(*UpdateUserResponse)(nil), // 7: pb.UpdateUserResponse
|
||||
}
|
||||
var file_service_simple_bank_proto_depIdxs = []int32{
|
||||
0, // 0: pb.SimpleBank.CreateUser:input_type -> pb.CreateUserRequest
|
||||
1, // 1: pb.SimpleBank.LoginUser:input_type -> pb.LoginUserRequest
|
||||
2, // 2: pb.SimpleBank.VerifyEmail:input_type -> pb.VerifyEmailRequest
|
||||
3, // 3: pb.SimpleBank.UpdateUser:input_type -> pb.UpdateUserRequest
|
||||
4, // 4: pb.SimpleBank.CreateUser:output_type -> pb.CreateUserResponse
|
||||
5, // 5: pb.SimpleBank.LoginUser:output_type -> pb.LoginUserResponse
|
||||
6, // 6: pb.SimpleBank.VerifyEmail:output_type -> pb.VerifyEmailResponse
|
||||
7, // 7: pb.SimpleBank.UpdateUser:output_type -> pb.UpdateUserResponse
|
||||
4, // [4:8] is the sub-list for method output_type
|
||||
0, // [0:4] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_service_simple_bank_proto_init() }
|
||||
func file_service_simple_bank_proto_init() {
|
||||
if File_service_simple_bank_proto != nil {
|
||||
return
|
||||
}
|
||||
file_rpc_create_user_proto_init()
|
||||
file_rpc_login_user_proto_init()
|
||||
file_rpc_update_user_proto_init()
|
||||
file_rpc_verify_email_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_service_simple_bank_proto_rawDesc), len(file_service_simple_bank_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_service_simple_bank_proto_goTypes,
|
||||
DependencyIndexes: file_service_simple_bank_proto_depIdxs,
|
||||
}.Build()
|
||||
File_service_simple_bank_proto = out.File
|
||||
file_service_simple_bank_proto_goTypes = nil
|
||||
file_service_simple_bank_proto_depIdxs = nil
|
||||
}
|
||||
@@ -1,235 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v6.33.1
|
||||
// source: service_simple_bank.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
SimpleBank_CreateUser_FullMethodName = "/pb.SimpleBank/CreateUser"
|
||||
SimpleBank_LoginUser_FullMethodName = "/pb.SimpleBank/LoginUser"
|
||||
SimpleBank_VerifyEmail_FullMethodName = "/pb.SimpleBank/VerifyEmail"
|
||||
SimpleBank_UpdateUser_FullMethodName = "/pb.SimpleBank/UpdateUser"
|
||||
)
|
||||
|
||||
// SimpleBankClient is the client API for SimpleBank service.
|
||||
//
|
||||
// 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.
|
||||
type SimpleBankClient interface {
|
||||
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
|
||||
LoginUser(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error)
|
||||
VerifyEmail(ctx context.Context, in *VerifyEmailRequest, opts ...grpc.CallOption) (*VerifyEmailResponse, error)
|
||||
UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error)
|
||||
}
|
||||
|
||||
type simpleBankClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSimpleBankClient(cc grpc.ClientConnInterface) SimpleBankClient {
|
||||
return &simpleBankClient{cc}
|
||||
}
|
||||
|
||||
func (c *simpleBankClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateUserResponse)
|
||||
err := c.cc.Invoke(ctx, SimpleBank_CreateUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *simpleBankClient) LoginUser(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(LoginUserResponse)
|
||||
err := c.cc.Invoke(ctx, SimpleBank_LoginUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *simpleBankClient) VerifyEmail(ctx context.Context, in *VerifyEmailRequest, opts ...grpc.CallOption) (*VerifyEmailResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(VerifyEmailResponse)
|
||||
err := c.cc.Invoke(ctx, SimpleBank_VerifyEmail_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *simpleBankClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateUserResponse)
|
||||
err := c.cc.Invoke(ctx, SimpleBank_UpdateUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SimpleBankServer is the server API for SimpleBank service.
|
||||
// All implementations must embed UnimplementedSimpleBankServer
|
||||
// for forward compatibility.
|
||||
type SimpleBankServer interface {
|
||||
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
|
||||
LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error)
|
||||
VerifyEmail(context.Context, *VerifyEmailRequest) (*VerifyEmailResponse, error)
|
||||
UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
|
||||
mustEmbedUnimplementedSimpleBankServer()
|
||||
}
|
||||
|
||||
// UnimplementedSimpleBankServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSimpleBankServer struct{}
|
||||
|
||||
func (UnimplementedSimpleBankServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented")
|
||||
}
|
||||
func (UnimplementedSimpleBankServer) LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoginUser not implemented")
|
||||
}
|
||||
func (UnimplementedSimpleBankServer) VerifyEmail(context.Context, *VerifyEmailRequest) (*VerifyEmailResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method VerifyEmail not implemented")
|
||||
}
|
||||
func (UnimplementedSimpleBankServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented")
|
||||
}
|
||||
func (UnimplementedSimpleBankServer) mustEmbedUnimplementedSimpleBankServer() {}
|
||||
func (UnimplementedSimpleBankServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSimpleBankServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SimpleBankServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSimpleBankServer interface {
|
||||
mustEmbedUnimplementedSimpleBankServer()
|
||||
}
|
||||
|
||||
func RegisterSimpleBankServer(s grpc.ServiceRegistrar, srv SimpleBankServer) {
|
||||
// If the following call pancis, it indicates UnimplementedSimpleBankServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&SimpleBank_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SimpleBank_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SimpleBankServer).CreateUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SimpleBank_CreateUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SimpleBankServer).CreateUser(ctx, req.(*CreateUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SimpleBank_LoginUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LoginUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SimpleBankServer).LoginUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SimpleBank_LoginUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SimpleBankServer).LoginUser(ctx, req.(*LoginUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SimpleBank_VerifyEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(VerifyEmailRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SimpleBankServer).VerifyEmail(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SimpleBank_VerifyEmail_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SimpleBankServer).VerifyEmail(ctx, req.(*VerifyEmailRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SimpleBank_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SimpleBankServer).UpdateUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SimpleBank_UpdateUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SimpleBankServer).UpdateUser(ctx, req.(*UpdateUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SimpleBank_ServiceDesc is the grpc.ServiceDesc for SimpleBank service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SimpleBank_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "pb.SimpleBank",
|
||||
HandlerType: (*SimpleBankServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateUser",
|
||||
Handler: _SimpleBank_CreateUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoginUser",
|
||||
Handler: _SimpleBank_LoginUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "VerifyEmail",
|
||||
Handler: _SimpleBank_VerifyEmail_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateUser",
|
||||
Handler: _SimpleBank_UpdateUser_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "service_simple_bank.proto",
|
||||
}
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v6.33.1
|
||||
// protoc v7.36.0
|
||||
// source: user.proto
|
||||
|
||||
package pb
|
||||
@@ -110,7 +110,7 @@ const file_user_proto_rawDesc = "" +
|
||||
"\x05email\x18\x03 \x01(\tR\x05email\x12J\n" +
|
||||
"\x13password_changed_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\x11passwordChangedAt\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAtB,Z*github.com/FernandoJVideira/simple_bank/pbb\x06proto3"
|
||||
"created_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAtB)Z'github.com/FernandoJVideira/api_tmpl/pbb\x06proto3"
|
||||
|
||||
var (
|
||||
file_user_proto_rawDescOnce sync.Once
|
||||
|
||||
Reference in new issue
Block a user