From 1f1a92a0f8e23d27bd7d51a4cdacf7e0dc04ec54 Mon Sep 17 00:00:00 2001 From: Nofre Date: Mon, 21 Apr 2025 17:36:07 +0200 Subject: [PATCH 1/7] chore(mod): go mod fetched --- go.mod | 22 ++++++++++++++-------- go.sum | 53 ++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 50 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index 0df4d0c..f9bbabb 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.24.2 require ( github.com/DavidMovas/gopherbox v0.0.0-20250329141646-145b4e0827ef - github.com/QuizWars-Ecosystem/go-common v0.0.0-20250403171830-7437ddfce87d + github.com/QuizWars-Ecosystem/go-common v0.0.0-20250421115754-c81ffe56c7c5 github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 github.com/hashicorp/consul/api v1.32.0 github.com/siderolabs/grpc-proxy v0.5.1 @@ -26,6 +26,8 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fatih/color v1.18.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/google/cel-go v0.24.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect @@ -37,22 +39,26 @@ require ( github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/serf v0.10.2 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect - github.com/jackc/pgx/v5 v5.7.4 // indirect - github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/joho/godotenv v1.5.1 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/redis/go-redis/v9 v9.7.3 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/viper v1.20.1 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect - golang.org/x/crypto v0.36.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect golang.org/x/net v0.38.0 // indirect - golang.org/x/sys v0.31.0 // indirect + golang.org/x/sys v0.32.0 // indirect golang.org/x/text v0.23.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250404141209-ee84b53bf3d0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 7a6cea0..b7fa628 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,8 @@ github.com/Brain-Wave-Ecosystem/go-common v0.0.0-20250331211142-53e0ee600e67/go. github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DavidMovas/gopherbox v0.0.0-20250329141646-145b4e0827ef h1:X3T8jXTK7eA1+xrbpzcb8rbwmNcVFG9ZwBvp+ueKNM4= github.com/DavidMovas/gopherbox v0.0.0-20250329141646-145b4e0827ef/go.mod h1:SS2j3swG57zrRmuVXbdOXJvHV7wgLsj3OewEPclDOBI= -github.com/QuizWars-Ecosystem/go-common v0.0.0-20250403171830-7437ddfce87d h1:qIXPSa9UTQ35mqhEZ7vsi8BPpW2CmUrt4UrHaAtWoDM= -github.com/QuizWars-Ecosystem/go-common v0.0.0-20250403171830-7437ddfce87d/go.mod h1:OzQy0EjVqH9mVqnR1B1btiZZsdgcDdzKqDK/Hs/ITtc= +github.com/QuizWars-Ecosystem/go-common v0.0.0-20250421115754-c81ffe56c7c5 h1:1iZSebr3LayoMz8DZzJ9J9m3Jw2E3xMfxXI0rTfRmNY= +github.com/QuizWars-Ecosystem/go-common v0.0.0-20250421115754-c81ffe56c7c5/go.mod h1:pt+KxBK12KmuYMvtHWvRjwxzVDVWmbf49hNL8DeTCSM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -46,6 +46,10 @@ github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2T github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -57,6 +61,8 @@ github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ4 github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -125,14 +131,6 @@ github.com/hashicorp/memberlist v0.5.2 h1:rJoNPWZ0juJBgqn48gjy59K5H4rNgvUoM1kUD7 github.com/hashicorp/memberlist v0.5.2/go.mod h1:Ri9p/tRShbjYnpNf4FFPXG7wxEGY4Nrcn6E7jrVa//4= github.com/hashicorp/serf v0.10.2 h1:m5IORhuNSjaxeljg5DeQVDlQyVkhRIjJDimbkCa8aAc= github.com/hashicorp/serf v0.10.2/go.mod h1:T1CmSGfSeGfnfNy/w0odXQUR1rfECGd2Qdsp84DjOiY= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.7.4 h1:9wKznZrhWa2QiHL+NjTSPP6yjl3451BX3imWDnokYlg= -github.com/jackc/pgx/v5 v5.7.4/go.mod h1:ncY89UGWxg82EykZUwSpUKEfccBGGYq1xjrOpsbsfGQ= -github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= -github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -146,8 +144,12 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= @@ -171,6 +173,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -197,6 +201,10 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0wM= github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/siderolabs/grpc-proxy v0.5.1 h1:WTZYLMPTZPt43BzEJ02LT9kYA9qAfquWwCezc6NPPYE= @@ -204,6 +212,16 @@ github.com/siderolabs/grpc-proxy v0.5.1/go.mod h1:EQwE87LiWxhiIUPBeWmpjJb9DIWxWI github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= +github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -215,13 +233,14 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= @@ -244,8 +263,6 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw= golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= @@ -283,8 +300,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= @@ -296,8 +313,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 h1:hE3bRWtU6uceqlh4fhrSnUyjKHMKB9KrTLLG+bc0ddM= google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463/go.mod h1:U90ffi8eUL9MwPcrJylN5+Mk2v3vuPDptd5yyNUiRR8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250404141209-ee84b53bf3d0 h1:0K7wTWyzxZ7J+L47+LbFogJW1nn/gnnMCN0vGXNYtTI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250404141209-ee84b53bf3d0/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI= google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -312,6 +329,8 @@ google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 19829fdee4d365a5c82edfd087352a9841775d26 Mon Sep 17 00:00:00 2001 From: Nofre Date: Mon, 21 Apr 2025 17:36:25 +0200 Subject: [PATCH 2/7] chore(mod): protobuf module fetched --- protobuf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobuf b/protobuf index ead5e0c..544ae2b 160000 --- a/protobuf +++ b/protobuf @@ -1 +1 @@ -Subproject commit ead5e0cd48f99b7b28adadd5d169db8f61c738c2 +Subproject commit 544ae2b45d2abca3e662320aafe525286dba2c16 From 93ad9a394a15b91d05e80db40719fbc9421eb50d Mon Sep 17 00:00:00 2001 From: Nofre Date: Mon, 21 Apr 2025 17:37:14 +0200 Subject: [PATCH 3/7] feat(mux): added heath prove endpoint for testing --- internal/mux/runtime.go | 19 +++++++++++++++++++ internal/server/server.go | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 internal/mux/runtime.go diff --git a/internal/mux/runtime.go b/internal/mux/runtime.go new file mode 100644 index 0000000..4823734 --- /dev/null +++ b/internal/mux/runtime.go @@ -0,0 +1,19 @@ +package mux + +import ( + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "net/http" +) + +func RegisterRuntimeMux(mux *runtime.ServeMux) error { + var err error + + if err = mux.HandlePath("GET", "/healthz", func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) { + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte("ok")) + }); err != nil { + return err + } + + return nil +} diff --git a/internal/server/server.go b/internal/server/server.go index b349e10..3b939e8 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/QuizWars-Ecosystem/api-gateway/internal/mux" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "google.golang.org/grpc" "google.golang.org/grpc/reflection" @@ -62,6 +63,12 @@ func NewServer(_ context.Context, cfg *config.Config) (*Server, error) { return nil, err } + err = mux.RegisterRuntimeMux(gt.Runtime()) + if err != nil { + logger.Zap().Error("error registering runtime mux", zap.Error(err)) + return nil, err + } + if cfg.Local { reflection.Register(gt.Proxy()) } From 6c56cab3066193e08934176a5f01bf76c471a3f5 Mon Sep 17 00:00:00 2001 From: Nofre Date: Mon, 21 Apr 2025 17:41:21 +0200 Subject: [PATCH 4/7] feat(ci): added ci-cd on GitHub actions --- .github/workflows/ci.yml | 105 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9b1013b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,105 @@ +name: Test, Release, Push + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test-healthz: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.24.2' + + - name: Build API Gateway + run: go build -o gateway . + + - name: Run API Gateway in background + run: | + ./gateway & + sleep 2 + + - name: Check /healthz endpoint + run: | + curl -f http://localhost:8000/healthz + + release: + needs: test-healthz + runs-on: ubuntu-latest + permissions: + contents: write + + outputs: + tag: ${{ steps.get_tag.outputs.tag }} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run go-semantic-release + uses: go-semantic-release/action@v1 + with: + hooks: goreleaser + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get latest tag or fallback + id: get_tag + run: | + TAG=$(git tag --sort=-creatordate | tail -n 1) + if [ -z "$TAG" ]; then + TAG="v1.0.0" + echo "::notice ::No tag found, defaulting to $TAG" + fi + echo "tag=$TAG" + echo "tag=$TAG" >> $GITHUB_OUTPUT + + - name: Create GitHub Release if not exists + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ steps.get_tag.outputs.tag }} + run: | + if gh release view "$VERSION" >/dev/null 2>&1; then + echo "Release $VERSION already exists, skipping creation." + else + gh release create "$VERSION" --generate-notes + fi + + docker-push: + needs: release + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.QUIZWARS_DOCKER_USERNAME }} + password: ${{ secrets.QUIZWARS_DOCKER_PASSWORD }} + + - name: Build & Push Docker image + run: | + TAG=${{ needs.release.outputs.tag }} + if [ -z "$TAG" ]; then + echo "No tag available for Docker image. Skipping push." + exit 0 + fi + IMAGE=davidmovas/quizwars-api-gateway + docker build -t $IMAGE:$TAG . + docker tag $IMAGE:$TAG $IMAGE:latest + docker push $IMAGE:$TAG + docker push $IMAGE:latest From 1cdfbe1df1f61b5b9787e42807f8de3925faad60 Mon Sep 17 00:00:00 2001 From: Nofre Date: Mon, 21 Apr 2025 17:49:27 +0200 Subject: [PATCH 5/7] fix(plan): fixed panic with double closing err chan for plans, runtime mux variable renamed in server because of name conflict --- internal/gateway/gateway.go | 7 ++++++- internal/gateway/plan.go | 1 - internal/server/server.go | 8 ++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/internal/gateway/gateway.go b/internal/gateway/gateway.go index 11223ea..65383e0 100644 --- a/internal/gateway/gateway.go +++ b/internal/gateway/gateway.go @@ -129,6 +129,8 @@ func (gt *Gateway) Stop() error { plan.Stop() } + close(gt.plansErrCh) + var errs error var err error @@ -147,7 +149,10 @@ func (gt *Gateway) Stop() error { } func (gt *Gateway) handleWatchErrors() { - for err := range gt.plansErrCh { + select { + case <-gt.ctx.Done(): + return + case err := <-gt.plansErrCh: if err != nil { gt.logger.Zap().Warn("plan watch error", zap.Error(err)) } diff --git a/internal/gateway/plan.go b/internal/gateway/plan.go index 8b7840d..8ffffc1 100644 --- a/internal/gateway/plan.go +++ b/internal/gateway/plan.go @@ -61,6 +61,5 @@ func (p *Plan) Stop() { if p.plan.IsStopped() { close(p.input) - close(p.errCh) } } diff --git a/internal/server/server.go b/internal/server/server.go index 3b939e8..c87d765 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -97,18 +97,18 @@ func (s *Server) Start() error { logger.Info("starting http runtime server", zap.String("port", httpPort)) if ls, err := net.Listen("tcp", fmt.Sprintf(":%s", httpPort)); err == nil { - mux := s.gateway.Runtime() - tcpSrv := &http.Server{Handler: mux} + serveMux := s.gateway.Runtime() + tcpSrv := &http.Server{Handler: serveMux} s.closer.PushIO(ls) s.closer.PushIO(tcpSrv) if err = tcpSrv.Serve(ls); err != nil && !errors.Is(err, http.ErrServerClosed) { - logger.Error("error serving http mux server", zap.Error(err)) + logger.Error("error serving http serveMux server", zap.Error(err)) return err } - logger.Info("http mux server stopped") + logger.Info("http serveMux server stopped") return nil } else { From 158056a43de5b021970dd09bb3c37948e062e12f Mon Sep 17 00:00:00 2001 From: Nofre Date: Mon, 21 Apr 2025 17:53:08 +0200 Subject: [PATCH 6/7] chron(gitignore): gitignore updated, added gen proto files --- .dockerignore | 4 +- .gitignore | 1 - gen/external/questions/v1/admin.pb.go | 1360 +++++++++++++++++ gen/external/questions/v1/admin.pb.gw.go | 595 ++++++++ gen/external/questions/v1/admin_grpc.pb.go | 386 +++++ gen/external/questions/v1/client.pb.go | 149 ++ gen/external/questions/v1/client.pb.gw.go | 155 ++ gen/external/questions/v1/client_grpc.pb.go | 120 ++ gen/external/questions/v1/questions.pb.go | 344 +++++ gen/external/questions/v1/questions.pb.gw.go | 217 +++ .../questions/v1/questions_grpc.pb.go | 157 ++ gen/external/questions/v1/shared.pb.go | 538 +++++++ gen/external/users/v1/admin.pb.go | 1058 +++++++++++++ gen/external/users/v1/admin.pb.gw.go | 406 +++++ gen/external/users/v1/admin_grpc.pb.go | 272 ++++ gen/external/users/v1/auth.pb.go | 702 +++++++++ gen/external/users/v1/auth.pb.gw.go | 406 +++++ gen/external/users/v1/auth_grpc.pb.go | 272 ++++ gen/external/users/v1/profile.pb.go | 539 +++++++ gen/external/users/v1/profile.pb.gw.go | 406 +++++ gen/external/users/v1/profile_grpc.pb.go | 272 ++++ gen/external/users/v1/shared.pb.go | 619 ++++++++ gen/external/users/v1/social.pb.go | 535 +++++++ gen/external/users/v1/social.pb.gw.go | 532 +++++++ gen/external/users/v1/social_grpc.pb.go | 348 +++++ 25 files changed, 10391 insertions(+), 2 deletions(-) create mode 100644 gen/external/questions/v1/admin.pb.go create mode 100644 gen/external/questions/v1/admin.pb.gw.go create mode 100644 gen/external/questions/v1/admin_grpc.pb.go create mode 100644 gen/external/questions/v1/client.pb.go create mode 100644 gen/external/questions/v1/client.pb.gw.go create mode 100644 gen/external/questions/v1/client_grpc.pb.go create mode 100644 gen/external/questions/v1/questions.pb.go create mode 100644 gen/external/questions/v1/questions.pb.gw.go create mode 100644 gen/external/questions/v1/questions_grpc.pb.go create mode 100644 gen/external/questions/v1/shared.pb.go create mode 100644 gen/external/users/v1/admin.pb.go create mode 100644 gen/external/users/v1/admin.pb.gw.go create mode 100644 gen/external/users/v1/admin_grpc.pb.go create mode 100644 gen/external/users/v1/auth.pb.go create mode 100644 gen/external/users/v1/auth.pb.gw.go create mode 100644 gen/external/users/v1/auth_grpc.pb.go create mode 100644 gen/external/users/v1/profile.pb.go create mode 100644 gen/external/users/v1/profile.pb.gw.go create mode 100644 gen/external/users/v1/profile_grpc.pb.go create mode 100644 gen/external/users/v1/shared.pb.go create mode 100644 gen/external/users/v1/social.pb.go create mode 100644 gen/external/users/v1/social.pb.gw.go create mode 100644 gen/external/users/v1/social_grpc.pb.go diff --git a/.dockerignore b/.dockerignore index 2ddb7c0..fc6cdf3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,7 +15,9 @@ protobuf .gitmodules Makefile README.md -config/config.yaml +.github +.golanci.yml +LICENSE # Test binary, built with `go test -c` *.test diff --git a/.gitignore b/.gitignore index f73a50c..468d7bb 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ *.so *.dylib .idea -gen # Test binary, built with `go test -c` *.test diff --git a/gen/external/questions/v1/admin.pb.go b/gen/external/questions/v1/admin.pb.go new file mode 100644 index 0000000..12a3a7e --- /dev/null +++ b/gen/external/questions/v1/admin.pb.go @@ -0,0 +1,1360 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: external/questions/v1/admin.proto + +package questionsv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + 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) +) + +type Order int32 + +const ( + Order_ORDER_UNSPECIFIED Order = 0 + Order_ORDER_ID Order = 1 + Order_ORDER_TEXT Order = 2 + Order_ORDER_TYPE Order = 3 + Order_ORDER_DIFFICULTY Order = 4 + Order_ORDER_CATEGORY Order = 5 + Order_ORDER_LANGUAGE Order = 6 + Order_ORDER_CREATED_AT Order = 7 +) + +// Enum value maps for Order. +var ( + Order_name = map[int32]string{ + 0: "ORDER_UNSPECIFIED", + 1: "ORDER_ID", + 2: "ORDER_TEXT", + 3: "ORDER_TYPE", + 4: "ORDER_DIFFICULTY", + 5: "ORDER_CATEGORY", + 6: "ORDER_LANGUAGE", + 7: "ORDER_CREATED_AT", + } + Order_value = map[string]int32{ + "ORDER_UNSPECIFIED": 0, + "ORDER_ID": 1, + "ORDER_TEXT": 2, + "ORDER_TYPE": 3, + "ORDER_DIFFICULTY": 4, + "ORDER_CATEGORY": 5, + "ORDER_LANGUAGE": 6, + "ORDER_CREATED_AT": 7, + } +) + +func (x Order) Enum() *Order { + p := new(Order) + *p = x + return p +} + +func (x Order) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Order) Descriptor() protoreflect.EnumDescriptor { + return file_external_questions_v1_admin_proto_enumTypes[0].Descriptor() +} + +func (Order) Type() protoreflect.EnumType { + return &file_external_questions_v1_admin_proto_enumTypes[0] +} + +func (x Order) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Order.Descriptor instead. +func (Order) EnumDescriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{0} +} + +type Sort int32 + +const ( + Sort_SORT_UNSPECIFIED Sort = 0 + Sort_SORT_ASC Sort = 1 + Sort_SORT_DESC Sort = 2 +) + +// Enum value maps for Sort. +var ( + Sort_name = map[int32]string{ + 0: "SORT_UNSPECIFIED", + 1: "SORT_ASC", + 2: "SORT_DESC", + } + Sort_value = map[string]int32{ + "SORT_UNSPECIFIED": 0, + "SORT_ASC": 1, + "SORT_DESC": 2, + } +) + +func (x Sort) Enum() *Sort { + p := new(Sort) + *p = x + return p +} + +func (x Sort) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Sort) Descriptor() protoreflect.EnumDescriptor { + return file_external_questions_v1_admin_proto_enumTypes[1].Descriptor() +} + +func (Sort) Type() protoreflect.EnumType { + return &file_external_questions_v1_admin_proto_enumTypes[1] +} + +func (x Sort) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Sort.Descriptor instead. +func (Sort) EnumDescriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{1} +} + +type CreateCategoryRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateCategoryRequest) Reset() { + *x = CreateCategoryRequest{} + mi := &file_external_questions_v1_admin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateCategoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCategoryRequest) ProtoMessage() {} + +func (x *CreateCategoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCategoryRequest.ProtoReflect.Descriptor instead. +func (*CreateCategoryRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateCategoryRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type CreateCategoryResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateCategoryResponse) Reset() { + *x = CreateCategoryResponse{} + mi := &file_external_questions_v1_admin_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateCategoryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCategoryResponse) ProtoMessage() {} + +func (x *CreateCategoryResponse) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCategoryResponse.ProtoReflect.Descriptor instead. +func (*CreateCategoryResponse) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateCategoryResponse) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +type CreateQuestionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=questionsservice.v1.Type" json:"type,omitempty"` + Difficulty Difficulty `protobuf:"varint,2,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty" json:"difficulty,omitempty"` + CategoryId int32 `protobuf:"varint,3,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` + Options []*Option `protobuf:"bytes,5,rep,name=options,proto3" json:"options,omitempty"` + Language string `protobuf:"bytes,6,opt,name=language,proto3" json:"language,omitempty"` + MediaUrl *string `protobuf:"bytes,7,opt,name=media_url,json=mediaUrl,proto3,oneof" json:"media_url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateQuestionRequest) Reset() { + *x = CreateQuestionRequest{} + mi := &file_external_questions_v1_admin_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateQuestionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateQuestionRequest) ProtoMessage() {} + +func (x *CreateQuestionRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateQuestionRequest.ProtoReflect.Descriptor instead. +func (*CreateQuestionRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{2} +} + +func (x *CreateQuestionRequest) GetType() Type { + if x != nil { + return x.Type + } + return Type_TYPE_UNSPECIFIED +} + +func (x *CreateQuestionRequest) GetDifficulty() Difficulty { + if x != nil { + return x.Difficulty + } + return Difficulty_DIFFICULTY_UNSPECIFIED +} + +func (x *CreateQuestionRequest) GetCategoryId() int32 { + if x != nil { + return x.CategoryId + } + return 0 +} + +func (x *CreateQuestionRequest) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *CreateQuestionRequest) GetOptions() []*Option { + if x != nil { + return x.Options + } + return nil +} + +func (x *CreateQuestionRequest) GetLanguage() string { + if x != nil { + return x.Language + } + return "" +} + +func (x *CreateQuestionRequest) GetMediaUrl() string { + if x != nil && x.MediaUrl != nil { + return *x.MediaUrl + } + return "" +} + +type UpdateCategoryRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateCategoryRequest) Reset() { + *x = UpdateCategoryRequest{} + mi := &file_external_questions_v1_admin_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateCategoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCategoryRequest) ProtoMessage() {} + +func (x *UpdateCategoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateCategoryRequest.ProtoReflect.Descriptor instead. +func (*UpdateCategoryRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{3} +} + +func (x *UpdateCategoryRequest) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateCategoryRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type UpdateQuestionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type *Type `protobuf:"varint,2,opt,name=type,proto3,enum=questionsservice.v1.Type,oneof" json:"type,omitempty"` + Difficulty *Difficulty `protobuf:"varint,3,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty,oneof" json:"difficulty,omitempty"` + CategoryId *int32 `protobuf:"varint,4,opt,name=category_id,json=categoryId,proto3,oneof" json:"category_id,omitempty"` + Text *string `protobuf:"bytes,5,opt,name=text,proto3,oneof" json:"text,omitempty"` + Language *string `protobuf:"bytes,6,opt,name=language,proto3,oneof" json:"language,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateQuestionRequest) Reset() { + *x = UpdateQuestionRequest{} + mi := &file_external_questions_v1_admin_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateQuestionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateQuestionRequest) ProtoMessage() {} + +func (x *UpdateQuestionRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateQuestionRequest.ProtoReflect.Descriptor instead. +func (*UpdateQuestionRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateQuestionRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateQuestionRequest) GetType() Type { + if x != nil && x.Type != nil { + return *x.Type + } + return Type_TYPE_UNSPECIFIED +} + +func (x *UpdateQuestionRequest) GetDifficulty() Difficulty { + if x != nil && x.Difficulty != nil { + return *x.Difficulty + } + return Difficulty_DIFFICULTY_UNSPECIFIED +} + +func (x *UpdateQuestionRequest) GetCategoryId() int32 { + if x != nil && x.CategoryId != nil { + return *x.CategoryId + } + return 0 +} + +func (x *UpdateQuestionRequest) GetText() string { + if x != nil && x.Text != nil { + return *x.Text + } + return "" +} + +func (x *UpdateQuestionRequest) GetLanguage() string { + if x != nil && x.Language != nil { + return *x.Language + } + return "" +} + +type UpdateQuestionOptionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Text *string `protobuf:"bytes,2,opt,name=text,proto3,oneof" json:"text,omitempty"` + IsCorrect *bool `protobuf:"varint,3,opt,name=is_correct,json=isCorrect,proto3,oneof" json:"is_correct,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateQuestionOptionRequest) Reset() { + *x = UpdateQuestionOptionRequest{} + mi := &file_external_questions_v1_admin_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateQuestionOptionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateQuestionOptionRequest) ProtoMessage() {} + +func (x *UpdateQuestionOptionRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateQuestionOptionRequest.ProtoReflect.Descriptor instead. +func (*UpdateQuestionOptionRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateQuestionOptionRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateQuestionOptionRequest) GetText() string { + if x != nil && x.Text != nil { + return *x.Text + } + return "" +} + +func (x *UpdateQuestionOptionRequest) GetIsCorrect() bool { + if x != nil && x.IsCorrect != nil { + return *x.IsCorrect + } + return false +} + +type DeleteQuestionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteQuestionRequest) Reset() { + *x = DeleteQuestionRequest{} + mi := &file_external_questions_v1_admin_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteQuestionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteQuestionRequest) ProtoMessage() {} + +func (x *DeleteQuestionRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteQuestionRequest.ProtoReflect.Descriptor instead. +func (*DeleteQuestionRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteQuestionRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteQuestionOptionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteQuestionOptionRequest) Reset() { + *x = DeleteQuestionOptionRequest{} + mi := &file_external_questions_v1_admin_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteQuestionOptionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteQuestionOptionRequest) ProtoMessage() {} + +func (x *DeleteQuestionOptionRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteQuestionOptionRequest.ProtoReflect.Descriptor instead. +func (*DeleteQuestionOptionRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{7} +} + +func (x *DeleteQuestionOptionRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetFilteredQuestionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page uint64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Order *Order `protobuf:"varint,3,opt,name=order,proto3,enum=questionsservice.v1.Order,oneof" json:"order,omitempty"` + Sort *Sort `protobuf:"varint,4,opt,name=sort,proto3,enum=questionsservice.v1.Sort,oneof" json:"sort,omitempty"` + TypeFilter *TypeFilter `protobuf:"bytes,5,opt,name=type_filter,json=typeFilter,proto3,oneof" json:"type_filter,omitempty"` + DifficultyFilter *DifficultyFilter `protobuf:"bytes,6,opt,name=difficulty_filter,json=difficultyFilter,proto3,oneof" json:"difficulty_filter,omitempty"` + CategoryFilter *CategoryFilter `protobuf:"bytes,7,opt,name=category_filter,json=categoryFilter,proto3,oneof" json:"category_filter,omitempty"` + LanguageFilter *LanguageFilter `protobuf:"bytes,8,opt,name=language_filter,json=languageFilter,proto3,oneof" json:"language_filter,omitempty"` + CreateAtFilter *CreatedAtFilter `protobuf:"bytes,9,opt,name=create_at_filter,json=createAtFilter,proto3,oneof" json:"create_at_filter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFilteredQuestionsRequest) Reset() { + *x = GetFilteredQuestionsRequest{} + mi := &file_external_questions_v1_admin_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFilteredQuestionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFilteredQuestionsRequest) ProtoMessage() {} + +func (x *GetFilteredQuestionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFilteredQuestionsRequest.ProtoReflect.Descriptor instead. +func (*GetFilteredQuestionsRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{8} +} + +func (x *GetFilteredQuestionsRequest) GetPage() uint64 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetFilteredQuestionsRequest) GetSize() uint64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *GetFilteredQuestionsRequest) GetOrder() Order { + if x != nil && x.Order != nil { + return *x.Order + } + return Order_ORDER_UNSPECIFIED +} + +func (x *GetFilteredQuestionsRequest) GetSort() Sort { + if x != nil && x.Sort != nil { + return *x.Sort + } + return Sort_SORT_UNSPECIFIED +} + +func (x *GetFilteredQuestionsRequest) GetTypeFilter() *TypeFilter { + if x != nil { + return x.TypeFilter + } + return nil +} + +func (x *GetFilteredQuestionsRequest) GetDifficultyFilter() *DifficultyFilter { + if x != nil { + return x.DifficultyFilter + } + return nil +} + +func (x *GetFilteredQuestionsRequest) GetCategoryFilter() *CategoryFilter { + if x != nil { + return x.CategoryFilter + } + return nil +} + +func (x *GetFilteredQuestionsRequest) GetLanguageFilter() *LanguageFilter { + if x != nil { + return x.LanguageFilter + } + return nil +} + +func (x *GetFilteredQuestionsRequest) GetCreateAtFilter() *CreatedAtFilter { + if x != nil { + return x.CreateAtFilter + } + return nil +} + +type GetFilteredQuestionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Questions []*Question `protobuf:"bytes,1,rep,name=questions,proto3" json:"questions,omitempty"` + Page uint64 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` + Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + Order Order `protobuf:"varint,4,opt,name=order,proto3,enum=questionsservice.v1.Order" json:"order,omitempty"` + Sort Sort `protobuf:"varint,5,opt,name=sort,proto3,enum=questionsservice.v1.Sort" json:"sort,omitempty"` + Amount int64 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFilteredQuestionsResponse) Reset() { + *x = GetFilteredQuestionsResponse{} + mi := &file_external_questions_v1_admin_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFilteredQuestionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFilteredQuestionsResponse) ProtoMessage() {} + +func (x *GetFilteredQuestionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFilteredQuestionsResponse.ProtoReflect.Descriptor instead. +func (*GetFilteredQuestionsResponse) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{9} +} + +func (x *GetFilteredQuestionsResponse) GetQuestions() []*Question { + if x != nil { + return x.Questions + } + return nil +} + +func (x *GetFilteredQuestionsResponse) GetPage() uint64 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetFilteredQuestionsResponse) GetSize() uint64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *GetFilteredQuestionsResponse) GetOrder() Order { + if x != nil { + return x.Order + } + return Order_ORDER_UNSPECIFIED +} + +func (x *GetFilteredQuestionsResponse) GetSort() Sort { + if x != nil { + return x.Sort + } + return Sort_SORT_UNSPECIFIED +} + +func (x *GetFilteredQuestionsResponse) GetAmount() int64 { + if x != nil { + return x.Amount + } + return 0 +} + +type TypeFilter struct { + state protoimpl.MessageState `protogen:"open.v1"` + Types []Type `protobuf:"varint,1,rep,packed,name=types,proto3,enum=questionsservice.v1.Type" json:"types,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TypeFilter) Reset() { + *x = TypeFilter{} + mi := &file_external_questions_v1_admin_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TypeFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TypeFilter) ProtoMessage() {} + +func (x *TypeFilter) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TypeFilter.ProtoReflect.Descriptor instead. +func (*TypeFilter) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{10} +} + +func (x *TypeFilter) GetTypes() []Type { + if x != nil { + return x.Types + } + return nil +} + +type DifficultyFilter struct { + state protoimpl.MessageState `protogen:"open.v1"` + Difficulties []Difficulty `protobuf:"varint,1,rep,packed,name=difficulties,proto3,enum=questionsservice.v1.Difficulty" json:"difficulties,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DifficultyFilter) Reset() { + *x = DifficultyFilter{} + mi := &file_external_questions_v1_admin_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DifficultyFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DifficultyFilter) ProtoMessage() {} + +func (x *DifficultyFilter) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DifficultyFilter.ProtoReflect.Descriptor instead. +func (*DifficultyFilter) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{11} +} + +func (x *DifficultyFilter) GetDifficulties() []Difficulty { + if x != nil { + return x.Difficulties + } + return nil +} + +type CategoryFilter struct { + state protoimpl.MessageState `protogen:"open.v1"` + Categories []int32 `protobuf:"varint,1,rep,packed,name=categories,proto3" json:"categories,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CategoryFilter) Reset() { + *x = CategoryFilter{} + mi := &file_external_questions_v1_admin_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CategoryFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CategoryFilter) ProtoMessage() {} + +func (x *CategoryFilter) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CategoryFilter.ProtoReflect.Descriptor instead. +func (*CategoryFilter) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{12} +} + +func (x *CategoryFilter) GetCategories() []int32 { + if x != nil { + return x.Categories + } + return nil +} + +type LanguageFilter struct { + state protoimpl.MessageState `protogen:"open.v1"` + Languages []string `protobuf:"bytes,1,rep,name=languages,proto3" json:"languages,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LanguageFilter) Reset() { + *x = LanguageFilter{} + mi := &file_external_questions_v1_admin_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LanguageFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LanguageFilter) ProtoMessage() {} + +func (x *LanguageFilter) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LanguageFilter.ProtoReflect.Descriptor instead. +func (*LanguageFilter) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{13} +} + +func (x *LanguageFilter) GetLanguages() []string { + if x != nil { + return x.Languages + } + return nil +} + +type CreatedAtFilter struct { + state protoimpl.MessageState `protogen:"open.v1"` + From *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + To *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreatedAtFilter) Reset() { + *x = CreatedAtFilter{} + mi := &file_external_questions_v1_admin_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreatedAtFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatedAtFilter) ProtoMessage() {} + +func (x *CreatedAtFilter) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatedAtFilter.ProtoReflect.Descriptor instead. +func (*CreatedAtFilter) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{14} +} + +func (x *CreatedAtFilter) GetFrom() *timestamppb.Timestamp { + if x != nil { + return x.From + } + return nil +} + +func (x *CreatedAtFilter) GetTo() *timestamppb.Timestamp { + if x != nil { + return x.To + } + return nil +} + +var File_external_questions_v1_admin_proto protoreflect.FileDescriptor + +var file_external_questions_v1_admin_proto_rawDesc = string([]byte{ + 0x0a, 0x21, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x22, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2b, 0x0a, 0x15, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, + 0x64, 0x22, 0xbf, 0x02, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x64, 0x69, + 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, + 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, + 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x63, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, + 0x12, 0x35, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, + 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, + 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x55, + 0x72, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, + 0x75, 0x72, 0x6c, 0x22, 0x3b, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0xbf, 0x02, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x44, + 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x79, 0x48, 0x01, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, + 0x79, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, + 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x0a, 0x63, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x74, 0x65, + 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, + 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, + 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0d, 0x0a, + 0x0b, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x42, 0x0e, 0x0a, 0x0c, + 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x42, 0x07, 0x0a, 0x05, + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, + 0x67, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x88, 0x01, 0x01, 0x12, 0x22, 0x0a, 0x0a, 0x69, + 0x73, 0x5f, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, + 0x01, 0x52, 0x09, 0x69, 0x73, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x88, 0x01, 0x01, 0x42, + 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x69, 0x73, 0x5f, + 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x22, 0x27, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x2d, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, + 0xc1, 0x05, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x51, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x48, 0x00, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x32, + 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x48, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x88, + 0x01, 0x01, 0x12, 0x45, 0x0a, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, + 0x70, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x02, 0x52, 0x0a, 0x74, 0x79, 0x70, 0x65, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x57, 0x0a, 0x11, 0x64, 0x69, 0x66, + 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x69, + 0x63, 0x75, 0x6c, 0x74, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x03, 0x52, 0x10, 0x64, + 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, + 0x01, 0x01, 0x12, 0x51, 0x0a, 0x0f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x48, 0x04, 0x52, 0x0e, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x51, 0x0a, 0x0f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, + 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x48, 0x05, 0x52, 0x0e, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x53, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x06, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, + 0x06, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x73, 0x6f, 0x72, 0x74, + 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x5f, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x6c, + 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x13, + 0x0a, 0x11, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x22, 0xfc, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, + 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x04, 0x73, + 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x3d, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x12, 0x2f, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, + 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x22, 0x57, 0x0a, 0x10, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0c, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x0c, 0x64, 0x69, + 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x69, 0x65, 0x73, 0x22, 0x30, 0x0a, 0x0e, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, + 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x2e, 0x0a, 0x0e, + 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1c, + 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x0f, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, + 0x2e, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, + 0x2a, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x02, 0x74, 0x6f, 0x2a, 0xa0, 0x01, 0x0a, 0x05, + 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, + 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x52, + 0x44, 0x45, 0x52, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x52, + 0x44, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x52, + 0x44, 0x45, 0x52, 0x5f, 0x44, 0x49, 0x46, 0x46, 0x49, 0x43, 0x55, 0x4c, 0x54, 0x59, 0x10, 0x04, + 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, + 0x52, 0x59, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x4c, 0x41, + 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x10, 0x06, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x52, 0x44, 0x45, + 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x54, 0x10, 0x07, 0x2a, 0x39, + 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, + 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x41, 0x53, 0x43, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x4f, + 0x52, 0x54, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x10, 0x02, 0x32, 0x9b, 0x06, 0x0a, 0x15, 0x51, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x65, 0x64, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x2e, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x51, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x69, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x12, 0x54, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x54, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x60, 0x0a, + 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, + 0x54, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x60, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x1a, 0x5a, 0x18, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_external_questions_v1_admin_proto_rawDescOnce sync.Once + file_external_questions_v1_admin_proto_rawDescData []byte +) + +func file_external_questions_v1_admin_proto_rawDescGZIP() []byte { + file_external_questions_v1_admin_proto_rawDescOnce.Do(func() { + file_external_questions_v1_admin_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_external_questions_v1_admin_proto_rawDesc), len(file_external_questions_v1_admin_proto_rawDesc))) + }) + return file_external_questions_v1_admin_proto_rawDescData +} + +var file_external_questions_v1_admin_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_external_questions_v1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_external_questions_v1_admin_proto_goTypes = []any{ + (Order)(0), // 0: questionsservice.v1.Order + (Sort)(0), // 1: questionsservice.v1.Sort + (*CreateCategoryRequest)(nil), // 2: questionsservice.v1.CreateCategoryRequest + (*CreateCategoryResponse)(nil), // 3: questionsservice.v1.CreateCategoryResponse + (*CreateQuestionRequest)(nil), // 4: questionsservice.v1.CreateQuestionRequest + (*UpdateCategoryRequest)(nil), // 5: questionsservice.v1.UpdateCategoryRequest + (*UpdateQuestionRequest)(nil), // 6: questionsservice.v1.UpdateQuestionRequest + (*UpdateQuestionOptionRequest)(nil), // 7: questionsservice.v1.UpdateQuestionOptionRequest + (*DeleteQuestionRequest)(nil), // 8: questionsservice.v1.DeleteQuestionRequest + (*DeleteQuestionOptionRequest)(nil), // 9: questionsservice.v1.DeleteQuestionOptionRequest + (*GetFilteredQuestionsRequest)(nil), // 10: questionsservice.v1.GetFilteredQuestionsRequest + (*GetFilteredQuestionsResponse)(nil), // 11: questionsservice.v1.GetFilteredQuestionsResponse + (*TypeFilter)(nil), // 12: questionsservice.v1.TypeFilter + (*DifficultyFilter)(nil), // 13: questionsservice.v1.DifficultyFilter + (*CategoryFilter)(nil), // 14: questionsservice.v1.CategoryFilter + (*LanguageFilter)(nil), // 15: questionsservice.v1.LanguageFilter + (*CreatedAtFilter)(nil), // 16: questionsservice.v1.CreatedAtFilter + (Type)(0), // 17: questionsservice.v1.Type + (Difficulty)(0), // 18: questionsservice.v1.Difficulty + (*Option)(nil), // 19: questionsservice.v1.Option + (*Question)(nil), // 20: questionsservice.v1.Question + (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 22: google.protobuf.Empty +} +var file_external_questions_v1_admin_proto_depIdxs = []int32{ + 17, // 0: questionsservice.v1.CreateQuestionRequest.type:type_name -> questionsservice.v1.Type + 18, // 1: questionsservice.v1.CreateQuestionRequest.difficulty:type_name -> questionsservice.v1.Difficulty + 19, // 2: questionsservice.v1.CreateQuestionRequest.options:type_name -> questionsservice.v1.Option + 17, // 3: questionsservice.v1.UpdateQuestionRequest.type:type_name -> questionsservice.v1.Type + 18, // 4: questionsservice.v1.UpdateQuestionRequest.difficulty:type_name -> questionsservice.v1.Difficulty + 0, // 5: questionsservice.v1.GetFilteredQuestionsRequest.order:type_name -> questionsservice.v1.Order + 1, // 6: questionsservice.v1.GetFilteredQuestionsRequest.sort:type_name -> questionsservice.v1.Sort + 12, // 7: questionsservice.v1.GetFilteredQuestionsRequest.type_filter:type_name -> questionsservice.v1.TypeFilter + 13, // 8: questionsservice.v1.GetFilteredQuestionsRequest.difficulty_filter:type_name -> questionsservice.v1.DifficultyFilter + 14, // 9: questionsservice.v1.GetFilteredQuestionsRequest.category_filter:type_name -> questionsservice.v1.CategoryFilter + 15, // 10: questionsservice.v1.GetFilteredQuestionsRequest.language_filter:type_name -> questionsservice.v1.LanguageFilter + 16, // 11: questionsservice.v1.GetFilteredQuestionsRequest.create_at_filter:type_name -> questionsservice.v1.CreatedAtFilter + 20, // 12: questionsservice.v1.GetFilteredQuestionsResponse.questions:type_name -> questionsservice.v1.Question + 0, // 13: questionsservice.v1.GetFilteredQuestionsResponse.order:type_name -> questionsservice.v1.Order + 1, // 14: questionsservice.v1.GetFilteredQuestionsResponse.sort:type_name -> questionsservice.v1.Sort + 17, // 15: questionsservice.v1.TypeFilter.types:type_name -> questionsservice.v1.Type + 18, // 16: questionsservice.v1.DifficultyFilter.difficulties:type_name -> questionsservice.v1.Difficulty + 21, // 17: questionsservice.v1.CreatedAtFilter.from:type_name -> google.protobuf.Timestamp + 21, // 18: questionsservice.v1.CreatedAtFilter.to:type_name -> google.protobuf.Timestamp + 10, // 19: questionsservice.v1.QuestionsAdminService.GetFilteredQuestions:input_type -> questionsservice.v1.GetFilteredQuestionsRequest + 2, // 20: questionsservice.v1.QuestionsAdminService.CreateCategory:input_type -> questionsservice.v1.CreateCategoryRequest + 4, // 21: questionsservice.v1.QuestionsAdminService.CreateQuestion:input_type -> questionsservice.v1.CreateQuestionRequest + 5, // 22: questionsservice.v1.QuestionsAdminService.UpdateCategory:input_type -> questionsservice.v1.UpdateCategoryRequest + 6, // 23: questionsservice.v1.QuestionsAdminService.UpdateQuestion:input_type -> questionsservice.v1.UpdateQuestionRequest + 7, // 24: questionsservice.v1.QuestionsAdminService.UpdateQuestionOption:input_type -> questionsservice.v1.UpdateQuestionOptionRequest + 8, // 25: questionsservice.v1.QuestionsAdminService.DeleteQuestion:input_type -> questionsservice.v1.DeleteQuestionRequest + 9, // 26: questionsservice.v1.QuestionsAdminService.DeleteQuestionOption:input_type -> questionsservice.v1.DeleteQuestionOptionRequest + 11, // 27: questionsservice.v1.QuestionsAdminService.GetFilteredQuestions:output_type -> questionsservice.v1.GetFilteredQuestionsResponse + 3, // 28: questionsservice.v1.QuestionsAdminService.CreateCategory:output_type -> questionsservice.v1.CreateCategoryResponse + 22, // 29: questionsservice.v1.QuestionsAdminService.CreateQuestion:output_type -> google.protobuf.Empty + 22, // 30: questionsservice.v1.QuestionsAdminService.UpdateCategory:output_type -> google.protobuf.Empty + 22, // 31: questionsservice.v1.QuestionsAdminService.UpdateQuestion:output_type -> google.protobuf.Empty + 22, // 32: questionsservice.v1.QuestionsAdminService.UpdateQuestionOption:output_type -> google.protobuf.Empty + 22, // 33: questionsservice.v1.QuestionsAdminService.DeleteQuestion:output_type -> google.protobuf.Empty + 22, // 34: questionsservice.v1.QuestionsAdminService.DeleteQuestionOption:output_type -> google.protobuf.Empty + 27, // [27:35] is the sub-list for method output_type + 19, // [19:27] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name +} + +func init() { file_external_questions_v1_admin_proto_init() } +func file_external_questions_v1_admin_proto_init() { + if File_external_questions_v1_admin_proto != nil { + return + } + file_external_questions_v1_shared_proto_init() + file_external_questions_v1_admin_proto_msgTypes[2].OneofWrappers = []any{} + file_external_questions_v1_admin_proto_msgTypes[4].OneofWrappers = []any{} + file_external_questions_v1_admin_proto_msgTypes[5].OneofWrappers = []any{} + file_external_questions_v1_admin_proto_msgTypes[8].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_questions_v1_admin_proto_rawDesc), len(file_external_questions_v1_admin_proto_rawDesc)), + NumEnums: 2, + NumMessages: 15, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_external_questions_v1_admin_proto_goTypes, + DependencyIndexes: file_external_questions_v1_admin_proto_depIdxs, + EnumInfos: file_external_questions_v1_admin_proto_enumTypes, + MessageInfos: file_external_questions_v1_admin_proto_msgTypes, + }.Build() + File_external_questions_v1_admin_proto = out.File + file_external_questions_v1_admin_proto_goTypes = nil + file_external_questions_v1_admin_proto_depIdxs = nil +} diff --git a/gen/external/questions/v1/admin.pb.gw.go b/gen/external/questions/v1/admin.pb.gw.go new file mode 100644 index 0000000..f282e7c --- /dev/null +++ b/gen/external/questions/v1/admin.pb.gw.go @@ -0,0 +1,595 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: external/questions/v1/admin.proto + +/* +Package questionsv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package questionsv1 + +import ( + "context" + "errors" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) + +func request_QuestionsAdminService_GetFilteredQuestions_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetFilteredQuestionsRequest + 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.GetFilteredQuestions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsAdminService_GetFilteredQuestions_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetFilteredQuestionsRequest + 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.GetFilteredQuestions(ctx, &protoReq) + return msg, metadata, err +} + +func request_QuestionsAdminService_CreateCategory_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CreateCategoryRequest + 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.CreateCategory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsAdminService_CreateCategory_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CreateCategoryRequest + 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.CreateCategory(ctx, &protoReq) + return msg, metadata, err +} + +func request_QuestionsAdminService_CreateQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CreateQuestionRequest + 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.CreateQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsAdminService_CreateQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CreateQuestionRequest + 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.CreateQuestion(ctx, &protoReq) + return msg, metadata, err +} + +func request_QuestionsAdminService_UpdateCategory_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateCategoryRequest + 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.UpdateCategory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsAdminService_UpdateCategory_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateCategoryRequest + 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.UpdateCategory(ctx, &protoReq) + return msg, metadata, err +} + +func request_QuestionsAdminService_UpdateQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateQuestionRequest + 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.UpdateQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsAdminService_UpdateQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateQuestionRequest + 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.UpdateQuestion(ctx, &protoReq) + return msg, metadata, err +} + +func request_QuestionsAdminService_UpdateQuestionOption_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateQuestionOptionRequest + 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.UpdateQuestionOption(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsAdminService_UpdateQuestionOption_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateQuestionOptionRequest + 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.UpdateQuestionOption(ctx, &protoReq) + return msg, metadata, err +} + +func request_QuestionsAdminService_DeleteQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq DeleteQuestionRequest + 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.DeleteQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsAdminService_DeleteQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq DeleteQuestionRequest + 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.DeleteQuestion(ctx, &protoReq) + return msg, metadata, err +} + +func request_QuestionsAdminService_DeleteQuestionOption_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq DeleteQuestionOptionRequest + 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.DeleteQuestionOption(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsAdminService_DeleteQuestionOption_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq DeleteQuestionOptionRequest + 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.DeleteQuestionOption(ctx, &protoReq) + return msg, metadata, err +} + +// RegisterQuestionsAdminServiceHandlerServer registers the http handlers for service QuestionsAdminService to "mux". +// UnaryRPC :call QuestionsAdminServiceServer 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 RegisterQuestionsAdminServiceHandlerFromEndpoint 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 RegisterQuestionsAdminServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QuestionsAdminServiceServer) error { + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_GetFilteredQuestions_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, "/questionsservice.v1.QuestionsAdminService/GetFilteredQuestions", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/GetFilteredQuestions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsAdminService_GetFilteredQuestions_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_QuestionsAdminService_GetFilteredQuestions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_CreateCategory_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, "/questionsservice.v1.QuestionsAdminService/CreateCategory", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/CreateCategory")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsAdminService_CreateCategory_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_QuestionsAdminService_CreateCategory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_CreateQuestion_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, "/questionsservice.v1.QuestionsAdminService/CreateQuestion", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/CreateQuestion")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsAdminService_CreateQuestion_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_QuestionsAdminService_CreateQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_UpdateCategory_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, "/questionsservice.v1.QuestionsAdminService/UpdateCategory", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/UpdateCategory")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsAdminService_UpdateCategory_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_QuestionsAdminService_UpdateCategory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_UpdateQuestion_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, "/questionsservice.v1.QuestionsAdminService/UpdateQuestion", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/UpdateQuestion")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsAdminService_UpdateQuestion_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_QuestionsAdminService_UpdateQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_UpdateQuestionOption_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, "/questionsservice.v1.QuestionsAdminService/UpdateQuestionOption", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/UpdateQuestionOption")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsAdminService_UpdateQuestionOption_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_QuestionsAdminService_UpdateQuestionOption_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_DeleteQuestion_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, "/questionsservice.v1.QuestionsAdminService/DeleteQuestion", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/DeleteQuestion")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsAdminService_DeleteQuestion_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_QuestionsAdminService_DeleteQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_DeleteQuestionOption_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, "/questionsservice.v1.QuestionsAdminService/DeleteQuestionOption", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/DeleteQuestionOption")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsAdminService_DeleteQuestionOption_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_QuestionsAdminService_DeleteQuestionOption_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + return nil +} + +// RegisterQuestionsAdminServiceHandlerFromEndpoint is same as RegisterQuestionsAdminServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQuestionsAdminServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.NewClient(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + return RegisterQuestionsAdminServiceHandler(ctx, mux, conn) +} + +// RegisterQuestionsAdminServiceHandler registers the http handlers for service QuestionsAdminService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQuestionsAdminServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQuestionsAdminServiceHandlerClient(ctx, mux, NewQuestionsAdminServiceClient(conn)) +} + +// RegisterQuestionsAdminServiceHandlerClient registers the http handlers for service QuestionsAdminService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QuestionsAdminServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QuestionsAdminServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QuestionsAdminServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +func RegisterQuestionsAdminServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QuestionsAdminServiceClient) error { + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_GetFilteredQuestions_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, "/questionsservice.v1.QuestionsAdminService/GetFilteredQuestions", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/GetFilteredQuestions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsAdminService_GetFilteredQuestions_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsAdminService_GetFilteredQuestions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_CreateCategory_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, "/questionsservice.v1.QuestionsAdminService/CreateCategory", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/CreateCategory")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsAdminService_CreateCategory_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsAdminService_CreateCategory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_CreateQuestion_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, "/questionsservice.v1.QuestionsAdminService/CreateQuestion", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/CreateQuestion")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsAdminService_CreateQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsAdminService_CreateQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_UpdateCategory_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, "/questionsservice.v1.QuestionsAdminService/UpdateCategory", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/UpdateCategory")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsAdminService_UpdateCategory_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsAdminService_UpdateCategory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_UpdateQuestion_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, "/questionsservice.v1.QuestionsAdminService/UpdateQuestion", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/UpdateQuestion")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsAdminService_UpdateQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsAdminService_UpdateQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_UpdateQuestionOption_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, "/questionsservice.v1.QuestionsAdminService/UpdateQuestionOption", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/UpdateQuestionOption")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsAdminService_UpdateQuestionOption_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsAdminService_UpdateQuestionOption_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_DeleteQuestion_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, "/questionsservice.v1.QuestionsAdminService/DeleteQuestion", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/DeleteQuestion")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsAdminService_DeleteQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsAdminService_DeleteQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_DeleteQuestionOption_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, "/questionsservice.v1.QuestionsAdminService/DeleteQuestionOption", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/DeleteQuestionOption")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsAdminService_DeleteQuestionOption_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsAdminService_DeleteQuestionOption_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil +} + +var ( + pattern_QuestionsAdminService_GetFilteredQuestions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "GetFilteredQuestions"}, "")) + pattern_QuestionsAdminService_CreateCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "CreateCategory"}, "")) + pattern_QuestionsAdminService_CreateQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "CreateQuestion"}, "")) + pattern_QuestionsAdminService_UpdateCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "UpdateCategory"}, "")) + pattern_QuestionsAdminService_UpdateQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "UpdateQuestion"}, "")) + pattern_QuestionsAdminService_UpdateQuestionOption_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "UpdateQuestionOption"}, "")) + pattern_QuestionsAdminService_DeleteQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "DeleteQuestion"}, "")) + pattern_QuestionsAdminService_DeleteQuestionOption_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "DeleteQuestionOption"}, "")) +) + +var ( + forward_QuestionsAdminService_GetFilteredQuestions_0 = runtime.ForwardResponseMessage + forward_QuestionsAdminService_CreateCategory_0 = runtime.ForwardResponseMessage + forward_QuestionsAdminService_CreateQuestion_0 = runtime.ForwardResponseMessage + forward_QuestionsAdminService_UpdateCategory_0 = runtime.ForwardResponseMessage + forward_QuestionsAdminService_UpdateQuestion_0 = runtime.ForwardResponseMessage + forward_QuestionsAdminService_UpdateQuestionOption_0 = runtime.ForwardResponseMessage + forward_QuestionsAdminService_DeleteQuestion_0 = runtime.ForwardResponseMessage + forward_QuestionsAdminService_DeleteQuestionOption_0 = runtime.ForwardResponseMessage +) diff --git a/gen/external/questions/v1/admin_grpc.pb.go b/gen/external/questions/v1/admin_grpc.pb.go new file mode 100644 index 0000000..289aeb9 --- /dev/null +++ b/gen/external/questions/v1/admin_grpc.pb.go @@ -0,0 +1,386 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: external/questions/v1/admin.proto + +package questionsv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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 ( + QuestionsAdminService_GetFilteredQuestions_FullMethodName = "/questionsservice.v1.QuestionsAdminService/GetFilteredQuestions" + QuestionsAdminService_CreateCategory_FullMethodName = "/questionsservice.v1.QuestionsAdminService/CreateCategory" + QuestionsAdminService_CreateQuestion_FullMethodName = "/questionsservice.v1.QuestionsAdminService/CreateQuestion" + QuestionsAdminService_UpdateCategory_FullMethodName = "/questionsservice.v1.QuestionsAdminService/UpdateCategory" + QuestionsAdminService_UpdateQuestion_FullMethodName = "/questionsservice.v1.QuestionsAdminService/UpdateQuestion" + QuestionsAdminService_UpdateQuestionOption_FullMethodName = "/questionsservice.v1.QuestionsAdminService/UpdateQuestionOption" + QuestionsAdminService_DeleteQuestion_FullMethodName = "/questionsservice.v1.QuestionsAdminService/DeleteQuestion" + QuestionsAdminService_DeleteQuestionOption_FullMethodName = "/questionsservice.v1.QuestionsAdminService/DeleteQuestionOption" +) + +// QuestionsAdminServiceClient is the client API for QuestionsAdminService 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 QuestionsAdminServiceClient interface { + GetFilteredQuestions(ctx context.Context, in *GetFilteredQuestionsRequest, opts ...grpc.CallOption) (*GetFilteredQuestionsResponse, error) + CreateCategory(ctx context.Context, in *CreateCategoryRequest, opts ...grpc.CallOption) (*CreateCategoryResponse, error) + CreateQuestion(ctx context.Context, in *CreateQuestionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + UpdateCategory(ctx context.Context, in *UpdateCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + UpdateQuestion(ctx context.Context, in *UpdateQuestionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + UpdateQuestionOption(ctx context.Context, in *UpdateQuestionOptionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + DeleteQuestion(ctx context.Context, in *DeleteQuestionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + DeleteQuestionOption(ctx context.Context, in *DeleteQuestionOptionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type questionsAdminServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewQuestionsAdminServiceClient(cc grpc.ClientConnInterface) QuestionsAdminServiceClient { + return &questionsAdminServiceClient{cc} +} + +func (c *questionsAdminServiceClient) GetFilteredQuestions(ctx context.Context, in *GetFilteredQuestionsRequest, opts ...grpc.CallOption) (*GetFilteredQuestionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetFilteredQuestionsResponse) + err := c.cc.Invoke(ctx, QuestionsAdminService_GetFilteredQuestions_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *questionsAdminServiceClient) CreateCategory(ctx context.Context, in *CreateCategoryRequest, opts ...grpc.CallOption) (*CreateCategoryResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CreateCategoryResponse) + err := c.cc.Invoke(ctx, QuestionsAdminService_CreateCategory_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *questionsAdminServiceClient) CreateQuestion(ctx context.Context, in *CreateQuestionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, QuestionsAdminService_CreateQuestion_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *questionsAdminServiceClient) UpdateCategory(ctx context.Context, in *UpdateCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, QuestionsAdminService_UpdateCategory_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *questionsAdminServiceClient) UpdateQuestion(ctx context.Context, in *UpdateQuestionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, QuestionsAdminService_UpdateQuestion_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *questionsAdminServiceClient) UpdateQuestionOption(ctx context.Context, in *UpdateQuestionOptionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, QuestionsAdminService_UpdateQuestionOption_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *questionsAdminServiceClient) DeleteQuestion(ctx context.Context, in *DeleteQuestionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, QuestionsAdminService_DeleteQuestion_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *questionsAdminServiceClient) DeleteQuestionOption(ctx context.Context, in *DeleteQuestionOptionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, QuestionsAdminService_DeleteQuestionOption_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QuestionsAdminServiceServer is the server API for QuestionsAdminService service. +// All implementations should embed UnimplementedQuestionsAdminServiceServer +// for forward compatibility. +type QuestionsAdminServiceServer interface { + GetFilteredQuestions(context.Context, *GetFilteredQuestionsRequest) (*GetFilteredQuestionsResponse, error) + CreateCategory(context.Context, *CreateCategoryRequest) (*CreateCategoryResponse, error) + CreateQuestion(context.Context, *CreateQuestionRequest) (*emptypb.Empty, error) + UpdateCategory(context.Context, *UpdateCategoryRequest) (*emptypb.Empty, error) + UpdateQuestion(context.Context, *UpdateQuestionRequest) (*emptypb.Empty, error) + UpdateQuestionOption(context.Context, *UpdateQuestionOptionRequest) (*emptypb.Empty, error) + DeleteQuestion(context.Context, *DeleteQuestionRequest) (*emptypb.Empty, error) + DeleteQuestionOption(context.Context, *DeleteQuestionOptionRequest) (*emptypb.Empty, error) +} + +// UnimplementedQuestionsAdminServiceServer should 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 UnimplementedQuestionsAdminServiceServer struct{} + +func (UnimplementedQuestionsAdminServiceServer) GetFilteredQuestions(context.Context, *GetFilteredQuestionsRequest) (*GetFilteredQuestionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFilteredQuestions not implemented") +} +func (UnimplementedQuestionsAdminServiceServer) CreateCategory(context.Context, *CreateCategoryRequest) (*CreateCategoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateCategory not implemented") +} +func (UnimplementedQuestionsAdminServiceServer) CreateQuestion(context.Context, *CreateQuestionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateQuestion not implemented") +} +func (UnimplementedQuestionsAdminServiceServer) UpdateCategory(context.Context, *UpdateCategoryRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateCategory not implemented") +} +func (UnimplementedQuestionsAdminServiceServer) UpdateQuestion(context.Context, *UpdateQuestionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateQuestion not implemented") +} +func (UnimplementedQuestionsAdminServiceServer) UpdateQuestionOption(context.Context, *UpdateQuestionOptionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateQuestionOption not implemented") +} +func (UnimplementedQuestionsAdminServiceServer) DeleteQuestion(context.Context, *DeleteQuestionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteQuestion not implemented") +} +func (UnimplementedQuestionsAdminServiceServer) DeleteQuestionOption(context.Context, *DeleteQuestionOptionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteQuestionOption not implemented") +} +func (UnimplementedQuestionsAdminServiceServer) testEmbeddedByValue() {} + +// UnsafeQuestionsAdminServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QuestionsAdminServiceServer will +// result in compilation errors. +type UnsafeQuestionsAdminServiceServer interface { + mustEmbedUnimplementedQuestionsAdminServiceServer() +} + +func RegisterQuestionsAdminServiceServer(s grpc.ServiceRegistrar, srv QuestionsAdminServiceServer) { + // If the following call pancis, it indicates UnimplementedQuestionsAdminServiceServer 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(&QuestionsAdminService_ServiceDesc, srv) +} + +func _QuestionsAdminService_GetFilteredQuestions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFilteredQuestionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsAdminServiceServer).GetFilteredQuestions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsAdminService_GetFilteredQuestions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsAdminServiceServer).GetFilteredQuestions(ctx, req.(*GetFilteredQuestionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QuestionsAdminService_CreateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCategoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsAdminServiceServer).CreateCategory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsAdminService_CreateCategory_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsAdminServiceServer).CreateCategory(ctx, req.(*CreateCategoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QuestionsAdminService_CreateQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateQuestionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsAdminServiceServer).CreateQuestion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsAdminService_CreateQuestion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsAdminServiceServer).CreateQuestion(ctx, req.(*CreateQuestionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QuestionsAdminService_UpdateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateCategoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsAdminServiceServer).UpdateCategory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsAdminService_UpdateCategory_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsAdminServiceServer).UpdateCategory(ctx, req.(*UpdateCategoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QuestionsAdminService_UpdateQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateQuestionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsAdminServiceServer).UpdateQuestion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsAdminService_UpdateQuestion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsAdminServiceServer).UpdateQuestion(ctx, req.(*UpdateQuestionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QuestionsAdminService_UpdateQuestionOption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateQuestionOptionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsAdminServiceServer).UpdateQuestionOption(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsAdminService_UpdateQuestionOption_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsAdminServiceServer).UpdateQuestionOption(ctx, req.(*UpdateQuestionOptionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QuestionsAdminService_DeleteQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteQuestionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsAdminServiceServer).DeleteQuestion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsAdminService_DeleteQuestion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsAdminServiceServer).DeleteQuestion(ctx, req.(*DeleteQuestionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QuestionsAdminService_DeleteQuestionOption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteQuestionOptionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsAdminServiceServer).DeleteQuestionOption(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsAdminService_DeleteQuestionOption_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsAdminServiceServer).DeleteQuestionOption(ctx, req.(*DeleteQuestionOptionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// QuestionsAdminService_ServiceDesc is the grpc.ServiceDesc for QuestionsAdminService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var QuestionsAdminService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "questionsservice.v1.QuestionsAdminService", + HandlerType: (*QuestionsAdminServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetFilteredQuestions", + Handler: _QuestionsAdminService_GetFilteredQuestions_Handler, + }, + { + MethodName: "CreateCategory", + Handler: _QuestionsAdminService_CreateCategory_Handler, + }, + { + MethodName: "CreateQuestion", + Handler: _QuestionsAdminService_CreateQuestion_Handler, + }, + { + MethodName: "UpdateCategory", + Handler: _QuestionsAdminService_UpdateCategory_Handler, + }, + { + MethodName: "UpdateQuestion", + Handler: _QuestionsAdminService_UpdateQuestion_Handler, + }, + { + MethodName: "UpdateQuestionOption", + Handler: _QuestionsAdminService_UpdateQuestionOption_Handler, + }, + { + MethodName: "DeleteQuestion", + Handler: _QuestionsAdminService_DeleteQuestion_Handler, + }, + { + MethodName: "DeleteQuestionOption", + Handler: _QuestionsAdminService_DeleteQuestionOption_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "external/questions/v1/admin.proto", +} diff --git a/gen/external/questions/v1/client.pb.go b/gen/external/questions/v1/client.pb.go new file mode 100644 index 0000000..be8b672 --- /dev/null +++ b/gen/external/questions/v1/client.pb.go @@ -0,0 +1,149 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: external/questions/v1/client.proto + +package questionsv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" + 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) +) + +type GetCategoriesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Categories []*Category `protobuf:"bytes,1,rep,name=categories,proto3" json:"categories,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetCategoriesResponse) Reset() { + *x = GetCategoriesResponse{} + mi := &file_external_questions_v1_client_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetCategoriesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCategoriesResponse) ProtoMessage() {} + +func (x *GetCategoriesResponse) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_client_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCategoriesResponse.ProtoReflect.Descriptor instead. +func (*GetCategoriesResponse) Descriptor() ([]byte, []int) { + return file_external_questions_v1_client_proto_rawDescGZIP(), []int{0} +} + +func (x *GetCategoriesResponse) GetCategories() []*Category { + if x != nil { + return x.Categories + } + return nil +} + +var File_external_questions_v1_client_proto protoreflect.FileDescriptor + +var file_external_questions_v1_client_proto_rawDesc = string([]byte{ + 0x0a, 0x22, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x15, 0x47, 0x65, + 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, + 0x65, 0x73, 0x32, 0x6d, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x0d, + 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x1a, 0x5a, 0x18, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, + 0x31, 0x3b, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_external_questions_v1_client_proto_rawDescOnce sync.Once + file_external_questions_v1_client_proto_rawDescData []byte +) + +func file_external_questions_v1_client_proto_rawDescGZIP() []byte { + file_external_questions_v1_client_proto_rawDescOnce.Do(func() { + file_external_questions_v1_client_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_external_questions_v1_client_proto_rawDesc), len(file_external_questions_v1_client_proto_rawDesc))) + }) + return file_external_questions_v1_client_proto_rawDescData +} + +var file_external_questions_v1_client_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_external_questions_v1_client_proto_goTypes = []any{ + (*GetCategoriesResponse)(nil), // 0: questionsservice.v1.GetCategoriesResponse + (*Category)(nil), // 1: questionsservice.v1.Category + (*emptypb.Empty)(nil), // 2: google.protobuf.Empty +} +var file_external_questions_v1_client_proto_depIdxs = []int32{ + 1, // 0: questionsservice.v1.GetCategoriesResponse.categories:type_name -> questionsservice.v1.Category + 2, // 1: questionsservice.v1.QuestionsClientService.GetCategories:input_type -> google.protobuf.Empty + 0, // 2: questionsservice.v1.QuestionsClientService.GetCategories:output_type -> questionsservice.v1.GetCategoriesResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_external_questions_v1_client_proto_init() } +func file_external_questions_v1_client_proto_init() { + if File_external_questions_v1_client_proto != nil { + return + } + file_external_questions_v1_shared_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_questions_v1_client_proto_rawDesc), len(file_external_questions_v1_client_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_external_questions_v1_client_proto_goTypes, + DependencyIndexes: file_external_questions_v1_client_proto_depIdxs, + MessageInfos: file_external_questions_v1_client_proto_msgTypes, + }.Build() + File_external_questions_v1_client_proto = out.File + file_external_questions_v1_client_proto_goTypes = nil + file_external_questions_v1_client_proto_depIdxs = nil +} diff --git a/gen/external/questions/v1/client.pb.gw.go b/gen/external/questions/v1/client.pb.gw.go new file mode 100644 index 0000000..00e65d1 --- /dev/null +++ b/gen/external/questions/v1/client.pb.gw.go @@ -0,0 +1,155 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: external/questions/v1/client.proto + +/* +Package questionsv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package questionsv1 + +import ( + "context" + "errors" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/emptypb" +) + +// Suppress "imported and not used" errors +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) + +func request_QuestionsClientService_GetCategories_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsClientServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq emptypb.Empty + 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.GetCategories(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsClientService_GetCategories_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsClientServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq emptypb.Empty + 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.GetCategories(ctx, &protoReq) + return msg, metadata, err +} + +// RegisterQuestionsClientServiceHandlerServer registers the http handlers for service QuestionsClientService to "mux". +// UnaryRPC :call QuestionsClientServiceServer 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 RegisterQuestionsClientServiceHandlerFromEndpoint 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 RegisterQuestionsClientServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QuestionsClientServiceServer) error { + mux.Handle(http.MethodPost, pattern_QuestionsClientService_GetCategories_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, "/questionsservice.v1.QuestionsClientService/GetCategories", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsClientService/GetCategories")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsClientService_GetCategories_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_QuestionsClientService_GetCategories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + return nil +} + +// RegisterQuestionsClientServiceHandlerFromEndpoint is same as RegisterQuestionsClientServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQuestionsClientServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.NewClient(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + return RegisterQuestionsClientServiceHandler(ctx, mux, conn) +} + +// RegisterQuestionsClientServiceHandler registers the http handlers for service QuestionsClientService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQuestionsClientServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQuestionsClientServiceHandlerClient(ctx, mux, NewQuestionsClientServiceClient(conn)) +} + +// RegisterQuestionsClientServiceHandlerClient registers the http handlers for service QuestionsClientService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QuestionsClientServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QuestionsClientServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QuestionsClientServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +func RegisterQuestionsClientServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QuestionsClientServiceClient) error { + mux.Handle(http.MethodPost, pattern_QuestionsClientService_GetCategories_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, "/questionsservice.v1.QuestionsClientService/GetCategories", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsClientService/GetCategories")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsClientService_GetCategories_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsClientService_GetCategories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil +} + +var ( + pattern_QuestionsClientService_GetCategories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsClientService", "GetCategories"}, "")) +) + +var ( + forward_QuestionsClientService_GetCategories_0 = runtime.ForwardResponseMessage +) diff --git a/gen/external/questions/v1/client_grpc.pb.go b/gen/external/questions/v1/client_grpc.pb.go new file mode 100644 index 0000000..f5c3b93 --- /dev/null +++ b/gen/external/questions/v1/client_grpc.pb.go @@ -0,0 +1,120 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: external/questions/v1/client.proto + +package questionsv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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 ( + QuestionsClientService_GetCategories_FullMethodName = "/questionsservice.v1.QuestionsClientService/GetCategories" +) + +// QuestionsClientServiceClient is the client API for QuestionsClientService 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 QuestionsClientServiceClient interface { + GetCategories(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetCategoriesResponse, error) +} + +type questionsClientServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewQuestionsClientServiceClient(cc grpc.ClientConnInterface) QuestionsClientServiceClient { + return &questionsClientServiceClient{cc} +} + +func (c *questionsClientServiceClient) GetCategories(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetCategoriesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetCategoriesResponse) + err := c.cc.Invoke(ctx, QuestionsClientService_GetCategories_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QuestionsClientServiceServer is the server API for QuestionsClientService service. +// All implementations should embed UnimplementedQuestionsClientServiceServer +// for forward compatibility. +type QuestionsClientServiceServer interface { + GetCategories(context.Context, *emptypb.Empty) (*GetCategoriesResponse, error) +} + +// UnimplementedQuestionsClientServiceServer should 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 UnimplementedQuestionsClientServiceServer struct{} + +func (UnimplementedQuestionsClientServiceServer) GetCategories(context.Context, *emptypb.Empty) (*GetCategoriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCategories not implemented") +} +func (UnimplementedQuestionsClientServiceServer) testEmbeddedByValue() {} + +// UnsafeQuestionsClientServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QuestionsClientServiceServer will +// result in compilation errors. +type UnsafeQuestionsClientServiceServer interface { + mustEmbedUnimplementedQuestionsClientServiceServer() +} + +func RegisterQuestionsClientServiceServer(s grpc.ServiceRegistrar, srv QuestionsClientServiceServer) { + // If the following call pancis, it indicates UnimplementedQuestionsClientServiceServer 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(&QuestionsClientService_ServiceDesc, srv) +} + +func _QuestionsClientService_GetCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsClientServiceServer).GetCategories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsClientService_GetCategories_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsClientServiceServer).GetCategories(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// QuestionsClientService_ServiceDesc is the grpc.ServiceDesc for QuestionsClientService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var QuestionsClientService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "questionsservice.v1.QuestionsClientService", + HandlerType: (*QuestionsClientServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetCategories", + Handler: _QuestionsClientService_GetCategories_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "external/questions/v1/client.proto", +} diff --git a/gen/external/questions/v1/questions.pb.go b/gen/external/questions/v1/questions.pb.go new file mode 100644 index 0000000..9dd2f52 --- /dev/null +++ b/gen/external/questions/v1/questions.pb.go @@ -0,0 +1,344 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: external/questions/v1/questions.proto + +package questionsv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + 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) +) + +type GetQuestionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Difficulty Difficulty `protobuf:"varint,1,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty" json:"difficulty,omitempty"` + Language string `protobuf:"bytes,2,opt,name=language,proto3" json:"language,omitempty"` + CategoryId int32 `protobuf:"varint,3,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + Amount int32 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetQuestionsRequest) Reset() { + *x = GetQuestionsRequest{} + mi := &file_external_questions_v1_questions_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetQuestionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetQuestionsRequest) ProtoMessage() {} + +func (x *GetQuestionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_questions_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetQuestionsRequest.ProtoReflect.Descriptor instead. +func (*GetQuestionsRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_questions_proto_rawDescGZIP(), []int{0} +} + +func (x *GetQuestionsRequest) GetDifficulty() Difficulty { + if x != nil { + return x.Difficulty + } + return Difficulty_DIFFICULTY_UNSPECIFIED +} + +func (x *GetQuestionsRequest) GetLanguage() string { + if x != nil { + return x.Language + } + return "" +} + +func (x *GetQuestionsRequest) GetCategoryId() int32 { + if x != nil { + return x.CategoryId + } + return 0 +} + +func (x *GetQuestionsRequest) GetAmount() int32 { + if x != nil { + return x.Amount + } + return 0 +} + +type GetQuestionBatchRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Types []Type `protobuf:"varint,1,rep,packed,name=types,proto3,enum=questionsservice.v1.Type" json:"types,omitempty"` + Sources []Source `protobuf:"varint,2,rep,packed,name=sources,proto3,enum=questionsservice.v1.Source" json:"sources,omitempty"` + Difficulties []Difficulty `protobuf:"varint,3,rep,packed,name=difficulties,proto3,enum=questionsservice.v1.Difficulty" json:"difficulties,omitempty"` + CategoriesIds []int32 `protobuf:"varint,4,rep,packed,name=categories_ids,json=categoriesIds,proto3" json:"categories_ids,omitempty"` + Language string `protobuf:"bytes,5,opt,name=language,proto3" json:"language,omitempty"` + Amount int32 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetQuestionBatchRequest) Reset() { + *x = GetQuestionBatchRequest{} + mi := &file_external_questions_v1_questions_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetQuestionBatchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetQuestionBatchRequest) ProtoMessage() {} + +func (x *GetQuestionBatchRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_questions_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetQuestionBatchRequest.ProtoReflect.Descriptor instead. +func (*GetQuestionBatchRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_questions_proto_rawDescGZIP(), []int{1} +} + +func (x *GetQuestionBatchRequest) GetTypes() []Type { + if x != nil { + return x.Types + } + return nil +} + +func (x *GetQuestionBatchRequest) GetSources() []Source { + if x != nil { + return x.Sources + } + return nil +} + +func (x *GetQuestionBatchRequest) GetDifficulties() []Difficulty { + if x != nil { + return x.Difficulties + } + return nil +} + +func (x *GetQuestionBatchRequest) GetCategoriesIds() []int32 { + if x != nil { + return x.CategoriesIds + } + return nil +} + +func (x *GetQuestionBatchRequest) GetLanguage() string { + if x != nil { + return x.Language + } + return "" +} + +func (x *GetQuestionBatchRequest) GetAmount() int32 { + if x != nil { + return x.Amount + } + return 0 +} + +type QuestionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Questions []*Question `protobuf:"bytes,1,rep,name=questions,proto3" json:"questions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuestionsResponse) Reset() { + *x = QuestionsResponse{} + mi := &file_external_questions_v1_questions_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuestionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuestionsResponse) ProtoMessage() {} + +func (x *QuestionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_questions_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuestionsResponse.ProtoReflect.Descriptor instead. +func (*QuestionsResponse) Descriptor() ([]byte, []int) { + return file_external_questions_v1_questions_proto_rawDescGZIP(), []int{2} +} + +func (x *QuestionsResponse) GetQuestions() []*Question { + if x != nil { + return x.Questions + } + return nil +} + +var File_external_questions_v1_questions_proto protoreflect.FileDescriptor + +var file_external_questions_v1_questions_proto_rawDesc = string([]byte{ + 0x0a, 0x25, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x22, 0x65, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xab, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, + 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x0a, 0x64, + 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa1, + 0x02, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x07, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0c, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x69, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x0c, 0x64, 0x69, 0x66, 0x66, 0x69, + 0x63, 0x75, 0x6c, 0x74, 0x69, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, + 0x0d, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x49, 0x64, 0x73, 0x12, 0x1a, + 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x50, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xde, 0x01, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x0c, 0x47, 0x65, 0x74, + 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x2e, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x10, 0x47, + 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, + 0x2c, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x1a, 0x5a, 0x18, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_external_questions_v1_questions_proto_rawDescOnce sync.Once + file_external_questions_v1_questions_proto_rawDescData []byte +) + +func file_external_questions_v1_questions_proto_rawDescGZIP() []byte { + file_external_questions_v1_questions_proto_rawDescOnce.Do(func() { + file_external_questions_v1_questions_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_external_questions_v1_questions_proto_rawDesc), len(file_external_questions_v1_questions_proto_rawDesc))) + }) + return file_external_questions_v1_questions_proto_rawDescData +} + +var file_external_questions_v1_questions_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_external_questions_v1_questions_proto_goTypes = []any{ + (*GetQuestionsRequest)(nil), // 0: questionsservice.v1.GetQuestionsRequest + (*GetQuestionBatchRequest)(nil), // 1: questionsservice.v1.GetQuestionBatchRequest + (*QuestionsResponse)(nil), // 2: questionsservice.v1.QuestionsResponse + (Difficulty)(0), // 3: questionsservice.v1.Difficulty + (Type)(0), // 4: questionsservice.v1.Type + (Source)(0), // 5: questionsservice.v1.Source + (*Question)(nil), // 6: questionsservice.v1.Question +} +var file_external_questions_v1_questions_proto_depIdxs = []int32{ + 3, // 0: questionsservice.v1.GetQuestionsRequest.difficulty:type_name -> questionsservice.v1.Difficulty + 4, // 1: questionsservice.v1.GetQuestionBatchRequest.types:type_name -> questionsservice.v1.Type + 5, // 2: questionsservice.v1.GetQuestionBatchRequest.sources:type_name -> questionsservice.v1.Source + 3, // 3: questionsservice.v1.GetQuestionBatchRequest.difficulties:type_name -> questionsservice.v1.Difficulty + 6, // 4: questionsservice.v1.QuestionsResponse.questions:type_name -> questionsservice.v1.Question + 0, // 5: questionsservice.v1.QuestionsService.GetQuestions:input_type -> questionsservice.v1.GetQuestionsRequest + 1, // 6: questionsservice.v1.QuestionsService.GetQuestionBatch:input_type -> questionsservice.v1.GetQuestionBatchRequest + 2, // 7: questionsservice.v1.QuestionsService.GetQuestions:output_type -> questionsservice.v1.QuestionsResponse + 2, // 8: questionsservice.v1.QuestionsService.GetQuestionBatch:output_type -> questionsservice.v1.QuestionsResponse + 7, // [7:9] is the sub-list for method output_type + 5, // [5:7] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_external_questions_v1_questions_proto_init() } +func file_external_questions_v1_questions_proto_init() { + if File_external_questions_v1_questions_proto != nil { + return + } + file_external_questions_v1_shared_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_questions_v1_questions_proto_rawDesc), len(file_external_questions_v1_questions_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_external_questions_v1_questions_proto_goTypes, + DependencyIndexes: file_external_questions_v1_questions_proto_depIdxs, + MessageInfos: file_external_questions_v1_questions_proto_msgTypes, + }.Build() + File_external_questions_v1_questions_proto = out.File + file_external_questions_v1_questions_proto_goTypes = nil + file_external_questions_v1_questions_proto_depIdxs = nil +} diff --git a/gen/external/questions/v1/questions.pb.gw.go b/gen/external/questions/v1/questions.pb.gw.go new file mode 100644 index 0000000..1ecbb4f --- /dev/null +++ b/gen/external/questions/v1/questions.pb.gw.go @@ -0,0 +1,217 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: external/questions/v1/questions.proto + +/* +Package questionsv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package questionsv1 + +import ( + "context" + "errors" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) + +func request_QuestionsService_GetQuestions_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetQuestionsRequest + 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.GetQuestions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsService_GetQuestions_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetQuestionsRequest + 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.GetQuestions(ctx, &protoReq) + return msg, metadata, err +} + +func request_QuestionsService_GetQuestionBatch_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetQuestionBatchRequest + 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.GetQuestionBatch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsService_GetQuestionBatch_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetQuestionBatchRequest + 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.GetQuestionBatch(ctx, &protoReq) + return msg, metadata, err +} + +// RegisterQuestionsServiceHandlerServer registers the http handlers for service QuestionsService to "mux". +// UnaryRPC :call QuestionsServiceServer 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 RegisterQuestionsServiceHandlerFromEndpoint 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 RegisterQuestionsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QuestionsServiceServer) error { + mux.Handle(http.MethodPost, pattern_QuestionsService_GetQuestions_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, "/questionsservice.v1.QuestionsService/GetQuestions", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsService/GetQuestions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsService_GetQuestions_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_QuestionsService_GetQuestions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsService_GetQuestionBatch_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, "/questionsservice.v1.QuestionsService/GetQuestionBatch", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsService/GetQuestionBatch")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsService_GetQuestionBatch_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_QuestionsService_GetQuestionBatch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + return nil +} + +// RegisterQuestionsServiceHandlerFromEndpoint is same as RegisterQuestionsServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQuestionsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.NewClient(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + return RegisterQuestionsServiceHandler(ctx, mux, conn) +} + +// RegisterQuestionsServiceHandler registers the http handlers for service QuestionsService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQuestionsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQuestionsServiceHandlerClient(ctx, mux, NewQuestionsServiceClient(conn)) +} + +// RegisterQuestionsServiceHandlerClient registers the http handlers for service QuestionsService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QuestionsServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QuestionsServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QuestionsServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +func RegisterQuestionsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QuestionsServiceClient) error { + mux.Handle(http.MethodPost, pattern_QuestionsService_GetQuestions_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, "/questionsservice.v1.QuestionsService/GetQuestions", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsService/GetQuestions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsService_GetQuestions_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsService_GetQuestions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_QuestionsService_GetQuestionBatch_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, "/questionsservice.v1.QuestionsService/GetQuestionBatch", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsService/GetQuestionBatch")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsService_GetQuestionBatch_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsService_GetQuestionBatch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil +} + +var ( + pattern_QuestionsService_GetQuestions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsService", "GetQuestions"}, "")) + pattern_QuestionsService_GetQuestionBatch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsService", "GetQuestionBatch"}, "")) +) + +var ( + forward_QuestionsService_GetQuestions_0 = runtime.ForwardResponseMessage + forward_QuestionsService_GetQuestionBatch_0 = runtime.ForwardResponseMessage +) diff --git a/gen/external/questions/v1/questions_grpc.pb.go b/gen/external/questions/v1/questions_grpc.pb.go new file mode 100644 index 0000000..693f6d5 --- /dev/null +++ b/gen/external/questions/v1/questions_grpc.pb.go @@ -0,0 +1,157 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: external/questions/v1/questions.proto + +package questionsv1 + +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 ( + QuestionsService_GetQuestions_FullMethodName = "/questionsservice.v1.QuestionsService/GetQuestions" + QuestionsService_GetQuestionBatch_FullMethodName = "/questionsservice.v1.QuestionsService/GetQuestionBatch" +) + +// QuestionsServiceClient is the client API for QuestionsService 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 QuestionsServiceClient interface { + GetQuestions(ctx context.Context, in *GetQuestionsRequest, opts ...grpc.CallOption) (*QuestionsResponse, error) + GetQuestionBatch(ctx context.Context, in *GetQuestionBatchRequest, opts ...grpc.CallOption) (*QuestionsResponse, error) +} + +type questionsServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewQuestionsServiceClient(cc grpc.ClientConnInterface) QuestionsServiceClient { + return &questionsServiceClient{cc} +} + +func (c *questionsServiceClient) GetQuestions(ctx context.Context, in *GetQuestionsRequest, opts ...grpc.CallOption) (*QuestionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QuestionsResponse) + err := c.cc.Invoke(ctx, QuestionsService_GetQuestions_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *questionsServiceClient) GetQuestionBatch(ctx context.Context, in *GetQuestionBatchRequest, opts ...grpc.CallOption) (*QuestionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QuestionsResponse) + err := c.cc.Invoke(ctx, QuestionsService_GetQuestionBatch_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QuestionsServiceServer is the server API for QuestionsService service. +// All implementations should embed UnimplementedQuestionsServiceServer +// for forward compatibility. +type QuestionsServiceServer interface { + GetQuestions(context.Context, *GetQuestionsRequest) (*QuestionsResponse, error) + GetQuestionBatch(context.Context, *GetQuestionBatchRequest) (*QuestionsResponse, error) +} + +// UnimplementedQuestionsServiceServer should 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 UnimplementedQuestionsServiceServer struct{} + +func (UnimplementedQuestionsServiceServer) GetQuestions(context.Context, *GetQuestionsRequest) (*QuestionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetQuestions not implemented") +} +func (UnimplementedQuestionsServiceServer) GetQuestionBatch(context.Context, *GetQuestionBatchRequest) (*QuestionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetQuestionBatch not implemented") +} +func (UnimplementedQuestionsServiceServer) testEmbeddedByValue() {} + +// UnsafeQuestionsServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QuestionsServiceServer will +// result in compilation errors. +type UnsafeQuestionsServiceServer interface { + mustEmbedUnimplementedQuestionsServiceServer() +} + +func RegisterQuestionsServiceServer(s grpc.ServiceRegistrar, srv QuestionsServiceServer) { + // If the following call pancis, it indicates UnimplementedQuestionsServiceServer 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(&QuestionsService_ServiceDesc, srv) +} + +func _QuestionsService_GetQuestions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetQuestionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsServiceServer).GetQuestions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsService_GetQuestions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsServiceServer).GetQuestions(ctx, req.(*GetQuestionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QuestionsService_GetQuestionBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetQuestionBatchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsServiceServer).GetQuestionBatch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsService_GetQuestionBatch_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsServiceServer).GetQuestionBatch(ctx, req.(*GetQuestionBatchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// QuestionsService_ServiceDesc is the grpc.ServiceDesc for QuestionsService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var QuestionsService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "questionsservice.v1.QuestionsService", + HandlerType: (*QuestionsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetQuestions", + Handler: _QuestionsService_GetQuestions_Handler, + }, + { + MethodName: "GetQuestionBatch", + Handler: _QuestionsService_GetQuestionBatch_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "external/questions/v1/questions.proto", +} diff --git a/gen/external/questions/v1/shared.pb.go b/gen/external/questions/v1/shared.pb.go new file mode 100644 index 0000000..363b0ed --- /dev/null +++ b/gen/external/questions/v1/shared.pb.go @@ -0,0 +1,538 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: external/questions/v1/shared.proto + +package questionsv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + 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) +) + +type Type int32 + +const ( + Type_TYPE_UNSPECIFIED Type = 0 + Type_TYPE_SINGLE Type = 1 + Type_TYPE_MULTI Type = 2 + Type_TYPE_BETTING Type = 3 +) + +// Enum value maps for Type. +var ( + Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "TYPE_SINGLE", + 2: "TYPE_MULTI", + 3: "TYPE_BETTING", + } + Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "TYPE_SINGLE": 1, + "TYPE_MULTI": 2, + "TYPE_BETTING": 3, + } +) + +func (x Type) Enum() *Type { + p := new(Type) + *p = x + return p +} + +func (x Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Type) Descriptor() protoreflect.EnumDescriptor { + return file_external_questions_v1_shared_proto_enumTypes[0].Descriptor() +} + +func (Type) Type() protoreflect.EnumType { + return &file_external_questions_v1_shared_proto_enumTypes[0] +} + +func (x Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Type.Descriptor instead. +func (Type) EnumDescriptor() ([]byte, []int) { + return file_external_questions_v1_shared_proto_rawDescGZIP(), []int{0} +} + +type Source int32 + +const ( + Source_SOURCE_UNSPECIFIED Source = 0 + Source_SOURCE_TEXT Source = 1 + Source_SOURCE_IMAGE Source = 2 + Source_SOURCE_AUDIO Source = 3 + Source_SOURCE_ANIMATION Source = 4 + Source_SOURCE_VIDEO Source = 5 +) + +// Enum value maps for Source. +var ( + Source_name = map[int32]string{ + 0: "SOURCE_UNSPECIFIED", + 1: "SOURCE_TEXT", + 2: "SOURCE_IMAGE", + 3: "SOURCE_AUDIO", + 4: "SOURCE_ANIMATION", + 5: "SOURCE_VIDEO", + } + Source_value = map[string]int32{ + "SOURCE_UNSPECIFIED": 0, + "SOURCE_TEXT": 1, + "SOURCE_IMAGE": 2, + "SOURCE_AUDIO": 3, + "SOURCE_ANIMATION": 4, + "SOURCE_VIDEO": 5, + } +) + +func (x Source) Enum() *Source { + p := new(Source) + *p = x + return p +} + +func (x Source) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Source) Descriptor() protoreflect.EnumDescriptor { + return file_external_questions_v1_shared_proto_enumTypes[1].Descriptor() +} + +func (Source) Type() protoreflect.EnumType { + return &file_external_questions_v1_shared_proto_enumTypes[1] +} + +func (x Source) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Source.Descriptor instead. +func (Source) EnumDescriptor() ([]byte, []int) { + return file_external_questions_v1_shared_proto_rawDescGZIP(), []int{1} +} + +type Difficulty int32 + +const ( + Difficulty_DIFFICULTY_UNSPECIFIED Difficulty = 0 + Difficulty_DIFFICULTY_EASY Difficulty = 1 + Difficulty_DIFFICULTY_MEDIUM Difficulty = 2 + Difficulty_DIFFICULTY_HARD Difficulty = 3 + Difficulty_DIFFICULTY_VERY_HARD Difficulty = 4 +) + +// Enum value maps for Difficulty. +var ( + Difficulty_name = map[int32]string{ + 0: "DIFFICULTY_UNSPECIFIED", + 1: "DIFFICULTY_EASY", + 2: "DIFFICULTY_MEDIUM", + 3: "DIFFICULTY_HARD", + 4: "DIFFICULTY_VERY_HARD", + } + Difficulty_value = map[string]int32{ + "DIFFICULTY_UNSPECIFIED": 0, + "DIFFICULTY_EASY": 1, + "DIFFICULTY_MEDIUM": 2, + "DIFFICULTY_HARD": 3, + "DIFFICULTY_VERY_HARD": 4, + } +) + +func (x Difficulty) Enum() *Difficulty { + p := new(Difficulty) + *p = x + return p +} + +func (x Difficulty) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Difficulty) Descriptor() protoreflect.EnumDescriptor { + return file_external_questions_v1_shared_proto_enumTypes[2].Descriptor() +} + +func (Difficulty) Type() protoreflect.EnumType { + return &file_external_questions_v1_shared_proto_enumTypes[2] +} + +func (x Difficulty) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Difficulty.Descriptor instead. +func (Difficulty) EnumDescriptor() ([]byte, []int) { + return file_external_questions_v1_shared_proto_rawDescGZIP(), []int{2} +} + +type Question struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type Type `protobuf:"varint,2,opt,name=type,proto3,enum=questionsservice.v1.Type" json:"type,omitempty"` + Source Source `protobuf:"varint,3,opt,name=source,proto3,enum=questionsservice.v1.Source" json:"source,omitempty"` + Difficulty Difficulty `protobuf:"varint,4,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty" json:"difficulty,omitempty"` + Category *Category `protobuf:"bytes,5,opt,name=category,proto3" json:"category,omitempty"` + Text string `protobuf:"bytes,6,opt,name=text,proto3" json:"text,omitempty"` + Options []*Option `protobuf:"bytes,7,rep,name=options,proto3" json:"options,omitempty"` + Language string `protobuf:"bytes,8,opt,name=language,proto3" json:"language,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Question) Reset() { + *x = Question{} + mi := &file_external_questions_v1_shared_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Question) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Question) ProtoMessage() {} + +func (x *Question) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_shared_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Question.ProtoReflect.Descriptor instead. +func (*Question) Descriptor() ([]byte, []int) { + return file_external_questions_v1_shared_proto_rawDescGZIP(), []int{0} +} + +func (x *Question) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Question) GetType() Type { + if x != nil { + return x.Type + } + return Type_TYPE_UNSPECIFIED +} + +func (x *Question) GetSource() Source { + if x != nil { + return x.Source + } + return Source_SOURCE_UNSPECIFIED +} + +func (x *Question) GetDifficulty() Difficulty { + if x != nil { + return x.Difficulty + } + return Difficulty_DIFFICULTY_UNSPECIFIED +} + +func (x *Question) GetCategory() *Category { + if x != nil { + return x.Category + } + return nil +} + +func (x *Question) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *Question) GetOptions() []*Option { + if x != nil { + return x.Options + } + return nil +} + +func (x *Question) GetLanguage() string { + if x != nil { + return x.Language + } + return "" +} + +func (x *Question) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type Option struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` + IsCorrect bool `protobuf:"varint,3,opt,name=is_correct,json=isCorrect,proto3" json:"is_correct,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Option) Reset() { + *x = Option{} + mi := &file_external_questions_v1_shared_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Option) ProtoMessage() {} + +func (x *Option) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_shared_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Option.ProtoReflect.Descriptor instead. +func (*Option) Descriptor() ([]byte, []int) { + return file_external_questions_v1_shared_proto_rawDescGZIP(), []int{1} +} + +func (x *Option) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Option) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *Option) GetIsCorrect() bool { + if x != nil { + return x.IsCorrect + } + return false +} + +type Category struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Category) Reset() { + *x = Category{} + mi := &file_external_questions_v1_shared_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Category) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Category) ProtoMessage() {} + +func (x *Category) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_shared_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Category.ProtoReflect.Descriptor instead. +func (*Category) Descriptor() ([]byte, []int) { + return file_external_questions_v1_shared_proto_rawDescGZIP(), []int{2} +} + +func (x *Category) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Category) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +var File_external_questions_v1_shared_proto protoreflect.FileDescriptor + +var file_external_questions_v1_shared_proto_rawDesc = string([]byte{ + 0x0a, 0x22, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x03, 0x0a, 0x08, 0x51, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x64, + 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1f, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, + 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x08, + 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x08, 0x63, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x35, 0x0a, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x39, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x4b, 0x0a, 0x06, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x63, 0x6f, + 0x72, 0x72, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x43, + 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x22, 0x2e, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x2a, 0x4f, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, + 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, + 0x47, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, + 0x4c, 0x54, 0x49, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x45, + 0x54, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x2a, 0x7d, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x4f, 0x55, + 0x52, 0x43, 0x45, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x4f, + 0x55, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, + 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x4f, 0x10, 0x03, 0x12, 0x14, + 0x0a, 0x10, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x41, 0x4e, 0x49, 0x4d, 0x41, 0x54, 0x49, + 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x56, + 0x49, 0x44, 0x45, 0x4f, 0x10, 0x05, 0x2a, 0x83, 0x01, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, + 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x49, 0x46, 0x46, 0x49, 0x43, 0x55, + 0x4c, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x49, 0x46, 0x46, 0x49, 0x43, 0x55, 0x4c, 0x54, 0x59, 0x5f, + 0x45, 0x41, 0x53, 0x59, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x46, 0x46, 0x49, 0x43, + 0x55, 0x4c, 0x54, 0x59, 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x55, 0x4d, 0x10, 0x02, 0x12, 0x13, 0x0a, + 0x0f, 0x44, 0x49, 0x46, 0x46, 0x49, 0x43, 0x55, 0x4c, 0x54, 0x59, 0x5f, 0x48, 0x41, 0x52, 0x44, + 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x49, 0x46, 0x46, 0x49, 0x43, 0x55, 0x4c, 0x54, 0x59, + 0x5f, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x48, 0x41, 0x52, 0x44, 0x10, 0x04, 0x42, 0x1a, 0x5a, 0x18, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_external_questions_v1_shared_proto_rawDescOnce sync.Once + file_external_questions_v1_shared_proto_rawDescData []byte +) + +func file_external_questions_v1_shared_proto_rawDescGZIP() []byte { + file_external_questions_v1_shared_proto_rawDescOnce.Do(func() { + file_external_questions_v1_shared_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_external_questions_v1_shared_proto_rawDesc), len(file_external_questions_v1_shared_proto_rawDesc))) + }) + return file_external_questions_v1_shared_proto_rawDescData +} + +var file_external_questions_v1_shared_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_external_questions_v1_shared_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_external_questions_v1_shared_proto_goTypes = []any{ + (Type)(0), // 0: questionsservice.v1.Type + (Source)(0), // 1: questionsservice.v1.Source + (Difficulty)(0), // 2: questionsservice.v1.Difficulty + (*Question)(nil), // 3: questionsservice.v1.Question + (*Option)(nil), // 4: questionsservice.v1.Option + (*Category)(nil), // 5: questionsservice.v1.Category + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} +var file_external_questions_v1_shared_proto_depIdxs = []int32{ + 0, // 0: questionsservice.v1.Question.type:type_name -> questionsservice.v1.Type + 1, // 1: questionsservice.v1.Question.source:type_name -> questionsservice.v1.Source + 2, // 2: questionsservice.v1.Question.difficulty:type_name -> questionsservice.v1.Difficulty + 5, // 3: questionsservice.v1.Question.category:type_name -> questionsservice.v1.Category + 4, // 4: questionsservice.v1.Question.options:type_name -> questionsservice.v1.Option + 6, // 5: questionsservice.v1.Question.created_at:type_name -> google.protobuf.Timestamp + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_external_questions_v1_shared_proto_init() } +func file_external_questions_v1_shared_proto_init() { + if File_external_questions_v1_shared_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_questions_v1_shared_proto_rawDesc), len(file_external_questions_v1_shared_proto_rawDesc)), + NumEnums: 3, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_external_questions_v1_shared_proto_goTypes, + DependencyIndexes: file_external_questions_v1_shared_proto_depIdxs, + EnumInfos: file_external_questions_v1_shared_proto_enumTypes, + MessageInfos: file_external_questions_v1_shared_proto_msgTypes, + }.Build() + File_external_questions_v1_shared_proto = out.File + file_external_questions_v1_shared_proto_goTypes = nil + file_external_questions_v1_shared_proto_depIdxs = nil +} diff --git a/gen/external/users/v1/admin.pb.go b/gen/external/users/v1/admin.pb.go new file mode 100644 index 0000000..c60f603 --- /dev/null +++ b/gen/external/users/v1/admin.pb.go @@ -0,0 +1,1058 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: external/users/v1/admin.proto + +package usersv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + 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) +) + +type Order int32 + +const ( + Order_ORDER_UNSPECIFIED Order = 0 + Order_ORDER_ID Order = 1 + Order_ORDER_USERNAME Order = 2 + Order_ORDER_EMAIL Order = 3 + Order_ORDER_RATING Order = 4 + Order_ORDER_COINS Order = 5 + Order_ORDER_CREATED_AT Order = 6 + Order_ORDER_DELETED_AT Order = 7 +) + +// Enum value maps for Order. +var ( + Order_name = map[int32]string{ + 0: "ORDER_UNSPECIFIED", + 1: "ORDER_ID", + 2: "ORDER_USERNAME", + 3: "ORDER_EMAIL", + 4: "ORDER_RATING", + 5: "ORDER_COINS", + 6: "ORDER_CREATED_AT", + 7: "ORDER_DELETED_AT", + } + Order_value = map[string]int32{ + "ORDER_UNSPECIFIED": 0, + "ORDER_ID": 1, + "ORDER_USERNAME": 2, + "ORDER_EMAIL": 3, + "ORDER_RATING": 4, + "ORDER_COINS": 5, + "ORDER_CREATED_AT": 6, + "ORDER_DELETED_AT": 7, + } +) + +func (x Order) Enum() *Order { + p := new(Order) + *p = x + return p +} + +func (x Order) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Order) Descriptor() protoreflect.EnumDescriptor { + return file_external_users_v1_admin_proto_enumTypes[0].Descriptor() +} + +func (Order) Type() protoreflect.EnumType { + return &file_external_users_v1_admin_proto_enumTypes[0] +} + +func (x Order) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Order.Descriptor instead. +func (Order) EnumDescriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{0} +} + +type Sort int32 + +const ( + Sort_SORT_UNSPECIFIED Sort = 0 + Sort_SORT_ASC Sort = 1 + Sort_SORT_DESC Sort = 2 +) + +// Enum value maps for Sort. +var ( + Sort_name = map[int32]string{ + 0: "SORT_UNSPECIFIED", + 1: "SORT_ASC", + 2: "SORT_DESC", + } + Sort_value = map[string]int32{ + "SORT_UNSPECIFIED": 0, + "SORT_ASC": 1, + "SORT_DESC": 2, + } +) + +func (x Sort) Enum() *Sort { + p := new(Sort) + *p = x + return p +} + +func (x Sort) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Sort) Descriptor() protoreflect.EnumDescriptor { + return file_external_users_v1_admin_proto_enumTypes[1].Descriptor() +} + +func (Sort) Type() protoreflect.EnumType { + return &file_external_users_v1_admin_proto_enumTypes[1] +} + +func (x Sort) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Sort.Descriptor instead. +func (Sort) EnumDescriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{1} +} + +type Role int32 + +const ( + Role_ROLE_UNSPECIFIED Role = 0 + Role_ROLE_USER Role = 1 + Role_ROLE_ADMIN Role = 2 + Role_ROLE_SUPER Role = 3 +) + +// Enum value maps for Role. +var ( + Role_name = map[int32]string{ + 0: "ROLE_UNSPECIFIED", + 1: "ROLE_USER", + 2: "ROLE_ADMIN", + 3: "ROLE_SUPER", + } + Role_value = map[string]int32{ + "ROLE_UNSPECIFIED": 0, + "ROLE_USER": 1, + "ROLE_ADMIN": 2, + "ROLE_SUPER": 3, + } +) + +func (x Role) Enum() *Role { + p := new(Role) + *p = x + return p +} + +func (x Role) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Role) Descriptor() protoreflect.EnumDescriptor { + return file_external_users_v1_admin_proto_enumTypes[2].Descriptor() +} + +func (Role) Type() protoreflect.EnumType { + return &file_external_users_v1_admin_proto_enumTypes[2] +} + +func (x Role) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Role.Descriptor instead. +func (Role) EnumDescriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{2} +} + +type SearchUsersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page uint64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Order *Order `protobuf:"varint,3,opt,name=order,proto3,enum=usersservice.v1.Order,oneof" json:"order,omitempty"` + Sort *Sort `protobuf:"varint,4,opt,name=sort,proto3,enum=usersservice.v1.Sort,oneof" json:"sort,omitempty"` + UserRating *RatingFiler `protobuf:"bytes,5,opt,name=user_rating,json=userRating,proto3" json:"user_rating,omitempty"` + UserCoins *CoinsFiler `protobuf:"bytes,6,opt,name=user_coins,json=userCoins,proto3" json:"user_coins,omitempty"` + UserCreatedAt *CreateAtFiler `protobuf:"bytes,7,opt,name=user_created_at,json=userCreatedAt,proto3" json:"user_created_at,omitempty"` + UserDeletedAt *DeletedAtFiler `protobuf:"bytes,8,opt,name=user_deleted_at,json=userDeletedAt,proto3" json:"user_deleted_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchUsersRequest) Reset() { + *x = SearchUsersRequest{} + mi := &file_external_users_v1_admin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersRequest) ProtoMessage() {} + +func (x *SearchUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUsersRequest.ProtoReflect.Descriptor instead. +func (*SearchUsersRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{0} +} + +func (x *SearchUsersRequest) GetPage() uint64 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *SearchUsersRequest) GetSize() uint64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *SearchUsersRequest) GetOrder() Order { + if x != nil && x.Order != nil { + return *x.Order + } + return Order_ORDER_UNSPECIFIED +} + +func (x *SearchUsersRequest) GetSort() Sort { + if x != nil && x.Sort != nil { + return *x.Sort + } + return Sort_SORT_UNSPECIFIED +} + +func (x *SearchUsersRequest) GetUserRating() *RatingFiler { + if x != nil { + return x.UserRating + } + return nil +} + +func (x *SearchUsersRequest) GetUserCoins() *CoinsFiler { + if x != nil { + return x.UserCoins + } + return nil +} + +func (x *SearchUsersRequest) GetUserCreatedAt() *CreateAtFiler { + if x != nil { + return x.UserCreatedAt + } + return nil +} + +func (x *SearchUsersRequest) GetUserDeletedAt() *DeletedAtFiler { + if x != nil { + return x.UserDeletedAt + } + return nil +} + +type RatingFiler struct { + state protoimpl.MessageState `protogen:"open.v1"` + From int32 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"` + To int32 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RatingFiler) Reset() { + *x = RatingFiler{} + mi := &file_external_users_v1_admin_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RatingFiler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RatingFiler) ProtoMessage() {} + +func (x *RatingFiler) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RatingFiler.ProtoReflect.Descriptor instead. +func (*RatingFiler) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{1} +} + +func (x *RatingFiler) GetFrom() int32 { + if x != nil { + return x.From + } + return 0 +} + +func (x *RatingFiler) GetTo() int32 { + if x != nil { + return x.To + } + return 0 +} + +type CoinsFiler struct { + state protoimpl.MessageState `protogen:"open.v1"` + From int64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"` + To int64 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CoinsFiler) Reset() { + *x = CoinsFiler{} + mi := &file_external_users_v1_admin_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CoinsFiler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CoinsFiler) ProtoMessage() {} + +func (x *CoinsFiler) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CoinsFiler.ProtoReflect.Descriptor instead. +func (*CoinsFiler) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{2} +} + +func (x *CoinsFiler) GetFrom() int64 { + if x != nil { + return x.From + } + return 0 +} + +func (x *CoinsFiler) GetTo() int64 { + if x != nil { + return x.To + } + return 0 +} + +type CreateAtFiler struct { + state protoimpl.MessageState `protogen:"open.v1"` + From *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + To *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateAtFiler) Reset() { + *x = CreateAtFiler{} + mi := &file_external_users_v1_admin_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateAtFiler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAtFiler) ProtoMessage() {} + +func (x *CreateAtFiler) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAtFiler.ProtoReflect.Descriptor instead. +func (*CreateAtFiler) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateAtFiler) GetFrom() *timestamppb.Timestamp { + if x != nil { + return x.From + } + return nil +} + +func (x *CreateAtFiler) GetTo() *timestamppb.Timestamp { + if x != nil { + return x.To + } + return nil +} + +type DeletedAtFiler struct { + state protoimpl.MessageState `protogen:"open.v1"` + From *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + To *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeletedAtFiler) Reset() { + *x = DeletedAtFiler{} + mi := &file_external_users_v1_admin_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeletedAtFiler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletedAtFiler) ProtoMessage() {} + +func (x *DeletedAtFiler) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletedAtFiler.ProtoReflect.Descriptor instead. +func (*DeletedAtFiler) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{4} +} + +func (x *DeletedAtFiler) GetFrom() *timestamppb.Timestamp { + if x != nil { + return x.From + } + return nil +} + +func (x *DeletedAtFiler) GetTo() *timestamppb.Timestamp { + if x != nil { + return x.To + } + return nil +} + +type SearchUsersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Users []*UserAdmin `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + Page uint64 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` + Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + Order Order `protobuf:"varint,4,opt,name=order,proto3,enum=usersservice.v1.Order" json:"order,omitempty"` + Sort Sort `protobuf:"varint,5,opt,name=sort,proto3,enum=usersservice.v1.Sort" json:"sort,omitempty"` + Amount int64 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchUsersResponse) Reset() { + *x = SearchUsersResponse{} + mi := &file_external_users_v1_admin_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersResponse) ProtoMessage() {} + +func (x *SearchUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUsersResponse.ProtoReflect.Descriptor instead. +func (*SearchUsersResponse) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{5} +} + +func (x *SearchUsersResponse) GetUsers() []*UserAdmin { + if x != nil { + return x.Users + } + return nil +} + +func (x *SearchUsersResponse) GetPage() uint64 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *SearchUsersResponse) GetSize() uint64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *SearchUsersResponse) GetOrder() Order { + if x != nil { + return x.Order + } + return Order_ORDER_UNSPECIFIED +} + +func (x *SearchUsersResponse) GetSort() Sort { + if x != nil { + return x.Sort + } + return Sort_SORT_UNSPECIFIED +} + +func (x *SearchUsersResponse) GetAmount() int64 { + if x != nil { + return x.Amount + } + return 0 +} + +type GetUserByIdentifierRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Identifier: + // + // *GetUserByIdentifierRequest_UserId + // *GetUserByIdentifierRequest_Username + // *GetUserByIdentifierRequest_Email + Identifier isGetUserByIdentifierRequest_Identifier `protobuf_oneof:"identifier"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserByIdentifierRequest) Reset() { + *x = GetUserByIdentifierRequest{} + mi := &file_external_users_v1_admin_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserByIdentifierRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserByIdentifierRequest) ProtoMessage() {} + +func (x *GetUserByIdentifierRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserByIdentifierRequest.ProtoReflect.Descriptor instead. +func (*GetUserByIdentifierRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{6} +} + +func (x *GetUserByIdentifierRequest) GetIdentifier() isGetUserByIdentifierRequest_Identifier { + if x != nil { + return x.Identifier + } + return nil +} + +func (x *GetUserByIdentifierRequest) GetUserId() string { + if x != nil { + if x, ok := x.Identifier.(*GetUserByIdentifierRequest_UserId); ok { + return x.UserId + } + } + return "" +} + +func (x *GetUserByIdentifierRequest) GetUsername() string { + if x != nil { + if x, ok := x.Identifier.(*GetUserByIdentifierRequest_Username); ok { + return x.Username + } + } + return "" +} + +func (x *GetUserByIdentifierRequest) GetEmail() string { + if x != nil { + if x, ok := x.Identifier.(*GetUserByIdentifierRequest_Email); ok { + return x.Email + } + } + return "" +} + +type isGetUserByIdentifierRequest_Identifier interface { + isGetUserByIdentifierRequest_Identifier() +} + +type GetUserByIdentifierRequest_UserId struct { + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3,oneof"` +} + +type GetUserByIdentifierRequest_Username struct { + Username string `protobuf:"bytes,2,opt,name=username,proto3,oneof"` +} + +type GetUserByIdentifierRequest_Email struct { + Email string `protobuf:"bytes,3,opt,name=email,proto3,oneof"` +} + +func (*GetUserByIdentifierRequest_UserId) isGetUserByIdentifierRequest_Identifier() {} + +func (*GetUserByIdentifierRequest_Username) isGetUserByIdentifierRequest_Identifier() {} + +func (*GetUserByIdentifierRequest_Email) isGetUserByIdentifierRequest_Identifier() {} + +type BanUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BanUserRequest) Reset() { + *x = BanUserRequest{} + mi := &file_external_users_v1_admin_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BanUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BanUserRequest) ProtoMessage() {} + +func (x *BanUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BanUserRequest.ProtoReflect.Descriptor instead. +func (*BanUserRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{7} +} + +func (x *BanUserRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type UnbanUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnbanUserRequest) Reset() { + *x = UnbanUserRequest{} + mi := &file_external_users_v1_admin_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnbanUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnbanUserRequest) ProtoMessage() {} + +func (x *UnbanUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnbanUserRequest.ProtoReflect.Descriptor instead. +func (*UnbanUserRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{8} +} + +func (x *UnbanUserRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type UpdateUserRoleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Role Role `protobuf:"varint,2,opt,name=role,proto3,enum=usersservice.v1.Role" json:"role,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateUserRoleRequest) Reset() { + *x = UpdateUserRoleRequest{} + mi := &file_external_users_v1_admin_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateUserRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserRoleRequest) ProtoMessage() {} + +func (x *UpdateUserRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserRoleRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserRoleRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateUserRoleRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UpdateUserRoleRequest) GetRole() Role { + if x != nil { + return x.Role + } + return Role_ROLE_UNSPECIFIED +} + +var File_external_users_v1_admin_proto protoreflect.FileDescriptor + +var file_external_users_v1_admin_proto_rawDesc = string([]byte{ + 0x0a, 0x1d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x1a, 0x1e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbe, + 0x03, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x31, 0x0a, + 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, + 0x72, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, + 0x12, 0x2e, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x48, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x88, 0x01, 0x01, + 0x12, 0x3d, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x69, + 0x6c, 0x65, 0x72, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, + 0x3a, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x72, + 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x0f, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x46, + 0x69, 0x6c, 0x65, 0x72, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x47, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x52, 0x0d, 0x75, + 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x08, 0x0a, 0x06, + 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x73, 0x6f, 0x72, 0x74, 0x22, + 0x31, 0x0a, 0x0b, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x12, + 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x66, 0x72, + 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x74, 0x6f, 0x22, 0x30, 0x0a, 0x0a, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x72, + 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, + 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, + 0x46, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x02, 0x74, + 0x6f, 0x22, 0x6c, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x46, 0x69, + 0x6c, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x66, + 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x02, 0x74, 0x6f, 0x22, + 0xe0, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x6d, + 0x69, 0x6e, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, + 0x29, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x7b, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x19, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, + 0x29, 0x0a, 0x0e, 0x42, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x10, 0x55, 0x6e, + 0x62, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x72, 0x6f, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x2a, 0xa0, 0x01, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x15, + 0x0a, 0x11, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x49, + 0x44, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x55, 0x53, 0x45, + 0x52, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x52, 0x44, 0x45, 0x52, + 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x52, 0x44, 0x45, + 0x52, 0x5f, 0x52, 0x41, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x52, + 0x44, 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x49, 0x4e, 0x53, 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x4f, + 0x52, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x54, 0x10, + 0x06, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, + 0x45, 0x44, 0x5f, 0x41, 0x54, 0x10, 0x07, 0x2a, 0x39, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, + 0x14, 0x0a, 0x10, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x41, 0x53, + 0x43, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x45, 0x53, 0x43, + 0x10, 0x02, 0x2a, 0x4b, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, + 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, + 0x0e, 0x0a, 0x0a, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, + 0x0e, 0x0a, 0x0a, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x53, 0x55, 0x50, 0x45, 0x52, 0x10, 0x03, 0x32, + 0xab, 0x03, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, + 0x73, 0x65, 0x72, 0x73, 0x12, 0x23, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5e, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x42, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, + 0x50, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, + 0x65, 0x12, 0x26, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x12, 0x42, 0x0a, 0x07, 0x42, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x09, 0x55, 0x6e, 0x62, 0x61, 0x6e, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x62, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x12, 0x5a, + 0x10, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_external_users_v1_admin_proto_rawDescOnce sync.Once + file_external_users_v1_admin_proto_rawDescData []byte +) + +func file_external_users_v1_admin_proto_rawDescGZIP() []byte { + file_external_users_v1_admin_proto_rawDescOnce.Do(func() { + file_external_users_v1_admin_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_external_users_v1_admin_proto_rawDesc), len(file_external_users_v1_admin_proto_rawDesc))) + }) + return file_external_users_v1_admin_proto_rawDescData +} + +var file_external_users_v1_admin_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_external_users_v1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_external_users_v1_admin_proto_goTypes = []any{ + (Order)(0), // 0: usersservice.v1.Order + (Sort)(0), // 1: usersservice.v1.Sort + (Role)(0), // 2: usersservice.v1.Role + (*SearchUsersRequest)(nil), // 3: usersservice.v1.SearchUsersRequest + (*RatingFiler)(nil), // 4: usersservice.v1.RatingFiler + (*CoinsFiler)(nil), // 5: usersservice.v1.CoinsFiler + (*CreateAtFiler)(nil), // 6: usersservice.v1.CreateAtFiler + (*DeletedAtFiler)(nil), // 7: usersservice.v1.DeletedAtFiler + (*SearchUsersResponse)(nil), // 8: usersservice.v1.SearchUsersResponse + (*GetUserByIdentifierRequest)(nil), // 9: usersservice.v1.GetUserByIdentifierRequest + (*BanUserRequest)(nil), // 10: usersservice.v1.BanUserRequest + (*UnbanUserRequest)(nil), // 11: usersservice.v1.UnbanUserRequest + (*UpdateUserRoleRequest)(nil), // 12: usersservice.v1.UpdateUserRoleRequest + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (*UserAdmin)(nil), // 14: usersservice.v1.UserAdmin + (*emptypb.Empty)(nil), // 15: google.protobuf.Empty +} +var file_external_users_v1_admin_proto_depIdxs = []int32{ + 0, // 0: usersservice.v1.SearchUsersRequest.order:type_name -> usersservice.v1.Order + 1, // 1: usersservice.v1.SearchUsersRequest.sort:type_name -> usersservice.v1.Sort + 4, // 2: usersservice.v1.SearchUsersRequest.user_rating:type_name -> usersservice.v1.RatingFiler + 5, // 3: usersservice.v1.SearchUsersRequest.user_coins:type_name -> usersservice.v1.CoinsFiler + 6, // 4: usersservice.v1.SearchUsersRequest.user_created_at:type_name -> usersservice.v1.CreateAtFiler + 7, // 5: usersservice.v1.SearchUsersRequest.user_deleted_at:type_name -> usersservice.v1.DeletedAtFiler + 13, // 6: usersservice.v1.CreateAtFiler.from:type_name -> google.protobuf.Timestamp + 13, // 7: usersservice.v1.CreateAtFiler.to:type_name -> google.protobuf.Timestamp + 13, // 8: usersservice.v1.DeletedAtFiler.from:type_name -> google.protobuf.Timestamp + 13, // 9: usersservice.v1.DeletedAtFiler.to:type_name -> google.protobuf.Timestamp + 14, // 10: usersservice.v1.SearchUsersResponse.users:type_name -> usersservice.v1.UserAdmin + 0, // 11: usersservice.v1.SearchUsersResponse.order:type_name -> usersservice.v1.Order + 1, // 12: usersservice.v1.SearchUsersResponse.sort:type_name -> usersservice.v1.Sort + 2, // 13: usersservice.v1.UpdateUserRoleRequest.role:type_name -> usersservice.v1.Role + 3, // 14: usersservice.v1.UsersAdminService.SearchUsers:input_type -> usersservice.v1.SearchUsersRequest + 9, // 15: usersservice.v1.UsersAdminService.GetUserByIdentifier:input_type -> usersservice.v1.GetUserByIdentifierRequest + 12, // 16: usersservice.v1.UsersAdminService.UpdateUserRole:input_type -> usersservice.v1.UpdateUserRoleRequest + 10, // 17: usersservice.v1.UsersAdminService.BanUser:input_type -> usersservice.v1.BanUserRequest + 11, // 18: usersservice.v1.UsersAdminService.UnbanUser:input_type -> usersservice.v1.UnbanUserRequest + 8, // 19: usersservice.v1.UsersAdminService.SearchUsers:output_type -> usersservice.v1.SearchUsersResponse + 14, // 20: usersservice.v1.UsersAdminService.GetUserByIdentifier:output_type -> usersservice.v1.UserAdmin + 15, // 21: usersservice.v1.UsersAdminService.UpdateUserRole:output_type -> google.protobuf.Empty + 15, // 22: usersservice.v1.UsersAdminService.BanUser:output_type -> google.protobuf.Empty + 15, // 23: usersservice.v1.UsersAdminService.UnbanUser:output_type -> google.protobuf.Empty + 19, // [19:24] is the sub-list for method output_type + 14, // [14:19] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_external_users_v1_admin_proto_init() } +func file_external_users_v1_admin_proto_init() { + if File_external_users_v1_admin_proto != nil { + return + } + file_external_users_v1_shared_proto_init() + file_external_users_v1_admin_proto_msgTypes[0].OneofWrappers = []any{} + file_external_users_v1_admin_proto_msgTypes[6].OneofWrappers = []any{ + (*GetUserByIdentifierRequest_UserId)(nil), + (*GetUserByIdentifierRequest_Username)(nil), + (*GetUserByIdentifierRequest_Email)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_users_v1_admin_proto_rawDesc), len(file_external_users_v1_admin_proto_rawDesc)), + NumEnums: 3, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_external_users_v1_admin_proto_goTypes, + DependencyIndexes: file_external_users_v1_admin_proto_depIdxs, + EnumInfos: file_external_users_v1_admin_proto_enumTypes, + MessageInfos: file_external_users_v1_admin_proto_msgTypes, + }.Build() + File_external_users_v1_admin_proto = out.File + file_external_users_v1_admin_proto_goTypes = nil + file_external_users_v1_admin_proto_depIdxs = nil +} diff --git a/gen/external/users/v1/admin.pb.gw.go b/gen/external/users/v1/admin.pb.gw.go new file mode 100644 index 0000000..2d986d9 --- /dev/null +++ b/gen/external/users/v1/admin.pb.gw.go @@ -0,0 +1,406 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: external/users/v1/admin.proto + +/* +Package usersv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package usersv1 + +import ( + "context" + "errors" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) + +func request_UsersAdminService_SearchUsers_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq SearchUsersRequest + 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.SearchUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAdminService_SearchUsers_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq SearchUsersRequest + 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.SearchUsers(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersAdminService_GetUserByIdentifier_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetUserByIdentifierRequest + 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.GetUserByIdentifier(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAdminService_GetUserByIdentifier_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetUserByIdentifierRequest + 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.GetUserByIdentifier(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersAdminService_UpdateUserRole_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateUserRoleRequest + 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.UpdateUserRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAdminService_UpdateUserRole_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateUserRoleRequest + 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.UpdateUserRole(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersAdminService_BanUser_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq BanUserRequest + 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.BanUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAdminService_BanUser_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq BanUserRequest + 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.BanUser(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersAdminService_UnbanUser_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UnbanUserRequest + 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.UnbanUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAdminService_UnbanUser_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UnbanUserRequest + 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.UnbanUser(ctx, &protoReq) + return msg, metadata, err +} + +// RegisterUsersAdminServiceHandlerServer registers the http handlers for service UsersAdminService to "mux". +// UnaryRPC :call UsersAdminServiceServer 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 RegisterUsersAdminServiceHandlerFromEndpoint 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 RegisterUsersAdminServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersAdminServiceServer) error { + mux.Handle(http.MethodPost, pattern_UsersAdminService_SearchUsers_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, "/usersservice.v1.UsersAdminService/SearchUsers", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/SearchUsers")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAdminService_SearchUsers_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_UsersAdminService_SearchUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAdminService_GetUserByIdentifier_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, "/usersservice.v1.UsersAdminService/GetUserByIdentifier", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/GetUserByIdentifier")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAdminService_GetUserByIdentifier_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_UsersAdminService_GetUserByIdentifier_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAdminService_UpdateUserRole_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, "/usersservice.v1.UsersAdminService/UpdateUserRole", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/UpdateUserRole")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAdminService_UpdateUserRole_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_UsersAdminService_UpdateUserRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAdminService_BanUser_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, "/usersservice.v1.UsersAdminService/BanUser", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/BanUser")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAdminService_BanUser_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_UsersAdminService_BanUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAdminService_UnbanUser_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, "/usersservice.v1.UsersAdminService/UnbanUser", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/UnbanUser")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAdminService_UnbanUser_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_UsersAdminService_UnbanUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + return nil +} + +// RegisterUsersAdminServiceHandlerFromEndpoint is same as RegisterUsersAdminServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterUsersAdminServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.NewClient(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + return RegisterUsersAdminServiceHandler(ctx, mux, conn) +} + +// RegisterUsersAdminServiceHandler registers the http handlers for service UsersAdminService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterUsersAdminServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterUsersAdminServiceHandlerClient(ctx, mux, NewUsersAdminServiceClient(conn)) +} + +// RegisterUsersAdminServiceHandlerClient registers the http handlers for service UsersAdminService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UsersAdminServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UsersAdminServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "UsersAdminServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +func RegisterUsersAdminServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersAdminServiceClient) error { + mux.Handle(http.MethodPost, pattern_UsersAdminService_SearchUsers_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, "/usersservice.v1.UsersAdminService/SearchUsers", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/SearchUsers")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAdminService_SearchUsers_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAdminService_SearchUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAdminService_GetUserByIdentifier_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, "/usersservice.v1.UsersAdminService/GetUserByIdentifier", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/GetUserByIdentifier")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAdminService_GetUserByIdentifier_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAdminService_GetUserByIdentifier_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAdminService_UpdateUserRole_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, "/usersservice.v1.UsersAdminService/UpdateUserRole", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/UpdateUserRole")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAdminService_UpdateUserRole_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAdminService_UpdateUserRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAdminService_BanUser_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, "/usersservice.v1.UsersAdminService/BanUser", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/BanUser")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAdminService_BanUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAdminService_BanUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAdminService_UnbanUser_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, "/usersservice.v1.UsersAdminService/UnbanUser", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/UnbanUser")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAdminService_UnbanUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAdminService_UnbanUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil +} + +var ( + pattern_UsersAdminService_SearchUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAdminService", "SearchUsers"}, "")) + pattern_UsersAdminService_GetUserByIdentifier_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAdminService", "GetUserByIdentifier"}, "")) + pattern_UsersAdminService_UpdateUserRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAdminService", "UpdateUserRole"}, "")) + pattern_UsersAdminService_BanUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAdminService", "BanUser"}, "")) + pattern_UsersAdminService_UnbanUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAdminService", "UnbanUser"}, "")) +) + +var ( + forward_UsersAdminService_SearchUsers_0 = runtime.ForwardResponseMessage + forward_UsersAdminService_GetUserByIdentifier_0 = runtime.ForwardResponseMessage + forward_UsersAdminService_UpdateUserRole_0 = runtime.ForwardResponseMessage + forward_UsersAdminService_BanUser_0 = runtime.ForwardResponseMessage + forward_UsersAdminService_UnbanUser_0 = runtime.ForwardResponseMessage +) diff --git a/gen/external/users/v1/admin_grpc.pb.go b/gen/external/users/v1/admin_grpc.pb.go new file mode 100644 index 0000000..84bc199 --- /dev/null +++ b/gen/external/users/v1/admin_grpc.pb.go @@ -0,0 +1,272 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: external/users/v1/admin.proto + +package usersv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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 ( + UsersAdminService_SearchUsers_FullMethodName = "/usersservice.v1.UsersAdminService/SearchUsers" + UsersAdminService_GetUserByIdentifier_FullMethodName = "/usersservice.v1.UsersAdminService/GetUserByIdentifier" + UsersAdminService_UpdateUserRole_FullMethodName = "/usersservice.v1.UsersAdminService/UpdateUserRole" + UsersAdminService_BanUser_FullMethodName = "/usersservice.v1.UsersAdminService/BanUser" + UsersAdminService_UnbanUser_FullMethodName = "/usersservice.v1.UsersAdminService/UnbanUser" +) + +// UsersAdminServiceClient is the client API for UsersAdminService 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 UsersAdminServiceClient interface { + SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) + GetUserByIdentifier(ctx context.Context, in *GetUserByIdentifierRequest, opts ...grpc.CallOption) (*UserAdmin, error) + UpdateUserRole(ctx context.Context, in *UpdateUserRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + BanUser(ctx context.Context, in *BanUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + UnbanUser(ctx context.Context, in *UnbanUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type usersAdminServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUsersAdminServiceClient(cc grpc.ClientConnInterface) UsersAdminServiceClient { + return &usersAdminServiceClient{cc} +} + +func (c *usersAdminServiceClient) SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SearchUsersResponse) + err := c.cc.Invoke(ctx, UsersAdminService_SearchUsers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersAdminServiceClient) GetUserByIdentifier(ctx context.Context, in *GetUserByIdentifierRequest, opts ...grpc.CallOption) (*UserAdmin, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UserAdmin) + err := c.cc.Invoke(ctx, UsersAdminService_GetUserByIdentifier_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersAdminServiceClient) UpdateUserRole(ctx context.Context, in *UpdateUserRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersAdminService_UpdateUserRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersAdminServiceClient) BanUser(ctx context.Context, in *BanUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersAdminService_BanUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersAdminServiceClient) UnbanUser(ctx context.Context, in *UnbanUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersAdminService_UnbanUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UsersAdminServiceServer is the server API for UsersAdminService service. +// All implementations should embed UnimplementedUsersAdminServiceServer +// for forward compatibility. +type UsersAdminServiceServer interface { + SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) + GetUserByIdentifier(context.Context, *GetUserByIdentifierRequest) (*UserAdmin, error) + UpdateUserRole(context.Context, *UpdateUserRoleRequest) (*emptypb.Empty, error) + BanUser(context.Context, *BanUserRequest) (*emptypb.Empty, error) + UnbanUser(context.Context, *UnbanUserRequest) (*emptypb.Empty, error) +} + +// UnimplementedUsersAdminServiceServer should 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 UnimplementedUsersAdminServiceServer struct{} + +func (UnimplementedUsersAdminServiceServer) SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchUsers not implemented") +} +func (UnimplementedUsersAdminServiceServer) GetUserByIdentifier(context.Context, *GetUserByIdentifierRequest) (*UserAdmin, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserByIdentifier not implemented") +} +func (UnimplementedUsersAdminServiceServer) UpdateUserRole(context.Context, *UpdateUserRoleRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserRole not implemented") +} +func (UnimplementedUsersAdminServiceServer) BanUser(context.Context, *BanUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method BanUser not implemented") +} +func (UnimplementedUsersAdminServiceServer) UnbanUser(context.Context, *UnbanUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnbanUser not implemented") +} +func (UnimplementedUsersAdminServiceServer) testEmbeddedByValue() {} + +// UnsafeUsersAdminServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UsersAdminServiceServer will +// result in compilation errors. +type UnsafeUsersAdminServiceServer interface { + mustEmbedUnimplementedUsersAdminServiceServer() +} + +func RegisterUsersAdminServiceServer(s grpc.ServiceRegistrar, srv UsersAdminServiceServer) { + // If the following call pancis, it indicates UnimplementedUsersAdminServiceServer 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(&UsersAdminService_ServiceDesc, srv) +} + +func _UsersAdminService_SearchUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAdminServiceServer).SearchUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAdminService_SearchUsers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAdminServiceServer).SearchUsers(ctx, req.(*SearchUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersAdminService_GetUserByIdentifier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserByIdentifierRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAdminServiceServer).GetUserByIdentifier(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAdminService_GetUserByIdentifier_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAdminServiceServer).GetUserByIdentifier(ctx, req.(*GetUserByIdentifierRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersAdminService_UpdateUserRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAdminServiceServer).UpdateUserRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAdminService_UpdateUserRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAdminServiceServer).UpdateUserRole(ctx, req.(*UpdateUserRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersAdminService_BanUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BanUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAdminServiceServer).BanUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAdminService_BanUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAdminServiceServer).BanUser(ctx, req.(*BanUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersAdminService_UnbanUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnbanUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAdminServiceServer).UnbanUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAdminService_UnbanUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAdminServiceServer).UnbanUser(ctx, req.(*UnbanUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UsersAdminService_ServiceDesc is the grpc.ServiceDesc for UsersAdminService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UsersAdminService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "usersservice.v1.UsersAdminService", + HandlerType: (*UsersAdminServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SearchUsers", + Handler: _UsersAdminService_SearchUsers_Handler, + }, + { + MethodName: "GetUserByIdentifier", + Handler: _UsersAdminService_GetUserByIdentifier_Handler, + }, + { + MethodName: "UpdateUserRole", + Handler: _UsersAdminService_UpdateUserRole_Handler, + }, + { + MethodName: "BanUser", + Handler: _UsersAdminService_BanUser_Handler, + }, + { + MethodName: "UnbanUser", + Handler: _UsersAdminService_UnbanUser_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "external/users/v1/admin.proto", +} diff --git a/gen/external/users/v1/auth.pb.go b/gen/external/users/v1/auth.pb.go new file mode 100644 index 0000000..c90c1df --- /dev/null +++ b/gen/external/users/v1/auth.pb.go @@ -0,0 +1,702 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: external/users/v1/auth.proto + +package usersv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" + 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) +) + +type RegisterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AvatarId int32 `protobuf:"varint,1,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RegisterRequest) Reset() { + *x = RegisterRequest{} + mi := &file_external_users_v1_auth_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RegisterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterRequest) ProtoMessage() {} + +func (x *RegisterRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_auth_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead. +func (*RegisterRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{0} +} + +func (x *RegisterRequest) GetAvatarId() int32 { + if x != nil { + return x.AvatarId + } + return 0 +} + +func (x *RegisterRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *RegisterRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *RegisterRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type RegisterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + Profile *Profile `protobuf:"bytes,2,opt,name=profile,proto3" json:"profile,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RegisterResponse) Reset() { + *x = RegisterResponse{} + mi := &file_external_users_v1_auth_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RegisterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterResponse) ProtoMessage() {} + +func (x *RegisterResponse) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_auth_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead. +func (*RegisterResponse) Descriptor() ([]byte, []int) { + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{1} +} + +func (x *RegisterResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *RegisterResponse) GetProfile() *Profile { + if x != nil { + return x.Profile + } + return nil +} + +type LoginRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Identifier: + // + // *LoginRequest_Username + // *LoginRequest_Email + Identifier isLoginRequest_Identifier `protobuf_oneof:"identifier"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LoginRequest) Reset() { + *x = LoginRequest{} + mi := &file_external_users_v1_auth_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginRequest) ProtoMessage() {} + +func (x *LoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_auth_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. +func (*LoginRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{2} +} + +func (x *LoginRequest) GetIdentifier() isLoginRequest_Identifier { + if x != nil { + return x.Identifier + } + return nil +} + +func (x *LoginRequest) GetUsername() string { + if x != nil { + if x, ok := x.Identifier.(*LoginRequest_Username); ok { + return x.Username + } + } + return "" +} + +func (x *LoginRequest) GetEmail() string { + if x != nil { + if x, ok := x.Identifier.(*LoginRequest_Email); ok { + return x.Email + } + } + return "" +} + +func (x *LoginRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type isLoginRequest_Identifier interface { + isLoginRequest_Identifier() +} + +type LoginRequest_Username struct { + Username string `protobuf:"bytes,1,opt,name=username,proto3,oneof"` +} + +type LoginRequest_Email struct { + Email string `protobuf:"bytes,2,opt,name=email,proto3,oneof"` +} + +func (*LoginRequest_Username) isLoginRequest_Identifier() {} + +func (*LoginRequest_Email) isLoginRequest_Identifier() {} + +type LoginResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + Profile *Profile `protobuf:"bytes,2,opt,name=profile,proto3" json:"profile,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LoginResponse) Reset() { + *x = LoginResponse{} + mi := &file_external_users_v1_auth_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LoginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginResponse) ProtoMessage() {} + +func (x *LoginResponse) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_auth_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead. +func (*LoginResponse) Descriptor() ([]byte, []int) { + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{3} +} + +func (x *LoginResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *LoginResponse) GetProfile() *Profile { + if x != nil { + return x.Profile + } + return nil +} + +type LogoutRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LogoutRequest) Reset() { + *x = LogoutRequest{} + mi := &file_external_users_v1_auth_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LogoutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogoutRequest) ProtoMessage() {} + +func (x *LogoutRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_auth_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead. +func (*LogoutRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{4} +} + +func (x *LogoutRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type LogoutResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LogoutResponse) Reset() { + *x = LogoutResponse{} + mi := &file_external_users_v1_auth_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LogoutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogoutResponse) ProtoMessage() {} + +func (x *LogoutResponse) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_auth_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead. +func (*LogoutResponse) Descriptor() ([]byte, []int) { + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{5} +} + +type OAuthLoginRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` + Code string `protobuf:"bytes,4,opt,name=code,proto3" json:"code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OAuthLoginRequest) Reset() { + *x = OAuthLoginRequest{} + mi := &file_external_users_v1_auth_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OAuthLoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OAuthLoginRequest) ProtoMessage() {} + +func (x *OAuthLoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_auth_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OAuthLoginRequest.ProtoReflect.Descriptor instead. +func (*OAuthLoginRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{6} +} + +func (x *OAuthLoginRequest) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *OAuthLoginRequest) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *OAuthLoginRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +type OAuthLoginResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Profile *Profile `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` + IsNewUser bool `protobuf:"varint,2,opt,name=is_new_user,json=isNewUser,proto3" json:"is_new_user,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OAuthLoginResponse) Reset() { + *x = OAuthLoginResponse{} + mi := &file_external_users_v1_auth_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OAuthLoginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OAuthLoginResponse) ProtoMessage() {} + +func (x *OAuthLoginResponse) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_auth_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OAuthLoginResponse.ProtoReflect.Descriptor instead. +func (*OAuthLoginResponse) Descriptor() ([]byte, []int) { + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{7} +} + +func (x *OAuthLoginResponse) GetProfile() *Profile { + if x != nil { + return x.Profile + } + return nil +} + +func (x *OAuthLoginResponse) GetIsNewUser() bool { + if x != nil { + return x.IsNewUser + } + return false +} + +type LinkOAuthProviderRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` + Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LinkOAuthProviderRequest) Reset() { + *x = LinkOAuthProviderRequest{} + mi := &file_external_users_v1_auth_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LinkOAuthProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkOAuthProviderRequest) ProtoMessage() {} + +func (x *LinkOAuthProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_auth_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LinkOAuthProviderRequest.ProtoReflect.Descriptor instead. +func (*LinkOAuthProviderRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{8} +} + +func (x *LinkOAuthProviderRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *LinkOAuthProviderRequest) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *LinkOAuthProviderRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +var File_external_users_v1_auth_proto protoreflect.FileDescriptor + +var file_external_users_v1_auth_proto_rawDesc = string([]byte{ + 0x0a, 0x1c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, + 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x65, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x0f, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x5c, 0x0a, 0x10, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, + 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x6e, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x59, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x32, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x22, 0x28, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x10, 0x0a, + 0x0e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x59, 0x0a, 0x11, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x68, 0x0a, 0x12, 0x4f, 0x41, + 0x75, 0x74, 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x32, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x4e, 0x65, 0x77, + 0x55, 0x73, 0x65, 0x72, 0x22, 0x63, 0x0a, 0x18, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x41, 0x75, 0x74, + 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x32, 0x9c, 0x03, 0x0a, 0x10, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, + 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x46, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, + 0x74, 0x12, 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x55, 0x0a, 0x0a, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x41, + 0x75, 0x74, 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x56, 0x0a, 0x11, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x29, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x41, 0x75, 0x74, + 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x12, 0x5a, 0x10, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_external_users_v1_auth_proto_rawDescOnce sync.Once + file_external_users_v1_auth_proto_rawDescData []byte +) + +func file_external_users_v1_auth_proto_rawDescGZIP() []byte { + file_external_users_v1_auth_proto_rawDescOnce.Do(func() { + file_external_users_v1_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_external_users_v1_auth_proto_rawDesc), len(file_external_users_v1_auth_proto_rawDesc))) + }) + return file_external_users_v1_auth_proto_rawDescData +} + +var file_external_users_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_external_users_v1_auth_proto_goTypes = []any{ + (*RegisterRequest)(nil), // 0: usersservice.v1.RegisterRequest + (*RegisterResponse)(nil), // 1: usersservice.v1.RegisterResponse + (*LoginRequest)(nil), // 2: usersservice.v1.LoginRequest + (*LoginResponse)(nil), // 3: usersservice.v1.LoginResponse + (*LogoutRequest)(nil), // 4: usersservice.v1.LogoutRequest + (*LogoutResponse)(nil), // 5: usersservice.v1.LogoutResponse + (*OAuthLoginRequest)(nil), // 6: usersservice.v1.OAuthLoginRequest + (*OAuthLoginResponse)(nil), // 7: usersservice.v1.OAuthLoginResponse + (*LinkOAuthProviderRequest)(nil), // 8: usersservice.v1.LinkOAuthProviderRequest + (*Profile)(nil), // 9: usersservice.v1.Profile + (*emptypb.Empty)(nil), // 10: google.protobuf.Empty +} +var file_external_users_v1_auth_proto_depIdxs = []int32{ + 9, // 0: usersservice.v1.RegisterResponse.profile:type_name -> usersservice.v1.Profile + 9, // 1: usersservice.v1.LoginResponse.profile:type_name -> usersservice.v1.Profile + 9, // 2: usersservice.v1.OAuthLoginResponse.profile:type_name -> usersservice.v1.Profile + 0, // 3: usersservice.v1.UsersAuthService.Register:input_type -> usersservice.v1.RegisterRequest + 2, // 4: usersservice.v1.UsersAuthService.Login:input_type -> usersservice.v1.LoginRequest + 4, // 5: usersservice.v1.UsersAuthService.Logout:input_type -> usersservice.v1.LogoutRequest + 6, // 6: usersservice.v1.UsersAuthService.OAuthLogin:input_type -> usersservice.v1.OAuthLoginRequest + 8, // 7: usersservice.v1.UsersAuthService.LinkOAuthProvider:input_type -> usersservice.v1.LinkOAuthProviderRequest + 1, // 8: usersservice.v1.UsersAuthService.Register:output_type -> usersservice.v1.RegisterResponse + 3, // 9: usersservice.v1.UsersAuthService.Login:output_type -> usersservice.v1.LoginResponse + 10, // 10: usersservice.v1.UsersAuthService.Logout:output_type -> google.protobuf.Empty + 7, // 11: usersservice.v1.UsersAuthService.OAuthLogin:output_type -> usersservice.v1.OAuthLoginResponse + 10, // 12: usersservice.v1.UsersAuthService.LinkOAuthProvider:output_type -> google.protobuf.Empty + 8, // [8:13] is the sub-list for method output_type + 3, // [3:8] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_external_users_v1_auth_proto_init() } +func file_external_users_v1_auth_proto_init() { + if File_external_users_v1_auth_proto != nil { + return + } + file_external_users_v1_shared_proto_init() + file_external_users_v1_auth_proto_msgTypes[2].OneofWrappers = []any{ + (*LoginRequest_Username)(nil), + (*LoginRequest_Email)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_users_v1_auth_proto_rawDesc), len(file_external_users_v1_auth_proto_rawDesc)), + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_external_users_v1_auth_proto_goTypes, + DependencyIndexes: file_external_users_v1_auth_proto_depIdxs, + MessageInfos: file_external_users_v1_auth_proto_msgTypes, + }.Build() + File_external_users_v1_auth_proto = out.File + file_external_users_v1_auth_proto_goTypes = nil + file_external_users_v1_auth_proto_depIdxs = nil +} diff --git a/gen/external/users/v1/auth.pb.gw.go b/gen/external/users/v1/auth.pb.gw.go new file mode 100644 index 0000000..4d825f3 --- /dev/null +++ b/gen/external/users/v1/auth.pb.gw.go @@ -0,0 +1,406 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: external/users/v1/auth.proto + +/* +Package usersv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package usersv1 + +import ( + "context" + "errors" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) + +func request_UsersAuthService_Register_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq RegisterRequest + 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.Register(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAuthService_Register_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq RegisterRequest + 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.Register(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersAuthService_Login_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq LoginRequest + 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.Login(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAuthService_Login_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq LoginRequest + 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.Login(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersAuthService_Logout_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq LogoutRequest + 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.Logout(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAuthService_Logout_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq LogoutRequest + 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.Logout(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersAuthService_OAuthLogin_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq OAuthLoginRequest + 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.OAuthLogin(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAuthService_OAuthLogin_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq OAuthLoginRequest + 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.OAuthLogin(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersAuthService_LinkOAuthProvider_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq LinkOAuthProviderRequest + 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.LinkOAuthProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAuthService_LinkOAuthProvider_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq LinkOAuthProviderRequest + 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.LinkOAuthProvider(ctx, &protoReq) + return msg, metadata, err +} + +// RegisterUsersAuthServiceHandlerServer registers the http handlers for service UsersAuthService to "mux". +// UnaryRPC :call UsersAuthServiceServer 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 RegisterUsersAuthServiceHandlerFromEndpoint 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 RegisterUsersAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersAuthServiceServer) error { + mux.Handle(http.MethodPost, pattern_UsersAuthService_Register_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, "/usersservice.v1.UsersAuthService/Register", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAuthService/Register")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAuthService_Register_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_UsersAuthService_Register_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAuthService_Login_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, "/usersservice.v1.UsersAuthService/Login", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAuthService/Login")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAuthService_Login_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_UsersAuthService_Login_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAuthService_Logout_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, "/usersservice.v1.UsersAuthService/Logout", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAuthService/Logout")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAuthService_Logout_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_UsersAuthService_Logout_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAuthService_OAuthLogin_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, "/usersservice.v1.UsersAuthService/OAuthLogin", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAuthService/OAuthLogin")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAuthService_OAuthLogin_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_UsersAuthService_OAuthLogin_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAuthService_LinkOAuthProvider_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, "/usersservice.v1.UsersAuthService/LinkOAuthProvider", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAuthService/LinkOAuthProvider")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAuthService_LinkOAuthProvider_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_UsersAuthService_LinkOAuthProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + return nil +} + +// RegisterUsersAuthServiceHandlerFromEndpoint is same as RegisterUsersAuthServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterUsersAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.NewClient(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + return RegisterUsersAuthServiceHandler(ctx, mux, conn) +} + +// RegisterUsersAuthServiceHandler registers the http handlers for service UsersAuthService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterUsersAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterUsersAuthServiceHandlerClient(ctx, mux, NewUsersAuthServiceClient(conn)) +} + +// RegisterUsersAuthServiceHandlerClient registers the http handlers for service UsersAuthService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UsersAuthServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UsersAuthServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "UsersAuthServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +func RegisterUsersAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersAuthServiceClient) error { + mux.Handle(http.MethodPost, pattern_UsersAuthService_Register_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, "/usersservice.v1.UsersAuthService/Register", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAuthService/Register")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAuthService_Register_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAuthService_Register_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAuthService_Login_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, "/usersservice.v1.UsersAuthService/Login", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAuthService/Login")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAuthService_Login_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAuthService_Login_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAuthService_Logout_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, "/usersservice.v1.UsersAuthService/Logout", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAuthService/Logout")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAuthService_Logout_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAuthService_Logout_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAuthService_OAuthLogin_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, "/usersservice.v1.UsersAuthService/OAuthLogin", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAuthService/OAuthLogin")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAuthService_OAuthLogin_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAuthService_OAuthLogin_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersAuthService_LinkOAuthProvider_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, "/usersservice.v1.UsersAuthService/LinkOAuthProvider", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAuthService/LinkOAuthProvider")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAuthService_LinkOAuthProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAuthService_LinkOAuthProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil +} + +var ( + pattern_UsersAuthService_Register_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAuthService", "Register"}, "")) + pattern_UsersAuthService_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAuthService", "Login"}, "")) + pattern_UsersAuthService_Logout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAuthService", "Logout"}, "")) + pattern_UsersAuthService_OAuthLogin_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAuthService", "OAuthLogin"}, "")) + pattern_UsersAuthService_LinkOAuthProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAuthService", "LinkOAuthProvider"}, "")) +) + +var ( + forward_UsersAuthService_Register_0 = runtime.ForwardResponseMessage + forward_UsersAuthService_Login_0 = runtime.ForwardResponseMessage + forward_UsersAuthService_Logout_0 = runtime.ForwardResponseMessage + forward_UsersAuthService_OAuthLogin_0 = runtime.ForwardResponseMessage + forward_UsersAuthService_LinkOAuthProvider_0 = runtime.ForwardResponseMessage +) diff --git a/gen/external/users/v1/auth_grpc.pb.go b/gen/external/users/v1/auth_grpc.pb.go new file mode 100644 index 0000000..7f76bf5 --- /dev/null +++ b/gen/external/users/v1/auth_grpc.pb.go @@ -0,0 +1,272 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: external/users/v1/auth.proto + +package usersv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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 ( + UsersAuthService_Register_FullMethodName = "/usersservice.v1.UsersAuthService/Register" + UsersAuthService_Login_FullMethodName = "/usersservice.v1.UsersAuthService/Login" + UsersAuthService_Logout_FullMethodName = "/usersservice.v1.UsersAuthService/Logout" + UsersAuthService_OAuthLogin_FullMethodName = "/usersservice.v1.UsersAuthService/OAuthLogin" + UsersAuthService_LinkOAuthProvider_FullMethodName = "/usersservice.v1.UsersAuthService/LinkOAuthProvider" +) + +// UsersAuthServiceClient is the client API for UsersAuthService 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 UsersAuthServiceClient interface { + Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) + Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) + Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + OAuthLogin(ctx context.Context, in *OAuthLoginRequest, opts ...grpc.CallOption) (*OAuthLoginResponse, error) + LinkOAuthProvider(ctx context.Context, in *LinkOAuthProviderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type usersAuthServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUsersAuthServiceClient(cc grpc.ClientConnInterface) UsersAuthServiceClient { + return &usersAuthServiceClient{cc} +} + +func (c *usersAuthServiceClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RegisterResponse) + err := c.cc.Invoke(ctx, UsersAuthService_Register_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersAuthServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LoginResponse) + err := c.cc.Invoke(ctx, UsersAuthService_Login_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersAuthServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersAuthService_Logout_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersAuthServiceClient) OAuthLogin(ctx context.Context, in *OAuthLoginRequest, opts ...grpc.CallOption) (*OAuthLoginResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OAuthLoginResponse) + err := c.cc.Invoke(ctx, UsersAuthService_OAuthLogin_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersAuthServiceClient) LinkOAuthProvider(ctx context.Context, in *LinkOAuthProviderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersAuthService_LinkOAuthProvider_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UsersAuthServiceServer is the server API for UsersAuthService service. +// All implementations should embed UnimplementedUsersAuthServiceServer +// for forward compatibility. +type UsersAuthServiceServer interface { + Register(context.Context, *RegisterRequest) (*RegisterResponse, error) + Login(context.Context, *LoginRequest) (*LoginResponse, error) + Logout(context.Context, *LogoutRequest) (*emptypb.Empty, error) + OAuthLogin(context.Context, *OAuthLoginRequest) (*OAuthLoginResponse, error) + LinkOAuthProvider(context.Context, *LinkOAuthProviderRequest) (*emptypb.Empty, error) +} + +// UnimplementedUsersAuthServiceServer should 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 UnimplementedUsersAuthServiceServer struct{} + +func (UnimplementedUsersAuthServiceServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") +} +func (UnimplementedUsersAuthServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (UnimplementedUsersAuthServiceServer) Logout(context.Context, *LogoutRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") +} +func (UnimplementedUsersAuthServiceServer) OAuthLogin(context.Context, *OAuthLoginRequest) (*OAuthLoginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OAuthLogin not implemented") +} +func (UnimplementedUsersAuthServiceServer) LinkOAuthProvider(context.Context, *LinkOAuthProviderRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method LinkOAuthProvider not implemented") +} +func (UnimplementedUsersAuthServiceServer) testEmbeddedByValue() {} + +// UnsafeUsersAuthServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UsersAuthServiceServer will +// result in compilation errors. +type UnsafeUsersAuthServiceServer interface { + mustEmbedUnimplementedUsersAuthServiceServer() +} + +func RegisterUsersAuthServiceServer(s grpc.ServiceRegistrar, srv UsersAuthServiceServer) { + // If the following call pancis, it indicates UnimplementedUsersAuthServiceServer 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(&UsersAuthService_ServiceDesc, srv) +} + +func _UsersAuthService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAuthServiceServer).Register(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAuthService_Register_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAuthServiceServer).Register(ctx, req.(*RegisterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersAuthService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAuthServiceServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAuthService_Login_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAuthServiceServer).Login(ctx, req.(*LoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersAuthService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LogoutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAuthServiceServer).Logout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAuthService_Logout_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAuthServiceServer).Logout(ctx, req.(*LogoutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersAuthService_OAuthLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OAuthLoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAuthServiceServer).OAuthLogin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAuthService_OAuthLogin_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAuthServiceServer).OAuthLogin(ctx, req.(*OAuthLoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersAuthService_LinkOAuthProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LinkOAuthProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAuthServiceServer).LinkOAuthProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAuthService_LinkOAuthProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAuthServiceServer).LinkOAuthProvider(ctx, req.(*LinkOAuthProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UsersAuthService_ServiceDesc is the grpc.ServiceDesc for UsersAuthService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UsersAuthService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "usersservice.v1.UsersAuthService", + HandlerType: (*UsersAuthServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Register", + Handler: _UsersAuthService_Register_Handler, + }, + { + MethodName: "Login", + Handler: _UsersAuthService_Login_Handler, + }, + { + MethodName: "Logout", + Handler: _UsersAuthService_Logout_Handler, + }, + { + MethodName: "OAuthLogin", + Handler: _UsersAuthService_OAuthLogin_Handler, + }, + { + MethodName: "LinkOAuthProvider", + Handler: _UsersAuthService_LinkOAuthProvider_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "external/users/v1/auth.proto", +} diff --git a/gen/external/users/v1/profile.pb.go b/gen/external/users/v1/profile.pb.go new file mode 100644 index 0000000..03d48cd --- /dev/null +++ b/gen/external/users/v1/profile.pb.go @@ -0,0 +1,539 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: external/users/v1/profile.proto + +package usersv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" + 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) +) + +type GetProfileRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Identifier: + // + // *GetProfileRequest_UserId + // *GetProfileRequest_Username + Identifier isGetProfileRequest_Identifier `protobuf_oneof:"identifier"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProfileRequest) Reset() { + *x = GetProfileRequest{} + mi := &file_external_users_v1_profile_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProfileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProfileRequest) ProtoMessage() {} + +func (x *GetProfileRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_profile_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProfileRequest.ProtoReflect.Descriptor instead. +func (*GetProfileRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_profile_proto_rawDescGZIP(), []int{0} +} + +func (x *GetProfileRequest) GetIdentifier() isGetProfileRequest_Identifier { + if x != nil { + return x.Identifier + } + return nil +} + +func (x *GetProfileRequest) GetUserId() string { + if x != nil { + if x, ok := x.Identifier.(*GetProfileRequest_UserId); ok { + return x.UserId + } + } + return "" +} + +func (x *GetProfileRequest) GetUsername() string { + if x != nil { + if x, ok := x.Identifier.(*GetProfileRequest_Username); ok { + return x.Username + } + } + return "" +} + +type isGetProfileRequest_Identifier interface { + isGetProfileRequest_Identifier() +} + +type GetProfileRequest_UserId struct { + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3,oneof"` +} + +type GetProfileRequest_Username struct { + Username string `protobuf:"bytes,2,opt,name=username,proto3,oneof"` +} + +func (*GetProfileRequest_UserId) isGetProfileRequest_Identifier() {} + +func (*GetProfileRequest_Username) isGetProfileRequest_Identifier() {} + +type GetProfileResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Data: + // + // *GetProfileResponse_Profile + // *GetProfileResponse_User + Data isGetProfileResponse_Data `protobuf_oneof:"data"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProfileResponse) Reset() { + *x = GetProfileResponse{} + mi := &file_external_users_v1_profile_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProfileResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProfileResponse) ProtoMessage() {} + +func (x *GetProfileResponse) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_profile_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProfileResponse.ProtoReflect.Descriptor instead. +func (*GetProfileResponse) Descriptor() ([]byte, []int) { + return file_external_users_v1_profile_proto_rawDescGZIP(), []int{1} +} + +func (x *GetProfileResponse) GetData() isGetProfileResponse_Data { + if x != nil { + return x.Data + } + return nil +} + +func (x *GetProfileResponse) GetProfile() *Profile { + if x != nil { + if x, ok := x.Data.(*GetProfileResponse_Profile); ok { + return x.Profile + } + } + return nil +} + +func (x *GetProfileResponse) GetUser() *User { + if x != nil { + if x, ok := x.Data.(*GetProfileResponse_User); ok { + return x.User + } + } + return nil +} + +type isGetProfileResponse_Data interface { + isGetProfileResponse_Data() +} + +type GetProfileResponse_Profile struct { + Profile *Profile `protobuf:"bytes,1,opt,name=profile,proto3,oneof"` +} + +type GetProfileResponse_User struct { + User *User `protobuf:"bytes,3,opt,name=user,proto3,oneof"` +} + +func (*GetProfileResponse_Profile) isGetProfileResponse_Data() {} + +func (*GetProfileResponse_User) isGetProfileResponse_Data() {} + +type UpdateProfileRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Username *string `protobuf:"bytes,2,opt,name=username,proto3,oneof" json:"username,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateProfileRequest) Reset() { + *x = UpdateProfileRequest{} + mi := &file_external_users_v1_profile_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateProfileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateProfileRequest) ProtoMessage() {} + +func (x *UpdateProfileRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_profile_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateProfileRequest.ProtoReflect.Descriptor instead. +func (*UpdateProfileRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_profile_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateProfileRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UpdateProfileRequest) GetUsername() string { + if x != nil && x.Username != nil { + return *x.Username + } + return "" +} + +type UpdateAvatarRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + AvatarId int32 `protobuf:"varint,2,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateAvatarRequest) Reset() { + *x = UpdateAvatarRequest{} + mi := &file_external_users_v1_profile_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateAvatarRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAvatarRequest) ProtoMessage() {} + +func (x *UpdateAvatarRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_profile_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAvatarRequest.ProtoReflect.Descriptor instead. +func (*UpdateAvatarRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_profile_proto_rawDescGZIP(), []int{3} +} + +func (x *UpdateAvatarRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UpdateAvatarRequest) GetAvatarId() int32 { + if x != nil { + return x.AvatarId + } + return 0 +} + +type ChangePasswordRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ChangePasswordRequest) Reset() { + *x = ChangePasswordRequest{} + mi := &file_external_users_v1_profile_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChangePasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangePasswordRequest) ProtoMessage() {} + +func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_profile_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead. +func (*ChangePasswordRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_profile_proto_rawDescGZIP(), []int{4} +} + +func (x *ChangePasswordRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ChangePasswordRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type DeleteAccountRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteAccountRequest) Reset() { + *x = DeleteAccountRequest{} + mi := &file_external_users_v1_profile_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteAccountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAccountRequest) ProtoMessage() {} + +func (x *DeleteAccountRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_profile_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAccountRequest.ProtoReflect.Descriptor instead. +func (*DeleteAccountRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_profile_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteAccountRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +var File_external_users_v1_profile_proto protoreflect.FileDescriptor + +var file_external_users_v1_profile_proto_rawDesc = string([]byte{ + 0x0a, 0x1f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x1a, 0x1e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x5a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x1c, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0c, 0x0a, + 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x7f, 0x0a, 0x12, 0x47, + 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x34, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x07, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x48, 0x00, 0x52, 0x04, + 0x75, 0x73, 0x65, 0x72, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x5d, 0x0a, 0x14, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0b, + 0x0a, 0x09, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4b, 0x0a, 0x13, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x61, + 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x49, 0x64, 0x22, 0x4c, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2f, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x32, 0xac, 0x03, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, + 0x73, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x55, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x22, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x23, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x25, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, + 0x76, 0x61, 0x74, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x50, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x26, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4e, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x12, 0x5a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, + 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +}) + +var ( + file_external_users_v1_profile_proto_rawDescOnce sync.Once + file_external_users_v1_profile_proto_rawDescData []byte +) + +func file_external_users_v1_profile_proto_rawDescGZIP() []byte { + file_external_users_v1_profile_proto_rawDescOnce.Do(func() { + file_external_users_v1_profile_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_external_users_v1_profile_proto_rawDesc), len(file_external_users_v1_profile_proto_rawDesc))) + }) + return file_external_users_v1_profile_proto_rawDescData +} + +var file_external_users_v1_profile_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_external_users_v1_profile_proto_goTypes = []any{ + (*GetProfileRequest)(nil), // 0: usersservice.v1.GetProfileRequest + (*GetProfileResponse)(nil), // 1: usersservice.v1.GetProfileResponse + (*UpdateProfileRequest)(nil), // 2: usersservice.v1.UpdateProfileRequest + (*UpdateAvatarRequest)(nil), // 3: usersservice.v1.UpdateAvatarRequest + (*ChangePasswordRequest)(nil), // 4: usersservice.v1.ChangePasswordRequest + (*DeleteAccountRequest)(nil), // 5: usersservice.v1.DeleteAccountRequest + (*Profile)(nil), // 6: usersservice.v1.Profile + (*User)(nil), // 7: usersservice.v1.User + (*emptypb.Empty)(nil), // 8: google.protobuf.Empty +} +var file_external_users_v1_profile_proto_depIdxs = []int32{ + 6, // 0: usersservice.v1.GetProfileResponse.profile:type_name -> usersservice.v1.Profile + 7, // 1: usersservice.v1.GetProfileResponse.user:type_name -> usersservice.v1.User + 0, // 2: usersservice.v1.UsersProfileService.GetProfile:input_type -> usersservice.v1.GetProfileRequest + 2, // 3: usersservice.v1.UsersProfileService.UpdateProfile:input_type -> usersservice.v1.UpdateProfileRequest + 3, // 4: usersservice.v1.UsersProfileService.UpdateAvatar:input_type -> usersservice.v1.UpdateAvatarRequest + 4, // 5: usersservice.v1.UsersProfileService.ChangePassword:input_type -> usersservice.v1.ChangePasswordRequest + 5, // 6: usersservice.v1.UsersProfileService.DeleteAccount:input_type -> usersservice.v1.DeleteAccountRequest + 1, // 7: usersservice.v1.UsersProfileService.GetProfile:output_type -> usersservice.v1.GetProfileResponse + 8, // 8: usersservice.v1.UsersProfileService.UpdateProfile:output_type -> google.protobuf.Empty + 8, // 9: usersservice.v1.UsersProfileService.UpdateAvatar:output_type -> google.protobuf.Empty + 8, // 10: usersservice.v1.UsersProfileService.ChangePassword:output_type -> google.protobuf.Empty + 8, // 11: usersservice.v1.UsersProfileService.DeleteAccount:output_type -> google.protobuf.Empty + 7, // [7:12] is the sub-list for method output_type + 2, // [2:7] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_external_users_v1_profile_proto_init() } +func file_external_users_v1_profile_proto_init() { + if File_external_users_v1_profile_proto != nil { + return + } + file_external_users_v1_shared_proto_init() + file_external_users_v1_profile_proto_msgTypes[0].OneofWrappers = []any{ + (*GetProfileRequest_UserId)(nil), + (*GetProfileRequest_Username)(nil), + } + file_external_users_v1_profile_proto_msgTypes[1].OneofWrappers = []any{ + (*GetProfileResponse_Profile)(nil), + (*GetProfileResponse_User)(nil), + } + file_external_users_v1_profile_proto_msgTypes[2].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_users_v1_profile_proto_rawDesc), len(file_external_users_v1_profile_proto_rawDesc)), + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_external_users_v1_profile_proto_goTypes, + DependencyIndexes: file_external_users_v1_profile_proto_depIdxs, + MessageInfos: file_external_users_v1_profile_proto_msgTypes, + }.Build() + File_external_users_v1_profile_proto = out.File + file_external_users_v1_profile_proto_goTypes = nil + file_external_users_v1_profile_proto_depIdxs = nil +} diff --git a/gen/external/users/v1/profile.pb.gw.go b/gen/external/users/v1/profile.pb.gw.go new file mode 100644 index 0000000..6c3e7f6 --- /dev/null +++ b/gen/external/users/v1/profile.pb.gw.go @@ -0,0 +1,406 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: external/users/v1/profile.proto + +/* +Package usersv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package usersv1 + +import ( + "context" + "errors" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) + +func request_UsersProfileService_GetProfile_0(ctx context.Context, marshaler runtime.Marshaler, client UsersProfileServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetProfileRequest + 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.GetProfile(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersProfileService_GetProfile_0(ctx context.Context, marshaler runtime.Marshaler, server UsersProfileServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetProfileRequest + 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.GetProfile(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersProfileService_UpdateProfile_0(ctx context.Context, marshaler runtime.Marshaler, client UsersProfileServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateProfileRequest + 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.UpdateProfile(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersProfileService_UpdateProfile_0(ctx context.Context, marshaler runtime.Marshaler, server UsersProfileServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateProfileRequest + 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.UpdateProfile(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersProfileService_UpdateAvatar_0(ctx context.Context, marshaler runtime.Marshaler, client UsersProfileServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateAvatarRequest + 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.UpdateAvatar(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersProfileService_UpdateAvatar_0(ctx context.Context, marshaler runtime.Marshaler, server UsersProfileServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateAvatarRequest + 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.UpdateAvatar(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersProfileService_ChangePassword_0(ctx context.Context, marshaler runtime.Marshaler, client UsersProfileServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq ChangePasswordRequest + 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.ChangePassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersProfileService_ChangePassword_0(ctx context.Context, marshaler runtime.Marshaler, server UsersProfileServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq ChangePasswordRequest + 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.ChangePassword(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersProfileService_DeleteAccount_0(ctx context.Context, marshaler runtime.Marshaler, client UsersProfileServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq DeleteAccountRequest + 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.DeleteAccount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersProfileService_DeleteAccount_0(ctx context.Context, marshaler runtime.Marshaler, server UsersProfileServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq DeleteAccountRequest + 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.DeleteAccount(ctx, &protoReq) + return msg, metadata, err +} + +// RegisterUsersProfileServiceHandlerServer registers the http handlers for service UsersProfileService to "mux". +// UnaryRPC :call UsersProfileServiceServer 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 RegisterUsersProfileServiceHandlerFromEndpoint 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 RegisterUsersProfileServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersProfileServiceServer) error { + mux.Handle(http.MethodPost, pattern_UsersProfileService_GetProfile_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, "/usersservice.v1.UsersProfileService/GetProfile", runtime.WithHTTPPathPattern("/usersservice.v1.UsersProfileService/GetProfile")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersProfileService_GetProfile_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_UsersProfileService_GetProfile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersProfileService_UpdateProfile_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, "/usersservice.v1.UsersProfileService/UpdateProfile", runtime.WithHTTPPathPattern("/usersservice.v1.UsersProfileService/UpdateProfile")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersProfileService_UpdateProfile_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_UsersProfileService_UpdateProfile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersProfileService_UpdateAvatar_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, "/usersservice.v1.UsersProfileService/UpdateAvatar", runtime.WithHTTPPathPattern("/usersservice.v1.UsersProfileService/UpdateAvatar")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersProfileService_UpdateAvatar_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_UsersProfileService_UpdateAvatar_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersProfileService_ChangePassword_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, "/usersservice.v1.UsersProfileService/ChangePassword", runtime.WithHTTPPathPattern("/usersservice.v1.UsersProfileService/ChangePassword")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersProfileService_ChangePassword_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_UsersProfileService_ChangePassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersProfileService_DeleteAccount_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, "/usersservice.v1.UsersProfileService/DeleteAccount", runtime.WithHTTPPathPattern("/usersservice.v1.UsersProfileService/DeleteAccount")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersProfileService_DeleteAccount_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_UsersProfileService_DeleteAccount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + return nil +} + +// RegisterUsersProfileServiceHandlerFromEndpoint is same as RegisterUsersProfileServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterUsersProfileServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.NewClient(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + return RegisterUsersProfileServiceHandler(ctx, mux, conn) +} + +// RegisterUsersProfileServiceHandler registers the http handlers for service UsersProfileService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterUsersProfileServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterUsersProfileServiceHandlerClient(ctx, mux, NewUsersProfileServiceClient(conn)) +} + +// RegisterUsersProfileServiceHandlerClient registers the http handlers for service UsersProfileService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UsersProfileServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UsersProfileServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "UsersProfileServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +func RegisterUsersProfileServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersProfileServiceClient) error { + mux.Handle(http.MethodPost, pattern_UsersProfileService_GetProfile_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, "/usersservice.v1.UsersProfileService/GetProfile", runtime.WithHTTPPathPattern("/usersservice.v1.UsersProfileService/GetProfile")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersProfileService_GetProfile_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersProfileService_GetProfile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersProfileService_UpdateProfile_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, "/usersservice.v1.UsersProfileService/UpdateProfile", runtime.WithHTTPPathPattern("/usersservice.v1.UsersProfileService/UpdateProfile")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersProfileService_UpdateProfile_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersProfileService_UpdateProfile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersProfileService_UpdateAvatar_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, "/usersservice.v1.UsersProfileService/UpdateAvatar", runtime.WithHTTPPathPattern("/usersservice.v1.UsersProfileService/UpdateAvatar")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersProfileService_UpdateAvatar_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersProfileService_UpdateAvatar_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersProfileService_ChangePassword_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, "/usersservice.v1.UsersProfileService/ChangePassword", runtime.WithHTTPPathPattern("/usersservice.v1.UsersProfileService/ChangePassword")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersProfileService_ChangePassword_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersProfileService_ChangePassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersProfileService_DeleteAccount_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, "/usersservice.v1.UsersProfileService/DeleteAccount", runtime.WithHTTPPathPattern("/usersservice.v1.UsersProfileService/DeleteAccount")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersProfileService_DeleteAccount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersProfileService_DeleteAccount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil +} + +var ( + pattern_UsersProfileService_GetProfile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersProfileService", "GetProfile"}, "")) + pattern_UsersProfileService_UpdateProfile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersProfileService", "UpdateProfile"}, "")) + pattern_UsersProfileService_UpdateAvatar_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersProfileService", "UpdateAvatar"}, "")) + pattern_UsersProfileService_ChangePassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersProfileService", "ChangePassword"}, "")) + pattern_UsersProfileService_DeleteAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersProfileService", "DeleteAccount"}, "")) +) + +var ( + forward_UsersProfileService_GetProfile_0 = runtime.ForwardResponseMessage + forward_UsersProfileService_UpdateProfile_0 = runtime.ForwardResponseMessage + forward_UsersProfileService_UpdateAvatar_0 = runtime.ForwardResponseMessage + forward_UsersProfileService_ChangePassword_0 = runtime.ForwardResponseMessage + forward_UsersProfileService_DeleteAccount_0 = runtime.ForwardResponseMessage +) diff --git a/gen/external/users/v1/profile_grpc.pb.go b/gen/external/users/v1/profile_grpc.pb.go new file mode 100644 index 0000000..7b1b4aa --- /dev/null +++ b/gen/external/users/v1/profile_grpc.pb.go @@ -0,0 +1,272 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: external/users/v1/profile.proto + +package usersv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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 ( + UsersProfileService_GetProfile_FullMethodName = "/usersservice.v1.UsersProfileService/GetProfile" + UsersProfileService_UpdateProfile_FullMethodName = "/usersservice.v1.UsersProfileService/UpdateProfile" + UsersProfileService_UpdateAvatar_FullMethodName = "/usersservice.v1.UsersProfileService/UpdateAvatar" + UsersProfileService_ChangePassword_FullMethodName = "/usersservice.v1.UsersProfileService/ChangePassword" + UsersProfileService_DeleteAccount_FullMethodName = "/usersservice.v1.UsersProfileService/DeleteAccount" +) + +// UsersProfileServiceClient is the client API for UsersProfileService 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 UsersProfileServiceClient interface { + GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*GetProfileResponse, error) + UpdateProfile(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + UpdateAvatar(ctx context.Context, in *UpdateAvatarRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type usersProfileServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUsersProfileServiceClient(cc grpc.ClientConnInterface) UsersProfileServiceClient { + return &usersProfileServiceClient{cc} +} + +func (c *usersProfileServiceClient) GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*GetProfileResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetProfileResponse) + err := c.cc.Invoke(ctx, UsersProfileService_GetProfile_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersProfileServiceClient) UpdateProfile(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersProfileService_UpdateProfile_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersProfileServiceClient) UpdateAvatar(ctx context.Context, in *UpdateAvatarRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersProfileService_UpdateAvatar_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersProfileServiceClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersProfileService_ChangePassword_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersProfileServiceClient) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersProfileService_DeleteAccount_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UsersProfileServiceServer is the server API for UsersProfileService service. +// All implementations should embed UnimplementedUsersProfileServiceServer +// for forward compatibility. +type UsersProfileServiceServer interface { + GetProfile(context.Context, *GetProfileRequest) (*GetProfileResponse, error) + UpdateProfile(context.Context, *UpdateProfileRequest) (*emptypb.Empty, error) + UpdateAvatar(context.Context, *UpdateAvatarRequest) (*emptypb.Empty, error) + ChangePassword(context.Context, *ChangePasswordRequest) (*emptypb.Empty, error) + DeleteAccount(context.Context, *DeleteAccountRequest) (*emptypb.Empty, error) +} + +// UnimplementedUsersProfileServiceServer should 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 UnimplementedUsersProfileServiceServer struct{} + +func (UnimplementedUsersProfileServiceServer) GetProfile(context.Context, *GetProfileRequest) (*GetProfileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProfile not implemented") +} +func (UnimplementedUsersProfileServiceServer) UpdateProfile(context.Context, *UpdateProfileRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateProfile not implemented") +} +func (UnimplementedUsersProfileServiceServer) UpdateAvatar(context.Context, *UpdateAvatarRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAvatar not implemented") +} +func (UnimplementedUsersProfileServiceServer) ChangePassword(context.Context, *ChangePasswordRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented") +} +func (UnimplementedUsersProfileServiceServer) DeleteAccount(context.Context, *DeleteAccountRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAccount not implemented") +} +func (UnimplementedUsersProfileServiceServer) testEmbeddedByValue() {} + +// UnsafeUsersProfileServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UsersProfileServiceServer will +// result in compilation errors. +type UnsafeUsersProfileServiceServer interface { + mustEmbedUnimplementedUsersProfileServiceServer() +} + +func RegisterUsersProfileServiceServer(s grpc.ServiceRegistrar, srv UsersProfileServiceServer) { + // If the following call pancis, it indicates UnimplementedUsersProfileServiceServer 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(&UsersProfileService_ServiceDesc, srv) +} + +func _UsersProfileService_GetProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersProfileServiceServer).GetProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersProfileService_GetProfile_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersProfileServiceServer).GetProfile(ctx, req.(*GetProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersProfileService_UpdateProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersProfileServiceServer).UpdateProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersProfileService_UpdateProfile_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersProfileServiceServer).UpdateProfile(ctx, req.(*UpdateProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersProfileService_UpdateAvatar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAvatarRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersProfileServiceServer).UpdateAvatar(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersProfileService_UpdateAvatar_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersProfileServiceServer).UpdateAvatar(ctx, req.(*UpdateAvatarRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersProfileService_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangePasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersProfileServiceServer).ChangePassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersProfileService_ChangePassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersProfileServiceServer).ChangePassword(ctx, req.(*ChangePasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersProfileService_DeleteAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersProfileServiceServer).DeleteAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersProfileService_DeleteAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersProfileServiceServer).DeleteAccount(ctx, req.(*DeleteAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UsersProfileService_ServiceDesc is the grpc.ServiceDesc for UsersProfileService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UsersProfileService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "usersservice.v1.UsersProfileService", + HandlerType: (*UsersProfileServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetProfile", + Handler: _UsersProfileService_GetProfile_Handler, + }, + { + MethodName: "UpdateProfile", + Handler: _UsersProfileService_UpdateProfile_Handler, + }, + { + MethodName: "UpdateAvatar", + Handler: _UsersProfileService_UpdateAvatar_Handler, + }, + { + MethodName: "ChangePassword", + Handler: _UsersProfileService_ChangePassword_Handler, + }, + { + MethodName: "DeleteAccount", + Handler: _UsersProfileService_DeleteAccount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "external/users/v1/profile.proto", +} diff --git a/gen/external/users/v1/shared.pb.go b/gen/external/users/v1/shared.pb.go new file mode 100644 index 0000000..e650848 --- /dev/null +++ b/gen/external/users/v1/shared.pb.go @@ -0,0 +1,619 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: external/users/v1/shared.proto + +package usersv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + 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) +) + +type Status int32 + +const ( + Status_STATUS_UNSPECIFIED Status = 0 + Status_STATUS_PENDING Status = 1 + Status_STATUS_ACCEPTED Status = 2 + Status_STATUS_BLOCKED Status = 3 +) + +// Enum value maps for Status. +var ( + Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "STATUS_PENDING", + 2: "STATUS_ACCEPTED", + 3: "STATUS_BLOCKED", + } + Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "STATUS_PENDING": 1, + "STATUS_ACCEPTED": 2, + "STATUS_BLOCKED": 3, + } +) + +func (x Status) Enum() *Status { + p := new(Status) + *p = x + return p +} + +func (x Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Status) Descriptor() protoreflect.EnumDescriptor { + return file_external_users_v1_shared_proto_enumTypes[0].Descriptor() +} + +func (Status) Type() protoreflect.EnumType { + return &file_external_users_v1_shared_proto_enumTypes[0] +} + +func (x Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Status.Descriptor instead. +func (Status) EnumDescriptor() ([]byte, []int) { + return file_external_users_v1_shared_proto_rawDescGZIP(), []int{0} +} + +type Profile struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + AvatarId int32 `protobuf:"varint,2,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + Rating int32 `protobuf:"varint,5,opt,name=rating,proto3" json:"rating,omitempty"` + Coins int64 `protobuf:"varint,6,opt,name=coins,proto3" json:"coins,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + LastLoginAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=last_login_at,json=lastLoginAt,proto3,oneof" json:"last_login_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Profile) Reset() { + *x = Profile{} + mi := &file_external_users_v1_shared_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Profile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Profile) ProtoMessage() {} + +func (x *Profile) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_shared_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Profile.ProtoReflect.Descriptor instead. +func (*Profile) Descriptor() ([]byte, []int) { + return file_external_users_v1_shared_proto_rawDescGZIP(), []int{0} +} + +func (x *Profile) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Profile) GetAvatarId() int32 { + if x != nil { + return x.AvatarId + } + return 0 +} + +func (x *Profile) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *Profile) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *Profile) GetRating() int32 { + if x != nil { + return x.Rating + } + return 0 +} + +func (x *Profile) GetCoins() int64 { + if x != nil { + return x.Coins + } + return 0 +} + +func (x *Profile) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Profile) GetLastLoginAt() *timestamppb.Timestamp { + if x != nil { + return x.LastLoginAt + } + return nil +} + +type User struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + AvatarId int32 `protobuf:"varint,2,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` + Rating int32 `protobuf:"varint,4,opt,name=rating,proto3" json:"rating,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + LastLoginAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_login_at,json=lastLoginAt,proto3,oneof" json:"last_login_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *User) Reset() { + *x = User{} + mi := &file_external_users_v1_shared_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_shared_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_external_users_v1_shared_proto_rawDescGZIP(), []int{1} +} + +func (x *User) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *User) GetAvatarId() int32 { + if x != nil { + return x.AvatarId + } + return 0 +} + +func (x *User) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *User) GetRating() int32 { + if x != nil { + return x.Rating + } + return 0 +} + +func (x *User) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *User) GetLastLoginAt() *timestamppb.Timestamp { + if x != nil { + return x.LastLoginAt + } + return nil +} + +type UserAdmin struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + AvatarId int32 `protobuf:"varint,2,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + Rating int32 `protobuf:"varint,5,opt,name=rating,proto3" json:"rating,omitempty"` + Coins int64 `protobuf:"varint,6,opt,name=coins,proto3" json:"coins,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + LastLoginAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=last_login_at,json=lastLoginAt,proto3,oneof" json:"last_login_at,omitempty"` + DeletedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=deleted_at,json=deletedAt,proto3,oneof" json:"deleted_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserAdmin) Reset() { + *x = UserAdmin{} + mi := &file_external_users_v1_shared_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserAdmin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserAdmin) ProtoMessage() {} + +func (x *UserAdmin) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_shared_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserAdmin.ProtoReflect.Descriptor instead. +func (*UserAdmin) Descriptor() ([]byte, []int) { + return file_external_users_v1_shared_proto_rawDescGZIP(), []int{2} +} + +func (x *UserAdmin) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UserAdmin) GetAvatarId() int32 { + if x != nil { + return x.AvatarId + } + return 0 +} + +func (x *UserAdmin) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *UserAdmin) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *UserAdmin) GetRating() int32 { + if x != nil { + return x.Rating + } + return 0 +} + +func (x *UserAdmin) GetCoins() int64 { + if x != nil { + return x.Coins + } + return 0 +} + +func (x *UserAdmin) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *UserAdmin) GetLastLoginAt() *timestamppb.Timestamp { + if x != nil { + return x.LastLoginAt + } + return nil +} + +func (x *UserAdmin) GetDeletedAt() *timestamppb.Timestamp { + if x != nil { + return x.DeletedAt + } + return nil +} + +type FriendsList struct { + state protoimpl.MessageState `protogen:"open.v1"` + Friends []*Friend `protobuf:"bytes,1,rep,name=friends,proto3" json:"friends,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FriendsList) Reset() { + *x = FriendsList{} + mi := &file_external_users_v1_shared_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FriendsList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendsList) ProtoMessage() {} + +func (x *FriendsList) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_shared_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FriendsList.ProtoReflect.Descriptor instead. +func (*FriendsList) Descriptor() ([]byte, []int) { + return file_external_users_v1_shared_proto_rawDescGZIP(), []int{3} +} + +func (x *FriendsList) GetFriends() []*Friend { + if x != nil { + return x.Friends + } + return nil +} + +type Friend struct { + state protoimpl.MessageState `protogen:"open.v1"` + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=usersservice.v1.Status" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Friend) Reset() { + *x = Friend{} + mi := &file_external_users_v1_shared_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Friend) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Friend) ProtoMessage() {} + +func (x *Friend) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_shared_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Friend.ProtoReflect.Descriptor instead. +func (*Friend) Descriptor() ([]byte, []int) { + return file_external_users_v1_shared_proto_rawDescGZIP(), []int{4} +} + +func (x *Friend) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *Friend) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +var File_external_users_v1_shared_proto protoreflect.FileDescriptor + +var file_external_users_v1_shared_proto_rawDesc = string([]byte{ + 0x0a, 0x1e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xa8, 0x02, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, + 0x06, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, + 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x43, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6c, + 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x61, 0x73, + 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, + 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x22, 0xf9, 0x01, + 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x76, 0x61, 0x74, 0x61, + 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x43, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, + 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x22, 0xf9, 0x02, 0x0a, 0x09, 0x55, 0x73, + 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x76, 0x61, 0x74, + 0x61, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x14, + 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, + 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x43, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x74, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, + 0x74, 0x88, 0x01, 0x01, 0x12, 0x3e, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6c, 0x6f, + 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x22, 0x40, 0x0a, 0x0b, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x07, + 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x22, 0x64, 0x0a, 0x06, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x12, 0x29, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x5d, 0x0a, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, + 0x47, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, + 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x03, 0x42, 0x12, 0x5a, 0x10, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_external_users_v1_shared_proto_rawDescOnce sync.Once + file_external_users_v1_shared_proto_rawDescData []byte +) + +func file_external_users_v1_shared_proto_rawDescGZIP() []byte { + file_external_users_v1_shared_proto_rawDescOnce.Do(func() { + file_external_users_v1_shared_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_external_users_v1_shared_proto_rawDesc), len(file_external_users_v1_shared_proto_rawDesc))) + }) + return file_external_users_v1_shared_proto_rawDescData +} + +var file_external_users_v1_shared_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_external_users_v1_shared_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_external_users_v1_shared_proto_goTypes = []any{ + (Status)(0), // 0: usersservice.v1.Status + (*Profile)(nil), // 1: usersservice.v1.Profile + (*User)(nil), // 2: usersservice.v1.User + (*UserAdmin)(nil), // 3: usersservice.v1.UserAdmin + (*FriendsList)(nil), // 4: usersservice.v1.FriendsList + (*Friend)(nil), // 5: usersservice.v1.Friend + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} +var file_external_users_v1_shared_proto_depIdxs = []int32{ + 6, // 0: usersservice.v1.Profile.created_at:type_name -> google.protobuf.Timestamp + 6, // 1: usersservice.v1.Profile.last_login_at:type_name -> google.protobuf.Timestamp + 6, // 2: usersservice.v1.User.created_at:type_name -> google.protobuf.Timestamp + 6, // 3: usersservice.v1.User.last_login_at:type_name -> google.protobuf.Timestamp + 6, // 4: usersservice.v1.UserAdmin.created_at:type_name -> google.protobuf.Timestamp + 6, // 5: usersservice.v1.UserAdmin.last_login_at:type_name -> google.protobuf.Timestamp + 6, // 6: usersservice.v1.UserAdmin.deleted_at:type_name -> google.protobuf.Timestamp + 5, // 7: usersservice.v1.FriendsList.friends:type_name -> usersservice.v1.Friend + 2, // 8: usersservice.v1.Friend.user:type_name -> usersservice.v1.User + 0, // 9: usersservice.v1.Friend.status:type_name -> usersservice.v1.Status + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_external_users_v1_shared_proto_init() } +func file_external_users_v1_shared_proto_init() { + if File_external_users_v1_shared_proto != nil { + return + } + file_external_users_v1_shared_proto_msgTypes[0].OneofWrappers = []any{} + file_external_users_v1_shared_proto_msgTypes[1].OneofWrappers = []any{} + file_external_users_v1_shared_proto_msgTypes[2].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_users_v1_shared_proto_rawDesc), len(file_external_users_v1_shared_proto_rawDesc)), + NumEnums: 1, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_external_users_v1_shared_proto_goTypes, + DependencyIndexes: file_external_users_v1_shared_proto_depIdxs, + EnumInfos: file_external_users_v1_shared_proto_enumTypes, + MessageInfos: file_external_users_v1_shared_proto_msgTypes, + }.Build() + File_external_users_v1_shared_proto = out.File + file_external_users_v1_shared_proto_goTypes = nil + file_external_users_v1_shared_proto_depIdxs = nil +} diff --git a/gen/external/users/v1/social.pb.go b/gen/external/users/v1/social.pb.go new file mode 100644 index 0000000..485ae8c --- /dev/null +++ b/gen/external/users/v1/social.pb.go @@ -0,0 +1,535 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: external/users/v1/social.proto + +package usersv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" + 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) +) + +type AddFriendRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RequesterId string `protobuf:"bytes,1,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + RecipientId string `protobuf:"bytes,2,opt,name=recipient_id,json=recipientId,proto3" json:"recipient_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddFriendRequest) Reset() { + *x = AddFriendRequest{} + mi := &file_external_users_v1_social_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddFriendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddFriendRequest) ProtoMessage() {} + +func (x *AddFriendRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_social_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddFriendRequest.ProtoReflect.Descriptor instead. +func (*AddFriendRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_social_proto_rawDescGZIP(), []int{0} +} + +func (x *AddFriendRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *AddFriendRequest) GetRecipientId() string { + if x != nil { + return x.RecipientId + } + return "" +} + +type AcceptFriendRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RecipientId string `protobuf:"bytes,1,opt,name=recipient_id,json=recipientId,proto3" json:"recipient_id,omitempty"` + RequesterId string `protobuf:"bytes,2,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AcceptFriendRequest) Reset() { + *x = AcceptFriendRequest{} + mi := &file_external_users_v1_social_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AcceptFriendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcceptFriendRequest) ProtoMessage() {} + +func (x *AcceptFriendRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_social_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AcceptFriendRequest.ProtoReflect.Descriptor instead. +func (*AcceptFriendRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_social_proto_rawDescGZIP(), []int{1} +} + +func (x *AcceptFriendRequest) GetRecipientId() string { + if x != nil { + return x.RecipientId + } + return "" +} + +func (x *AcceptFriendRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +type RejectFriendRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RecipientId string `protobuf:"bytes,1,opt,name=recipient_id,json=recipientId,proto3" json:"recipient_id,omitempty"` + RequesterId string `protobuf:"bytes,2,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RejectFriendRequest) Reset() { + *x = RejectFriendRequest{} + mi := &file_external_users_v1_social_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RejectFriendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RejectFriendRequest) ProtoMessage() {} + +func (x *RejectFriendRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_social_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RejectFriendRequest.ProtoReflect.Descriptor instead. +func (*RejectFriendRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_social_proto_rawDescGZIP(), []int{2} +} + +func (x *RejectFriendRequest) GetRecipientId() string { + if x != nil { + return x.RecipientId + } + return "" +} + +func (x *RejectFriendRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +type RemoveFriendRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RequesterId string `protobuf:"bytes,1,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + FriendId string `protobuf:"bytes,2,opt,name=friend_id,json=friendId,proto3" json:"friend_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveFriendRequest) Reset() { + *x = RemoveFriendRequest{} + mi := &file_external_users_v1_social_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveFriendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveFriendRequest) ProtoMessage() {} + +func (x *RemoveFriendRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_social_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveFriendRequest.ProtoReflect.Descriptor instead. +func (*RemoveFriendRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_social_proto_rawDescGZIP(), []int{3} +} + +func (x *RemoveFriendRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *RemoveFriendRequest) GetFriendId() string { + if x != nil { + return x.FriendId + } + return "" +} + +type ListFriendsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListFriendsRequest) Reset() { + *x = ListFriendsRequest{} + mi := &file_external_users_v1_social_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListFriendsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFriendsRequest) ProtoMessage() {} + +func (x *ListFriendsRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_social_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFriendsRequest.ProtoReflect.Descriptor instead. +func (*ListFriendsRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_social_proto_rawDescGZIP(), []int{4} +} + +func (x *ListFriendsRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type BlockFriendRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + FriendId string `protobuf:"bytes,2,opt,name=friend_id,json=friendId,proto3" json:"friend_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockFriendRequest) Reset() { + *x = BlockFriendRequest{} + mi := &file_external_users_v1_social_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockFriendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockFriendRequest) ProtoMessage() {} + +func (x *BlockFriendRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_social_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockFriendRequest.ProtoReflect.Descriptor instead. +func (*BlockFriendRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_social_proto_rawDescGZIP(), []int{5} +} + +func (x *BlockFriendRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *BlockFriendRequest) GetFriendId() string { + if x != nil { + return x.FriendId + } + return "" +} + +type UnblockFriendRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + FriendId string `protobuf:"bytes,2,opt,name=friend_id,json=friendId,proto3" json:"friend_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnblockFriendRequest) Reset() { + *x = UnblockFriendRequest{} + mi := &file_external_users_v1_social_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnblockFriendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnblockFriendRequest) ProtoMessage() {} + +func (x *UnblockFriendRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_social_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnblockFriendRequest.ProtoReflect.Descriptor instead. +func (*UnblockFriendRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_social_proto_rawDescGZIP(), []int{6} +} + +func (x *UnblockFriendRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UnblockFriendRequest) GetFriendId() string { + if x != nil { + return x.FriendId + } + return "" +} + +var File_external_users_v1_social_proto protoreflect.FileDescriptor + +var file_external_users_v1_social_proto_rawDesc = string([]byte{ + 0x0a, 0x1e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x1e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, + 0x0a, 0x10, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x13, 0x41, 0x63, 0x63, 0x65, + 0x70, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x13, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x49, 0x64, 0x22, 0x55, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x2d, 0x0a, 0x12, 0x4c, 0x69, 0x73, + 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x4a, 0x0a, 0x12, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x49, 0x64, 0x22, 0x4c, 0x0a, 0x14, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x49, 0x64, 0x32, 0xb4, 0x04, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x73, 0x53, 0x6f, 0x63, 0x69, + 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x41, 0x64, 0x64, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x12, 0x4c, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x12, 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, + 0x4c, 0x0a, 0x0c, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, + 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, 0x0a, + 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x24, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x50, 0x0a, 0x0b, 0x4c, + 0x69, 0x73, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x12, 0x23, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x4a, 0x0a, + 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x23, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4e, 0x0a, 0x0d, 0x55, 0x6e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x25, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x12, 0x5a, 0x10, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_external_users_v1_social_proto_rawDescOnce sync.Once + file_external_users_v1_social_proto_rawDescData []byte +) + +func file_external_users_v1_social_proto_rawDescGZIP() []byte { + file_external_users_v1_social_proto_rawDescOnce.Do(func() { + file_external_users_v1_social_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_external_users_v1_social_proto_rawDesc), len(file_external_users_v1_social_proto_rawDesc))) + }) + return file_external_users_v1_social_proto_rawDescData +} + +var file_external_users_v1_social_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_external_users_v1_social_proto_goTypes = []any{ + (*AddFriendRequest)(nil), // 0: usersservice.v1.AddFriendRequest + (*AcceptFriendRequest)(nil), // 1: usersservice.v1.AcceptFriendRequest + (*RejectFriendRequest)(nil), // 2: usersservice.v1.RejectFriendRequest + (*RemoveFriendRequest)(nil), // 3: usersservice.v1.RemoveFriendRequest + (*ListFriendsRequest)(nil), // 4: usersservice.v1.ListFriendsRequest + (*BlockFriendRequest)(nil), // 5: usersservice.v1.BlockFriendRequest + (*UnblockFriendRequest)(nil), // 6: usersservice.v1.UnblockFriendRequest + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty + (*FriendsList)(nil), // 8: usersservice.v1.FriendsList +} +var file_external_users_v1_social_proto_depIdxs = []int32{ + 0, // 0: usersservice.v1.UsersSocialService.AddFriend:input_type -> usersservice.v1.AddFriendRequest + 1, // 1: usersservice.v1.UsersSocialService.AcceptFriend:input_type -> usersservice.v1.AcceptFriendRequest + 2, // 2: usersservice.v1.UsersSocialService.RejectFriend:input_type -> usersservice.v1.RejectFriendRequest + 3, // 3: usersservice.v1.UsersSocialService.RemoveFriend:input_type -> usersservice.v1.RemoveFriendRequest + 4, // 4: usersservice.v1.UsersSocialService.ListFriends:input_type -> usersservice.v1.ListFriendsRequest + 5, // 5: usersservice.v1.UsersSocialService.BlockFriend:input_type -> usersservice.v1.BlockFriendRequest + 6, // 6: usersservice.v1.UsersSocialService.UnblockFriend:input_type -> usersservice.v1.UnblockFriendRequest + 7, // 7: usersservice.v1.UsersSocialService.AddFriend:output_type -> google.protobuf.Empty + 7, // 8: usersservice.v1.UsersSocialService.AcceptFriend:output_type -> google.protobuf.Empty + 7, // 9: usersservice.v1.UsersSocialService.RejectFriend:output_type -> google.protobuf.Empty + 7, // 10: usersservice.v1.UsersSocialService.RemoveFriend:output_type -> google.protobuf.Empty + 8, // 11: usersservice.v1.UsersSocialService.ListFriends:output_type -> usersservice.v1.FriendsList + 7, // 12: usersservice.v1.UsersSocialService.BlockFriend:output_type -> google.protobuf.Empty + 7, // 13: usersservice.v1.UsersSocialService.UnblockFriend:output_type -> google.protobuf.Empty + 7, // [7:14] is the sub-list for method output_type + 0, // [0:7] 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_external_users_v1_social_proto_init() } +func file_external_users_v1_social_proto_init() { + if File_external_users_v1_social_proto != nil { + return + } + file_external_users_v1_shared_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_users_v1_social_proto_rawDesc), len(file_external_users_v1_social_proto_rawDesc)), + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_external_users_v1_social_proto_goTypes, + DependencyIndexes: file_external_users_v1_social_proto_depIdxs, + MessageInfos: file_external_users_v1_social_proto_msgTypes, + }.Build() + File_external_users_v1_social_proto = out.File + file_external_users_v1_social_proto_goTypes = nil + file_external_users_v1_social_proto_depIdxs = nil +} diff --git a/gen/external/users/v1/social.pb.gw.go b/gen/external/users/v1/social.pb.gw.go new file mode 100644 index 0000000..44c3d57 --- /dev/null +++ b/gen/external/users/v1/social.pb.gw.go @@ -0,0 +1,532 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: external/users/v1/social.proto + +/* +Package usersv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package usersv1 + +import ( + "context" + "errors" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) + +func request_UsersSocialService_AddFriend_0(ctx context.Context, marshaler runtime.Marshaler, client UsersSocialServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq AddFriendRequest + 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.AddFriend(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersSocialService_AddFriend_0(ctx context.Context, marshaler runtime.Marshaler, server UsersSocialServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq AddFriendRequest + 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.AddFriend(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersSocialService_AcceptFriend_0(ctx context.Context, marshaler runtime.Marshaler, client UsersSocialServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq AcceptFriendRequest + 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.AcceptFriend(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersSocialService_AcceptFriend_0(ctx context.Context, marshaler runtime.Marshaler, server UsersSocialServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq AcceptFriendRequest + 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.AcceptFriend(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersSocialService_RejectFriend_0(ctx context.Context, marshaler runtime.Marshaler, client UsersSocialServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq RejectFriendRequest + 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.RejectFriend(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersSocialService_RejectFriend_0(ctx context.Context, marshaler runtime.Marshaler, server UsersSocialServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq RejectFriendRequest + 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.RejectFriend(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersSocialService_RemoveFriend_0(ctx context.Context, marshaler runtime.Marshaler, client UsersSocialServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq RemoveFriendRequest + 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.RemoveFriend(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersSocialService_RemoveFriend_0(ctx context.Context, marshaler runtime.Marshaler, server UsersSocialServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq RemoveFriendRequest + 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.RemoveFriend(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersSocialService_ListFriends_0(ctx context.Context, marshaler runtime.Marshaler, client UsersSocialServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq ListFriendsRequest + 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.ListFriends(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersSocialService_ListFriends_0(ctx context.Context, marshaler runtime.Marshaler, server UsersSocialServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq ListFriendsRequest + 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.ListFriends(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersSocialService_BlockFriend_0(ctx context.Context, marshaler runtime.Marshaler, client UsersSocialServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq BlockFriendRequest + 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.BlockFriend(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersSocialService_BlockFriend_0(ctx context.Context, marshaler runtime.Marshaler, server UsersSocialServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq BlockFriendRequest + 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.BlockFriend(ctx, &protoReq) + return msg, metadata, err +} + +func request_UsersSocialService_UnblockFriend_0(ctx context.Context, marshaler runtime.Marshaler, client UsersSocialServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UnblockFriendRequest + 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.UnblockFriend(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersSocialService_UnblockFriend_0(ctx context.Context, marshaler runtime.Marshaler, server UsersSocialServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UnblockFriendRequest + 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.UnblockFriend(ctx, &protoReq) + return msg, metadata, err +} + +// RegisterUsersSocialServiceHandlerServer registers the http handlers for service UsersSocialService to "mux". +// UnaryRPC :call UsersSocialServiceServer 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 RegisterUsersSocialServiceHandlerFromEndpoint 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 RegisterUsersSocialServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersSocialServiceServer) error { + mux.Handle(http.MethodPost, pattern_UsersSocialService_AddFriend_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, "/usersservice.v1.UsersSocialService/AddFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/AddFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersSocialService_AddFriend_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_UsersSocialService_AddFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_AcceptFriend_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, "/usersservice.v1.UsersSocialService/AcceptFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/AcceptFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersSocialService_AcceptFriend_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_UsersSocialService_AcceptFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_RejectFriend_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, "/usersservice.v1.UsersSocialService/RejectFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/RejectFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersSocialService_RejectFriend_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_UsersSocialService_RejectFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_RemoveFriend_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, "/usersservice.v1.UsersSocialService/RemoveFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/RemoveFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersSocialService_RemoveFriend_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_UsersSocialService_RemoveFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_ListFriends_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, "/usersservice.v1.UsersSocialService/ListFriends", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/ListFriends")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersSocialService_ListFriends_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_UsersSocialService_ListFriends_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_BlockFriend_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, "/usersservice.v1.UsersSocialService/BlockFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/BlockFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersSocialService_BlockFriend_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_UsersSocialService_BlockFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_UnblockFriend_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, "/usersservice.v1.UsersSocialService/UnblockFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/UnblockFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersSocialService_UnblockFriend_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_UsersSocialService_UnblockFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + return nil +} + +// RegisterUsersSocialServiceHandlerFromEndpoint is same as RegisterUsersSocialServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterUsersSocialServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.NewClient(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + return RegisterUsersSocialServiceHandler(ctx, mux, conn) +} + +// RegisterUsersSocialServiceHandler registers the http handlers for service UsersSocialService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterUsersSocialServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterUsersSocialServiceHandlerClient(ctx, mux, NewUsersSocialServiceClient(conn)) +} + +// RegisterUsersSocialServiceHandlerClient registers the http handlers for service UsersSocialService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UsersSocialServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UsersSocialServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "UsersSocialServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +func RegisterUsersSocialServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersSocialServiceClient) error { + mux.Handle(http.MethodPost, pattern_UsersSocialService_AddFriend_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, "/usersservice.v1.UsersSocialService/AddFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/AddFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersSocialService_AddFriend_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersSocialService_AddFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_AcceptFriend_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, "/usersservice.v1.UsersSocialService/AcceptFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/AcceptFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersSocialService_AcceptFriend_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersSocialService_AcceptFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_RejectFriend_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, "/usersservice.v1.UsersSocialService/RejectFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/RejectFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersSocialService_RejectFriend_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersSocialService_RejectFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_RemoveFriend_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, "/usersservice.v1.UsersSocialService/RemoveFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/RemoveFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersSocialService_RemoveFriend_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersSocialService_RemoveFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_ListFriends_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, "/usersservice.v1.UsersSocialService/ListFriends", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/ListFriends")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersSocialService_ListFriends_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersSocialService_ListFriends_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_BlockFriend_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, "/usersservice.v1.UsersSocialService/BlockFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/BlockFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersSocialService_BlockFriend_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersSocialService_BlockFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_UsersSocialService_UnblockFriend_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, "/usersservice.v1.UsersSocialService/UnblockFriend", runtime.WithHTTPPathPattern("/usersservice.v1.UsersSocialService/UnblockFriend")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersSocialService_UnblockFriend_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersSocialService_UnblockFriend_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil +} + +var ( + pattern_UsersSocialService_AddFriend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersSocialService", "AddFriend"}, "")) + pattern_UsersSocialService_AcceptFriend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersSocialService", "AcceptFriend"}, "")) + pattern_UsersSocialService_RejectFriend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersSocialService", "RejectFriend"}, "")) + pattern_UsersSocialService_RemoveFriend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersSocialService", "RemoveFriend"}, "")) + pattern_UsersSocialService_ListFriends_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersSocialService", "ListFriends"}, "")) + pattern_UsersSocialService_BlockFriend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersSocialService", "BlockFriend"}, "")) + pattern_UsersSocialService_UnblockFriend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersSocialService", "UnblockFriend"}, "")) +) + +var ( + forward_UsersSocialService_AddFriend_0 = runtime.ForwardResponseMessage + forward_UsersSocialService_AcceptFriend_0 = runtime.ForwardResponseMessage + forward_UsersSocialService_RejectFriend_0 = runtime.ForwardResponseMessage + forward_UsersSocialService_RemoveFriend_0 = runtime.ForwardResponseMessage + forward_UsersSocialService_ListFriends_0 = runtime.ForwardResponseMessage + forward_UsersSocialService_BlockFriend_0 = runtime.ForwardResponseMessage + forward_UsersSocialService_UnblockFriend_0 = runtime.ForwardResponseMessage +) diff --git a/gen/external/users/v1/social_grpc.pb.go b/gen/external/users/v1/social_grpc.pb.go new file mode 100644 index 0000000..6a223a8 --- /dev/null +++ b/gen/external/users/v1/social_grpc.pb.go @@ -0,0 +1,348 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: external/users/v1/social.proto + +package usersv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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 ( + UsersSocialService_AddFriend_FullMethodName = "/usersservice.v1.UsersSocialService/AddFriend" + UsersSocialService_AcceptFriend_FullMethodName = "/usersservice.v1.UsersSocialService/AcceptFriend" + UsersSocialService_RejectFriend_FullMethodName = "/usersservice.v1.UsersSocialService/RejectFriend" + UsersSocialService_RemoveFriend_FullMethodName = "/usersservice.v1.UsersSocialService/RemoveFriend" + UsersSocialService_ListFriends_FullMethodName = "/usersservice.v1.UsersSocialService/ListFriends" + UsersSocialService_BlockFriend_FullMethodName = "/usersservice.v1.UsersSocialService/BlockFriend" + UsersSocialService_UnblockFriend_FullMethodName = "/usersservice.v1.UsersSocialService/UnblockFriend" +) + +// UsersSocialServiceClient is the client API for UsersSocialService 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 UsersSocialServiceClient interface { + AddFriend(ctx context.Context, in *AddFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + AcceptFriend(ctx context.Context, in *AcceptFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + RejectFriend(ctx context.Context, in *RejectFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + RemoveFriend(ctx context.Context, in *RemoveFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + ListFriends(ctx context.Context, in *ListFriendsRequest, opts ...grpc.CallOption) (*FriendsList, error) + BlockFriend(ctx context.Context, in *BlockFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + UnblockFriend(ctx context.Context, in *UnblockFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type usersSocialServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUsersSocialServiceClient(cc grpc.ClientConnInterface) UsersSocialServiceClient { + return &usersSocialServiceClient{cc} +} + +func (c *usersSocialServiceClient) AddFriend(ctx context.Context, in *AddFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersSocialService_AddFriend_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersSocialServiceClient) AcceptFriend(ctx context.Context, in *AcceptFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersSocialService_AcceptFriend_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersSocialServiceClient) RejectFriend(ctx context.Context, in *RejectFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersSocialService_RejectFriend_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersSocialServiceClient) RemoveFriend(ctx context.Context, in *RemoveFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersSocialService_RemoveFriend_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersSocialServiceClient) ListFriends(ctx context.Context, in *ListFriendsRequest, opts ...grpc.CallOption) (*FriendsList, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(FriendsList) + err := c.cc.Invoke(ctx, UsersSocialService_ListFriends_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersSocialServiceClient) BlockFriend(ctx context.Context, in *BlockFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersSocialService_BlockFriend_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersSocialServiceClient) UnblockFriend(ctx context.Context, in *UnblockFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersSocialService_UnblockFriend_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UsersSocialServiceServer is the server API for UsersSocialService service. +// All implementations should embed UnimplementedUsersSocialServiceServer +// for forward compatibility. +type UsersSocialServiceServer interface { + AddFriend(context.Context, *AddFriendRequest) (*emptypb.Empty, error) + AcceptFriend(context.Context, *AcceptFriendRequest) (*emptypb.Empty, error) + RejectFriend(context.Context, *RejectFriendRequest) (*emptypb.Empty, error) + RemoveFriend(context.Context, *RemoveFriendRequest) (*emptypb.Empty, error) + ListFriends(context.Context, *ListFriendsRequest) (*FriendsList, error) + BlockFriend(context.Context, *BlockFriendRequest) (*emptypb.Empty, error) + UnblockFriend(context.Context, *UnblockFriendRequest) (*emptypb.Empty, error) +} + +// UnimplementedUsersSocialServiceServer should 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 UnimplementedUsersSocialServiceServer struct{} + +func (UnimplementedUsersSocialServiceServer) AddFriend(context.Context, *AddFriendRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddFriend not implemented") +} +func (UnimplementedUsersSocialServiceServer) AcceptFriend(context.Context, *AcceptFriendRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method AcceptFriend not implemented") +} +func (UnimplementedUsersSocialServiceServer) RejectFriend(context.Context, *RejectFriendRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method RejectFriend not implemented") +} +func (UnimplementedUsersSocialServiceServer) RemoveFriend(context.Context, *RemoveFriendRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveFriend not implemented") +} +func (UnimplementedUsersSocialServiceServer) ListFriends(context.Context, *ListFriendsRequest) (*FriendsList, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListFriends not implemented") +} +func (UnimplementedUsersSocialServiceServer) BlockFriend(context.Context, *BlockFriendRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlockFriend not implemented") +} +func (UnimplementedUsersSocialServiceServer) UnblockFriend(context.Context, *UnblockFriendRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnblockFriend not implemented") +} +func (UnimplementedUsersSocialServiceServer) testEmbeddedByValue() {} + +// UnsafeUsersSocialServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UsersSocialServiceServer will +// result in compilation errors. +type UnsafeUsersSocialServiceServer interface { + mustEmbedUnimplementedUsersSocialServiceServer() +} + +func RegisterUsersSocialServiceServer(s grpc.ServiceRegistrar, srv UsersSocialServiceServer) { + // If the following call pancis, it indicates UnimplementedUsersSocialServiceServer 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(&UsersSocialService_ServiceDesc, srv) +} + +func _UsersSocialService_AddFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddFriendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersSocialServiceServer).AddFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersSocialService_AddFriend_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersSocialServiceServer).AddFriend(ctx, req.(*AddFriendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersSocialService_AcceptFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AcceptFriendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersSocialServiceServer).AcceptFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersSocialService_AcceptFriend_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersSocialServiceServer).AcceptFriend(ctx, req.(*AcceptFriendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersSocialService_RejectFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RejectFriendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersSocialServiceServer).RejectFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersSocialService_RejectFriend_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersSocialServiceServer).RejectFriend(ctx, req.(*RejectFriendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersSocialService_RemoveFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveFriendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersSocialServiceServer).RemoveFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersSocialService_RemoveFriend_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersSocialServiceServer).RemoveFriend(ctx, req.(*RemoveFriendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersSocialService_ListFriends_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListFriendsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersSocialServiceServer).ListFriends(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersSocialService_ListFriends_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersSocialServiceServer).ListFriends(ctx, req.(*ListFriendsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersSocialService_BlockFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockFriendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersSocialServiceServer).BlockFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersSocialService_BlockFriend_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersSocialServiceServer).BlockFriend(ctx, req.(*BlockFriendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UsersSocialService_UnblockFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnblockFriendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersSocialServiceServer).UnblockFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersSocialService_UnblockFriend_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersSocialServiceServer).UnblockFriend(ctx, req.(*UnblockFriendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UsersSocialService_ServiceDesc is the grpc.ServiceDesc for UsersSocialService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UsersSocialService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "usersservice.v1.UsersSocialService", + HandlerType: (*UsersSocialServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddFriend", + Handler: _UsersSocialService_AddFriend_Handler, + }, + { + MethodName: "AcceptFriend", + Handler: _UsersSocialService_AcceptFriend_Handler, + }, + { + MethodName: "RejectFriend", + Handler: _UsersSocialService_RejectFriend_Handler, + }, + { + MethodName: "RemoveFriend", + Handler: _UsersSocialService_RemoveFriend_Handler, + }, + { + MethodName: "ListFriends", + Handler: _UsersSocialService_ListFriends_Handler, + }, + { + MethodName: "BlockFriend", + Handler: _UsersSocialService_BlockFriend_Handler, + }, + { + MethodName: "UnblockFriend", + Handler: _UsersSocialService_UnblockFriend_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "external/users/v1/social.proto", +} From c5fb865561ab91f6dbc07d1820faffde503ed2f1 Mon Sep 17 00:00:00 2001 From: Nofre Date: Wed, 30 Apr 2025 19:19:58 +0200 Subject: [PATCH 7/7] chron(metrics): runtime mux wrapped in http mux, added endpoint for metrics, added telemetry --- go.mod | 25 +++++++- go.sum | 115 ++++++++++++++++++++++++++++++++++-- internal/gateway/gateway.go | 44 ++++++++++++-- internal/mux/runtime.go | 10 +--- internal/server/server.go | 4 +- 5 files changed, 177 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index f9bbabb..492ab65 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,15 @@ go 1.24.2 require ( github.com/DavidMovas/gopherbox v0.0.0-20250329141646-145b4e0827ef - github.com/QuizWars-Ecosystem/go-common v0.0.0-20250421115754-c81ffe56c7c5 + github.com/QuizWars-Ecosystem/go-common v0.0.0-20250430145400-a93f9561350d + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 + github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 github.com/hashicorp/consul/api v1.32.0 + github.com/prometheus/client_golang v1.21.1 github.com/siderolabs/grpc-proxy v0.5.1 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 + go.opentelemetry.io/otel/sdk v1.35.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 golang.org/x/sync v0.12.0 @@ -21,12 +26,16 @@ require ( github.com/Brain-Wave-Ecosystem/go-common v0.0.0-20250331211142-53e0ee600e67 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/armon/go-metrics v0.4.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect github.com/bufbuild/protovalidate-go v0.9.2 // indirect github.com/caarlos0/env/v11 v11.3.1 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fatih/color v1.18.0 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/google/cel-go v0.24.1 // indirect github.com/google/uuid v1.6.0 // indirect @@ -40,12 +49,17 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/serf v0.10.2 // indirect github.com/joho/godotenv v1.5.1 // indirect + github.com/klauspost/compress v1.18.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect - github.com/redis/go-redis/v9 v9.7.3 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/redis/go-redis/v9 v9.8.0 // indirect github.com/sagikazarmark/locafero v0.7.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.12.0 // indirect @@ -54,6 +68,13 @@ require ( github.com/spf13/viper v1.20.1 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/otel v1.35.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect + go.opentelemetry.io/otel/metric v1.35.0 // indirect + go.opentelemetry.io/otel/trace v1.35.0 // indirect + go.opentelemetry.io/proto/otlp v1.5.0 // indirect golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect golang.org/x/net v0.38.0 // indirect golang.org/x/sys v0.32.0 // indirect diff --git a/go.sum b/go.sum index b7fa628..501e128 100644 --- a/go.sum +++ b/go.sum @@ -2,14 +2,16 @@ buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-2025030720450 buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250307204501-0409229c3780.1/go.mod h1:avRlCjnFzl98VPaeCtJ24RrV/wwHFzB8sWXhj26+n/U= cel.dev/expr v0.22.1 h1:xoFEsNh972Yzey8N9TCPx2nDvMN7TMhQEzxLuj/iRrI= cel.dev/expr v0.22.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/Brain-Wave-Ecosystem/go-common v0.0.0-20250331211142-53e0ee600e67 h1:X2nxEweg/wTAVRGHYJ0ksck+6jHJRc+sAvtXiSVhVxs= github.com/Brain-Wave-Ecosystem/go-common v0.0.0-20250331211142-53e0ee600e67/go.mod h1:PfpycKjFn8andfb9ki5adk9w74BfoUD0yb+4ZaBQjA0= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DavidMovas/gopherbox v0.0.0-20250329141646-145b4e0827ef h1:X3T8jXTK7eA1+xrbpzcb8rbwmNcVFG9ZwBvp+ueKNM4= github.com/DavidMovas/gopherbox v0.0.0-20250329141646-145b4e0827ef/go.mod h1:SS2j3swG57zrRmuVXbdOXJvHV7wgLsj3OewEPclDOBI= -github.com/QuizWars-Ecosystem/go-common v0.0.0-20250421115754-c81ffe56c7c5 h1:1iZSebr3LayoMz8DZzJ9J9m3Jw2E3xMfxXI0rTfRmNY= -github.com/QuizWars-Ecosystem/go-common v0.0.0-20250421115754-c81ffe56c7c5/go.mod h1:pt+KxBK12KmuYMvtHWvRjwxzVDVWmbf49hNL8DeTCSM= +github.com/QuizWars-Ecosystem/go-common v0.0.0-20250430145400-a93f9561350d h1:162fSXBXsig4wHC09N8wFttNlb1kWWKswR8PovKeD18= +github.com/QuizWars-Ecosystem/go-common v0.0.0-20250430145400-a93f9561350d/go.mod h1:c/YHg5Zncbz1yhWPvtPqahsDI5gMSwu9/45czIZMaNA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -19,8 +21,10 @@ github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYW github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= @@ -30,17 +34,26 @@ github.com/bufbuild/protovalidate-go v0.9.2 h1:dUoPvFimovS74s3eeFNvHQOxFumRPsk39 github.com/bufbuild/protovalidate-go v0.9.2/go.mod h1:U9+WHAa6IOrLuqQEWPcxsyE4QEOTwm9fDpVbWXsR0zU= github.com/caarlos0/env/v11 v11.3.1 h1:cArPWC15hWmEt+gWk7YBi7lEXTXCvpaSdCiZE2X5mCA= github.com/caarlos0/env/v11 v11.3.1/go.mod h1:qupehSf/Y0TUTsxKywqRt/vJjN5nz6vauiYEUUr8P4U= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -56,6 +69,7 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -64,9 +78,13 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -80,6 +98,7 @@ github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/cel-go v0.24.1 h1:jsBCtxG8mM5wiUJDSGUqU0K7Mtr3w7Eyv00rw4DiZxI= github.com/google/cel-go v0.24.1/go.mod h1:Hdf9TqOaTNSFQA1ybQaRqATVoK7m/zcf7IMhGXP5zI8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -90,6 +109,10 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= github.com/hashicorp/consul/api v1.32.0 h1:5wp5u780Gri7c4OedGEPzmlUEzi0g2KyiPphSr6zjVg= @@ -140,6 +163,10 @@ github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -150,6 +177,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= @@ -169,8 +198,11 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= @@ -187,22 +219,31 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.21.1 h1:DOvXXTqVzvkIewV/CDPFdejpMCGeMcbGCQ8YOmu+Ibk= +github.com/prometheus/client_golang v1.21.1/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0wM= -github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI= +github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= @@ -233,6 +274,7 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -242,10 +284,18 @@ github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 h1:1fTNlAIJZGWLP5FVu0fikVry1IsiUnXjf7QFvoNN3Xw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0/go.mod h1:zjPK58DtkqQFn+YUMbx0M2XV3QgKU0gS9LeGohREyK4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 h1:m639+BofXTvcY1q8CGs4ItwQarYtJPOWmVobfM1HpVI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0/go.mod h1:LjReUci/F4BUyv+y4dwnq3h/26iNOeC3wAIqgvTIZVo= go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= @@ -254,34 +304,59 @@ go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= +go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= +go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw= golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -294,27 +369,50 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= +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= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 h1:hE3bRWtU6uceqlh4fhrSnUyjKHMKB9KrTLLG+bc0ddM= google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463/go.mod h1:U90ffi8eUL9MwPcrJylN5+Mk2v3vuPDptd5yyNUiRR8= google.golang.org/genproto/googleapis/rpc v0.0.0-20250404141209-ee84b53bf3d0 h1:0K7wTWyzxZ7J+L47+LbFogJW1nn/gnnMCN0vGXNYtTI= google.golang.org/genproto/googleapis/rpc v0.0.0-20250404141209-ee84b53bf3d0/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI= google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -328,6 +426,7 @@ google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9x google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -335,7 +434,11 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/gateway/gateway.go b/internal/gateway/gateway.go index 65383e0..3a4e587 100644 --- a/internal/gateway/gateway.go +++ b/internal/gateway/gateway.go @@ -3,13 +3,20 @@ package gateway import ( "context" "fmt" + "github.com/QuizWars-Ecosystem/go-common/pkg/grpcx/telemetry" "github.com/QuizWars-Ecosystem/go-common/pkg/log" + grpcrecovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" + grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/hashicorp/consul/api" + "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/siderolabs/grpc-proxy/proxy" + "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + "go.opentelemetry.io/otel/sdk/trace" "go.uber.org/multierr" "go.uber.org/zap" "google.golang.org/grpc" + "net/http" "strings" ) @@ -23,13 +30,14 @@ type Gateway struct { ctx context.Context cancel context.CancelFunc consul *api.Client - runtimeMux *runtime.ServeMux + serveMux *http.ServeMux grpcProxyMux *grpc.Server plans []*Plan plansInputs []chan []*api.ServiceEntry plansErrCh chan error grpcConns map[string]*grpc.ClientConn logger *log.Logger + provider *trace.TracerProvider } func NewGateway(consulURL string, serviceOpts []*ServiceOption, logger *log.Logger) (*Gateway, error) { @@ -39,6 +47,10 @@ func NewGateway(consulURL string, serviceOpts []*ServiceOption, logger *log.Logg runtimeMux := runtime.NewServeMux(standardServerMuxOptions(z)...) + serveMux := http.NewServeMux() + serveMux.Handle("/", runtimeMux) + serveMux.Handle("/metrics", promhttp.Handler()) + cfg := api.DefaultConfig() cfg.Address = consulURL @@ -48,7 +60,7 @@ func NewGateway(consulURL string, serviceOpts []*ServiceOption, logger *log.Logg return nil, fmt.Errorf("error creating client client: %w", err) } - gt.runtimeMux = runtimeMux + gt.serveMux = serveMux gt.ctx, gt.cancel = context.WithCancel(context.Background()) gt.consul = client gt.logger = logger @@ -87,9 +99,29 @@ func NewGateway(consulURL string, serviceOpts []*ServiceOption, logger *log.Logg p := NewProxy(gt.grpcConns, logger.Zap()) + provider, err := telemetry.NewTracerProvider(gt.ctx, "gateway", "otel-collector:4317") + if err != nil { + logger.Zap().Error("error initializing telemetry tracer", zap.Error(err)) + } + + gt.provider = provider + grpcServerOpts := []grpc.ServerOption{ grpc.ForceServerCodecV2(proxy.Codec()), grpc.UnknownServiceHandler(proxy.TransparentHandler(p.Director)), + grpc.ChainUnaryInterceptor( + grpcrecovery.UnaryServerInterceptor(), + grpcprometheus.UnaryServerInterceptor, + ), + grpc.ChainStreamInterceptor( + grpcrecovery.StreamServerInterceptor(), + grpcprometheus.StreamServerInterceptor, + ), + grpc.StatsHandler( + otelgrpc.NewServerHandler( + otelgrpc.WithTracerProvider(provider), + ), + ), } grpcServerOpts = append(grpcServerOpts, standardServerOptions(logger.Zap())...) @@ -101,8 +133,8 @@ func NewGateway(consulURL string, serviceOpts []*ServiceOption, logger *log.Logg return >, err } -func (gt *Gateway) Runtime() *runtime.ServeMux { - return gt.runtimeMux +func (gt *Gateway) ServeMux() *http.ServeMux { + return gt.serveMux } func (gt *Gateway) Proxy() *grpc.Server { @@ -141,6 +173,10 @@ func (gt *Gateway) Stop() error { } } + if err = gt.provider.Shutdown(gt.ctx); err != nil { + gt.logger.Zap().Error("error shutting down tracer", zap.Error(err)) + } + gt.cancel() gt.logger.Zap().Debug("gateway stopped") diff --git a/internal/mux/runtime.go b/internal/mux/runtime.go index 4823734..85656a5 100644 --- a/internal/mux/runtime.go +++ b/internal/mux/runtime.go @@ -1,19 +1,15 @@ package mux import ( - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "net/http" ) -func RegisterRuntimeMux(mux *runtime.ServeMux) error { - var err error +func RegisterRuntimeMux(mux *http.ServeMux) error { - if err = mux.HandlePath("GET", "/healthz", func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) { + mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte("ok")) - }); err != nil { - return err - } + }) return nil } diff --git a/internal/server/server.go b/internal/server/server.go index c87d765..115054d 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -63,7 +63,7 @@ func NewServer(_ context.Context, cfg *config.Config) (*Server, error) { return nil, err } - err = mux.RegisterRuntimeMux(gt.Runtime()) + err = mux.RegisterRuntimeMux(gt.ServeMux()) if err != nil { logger.Zap().Error("error registering runtime mux", zap.Error(err)) return nil, err @@ -97,7 +97,7 @@ func (s *Server) Start() error { logger.Info("starting http runtime server", zap.String("port", httpPort)) if ls, err := net.Listen("tcp", fmt.Sprintf(":%s", httpPort)); err == nil { - serveMux := s.gateway.Runtime() + serveMux := s.gateway.ServeMux() tcpSrv := &http.Server{Handler: serveMux} s.closer.PushIO(ls)