From a1a100cfb93b5db7fe339f56fa04206032d67950 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:56:36 +0000 Subject: [PATCH 1/5] fix(deps): update module golang.org/x/tools to v0.28.0 --- go.mod | 2 +- go.sum | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 8e56114b..ff0423cd 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( go.mercari.io/yo v0.5.7 go.uber.org/mock v0.5.0 go.uber.org/zap v1.27.0 - golang.org/x/tools v0.27.0 + golang.org/x/tools v0.28.0 google.golang.org/api v0.211.0 google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 diff --git a/go.sum b/go.sum index 2bf63f7d..f128db55 100644 --- a/go.sum +++ b/go.sum @@ -2405,6 +2405,7 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From fdea29f9846f3769132c96c0270c598017c72403 Mon Sep 17 00:00:00 2001 From: abyssparanoia Date: Mon, 16 Dec 2024 13:11:55 +0900 Subject: [PATCH 2/5] chore: update go sum --- go.sum | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/go.sum b/go.sum index cadf5704..f03125b9 100644 --- a/go.sum +++ b/go.sum @@ -121,8 +121,6 @@ cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVo cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= -cloud.google.com/go/auth v0.11.0 h1:Ic5SZz2lsvbYcWT5dfjNWgw6tTlGi2Wc8hyQSC9BstA= -cloud.google.com/go/auth v0.11.0/go.mod h1:xxA5AqpDrvS+Gkmo9RqrGGRh6WSNKKOXhY3zNOr38tI= cloud.google.com/go/auth v0.12.1 h1:n2Bj25BUMM0nvE9D2XLTiImanwZhO3DkfWSYS/SAJP4= cloud.google.com/go/auth v0.12.1/go.mod h1:BFMu+TNpF3DmvfBO9ClqTR/SiqVIm7LukKF9mbendF4= cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU= @@ -782,8 +780,6 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvK github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.25 h1:r67ps7oHCYnflpgDy2LZU0MAQtQbYIOqNNnqGO6xQkE= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.25/go.mod h1:GrGY+Q4fIokYLtjCVB/aFfCVL6hhGUFl8inD18fDalE= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.0 h1:0Ph3YCW0bkw5cZbH3MAWCNC5lbhnn0vTIX6UlVlXRnY= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.0/go.mod h1:U+GnB0KkXI5SgVMzW2J1FHMGbAiObr1XaIGZSMejLlI= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.1 h1:qMJk1I55avN/vN+51rPdE0dLgkhWrlU6Cw0Wg34eQvM= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.1/go.mod h1:U+GnB0KkXI5SgVMzW2J1FHMGbAiObr1XaIGZSMejLlI= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= @@ -1131,8 +1127,6 @@ github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u1 github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= -github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/goccy/go-json v0.10.4 h1:JSwxQzIqKfmFX1swYPpUThQZp/Ka4wzJdK0LWVytLPM= github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/goccy/go-yaml v1.11.0 h1:n7Z+zx8S9f9KgzG6KtQKf+kwqXZlLNR2F6018Dgau54= @@ -1326,8 +1320,6 @@ github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0 h1:kQ0NI7W1B3HwiN5gAYtY+XFItDPbLBwYRxAqbFTyDes= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0/go.mod h1:zrT2dxOAjNFPRGjTUe2Xmb4q4YdUwVvQFV6xiCSf+z0= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -1678,8 +1670,6 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= -github.com/pressly/goose/v3 v3.23.0 h1:57hqKos8izGek4v6D5+OXBa+Y4Rq8MU//+MmnevdpVA= -github.com/pressly/goose/v3 v3.23.0/go.mod h1:rpx+D9GX/+stXmzKa+uh1DkjPnNVMdiOCV9iLdle4N8= github.com/pressly/goose/v3 v3.23.1 h1:bwjOXvep4HtuiiIqtrXmCkQu0IW9O9JAqA6UQNY9ntk= github.com/pressly/goose/v3 v3.23.1/go.mod h1:0oK0zcK7cmNqJSVwMIOiUUW0ox2nDIz+UfPMSOaw2zY= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -2137,8 +2127,6 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -2409,8 +2397,7 @@ golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2489,8 +2476,6 @@ google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/ google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= -google.golang.org/api v0.210.0 h1:HMNffZ57OoZCRYSbdWVRoqOa8V8NIHLL0CzdBPLztWk= -google.golang.org/api v0.210.0/go.mod h1:B9XDZGnx2NtyjzVkOVTGrFSAVZgPcbedzKg/gTLwqBs= google.golang.org/api v0.211.0 h1:IUpLjq09jxBSV1lACO33CGY3jsRcbctfGzhj+ZSE/Bg= google.golang.org/api v0.211.0/go.mod h1:XOloB4MXFH4UTlQSGuNUxw0UT74qdENK8d6JNsXKLi0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= From f7e195261b0bb37c5b4734a54e32977daafb81d8 Mon Sep 17 00:00:00 2001 From: abyssparanoia Date: Mon, 16 Dec 2024 13:12:01 +0900 Subject: [PATCH 3/5] chore: regenerate --- .../grpc/pb/rapid/admin_api/v1/api.pb.gw.go | 378 ++++++------------ 1 file changed, 119 insertions(+), 259 deletions(-) diff --git a/internal/infrastructure/grpc/pb/rapid/admin_api/v1/api.pb.gw.go b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/api.pb.gw.go index 29cbe7af..7f422e06 100644 --- a/internal/infrastructure/grpc/pb/rapid/admin_api/v1/api.pb.gw.go +++ b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/api.pb.gw.go @@ -10,6 +10,7 @@ package admin_apiv1 import ( "context" + "errors" "io" "net/http" @@ -24,289 +25,232 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_AdminV1Service_CreateAssetPresignedURL_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateAssetPresignedURLRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateAssetPresignedURLRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.CreateAssetPresignedURL(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AdminV1Service_CreateAssetPresignedURL_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateAssetPresignedURLRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateAssetPresignedURLRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.CreateAssetPresignedURL(ctx, &protoReq) return msg, metadata, err - } func request_AdminV1Service_GetTenant_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetTenantRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq GetTenantRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["tenant_id"] + val, ok := pathParams["tenant_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") } - protoReq.TenantId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) } - msg, err := client.GetTenant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AdminV1Service_GetTenant_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetTenantRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq GetTenantRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["tenant_id"] + val, ok := pathParams["tenant_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") } - protoReq.TenantId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) } - msg, err := server.GetTenant(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_AdminV1Service_ListTenants_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_AdminV1Service_ListTenants_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_AdminV1Service_ListTenants_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListTenantsRequest - var metadata runtime.ServerMetadata - + var ( + protoReq ListTenantsRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AdminV1Service_ListTenants_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ListTenants(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AdminV1Service_ListTenants_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListTenantsRequest - var metadata runtime.ServerMetadata - + var ( + protoReq ListTenantsRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AdminV1Service_ListTenants_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ListTenants(ctx, &protoReq) return msg, metadata, err - } func request_AdminV1Service_CreateTenant_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateTenantRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateTenantRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.CreateTenant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AdminV1Service_CreateTenant_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateTenantRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateTenantRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.CreateTenant(ctx, &protoReq) return msg, metadata, err - } func request_AdminV1Service_UpdateTenant_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateTenantRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - var ( - val string - ok bool - err error - _ = err + protoReq UpdateTenantRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["tenant_id"] + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + val, ok := pathParams["tenant_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") } - protoReq.TenantId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) } - msg, err := client.UpdateTenant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AdminV1Service_UpdateTenant_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateTenantRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - var ( - val string - ok bool - err error - _ = err + protoReq UpdateTenantRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["tenant_id"] + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + val, ok := pathParams["tenant_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") } - protoReq.TenantId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) } - msg, err := server.UpdateTenant(ctx, &protoReq) return msg, metadata, err - } func request_AdminV1Service_DeleteTenant_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteTenantRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq DeleteTenantRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["tenant_id"] + val, ok := pathParams["tenant_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") } - protoReq.TenantId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) } - msg, err := client.DeleteTenant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AdminV1Service_DeleteTenant_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteTenantRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq DeleteTenantRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["tenant_id"] + val, ok := pathParams["tenant_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") } - protoReq.TenantId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) } - msg, err := server.DeleteTenant(ctx, &protoReq) return msg, metadata, err - } func request_AdminV1Service_CreateStaff_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateStaffRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateStaffRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.CreateStaff(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AdminV1Service_CreateStaff_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateStaffRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateStaffRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.CreateStaff(ctx, &protoReq) return msg, metadata, err - } // RegisterAdminV1ServiceHandlerServer registers the http handlers for service AdminV1Service to "mux". @@ -315,16 +259,13 @@ func local_request_AdminV1Service_CreateStaff_0(ctx context.Context, marshaler r // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAdminV1ServiceHandlerFromEndpoint 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 RegisterAdminV1ServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdminV1ServiceServer) error { - - mux.Handle("POST", pattern_AdminV1Service_CreateAssetPresignedURL_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_AdminV1Service_CreateAssetPresignedURL_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateAssetPresignedURL", runtime.WithHTTPPathPattern("/admin/v1/assets/-/presigned_url")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateAssetPresignedURL", runtime.WithHTTPPathPattern("/admin/v1/assets/-/presigned_url")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -336,20 +277,15 @@ func RegisterAdminV1ServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_CreateAssetPresignedURL_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_AdminV1Service_GetTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_AdminV1Service_GetTenant_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/GetTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/GetTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -361,20 +297,15 @@ func RegisterAdminV1ServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_GetTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_AdminV1Service_ListTenants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_AdminV1Service_ListTenants_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/ListTenants", runtime.WithHTTPPathPattern("/admin/v1/tenants")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/ListTenants", runtime.WithHTTPPathPattern("/admin/v1/tenants")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -386,20 +317,15 @@ func RegisterAdminV1ServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_ListTenants_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_AdminV1Service_CreateTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_AdminV1Service_CreateTenant_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -411,20 +337,15 @@ func RegisterAdminV1ServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_CreateTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("PATCH", pattern_AdminV1Service_UpdateTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPatch, pattern_AdminV1Service_UpdateTenant_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/UpdateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/UpdateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -436,20 +357,15 @@ func RegisterAdminV1ServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_UpdateTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("DELETE", pattern_AdminV1Service_DeleteTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodDelete, pattern_AdminV1Service_DeleteTenant_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/DeleteTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/DeleteTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -461,20 +377,15 @@ func RegisterAdminV1ServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_DeleteTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_AdminV1Service_CreateStaff_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_AdminV1Service_CreateStaff_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateStaff", runtime.WithHTTPPathPattern("/admin/v1/staffs")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateStaff", runtime.WithHTTPPathPattern("/admin/v1/staffs")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -486,9 +397,7 @@ func RegisterAdminV1ServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_CreateStaff_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -515,7 +424,6 @@ func RegisterAdminV1ServiceHandlerFromEndpoint(ctx context.Context, mux *runtime } }() }() - return RegisterAdminV1ServiceHandler(ctx, mux, conn) } @@ -531,14 +439,11 @@ func RegisterAdminV1ServiceHandler(ctx context.Context, mux *runtime.ServeMux, c // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "AdminV1ServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterAdminV1ServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdminV1ServiceClient) error { - - mux.Handle("POST", pattern_AdminV1Service_CreateAssetPresignedURL_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_AdminV1Service_CreateAssetPresignedURL_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateAssetPresignedURL", runtime.WithHTTPPathPattern("/admin/v1/assets/-/presigned_url")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateAssetPresignedURL", runtime.WithHTTPPathPattern("/admin/v1/assets/-/presigned_url")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -549,18 +454,13 @@ func RegisterAdminV1ServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_CreateAssetPresignedURL_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_AdminV1Service_GetTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_AdminV1Service_GetTenant_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/GetTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/GetTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -571,18 +471,13 @@ func RegisterAdminV1ServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_GetTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_AdminV1Service_ListTenants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_AdminV1Service_ListTenants_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/ListTenants", runtime.WithHTTPPathPattern("/admin/v1/tenants")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/ListTenants", runtime.WithHTTPPathPattern("/admin/v1/tenants")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -593,18 +488,13 @@ func RegisterAdminV1ServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_ListTenants_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_AdminV1Service_CreateTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_AdminV1Service_CreateTenant_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -615,18 +505,13 @@ func RegisterAdminV1ServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_CreateTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("PATCH", pattern_AdminV1Service_UpdateTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPatch, pattern_AdminV1Service_UpdateTenant_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/UpdateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/UpdateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -637,18 +522,13 @@ func RegisterAdminV1ServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_UpdateTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("DELETE", pattern_AdminV1Service_DeleteTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodDelete, pattern_AdminV1Service_DeleteTenant_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/DeleteTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/DeleteTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -659,18 +539,13 @@ func RegisterAdminV1ServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_DeleteTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_AdminV1Service_CreateStaff_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_AdminV1Service_CreateStaff_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateStaff", runtime.WithHTTPPathPattern("/admin/v1/staffs")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateStaff", runtime.WithHTTPPathPattern("/admin/v1/staffs")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -681,42 +556,27 @@ func RegisterAdminV1ServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AdminV1Service_CreateStaff_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( pattern_AdminV1Service_CreateAssetPresignedURL_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"admin", "v1", "assets", "-", "presigned_url"}, "")) - - pattern_AdminV1Service_GetTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"admin", "v1", "tenants", "tenant_id"}, "")) - - pattern_AdminV1Service_ListTenants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"admin", "v1", "tenants"}, "")) - - pattern_AdminV1Service_CreateTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"admin", "v1", "tenants"}, "")) - - pattern_AdminV1Service_UpdateTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"admin", "v1", "tenants", "tenant_id"}, "")) - - pattern_AdminV1Service_DeleteTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"admin", "v1", "tenants", "tenant_id"}, "")) - - pattern_AdminV1Service_CreateStaff_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"admin", "v1", "staffs"}, "")) + pattern_AdminV1Service_GetTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"admin", "v1", "tenants", "tenant_id"}, "")) + pattern_AdminV1Service_ListTenants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"admin", "v1", "tenants"}, "")) + pattern_AdminV1Service_CreateTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"admin", "v1", "tenants"}, "")) + pattern_AdminV1Service_UpdateTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"admin", "v1", "tenants", "tenant_id"}, "")) + pattern_AdminV1Service_DeleteTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"admin", "v1", "tenants", "tenant_id"}, "")) + pattern_AdminV1Service_CreateStaff_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"admin", "v1", "staffs"}, "")) ) var ( forward_AdminV1Service_CreateAssetPresignedURL_0 = runtime.ForwardResponseMessage - - forward_AdminV1Service_GetTenant_0 = runtime.ForwardResponseMessage - - forward_AdminV1Service_ListTenants_0 = runtime.ForwardResponseMessage - - forward_AdminV1Service_CreateTenant_0 = runtime.ForwardResponseMessage - - forward_AdminV1Service_UpdateTenant_0 = runtime.ForwardResponseMessage - - forward_AdminV1Service_DeleteTenant_0 = runtime.ForwardResponseMessage - - forward_AdminV1Service_CreateStaff_0 = runtime.ForwardResponseMessage + forward_AdminV1Service_GetTenant_0 = runtime.ForwardResponseMessage + forward_AdminV1Service_ListTenants_0 = runtime.ForwardResponseMessage + forward_AdminV1Service_CreateTenant_0 = runtime.ForwardResponseMessage + forward_AdminV1Service_UpdateTenant_0 = runtime.ForwardResponseMessage + forward_AdminV1Service_DeleteTenant_0 = runtime.ForwardResponseMessage + forward_AdminV1Service_CreateStaff_0 = runtime.ForwardResponseMessage ) From d8febb86f87d18708bd0fad000991e34f8278873 Mon Sep 17 00:00:00 2001 From: abyssparanoia Date: Mon, 16 Dec 2024 13:12:03 +0900 Subject: [PATCH 4/5] chore: regenerate --- .../grpc/pb/rapid/debug_api/v1/api.pb.gw.go | 58 ++++++++----------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/internal/infrastructure/grpc/pb/rapid/debug_api/v1/api.pb.gw.go b/internal/infrastructure/grpc/pb/rapid/debug_api/v1/api.pb.gw.go index ce910eab..32ced238 100644 --- a/internal/infrastructure/grpc/pb/rapid/debug_api/v1/api.pb.gw.go +++ b/internal/infrastructure/grpc/pb/rapid/debug_api/v1/api.pb.gw.go @@ -10,6 +10,7 @@ package debug_apiv1 import ( "context" + "errors" "io" "net/http" @@ -24,37 +25,38 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_DebugV1Service_CreateStaffIDToken_0(ctx context.Context, marshaler runtime.Marshaler, client DebugV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateStaffIDTokenRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateStaffIDTokenRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.CreateStaffIDToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_DebugV1Service_CreateStaffIDToken_0(ctx context.Context, marshaler runtime.Marshaler, server DebugV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateStaffIDTokenRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateStaffIDTokenRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.CreateStaffIDToken(ctx, &protoReq) return msg, metadata, err - } // RegisterDebugV1ServiceHandlerServer registers the http handlers for service DebugV1Service to "mux". @@ -63,16 +65,13 @@ func local_request_DebugV1Service_CreateStaffIDToken_0(ctx context.Context, mars // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDebugV1ServiceHandlerFromEndpoint 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 RegisterDebugV1ServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DebugV1ServiceServer) error { - - mux.Handle("POST", pattern_DebugV1Service_CreateStaffIDToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_DebugV1Service_CreateStaffIDToken_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.debug_api.v1.DebugV1Service/CreateStaffIDToken", runtime.WithHTTPPathPattern("/debug/v1/staffs/-/id_token")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.debug_api.v1.DebugV1Service/CreateStaffIDToken", runtime.WithHTTPPathPattern("/debug/v1/staffs/-/id_token")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -84,9 +83,7 @@ func RegisterDebugV1ServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_DebugV1Service_CreateStaffIDToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -113,7 +110,6 @@ func RegisterDebugV1ServiceHandlerFromEndpoint(ctx context.Context, mux *runtime } }() }() - return RegisterDebugV1ServiceHandler(ctx, mux, conn) } @@ -129,14 +125,11 @@ func RegisterDebugV1ServiceHandler(ctx context.Context, mux *runtime.ServeMux, c // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "DebugV1ServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterDebugV1ServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DebugV1ServiceClient) error { - - mux.Handle("POST", pattern_DebugV1Service_CreateStaffIDToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_DebugV1Service_CreateStaffIDToken_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rapid.debug_api.v1.DebugV1Service/CreateStaffIDToken", runtime.WithHTTPPathPattern("/debug/v1/staffs/-/id_token")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.debug_api.v1.DebugV1Service/CreateStaffIDToken", runtime.WithHTTPPathPattern("/debug/v1/staffs/-/id_token")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -147,11 +140,8 @@ func RegisterDebugV1ServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_DebugV1Service_CreateStaffIDToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } From b483669b46bef9db5e1ca662bc23b4f1650027bf Mon Sep 17 00:00:00 2001 From: abyssparanoia Date: Mon, 16 Dec 2024 13:12:06 +0900 Subject: [PATCH 5/5] chore: regenerate --- .../grpc/pb/rapid/public_api/v1/api.pb.gw.go | 52 ++++++++----------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/internal/infrastructure/grpc/pb/rapid/public_api/v1/api.pb.gw.go b/internal/infrastructure/grpc/pb/rapid/public_api/v1/api.pb.gw.go index dc4012f7..e330e35d 100644 --- a/internal/infrastructure/grpc/pb/rapid/public_api/v1/api.pb.gw.go +++ b/internal/infrastructure/grpc/pb/rapid/public_api/v1/api.pb.gw.go @@ -10,6 +10,7 @@ package public_apiv1 import ( "context" + "errors" "io" "net/http" @@ -24,29 +25,32 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_PublicV1Service_DeepHealthCheck_0(ctx context.Context, marshaler runtime.Marshaler, client PublicV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeepHealthCheckRequest - var metadata runtime.ServerMetadata - + var ( + protoReq DeepHealthCheckRequest + metadata runtime.ServerMetadata + ) msg, err := client.DeepHealthCheck(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_PublicV1Service_DeepHealthCheck_0(ctx context.Context, marshaler runtime.Marshaler, server PublicV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeepHealthCheckRequest - var metadata runtime.ServerMetadata - + var ( + protoReq DeepHealthCheckRequest + metadata runtime.ServerMetadata + ) msg, err := server.DeepHealthCheck(ctx, &protoReq) return msg, metadata, err - } // RegisterPublicV1ServiceHandlerServer registers the http handlers for service PublicV1Service to "mux". @@ -55,16 +59,13 @@ func local_request_PublicV1Service_DeepHealthCheck_0(ctx context.Context, marsha // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPublicV1ServiceHandlerFromEndpoint 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 RegisterPublicV1ServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PublicV1ServiceServer) error { - - mux.Handle("GET", pattern_PublicV1Service_DeepHealthCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_PublicV1Service_DeepHealthCheck_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.public_api.v1.PublicV1Service/DeepHealthCheck", runtime.WithHTTPPathPattern("/v1/deep_health_check")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.public_api.v1.PublicV1Service/DeepHealthCheck", runtime.WithHTTPPathPattern("/v1/deep_health_check")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -76,9 +77,7 @@ func RegisterPublicV1ServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PublicV1Service_DeepHealthCheck_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -105,7 +104,6 @@ func RegisterPublicV1ServiceHandlerFromEndpoint(ctx context.Context, mux *runtim } }() }() - return RegisterPublicV1ServiceHandler(ctx, mux, conn) } @@ -121,14 +119,11 @@ func RegisterPublicV1ServiceHandler(ctx context.Context, mux *runtime.ServeMux, // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "PublicV1ServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterPublicV1ServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PublicV1ServiceClient) error { - - mux.Handle("GET", pattern_PublicV1Service_DeepHealthCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_PublicV1Service_DeepHealthCheck_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) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rapid.public_api.v1.PublicV1Service/DeepHealthCheck", runtime.WithHTTPPathPattern("/v1/deep_health_check")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.public_api.v1.PublicV1Service/DeepHealthCheck", runtime.WithHTTPPathPattern("/v1/deep_health_check")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -139,11 +134,8 @@ func RegisterPublicV1ServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PublicV1Service_DeepHealthCheck_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil }