From d74cdddbaf490efdf257ec32e24405956cd6432f Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 21 Jul 2024 13:51:46 +0800 Subject: [PATCH] :sparkles: Postman the notifier --- go.mod | 24 ++ go.sum | 129 +++++- pkg/internal/grpc/postman.go | 41 ++ pkg/internal/grpc/server.go | 2 + pkg/internal/services/postman.go | 169 ++++++++ pkg/internal/services/pusher_conn.go | 43 ++ pkg/main.go | 12 + pkg/proto/auth.pb.go | 28 +- pkg/proto/auth_grpc.pb.go | 27 +- pkg/proto/notify.pb.go | 14 +- pkg/proto/notify_grpc.pb.go | 27 +- pkg/proto/postman.pb.go | 570 +++++++++++++++++++++++++++ pkg/proto/postman.proto | 45 +++ pkg/proto/postman_grpc.pb.go | 213 ++++++++++ pkg/proto/realm.pb.go | 28 +- pkg/proto/realm_grpc.pb.go | 51 +-- pkg/proto/record.pb.go | 8 +- pkg/proto/record_grpc.pb.go | 15 +- pkg/proto/services.pb.go | 26 +- pkg/proto/services_grpc.pb.go | 33 +- pkg/proto/stream.pb.go | 18 +- pkg/proto/stream_grpc.pb.go | 33 +- 22 files changed, 1361 insertions(+), 195 deletions(-) create mode 100644 pkg/internal/grpc/postman.go create mode 100644 pkg/internal/services/postman.go create mode 100644 pkg/internal/services/pusher_conn.go create mode 100644 pkg/proto/postman.pb.go create mode 100644 pkg/proto/postman.proto create mode 100644 pkg/proto/postman_grpc.pb.go diff --git a/go.mod b/go.mod index e2cff3f..731fca9 100644 --- a/go.mod +++ b/go.mod @@ -5,15 +5,19 @@ go 1.21.6 toolchain go1.22.1 require ( + firebase.google.com/go v3.13.0+incompatible github.com/go-playground/validator/v10 v10.17.0 github.com/gofiber/contrib/websocket v1.3.0 github.com/gofiber/fiber/v2 v2.52.4 + github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible github.com/json-iterator/go v1.1.12 github.com/mbobakov/grpc-consul-resolver v1.5.3 github.com/robfig/cron/v3 v3.0.1 github.com/rs/zerolog v1.31.0 github.com/samber/lo v1.39.0 + github.com/sideshow/apns2 v0.23.0 github.com/spf13/viper v1.18.2 + google.golang.org/api v0.153.0 google.golang.org/grpc v1.65.0 google.golang.org/protobuf v1.34.2 gorm.io/datatypes v1.2.0 @@ -21,6 +25,12 @@ require ( ) require ( + cloud.google.com/go v0.110.10 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/firestore v1.14.0 // indirect + cloud.google.com/go/iam v1.1.5 // indirect + cloud.google.com/go/longrunning v0.5.4 // indirect + cloud.google.com/go/storage v1.35.1 // indirect github.com/andybalholm/brotli v1.1.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/fasthttp/websocket v1.5.8 // indirect @@ -31,7 +41,13 @@ require ( github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect + github.com/golang-jwt/jwt/v4 v4.4.1 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/hashicorp/consul/api v1.29.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -74,12 +90,20 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.52.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect + go.opencensus.io v0.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.25.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect golang.org/x/net v0.27.0 // indirect + golang.org/x/oauth2 v0.20.0 // indirect + golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index 892f922..e7161f0 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,25 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= +cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/firestore v1.14.0 h1:8aLcKnMPoldYU3YHgu4t2exrKhLQkqaXAGqT0ljrFVw= +cloud.google.com/go/firestore v1.14.0/go.mod h1:96MVaHLsEhbvkBEdZgfN+AS/GIkco1LRpH9Xp9YZfzQ= +cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/longrunning v0.5.4 h1:w8xEcbZodnA2BbW6sVirkkoC+1gP8wS57EUUgGS0GVg= +cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= +cloud.google.com/go/storage v1.35.1 h1:B59ahL//eDfx2IIKFBeT5Atm9wnNmj3+8xG/W4WB//w= +cloud.google.com/go/storage v1.35.1/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= +firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4= +firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs= +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/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= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20201120081800-1786d5ef83d4/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -15,14 +32,21 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +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/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/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= 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/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/fasthttp/websocket v1.5.8 h1:k5DpirKkftIF/w1R8ZzjSgARJrs54Je9YJK37DL/Ah8= github.com/fasthttp/websocket v1.5.8/go.mod h1:d08g8WaT6nnyvg9uMm8K9zMYyDjfKyj3170AtPRuVU0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -60,23 +84,52 @@ github.com/gofiber/contrib/websocket v1.3.0/go.mod h1:xguaOzn2ZZ759LavtosEP+rcxI github.com/gofiber/fiber/v2 v2.52.4 h1:P+T+4iK7VaqUsq2PALYEfBBo6bJZ4q3FP8cZ84EggTM= github.com/gofiber/fiber/v2 v2.52.4/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= +github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +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.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= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +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= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/hashicorp/consul/api v1.29.1 h1:UEwOjYJrd3lG1x5w7HxDRMGiAUPrb3f103EoeKuuEcc= github.com/hashicorp/consul/api v1.29.1/go.mod h1:lumfRkY/coLuqMICkI7Fh3ylMG31mQSRZyef2c5YvJI= github.com/hashicorp/consul/proto-public v0.6.1 h1:+uzH3olCrksXYWAYHKqK782CtK9scfqH+Unlw3UHhCg= @@ -137,6 +190,8 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible h1:jdpOPRN1zP63Td1hDQbZW73xKmzDvZHzVdNYxhnTMDA= +github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -223,6 +278,7 @@ 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_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/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= @@ -250,6 +306,8 @@ github.com/savsgio/gotils v0.0.0-20240303185622-093b76447511 h1:KanIMPX0QdEdB4R3 github.com/savsgio/gotils v0.0.0-20240303185622-093b76447511/go.mod h1:sM7Mt7uEoCeFSCBM+qBrqvEo+/9vdmj19wzp3yzUhmg= 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/sideshow/apns2 v0.23.0 h1:lpkikaZ995GIcKk6AFsYzHyezCrsrfEDvUWcWkEGErY= +github.com/sideshow/apns2 v0.23.0/go.mod h1:7Fceu+sL0XscxrfLSkAoH6UtvKefq3Kq1n4W3ayQZqE= 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/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= @@ -275,6 +333,7 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ 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.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -291,33 +350,48 @@ github.com/valyala/fasthttp v1.52.0/go.mod h1:hf5C4QnVMkNXMspnsUlfM3WitlgYflyhHY github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +golang.org/x/crypto v0.0.0-20170512130425-ab89591268e0/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +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/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +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-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-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 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-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20220403103023-749bd193bc2b/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +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= @@ -328,10 +402,12 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +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= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -339,12 +415,14 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -353,8 +431,6 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -368,21 +444,52 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= 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-20190907020128-2ca718005c18/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.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.153.0 h1:N1AwGhielyKFaUqH07/ZSIQR3uNPcV7NVw0vj+j4iR4= +google.golang.org/api v0.153.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= +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/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +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-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= +google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= +google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d h1:JU0iKnSg02Gmb5ZdV8nYsKEKsP6o/FGVWTrw4i1DA9A= google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +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.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -414,3 +521,5 @@ gorm.io/driver/sqlserver v1.4.1/go.mod h1:DJ4P+MeZbc5rvY58PnmN1Lnyvb5gw5NPzGshHD gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gorm.io/gorm v1.25.6 h1:V92+vVda1wEISSOMtodHVRcUIOPYa2tgQtyF+DfFx+A= gorm.io/gorm v1.25.6/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +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/pkg/internal/grpc/postman.go b/pkg/internal/grpc/postman.go new file mode 100644 index 0000000..17fd228 --- /dev/null +++ b/pkg/internal/grpc/postman.go @@ -0,0 +1,41 @@ +package grpc + +import ( + "context" + "git.solsynth.dev/hydrogen/dealer/pkg/internal/services" + "git.solsynth.dev/hydrogen/dealer/pkg/proto" +) + +func (v *Server) DeliverNotification(ctx context.Context, request *proto.DeliverNotificationRequest) (*proto.DeliverResponse, error) { + services.PublishDeliveryTask(request) + return &proto.DeliverResponse{}, nil +} + +func (v *Server) DeliverNotificationBatch(ctx context.Context, request *proto.DeliverNotificationBatchRequest) (*proto.DeliverResponse, error) { + for idx, provider := range request.GetProviders() { + token := request.GetDeviceTokens()[idx] + services.PublishDeliveryTask(&proto.DeliverNotificationRequest{ + Provider: provider, + DeviceToken: token, + Notify: request.GetNotify(), + }) + } + + return &proto.DeliverResponse{}, nil +} + +func (v *Server) DeliverEmail(ctx context.Context, request *proto.DeliverEmailRequest) (*proto.DeliverResponse, error) { + services.PublishDeliveryTask(request) + return &proto.DeliverResponse{}, nil +} + +func (v *Server) DeliverEmailBatch(ctx context.Context, request *proto.DeliverEmailBatchRequest) (*proto.DeliverResponse, error) { + for _, to := range request.GetTo() { + services.PublishDeliveryTask(&proto.DeliverEmailRequest{ + To: to, + Email: request.GetEmail(), + }) + } + + return &proto.DeliverResponse{}, nil +} diff --git a/pkg/internal/grpc/server.go b/pkg/internal/grpc/server.go index 86f8943..5909d9b 100644 --- a/pkg/internal/grpc/server.go +++ b/pkg/internal/grpc/server.go @@ -16,6 +16,7 @@ import ( type Server struct { proto.UnimplementedServiceDirectoryServer proto.UnimplementedStreamControllerServer + proto.UnimplementedPostmanServer proto.UnimplementedAuthServer srv *grpc.Server @@ -29,6 +30,7 @@ func NewServer() *Server { proto.RegisterServiceDirectoryServer(server.srv, server) proto.RegisterStreamControllerServer(server.srv, server) proto.RegisterAuthServer(server.srv, server) + proto.RegisterPostmanServer(server.srv, server) health.RegisterHealthServer(server.srv, server) reflection.Register(server.srv) diff --git a/pkg/internal/services/postman.go b/pkg/internal/services/postman.go new file mode 100644 index 0000000..d3d3469 --- /dev/null +++ b/pkg/internal/services/postman.go @@ -0,0 +1,169 @@ +package services + +import ( + "context" + "crypto/tls" + "firebase.google.com/go/messaging" + "fmt" + "git.solsynth.dev/hydrogen/dealer/pkg/proto" + "github.com/jordan-wright/email" + "github.com/rs/zerolog/log" + "github.com/sideshow/apns2" + payload2 "github.com/sideshow/apns2/payload" + "github.com/spf13/viper" + "net/smtp" + "net/textproto" + "time" +) + +var deliveryTaskQueue = make(chan any, 256) + +func PublishDeliveryTask(task any) { + deliveryTaskQueue <- task +} + +func ConsumeDeliveryTasks() { + for { + task := <-deliveryTaskQueue + switch tk := task.(type) { + case *proto.DeliverEmailRequest: + if tk.GetEmail().HtmlBody != nil { + _ = SendMailHTML(tk.GetTo(), tk.GetEmail().GetSubject(), tk.GetEmail().GetHtmlBody()) + } else { + _ = SendMail(tk.GetTo(), tk.GetEmail().GetSubject(), tk.GetEmail().GetTextBody()) + } + case *proto.DeliverNotificationRequest: + switch tk.GetProvider() { + case "firebase": + _ = PushFirebaseNotify(tk.GetDeviceToken(), tk.GetNotify()) + case "apple": + _ = PushAppleNotify(tk.GetDeviceToken(), tk.GetNotify()) + } + } + } +} + +func PushFirebaseNotify(token string, in *proto.NotifyRequest) error { + if ExtFire == nil { + return fmt.Errorf("firebase push notification is unavailable") + } + + start := time.Now() + + ctx := context.Background() + client, err := ExtFire.Messaging(ctx) + if err != nil { + return fmt.Errorf("failed to create firebase client") + } + + var image string + if in.Picture != nil { + image = *in.Picture + } + var subtitle string + if in.Subtitle != nil { + subtitle = "\n" + *in.Subtitle + } + message := &messaging.Message{ + Notification: &messaging.Notification{ + Title: in.Title, + Body: subtitle + in.Body, + ImageURL: image, + }, + Token: token, + } + + if response, err := client.Send(ctx, message); err != nil { + log.Warn().Err(err).Msg("An error occurred when notify subscriber via FCM...") + } else { + log.Debug(). + Dur("elapsed", time.Since(start)). + Str("response", response). + Msg("Push a notify via firebase") + } + + return nil +} + +func PushAppleNotify(token string, in *proto.NotifyRequest) error { + if ExtAPNS == nil { + return fmt.Errorf("apple push notification is unavailable") + } + + start := time.Now() + + data := payload2. + NewPayload(). + AlertTitle(in.GetTitle()). + AlertBody(in.GetBody()). + Category(in.GetTopic()). + Sound("default"). + MutableContent() + if in.Avatar != nil { + data = data.Custom("avatar", *in.Avatar) + } + if in.Picture != nil { + data = data.Custom("picture", *in.Picture) + } + rawData, err := data.MarshalJSON() + if err != nil { + log.Warn().Err(err).Msg("An error occurred when preparing to notify subscriber via APNs...") + } + payload := &apns2.Notification{ + DeviceToken: token, + Topic: viper.GetString("apns_topic"), + Payload: rawData, + } + + if resp, err := ExtAPNS.Push(payload); err != nil { + log.Warn().Err(err).Msg("An error occurred when notify subscriber via APNs...") + } else { + log.Debug(). + Dur("elapsed", time.Since(start)). + Str("reason", resp.Reason). + Int("status", resp.StatusCode). + Msg("Push a notify via firebase") + } + + return nil +} + +func SendMail(target string, subject string, content string) error { + mail := &email.Email{ + To: []string{target}, + From: viper.GetString("mailer.name"), + Subject: subject, + Text: []byte(content), + Headers: textproto.MIMEHeader{}, + } + return mail.SendWithTLS( + fmt.Sprintf("%s:%d", viper.GetString("mailer.smtp_host"), viper.GetInt("mailer.smtp_port")), + smtp.PlainAuth( + "", + viper.GetString("mailer.username"), + viper.GetString("mailer.password"), + viper.GetString("mailer.smtp_host"), + ), + &tls.Config{ServerName: viper.GetString("mailer.smtp_host")}, + ) +} + +func SendMailHTML(target string, subject string, content string) error { + mail := &email.Email{ + To: []string{target}, + From: viper.GetString("mailer.name"), + Subject: subject, + HTML: []byte(content), + Headers: textproto.MIMEHeader{}, + } + return mail.SendWithTLS( + fmt.Sprintf("%s:%d", viper.GetString("mailer.smtp_host"), viper.GetInt("mailer.smtp_port")), + smtp.PlainAuth( + "", + viper.GetString("mailer.username"), + viper.GetString("mailer.password"), + viper.GetString("mailer.smtp_host"), + ), + &tls.Config{ServerName: viper.GetString("mailer.smtp_host")}, + ) +} diff --git a/pkg/internal/services/pusher_conn.go b/pkg/internal/services/pusher_conn.go new file mode 100644 index 0000000..0b52a28 --- /dev/null +++ b/pkg/internal/services/pusher_conn.go @@ -0,0 +1,43 @@ +package services + +import ( + "context" + firebase "firebase.google.com/go" + "github.com/sideshow/apns2" + "github.com/sideshow/apns2/token" + "github.com/spf13/viper" + "google.golang.org/api/option" +) + +// ExtFire is a Firebase App client +var ExtFire *firebase.App + +func SetupFirebase() error { + opt := option.WithCredentialsFile(viper.GetString("firebase_credentials")) + app, err := firebase.NewApp(context.Background(), nil, opt) + if err != nil { + return err + } else { + ExtFire = app + } + + return nil +} + +// ExtAPNS is an Apple Push Notification Services client +var ExtAPNS *apns2.Client + +func SetupAPNS() error { + authKey, err := token.AuthKeyFromFile(viper.GetString("apns_credentials")) + if err != nil { + return err + } + + ExtAPNS = apns2.NewTokenClient(&token.Token{ + AuthKey: authKey, + KeyID: viper.GetString("apns_credentials_key"), + TeamID: viper.GetString("apns_credentials_team"), + }).Production() + + return nil +} diff --git a/pkg/main.go b/pkg/main.go index df053c3..fb208e2 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -1,6 +1,7 @@ package main import ( + "git.solsynth.dev/hydrogen/dealer/pkg/internal/services" "os" "os/signal" "syscall" @@ -32,6 +33,17 @@ func main() { log.Panic().Err(err).Msg("An error occurred when loading settings.") } + // Set up external services + if err := services.SetupFirebase(); err != nil { + log.Warn().Err(err).Msg("An error occurred when setup firebase, firebase notification push is unavailable...") + } + if err := services.SetupAPNS(); err != nil { + log.Warn().Err(err).Msg("An error occurred when setup APNs, apple notification push is unavailable...") + } + + // Set up tasks queue consumers + go services.ConsumeDeliveryTasks() + // Server go server.NewServer().Listen() diff --git a/pkg/proto/auth.pb.go b/pkg/proto/auth.pb.go index 39e4311..49e4f76 100644 --- a/pkg/proto/auth.pb.go +++ b/pkg/proto/auth.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.28.1 // protoc v5.27.1 // source: auth.proto @@ -626,7 +626,7 @@ func file_auth_proto_rawDescGZIP() []byte { } var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_auth_proto_goTypes = []any{ +var file_auth_proto_goTypes = []interface{}{ (*UserInfo)(nil), // 0: proto.UserInfo (*AuthInfo)(nil), // 1: proto.AuthInfo (*AuthRequest)(nil), // 2: proto.AuthRequest @@ -658,7 +658,7 @@ func file_auth_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_auth_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserInfo); i { case 0: return &v.state @@ -670,7 +670,7 @@ func file_auth_proto_init() { return nil } } - file_auth_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthInfo); i { case 0: return &v.state @@ -682,7 +682,7 @@ func file_auth_proto_init() { return nil } } - file_auth_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthRequest); i { case 0: return &v.state @@ -694,7 +694,7 @@ func file_auth_proto_init() { return nil } } - file_auth_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthReply); i { case 0: return &v.state @@ -706,7 +706,7 @@ func file_auth_proto_init() { return nil } } - file_auth_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_auth_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckPermRequest); i { case 0: return &v.state @@ -718,7 +718,7 @@ func file_auth_proto_init() { return nil } } - file_auth_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_auth_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckPermResponse); i { case 0: return &v.state @@ -730,7 +730,7 @@ func file_auth_proto_init() { return nil } } - file_auth_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_auth_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckUserPermRequest); i { case 0: return &v.state @@ -742,7 +742,7 @@ func file_auth_proto_init() { return nil } } - file_auth_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_auth_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckUserPermResponse); i { case 0: return &v.state @@ -755,10 +755,10 @@ func file_auth_proto_init() { } } } - file_auth_proto_msgTypes[0].OneofWrappers = []any{} - file_auth_proto_msgTypes[1].OneofWrappers = []any{} - file_auth_proto_msgTypes[2].OneofWrappers = []any{} - file_auth_proto_msgTypes[3].OneofWrappers = []any{} + file_auth_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_auth_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_auth_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_auth_proto_msgTypes[3].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/auth_grpc.pb.go b/pkg/proto/auth_grpc.pb.go index 2c0be3f..1d0497f 100644 --- a/pkg/proto/auth_grpc.pb.go +++ b/pkg/proto/auth_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.27.1 // source: auth.proto @@ -15,14 +15,8 @@ import ( // 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.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Auth_Authenticate_FullMethodName = "/proto.Auth/Authenticate" - Auth_EnsurePermGranted_FullMethodName = "/proto.Auth/EnsurePermGranted" - Auth_EnsureUserPermGranted_FullMethodName = "/proto.Auth/EnsureUserPermGranted" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // AuthClient is the client API for Auth service. // @@ -42,9 +36,8 @@ func NewAuthClient(cc grpc.ClientConnInterface) AuthClient { } func (c *authClient) Authenticate(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthReply, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AuthReply) - err := c.cc.Invoke(ctx, Auth_Authenticate_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Auth/Authenticate", in, out, opts...) if err != nil { return nil, err } @@ -52,9 +45,8 @@ func (c *authClient) Authenticate(ctx context.Context, in *AuthRequest, opts ... } func (c *authClient) EnsurePermGranted(ctx context.Context, in *CheckPermRequest, opts ...grpc.CallOption) (*CheckPermResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CheckPermResponse) - err := c.cc.Invoke(ctx, Auth_EnsurePermGranted_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Auth/EnsurePermGranted", in, out, opts...) if err != nil { return nil, err } @@ -62,9 +54,8 @@ func (c *authClient) EnsurePermGranted(ctx context.Context, in *CheckPermRequest } func (c *authClient) EnsureUserPermGranted(ctx context.Context, in *CheckUserPermRequest, opts ...grpc.CallOption) (*CheckUserPermResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CheckUserPermResponse) - err := c.cc.Invoke(ctx, Auth_EnsureUserPermGranted_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Auth/EnsureUserPermGranted", in, out, opts...) if err != nil { return nil, err } @@ -117,7 +108,7 @@ func _Auth_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Auth_Authenticate_FullMethodName, + FullMethod: "/proto.Auth/Authenticate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).Authenticate(ctx, req.(*AuthRequest)) @@ -135,7 +126,7 @@ func _Auth_EnsurePermGranted_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Auth_EnsurePermGranted_FullMethodName, + FullMethod: "/proto.Auth/EnsurePermGranted", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).EnsurePermGranted(ctx, req.(*CheckPermRequest)) @@ -153,7 +144,7 @@ func _Auth_EnsureUserPermGranted_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Auth_EnsureUserPermGranted_FullMethodName, + FullMethod: "/proto.Auth/EnsureUserPermGranted", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).EnsureUserPermGranted(ctx, req.(*CheckUserPermRequest)) diff --git a/pkg/proto/notify.pb.go b/pkg/proto/notify.pb.go index a8baf26..84bcba4 100644 --- a/pkg/proto/notify.pb.go +++ b/pkg/proto/notify.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.28.1 // protoc v5.27.1 // source: notify.proto @@ -367,7 +367,7 @@ func file_notify_proto_rawDescGZIP() []byte { } var file_notify_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_notify_proto_goTypes = []any{ +var file_notify_proto_goTypes = []interface{}{ (*NotifyUserRequest)(nil), // 0: proto.NotifyUserRequest (*NotifyUserBatchRequest)(nil), // 1: proto.NotifyUserBatchRequest (*NotifyRequest)(nil), // 2: proto.NotifyRequest @@ -395,7 +395,7 @@ func file_notify_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_notify_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_notify_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NotifyUserRequest); i { case 0: return &v.state @@ -407,7 +407,7 @@ func file_notify_proto_init() { return nil } } - file_notify_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_notify_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NotifyUserBatchRequest); i { case 0: return &v.state @@ -419,7 +419,7 @@ func file_notify_proto_init() { return nil } } - file_notify_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_notify_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NotifyRequest); i { case 0: return &v.state @@ -431,7 +431,7 @@ func file_notify_proto_init() { return nil } } - file_notify_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_notify_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NotifyResponse); i { case 0: return &v.state @@ -444,7 +444,7 @@ func file_notify_proto_init() { } } } - file_notify_proto_msgTypes[2].OneofWrappers = []any{} + file_notify_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/notify_grpc.pb.go b/pkg/proto/notify_grpc.pb.go index 5434787..7ae01e7 100644 --- a/pkg/proto/notify_grpc.pb.go +++ b/pkg/proto/notify_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.27.1 // source: notify.proto @@ -15,14 +15,8 @@ import ( // 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.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Notifier_NotifyUser_FullMethodName = "/proto.Notifier/NotifyUser" - Notifier_NotifyUserBatch_FullMethodName = "/proto.Notifier/NotifyUserBatch" - Notifier_NotifyAllUser_FullMethodName = "/proto.Notifier/NotifyAllUser" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // NotifierClient is the client API for Notifier service. // @@ -42,9 +36,8 @@ func NewNotifierClient(cc grpc.ClientConnInterface) NotifierClient { } func (c *notifierClient) NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(NotifyResponse) - err := c.cc.Invoke(ctx, Notifier_NotifyUser_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Notifier/NotifyUser", in, out, opts...) if err != nil { return nil, err } @@ -52,9 +45,8 @@ func (c *notifierClient) NotifyUser(ctx context.Context, in *NotifyUserRequest, } func (c *notifierClient) NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, opts ...grpc.CallOption) (*NotifyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(NotifyResponse) - err := c.cc.Invoke(ctx, Notifier_NotifyUserBatch_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Notifier/NotifyUserBatch", in, out, opts...) if err != nil { return nil, err } @@ -62,9 +54,8 @@ func (c *notifierClient) NotifyUserBatch(ctx context.Context, in *NotifyUserBatc } func (c *notifierClient) NotifyAllUser(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(NotifyResponse) - err := c.cc.Invoke(ctx, Notifier_NotifyAllUser_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Notifier/NotifyAllUser", in, out, opts...) if err != nil { return nil, err } @@ -117,7 +108,7 @@ func _Notifier_NotifyUser_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Notifier_NotifyUser_FullMethodName, + FullMethod: "/proto.Notifier/NotifyUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NotifierServer).NotifyUser(ctx, req.(*NotifyUserRequest)) @@ -135,7 +126,7 @@ func _Notifier_NotifyUserBatch_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Notifier_NotifyUserBatch_FullMethodName, + FullMethod: "/proto.Notifier/NotifyUserBatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NotifierServer).NotifyUserBatch(ctx, req.(*NotifyUserBatchRequest)) @@ -153,7 +144,7 @@ func _Notifier_NotifyAllUser_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Notifier_NotifyAllUser_FullMethodName, + FullMethod: "/proto.Notifier/NotifyAllUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NotifierServer).NotifyAllUser(ctx, req.(*NotifyRequest)) diff --git a/pkg/proto/postman.pb.go b/pkg/proto/postman.pb.go new file mode 100644 index 0000000..8496eec --- /dev/null +++ b/pkg/proto/postman.pb.go @@ -0,0 +1,570 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v5.27.1 +// source: postman.proto + +package proto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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 DeliverNotificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + DeviceToken string `protobuf:"bytes,2,opt,name=device_token,json=deviceToken,proto3" json:"device_token,omitempty"` + Notify *NotifyRequest `protobuf:"bytes,3,opt,name=notify,proto3" json:"notify,omitempty"` +} + +func (x *DeliverNotificationRequest) Reset() { + *x = DeliverNotificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_postman_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeliverNotificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeliverNotificationRequest) ProtoMessage() {} + +func (x *DeliverNotificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_postman_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeliverNotificationRequest.ProtoReflect.Descriptor instead. +func (*DeliverNotificationRequest) Descriptor() ([]byte, []int) { + return file_postman_proto_rawDescGZIP(), []int{0} +} + +func (x *DeliverNotificationRequest) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *DeliverNotificationRequest) GetDeviceToken() string { + if x != nil { + return x.DeviceToken + } + return "" +} + +func (x *DeliverNotificationRequest) GetNotify() *NotifyRequest { + if x != nil { + return x.Notify + } + return nil +} + +type DeliverNotificationBatchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Providers []string `protobuf:"bytes,1,rep,name=providers,proto3" json:"providers,omitempty"` + DeviceTokens []string `protobuf:"bytes,2,rep,name=device_tokens,json=deviceTokens,proto3" json:"device_tokens,omitempty"` + Notify *NotifyRequest `protobuf:"bytes,3,opt,name=notify,proto3" json:"notify,omitempty"` +} + +func (x *DeliverNotificationBatchRequest) Reset() { + *x = DeliverNotificationBatchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_postman_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeliverNotificationBatchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeliverNotificationBatchRequest) ProtoMessage() {} + +func (x *DeliverNotificationBatchRequest) ProtoReflect() protoreflect.Message { + mi := &file_postman_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeliverNotificationBatchRequest.ProtoReflect.Descriptor instead. +func (*DeliverNotificationBatchRequest) Descriptor() ([]byte, []int) { + return file_postman_proto_rawDescGZIP(), []int{1} +} + +func (x *DeliverNotificationBatchRequest) GetProviders() []string { + if x != nil { + return x.Providers + } + return nil +} + +func (x *DeliverNotificationBatchRequest) GetDeviceTokens() []string { + if x != nil { + return x.DeviceTokens + } + return nil +} + +func (x *DeliverNotificationBatchRequest) GetNotify() *NotifyRequest { + if x != nil { + return x.Notify + } + return nil +} + +type DeliverEmailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` + Email *EmailRequest `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *DeliverEmailRequest) Reset() { + *x = DeliverEmailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_postman_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeliverEmailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeliverEmailRequest) ProtoMessage() {} + +func (x *DeliverEmailRequest) ProtoReflect() protoreflect.Message { + mi := &file_postman_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeliverEmailRequest.ProtoReflect.Descriptor instead. +func (*DeliverEmailRequest) Descriptor() ([]byte, []int) { + return file_postman_proto_rawDescGZIP(), []int{2} +} + +func (x *DeliverEmailRequest) GetTo() string { + if x != nil { + return x.To + } + return "" +} + +func (x *DeliverEmailRequest) GetEmail() *EmailRequest { + if x != nil { + return x.Email + } + return nil +} + +type DeliverEmailBatchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + To []string `protobuf:"bytes,1,rep,name=to,proto3" json:"to,omitempty"` + Email *EmailRequest `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *DeliverEmailBatchRequest) Reset() { + *x = DeliverEmailBatchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_postman_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeliverEmailBatchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeliverEmailBatchRequest) ProtoMessage() {} + +func (x *DeliverEmailBatchRequest) ProtoReflect() protoreflect.Message { + mi := &file_postman_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeliverEmailBatchRequest.ProtoReflect.Descriptor instead. +func (*DeliverEmailBatchRequest) Descriptor() ([]byte, []int) { + return file_postman_proto_rawDescGZIP(), []int{3} +} + +func (x *DeliverEmailBatchRequest) GetTo() []string { + if x != nil { + return x.To + } + return nil +} + +func (x *DeliverEmailBatchRequest) GetEmail() *EmailRequest { + if x != nil { + return x.Email + } + return nil +} + +type EmailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + TextBody *string `protobuf:"bytes,2,opt,name=text_body,json=textBody,proto3,oneof" json:"text_body,omitempty"` + HtmlBody *string `protobuf:"bytes,3,opt,name=html_body,json=htmlBody,proto3,oneof" json:"html_body,omitempty"` +} + +func (x *EmailRequest) Reset() { + *x = EmailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_postman_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmailRequest) ProtoMessage() {} + +func (x *EmailRequest) ProtoReflect() protoreflect.Message { + mi := &file_postman_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmailRequest.ProtoReflect.Descriptor instead. +func (*EmailRequest) Descriptor() ([]byte, []int) { + return file_postman_proto_rawDescGZIP(), []int{4} +} + +func (x *EmailRequest) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *EmailRequest) GetTextBody() string { + if x != nil && x.TextBody != nil { + return *x.TextBody + } + return "" +} + +func (x *EmailRequest) GetHtmlBody() string { + if x != nil && x.HtmlBody != nil { + return *x.HtmlBody + } + return "" +} + +type DeliverResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeliverResponse) Reset() { + *x = DeliverResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_postman_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeliverResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeliverResponse) ProtoMessage() {} + +func (x *DeliverResponse) ProtoReflect() protoreflect.Message { + mi := &file_postman_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeliverResponse.ProtoReflect.Descriptor instead. +func (*DeliverResponse) Descriptor() ([]byte, []int) { + return file_postman_proto_rawDescGZIP(), []int{5} +} + +var File_postman_proto protoreflect.FileDescriptor + +var file_postman_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x70, 0x6f, 0x73, 0x74, 0x6d, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, + 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x2c, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, + 0x22, 0x92, 0x01, 0x0a, 0x1f, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x06, 0x6e, + 0x6f, 0x74, 0x69, 0x66, 0x79, 0x22, 0x50, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, + 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x29, 0x0a, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x55, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x69, 0x76, + 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x02, 0x74, 0x6f, 0x12, 0x29, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x88, + 0x01, 0x0a, 0x0c, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x74, 0x65, 0x78, + 0x74, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, + 0x74, 0x65, 0x78, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x68, + 0x74, 0x6d, 0x6c, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, + 0x52, 0x08, 0x68, 0x74, 0x6d, 0x6c, 0x42, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, + 0x0a, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, + 0x68, 0x74, 0x6d, 0x6c, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x11, 0x0a, 0x0f, 0x44, 0x65, 0x6c, + 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xd1, 0x02, 0x0a, + 0x07, 0x50, 0x6f, 0x73, 0x74, 0x6d, 0x61, 0x6e, 0x12, 0x52, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x69, + 0x76, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x18, + 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0c, 0x44, 0x65, + 0x6c, 0x69, 0x76, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, + 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x4e, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, + 0x6c, 0x69, 0x76, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, + 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_postman_proto_rawDescOnce sync.Once + file_postman_proto_rawDescData = file_postman_proto_rawDesc +) + +func file_postman_proto_rawDescGZIP() []byte { + file_postman_proto_rawDescOnce.Do(func() { + file_postman_proto_rawDescData = protoimpl.X.CompressGZIP(file_postman_proto_rawDescData) + }) + return file_postman_proto_rawDescData +} + +var file_postman_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_postman_proto_goTypes = []interface{}{ + (*DeliverNotificationRequest)(nil), // 0: proto.DeliverNotificationRequest + (*DeliverNotificationBatchRequest)(nil), // 1: proto.DeliverNotificationBatchRequest + (*DeliverEmailRequest)(nil), // 2: proto.DeliverEmailRequest + (*DeliverEmailBatchRequest)(nil), // 3: proto.DeliverEmailBatchRequest + (*EmailRequest)(nil), // 4: proto.EmailRequest + (*DeliverResponse)(nil), // 5: proto.DeliverResponse + (*NotifyRequest)(nil), // 6: proto.NotifyRequest +} +var file_postman_proto_depIdxs = []int32{ + 6, // 0: proto.DeliverNotificationRequest.notify:type_name -> proto.NotifyRequest + 6, // 1: proto.DeliverNotificationBatchRequest.notify:type_name -> proto.NotifyRequest + 4, // 2: proto.DeliverEmailRequest.email:type_name -> proto.EmailRequest + 4, // 3: proto.DeliverEmailBatchRequest.email:type_name -> proto.EmailRequest + 0, // 4: proto.Postman.DeliverNotification:input_type -> proto.DeliverNotificationRequest + 1, // 5: proto.Postman.DeliverNotificationBatch:input_type -> proto.DeliverNotificationBatchRequest + 2, // 6: proto.Postman.DeliverEmail:input_type -> proto.DeliverEmailRequest + 3, // 7: proto.Postman.DeliverEmailBatch:input_type -> proto.DeliverEmailBatchRequest + 5, // 8: proto.Postman.DeliverNotification:output_type -> proto.DeliverResponse + 5, // 9: proto.Postman.DeliverNotificationBatch:output_type -> proto.DeliverResponse + 5, // 10: proto.Postman.DeliverEmail:output_type -> proto.DeliverResponse + 5, // 11: proto.Postman.DeliverEmailBatch:output_type -> proto.DeliverResponse + 8, // [8:12] is the sub-list for method output_type + 4, // [4:8] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_postman_proto_init() } +func file_postman_proto_init() { + if File_postman_proto != nil { + return + } + file_notify_proto_init() + if !protoimpl.UnsafeEnabled { + file_postman_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeliverNotificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_postman_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeliverNotificationBatchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_postman_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeliverEmailRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_postman_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeliverEmailBatchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_postman_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmailRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_postman_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeliverResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_postman_proto_msgTypes[4].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_postman_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_postman_proto_goTypes, + DependencyIndexes: file_postman_proto_depIdxs, + MessageInfos: file_postman_proto_msgTypes, + }.Build() + File_postman_proto = out.File + file_postman_proto_rawDesc = nil + file_postman_proto_goTypes = nil + file_postman_proto_depIdxs = nil +} diff --git a/pkg/proto/postman.proto b/pkg/proto/postman.proto new file mode 100644 index 0000000..82e0a71 --- /dev/null +++ b/pkg/proto/postman.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +option go_package = ".;proto"; + +import "notify.proto"; + +package proto; + +service Postman { + rpc DeliverNotification(DeliverNotificationRequest) returns (DeliverResponse) {} + rpc DeliverNotificationBatch(DeliverNotificationBatchRequest) returns (DeliverResponse) {} + rpc DeliverEmail(DeliverEmailRequest) returns (DeliverResponse) {} + rpc DeliverEmailBatch(DeliverEmailBatchRequest) returns (DeliverResponse) {} +} + +message DeliverNotificationRequest { + string provider = 1; + string device_token = 2; + NotifyRequest notify = 3; +} + +message DeliverNotificationBatchRequest { + repeated string providers = 1; + repeated string device_tokens = 2; + NotifyRequest notify = 3; +} + +message DeliverEmailRequest { + string to = 1; + EmailRequest email = 2; +} + +message DeliverEmailBatchRequest { + repeated string to = 1; + EmailRequest email = 2; +} + +message EmailRequest { + string subject = 1; + optional string text_body = 2; + optional string html_body = 3; +} + +message DeliverResponse { +} diff --git a/pkg/proto/postman_grpc.pb.go b/pkg/proto/postman_grpc.pb.go new file mode 100644 index 0000000..6a7944b --- /dev/null +++ b/pkg/proto/postman_grpc.pb.go @@ -0,0 +1,213 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v5.27.1 +// source: postman.proto + +package proto + +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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PostmanClient is the client API for Postman 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 PostmanClient interface { + DeliverNotification(ctx context.Context, in *DeliverNotificationRequest, opts ...grpc.CallOption) (*DeliverResponse, error) + DeliverNotificationBatch(ctx context.Context, in *DeliverNotificationBatchRequest, opts ...grpc.CallOption) (*DeliverResponse, error) + DeliverEmail(ctx context.Context, in *DeliverEmailRequest, opts ...grpc.CallOption) (*DeliverResponse, error) + DeliverEmailBatch(ctx context.Context, in *DeliverEmailBatchRequest, opts ...grpc.CallOption) (*DeliverResponse, error) +} + +type postmanClient struct { + cc grpc.ClientConnInterface +} + +func NewPostmanClient(cc grpc.ClientConnInterface) PostmanClient { + return &postmanClient{cc} +} + +func (c *postmanClient) DeliverNotification(ctx context.Context, in *DeliverNotificationRequest, opts ...grpc.CallOption) (*DeliverResponse, error) { + out := new(DeliverResponse) + err := c.cc.Invoke(ctx, "/proto.Postman/DeliverNotification", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *postmanClient) DeliverNotificationBatch(ctx context.Context, in *DeliverNotificationBatchRequest, opts ...grpc.CallOption) (*DeliverResponse, error) { + out := new(DeliverResponse) + err := c.cc.Invoke(ctx, "/proto.Postman/DeliverNotificationBatch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *postmanClient) DeliverEmail(ctx context.Context, in *DeliverEmailRequest, opts ...grpc.CallOption) (*DeliverResponse, error) { + out := new(DeliverResponse) + err := c.cc.Invoke(ctx, "/proto.Postman/DeliverEmail", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *postmanClient) DeliverEmailBatch(ctx context.Context, in *DeliverEmailBatchRequest, opts ...grpc.CallOption) (*DeliverResponse, error) { + out := new(DeliverResponse) + err := c.cc.Invoke(ctx, "/proto.Postman/DeliverEmailBatch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PostmanServer is the server API for Postman service. +// All implementations must embed UnimplementedPostmanServer +// for forward compatibility +type PostmanServer interface { + DeliverNotification(context.Context, *DeliverNotificationRequest) (*DeliverResponse, error) + DeliverNotificationBatch(context.Context, *DeliverNotificationBatchRequest) (*DeliverResponse, error) + DeliverEmail(context.Context, *DeliverEmailRequest) (*DeliverResponse, error) + DeliverEmailBatch(context.Context, *DeliverEmailBatchRequest) (*DeliverResponse, error) + mustEmbedUnimplementedPostmanServer() +} + +// UnimplementedPostmanServer must be embedded to have forward compatible implementations. +type UnimplementedPostmanServer struct { +} + +func (UnimplementedPostmanServer) DeliverNotification(context.Context, *DeliverNotificationRequest) (*DeliverResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeliverNotification not implemented") +} +func (UnimplementedPostmanServer) DeliverNotificationBatch(context.Context, *DeliverNotificationBatchRequest) (*DeliverResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeliverNotificationBatch not implemented") +} +func (UnimplementedPostmanServer) DeliverEmail(context.Context, *DeliverEmailRequest) (*DeliverResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeliverEmail not implemented") +} +func (UnimplementedPostmanServer) DeliverEmailBatch(context.Context, *DeliverEmailBatchRequest) (*DeliverResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeliverEmailBatch not implemented") +} +func (UnimplementedPostmanServer) mustEmbedUnimplementedPostmanServer() {} + +// UnsafePostmanServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PostmanServer will +// result in compilation errors. +type UnsafePostmanServer interface { + mustEmbedUnimplementedPostmanServer() +} + +func RegisterPostmanServer(s grpc.ServiceRegistrar, srv PostmanServer) { + s.RegisterService(&Postman_ServiceDesc, srv) +} + +func _Postman_DeliverNotification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeliverNotificationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PostmanServer).DeliverNotification(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Postman/DeliverNotification", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PostmanServer).DeliverNotification(ctx, req.(*DeliverNotificationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Postman_DeliverNotificationBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeliverNotificationBatchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PostmanServer).DeliverNotificationBatch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Postman/DeliverNotificationBatch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PostmanServer).DeliverNotificationBatch(ctx, req.(*DeliverNotificationBatchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Postman_DeliverEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeliverEmailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PostmanServer).DeliverEmail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Postman/DeliverEmail", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PostmanServer).DeliverEmail(ctx, req.(*DeliverEmailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Postman_DeliverEmailBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeliverEmailBatchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PostmanServer).DeliverEmailBatch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Postman/DeliverEmailBatch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PostmanServer).DeliverEmailBatch(ctx, req.(*DeliverEmailBatchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Postman_ServiceDesc is the grpc.ServiceDesc for Postman service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Postman_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Postman", + HandlerType: (*PostmanServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DeliverNotification", + Handler: _Postman_DeliverNotification_Handler, + }, + { + MethodName: "DeliverNotificationBatch", + Handler: _Postman_DeliverNotificationBatch_Handler, + }, + { + MethodName: "DeliverEmail", + Handler: _Postman_DeliverEmail_Handler, + }, + { + MethodName: "DeliverEmailBatch", + Handler: _Postman_DeliverEmailBatch_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "postman.proto", +} diff --git a/pkg/proto/realm.pb.go b/pkg/proto/realm.pb.go index 8246d85..79d2ae3 100644 --- a/pkg/proto/realm.pb.go +++ b/pkg/proto/realm.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.28.1 // protoc v5.27.1 // source: realm.proto @@ -699,7 +699,7 @@ func file_realm_proto_rawDescGZIP() []byte { } var file_realm_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_realm_proto_goTypes = []any{ +var file_realm_proto_goTypes = []interface{}{ (*RealmInfo)(nil), // 0: proto.RealmInfo (*ListRealmRequest)(nil), // 1: proto.ListRealmRequest (*LookupUserRealmRequest)(nil), // 2: proto.LookupUserRealmRequest @@ -741,7 +741,7 @@ func file_realm_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_realm_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_realm_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RealmInfo); i { case 0: return &v.state @@ -753,7 +753,7 @@ func file_realm_proto_init() { return nil } } - file_realm_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_realm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListRealmRequest); i { case 0: return &v.state @@ -765,7 +765,7 @@ func file_realm_proto_init() { return nil } } - file_realm_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_realm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LookupUserRealmRequest); i { case 0: return &v.state @@ -777,7 +777,7 @@ func file_realm_proto_init() { return nil } } - file_realm_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_realm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LookupRealmRequest); i { case 0: return &v.state @@ -789,7 +789,7 @@ func file_realm_proto_init() { return nil } } - file_realm_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_realm_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListRealmResponse); i { case 0: return &v.state @@ -801,7 +801,7 @@ func file_realm_proto_init() { return nil } } - file_realm_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_realm_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RealmMemberLookupRequest); i { case 0: return &v.state @@ -813,7 +813,7 @@ func file_realm_proto_init() { return nil } } - file_realm_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_realm_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RealmMemberInfo); i { case 0: return &v.state @@ -825,7 +825,7 @@ func file_realm_proto_init() { return nil } } - file_realm_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_realm_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListRealmMemberResponse); i { case 0: return &v.state @@ -837,7 +837,7 @@ func file_realm_proto_init() { return nil } } - file_realm_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_realm_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckRealmPermRequest); i { case 0: return &v.state @@ -849,7 +849,7 @@ func file_realm_proto_init() { return nil } } - file_realm_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_realm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckRealmPermResponse); i { case 0: return &v.state @@ -862,8 +862,8 @@ func file_realm_proto_init() { } } } - file_realm_proto_msgTypes[3].OneofWrappers = []any{} - file_realm_proto_msgTypes[5].OneofWrappers = []any{} + file_realm_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_realm_proto_msgTypes[5].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/realm_grpc.pb.go b/pkg/proto/realm_grpc.pb.go index c35b4c8..56c9df9 100644 --- a/pkg/proto/realm_grpc.pb.go +++ b/pkg/proto/realm_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.27.1 // source: realm.proto @@ -15,18 +15,8 @@ import ( // 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.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Realm_ListCommunityRealm_FullMethodName = "/proto.Realm/ListCommunityRealm" - Realm_ListAvailableRealm_FullMethodName = "/proto.Realm/ListAvailableRealm" - Realm_ListOwnedRealm_FullMethodName = "/proto.Realm/ListOwnedRealm" - Realm_GetRealm_FullMethodName = "/proto.Realm/GetRealm" - Realm_ListRealmMember_FullMethodName = "/proto.Realm/ListRealmMember" - Realm_GetRealmMember_FullMethodName = "/proto.Realm/GetRealmMember" - Realm_CheckRealmMemberPerm_FullMethodName = "/proto.Realm/CheckRealmMemberPerm" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // RealmClient is the client API for Realm service. // @@ -50,9 +40,8 @@ func NewRealmClient(cc grpc.ClientConnInterface) RealmClient { } func (c *realmClient) ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListRealmResponse) - err := c.cc.Invoke(ctx, Realm_ListCommunityRealm_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Realm/ListCommunityRealm", in, out, opts...) if err != nil { return nil, err } @@ -60,9 +49,8 @@ func (c *realmClient) ListCommunityRealm(ctx context.Context, in *ListRealmReque } func (c *realmClient) ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListRealmResponse) - err := c.cc.Invoke(ctx, Realm_ListAvailableRealm_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Realm/ListAvailableRealm", in, out, opts...) if err != nil { return nil, err } @@ -70,9 +58,8 @@ func (c *realmClient) ListAvailableRealm(ctx context.Context, in *LookupUserReal } func (c *realmClient) ListOwnedRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListRealmResponse) - err := c.cc.Invoke(ctx, Realm_ListOwnedRealm_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Realm/ListOwnedRealm", in, out, opts...) if err != nil { return nil, err } @@ -80,9 +67,8 @@ func (c *realmClient) ListOwnedRealm(ctx context.Context, in *LookupUserRealmReq } func (c *realmClient) GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(RealmInfo) - err := c.cc.Invoke(ctx, Realm_GetRealm_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Realm/GetRealm", in, out, opts...) if err != nil { return nil, err } @@ -90,9 +76,8 @@ func (c *realmClient) GetRealm(ctx context.Context, in *LookupRealmRequest, opts } func (c *realmClient) ListRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*ListRealmMemberResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListRealmMemberResponse) - err := c.cc.Invoke(ctx, Realm_ListRealmMember_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Realm/ListRealmMember", in, out, opts...) if err != nil { return nil, err } @@ -100,9 +85,8 @@ func (c *realmClient) ListRealmMember(ctx context.Context, in *RealmMemberLookup } func (c *realmClient) GetRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*RealmMemberInfo, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(RealmMemberInfo) - err := c.cc.Invoke(ctx, Realm_GetRealmMember_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Realm/GetRealmMember", in, out, opts...) if err != nil { return nil, err } @@ -110,9 +94,8 @@ func (c *realmClient) GetRealmMember(ctx context.Context, in *RealmMemberLookupR } func (c *realmClient) CheckRealmMemberPerm(ctx context.Context, in *CheckRealmPermRequest, opts ...grpc.CallOption) (*CheckRealmPermResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CheckRealmPermResponse) - err := c.cc.Invoke(ctx, Realm_CheckRealmMemberPerm_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.Realm/CheckRealmMemberPerm", in, out, opts...) if err != nil { return nil, err } @@ -181,7 +164,7 @@ func _Realm_ListCommunityRealm_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Realm_ListCommunityRealm_FullMethodName, + FullMethod: "/proto.Realm/ListCommunityRealm", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RealmServer).ListCommunityRealm(ctx, req.(*ListRealmRequest)) @@ -199,7 +182,7 @@ func _Realm_ListAvailableRealm_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Realm_ListAvailableRealm_FullMethodName, + FullMethod: "/proto.Realm/ListAvailableRealm", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RealmServer).ListAvailableRealm(ctx, req.(*LookupUserRealmRequest)) @@ -217,7 +200,7 @@ func _Realm_ListOwnedRealm_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Realm_ListOwnedRealm_FullMethodName, + FullMethod: "/proto.Realm/ListOwnedRealm", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RealmServer).ListOwnedRealm(ctx, req.(*LookupUserRealmRequest)) @@ -235,7 +218,7 @@ func _Realm_GetRealm_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Realm_GetRealm_FullMethodName, + FullMethod: "/proto.Realm/GetRealm", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RealmServer).GetRealm(ctx, req.(*LookupRealmRequest)) @@ -253,7 +236,7 @@ func _Realm_ListRealmMember_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Realm_ListRealmMember_FullMethodName, + FullMethod: "/proto.Realm/ListRealmMember", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RealmServer).ListRealmMember(ctx, req.(*RealmMemberLookupRequest)) @@ -271,7 +254,7 @@ func _Realm_GetRealmMember_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Realm_GetRealmMember_FullMethodName, + FullMethod: "/proto.Realm/GetRealmMember", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RealmServer).GetRealmMember(ctx, req.(*RealmMemberLookupRequest)) @@ -289,7 +272,7 @@ func _Realm_CheckRealmMemberPerm_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Realm_CheckRealmMemberPerm_FullMethodName, + FullMethod: "/proto.Realm/CheckRealmMemberPerm", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RealmServer).CheckRealmMemberPerm(ctx, req.(*CheckRealmPermRequest)) diff --git a/pkg/proto/record.pb.go b/pkg/proto/record.pb.go index f411abb..de609b0 100644 --- a/pkg/proto/record.pb.go +++ b/pkg/proto/record.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.28.1 // protoc v5.27.1 // source: record.proto @@ -185,7 +185,7 @@ func file_record_proto_rawDescGZIP() []byte { } var file_record_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_record_proto_goTypes = []any{ +var file_record_proto_goTypes = []interface{}{ (*RecordEventRequest)(nil), // 0: proto.RecordEventRequest (*RecordEventResponse)(nil), // 1: proto.RecordEventResponse } @@ -205,7 +205,7 @@ func file_record_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_record_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_record_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RecordEventRequest); i { case 0: return &v.state @@ -217,7 +217,7 @@ func file_record_proto_init() { return nil } } - file_record_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_record_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RecordEventResponse); i { case 0: return &v.state diff --git a/pkg/proto/record_grpc.pb.go b/pkg/proto/record_grpc.pb.go index 28ed4ba..17be0b6 100644 --- a/pkg/proto/record_grpc.pb.go +++ b/pkg/proto/record_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.27.1 // source: record.proto @@ -15,12 +15,8 @@ import ( // 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.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - EventRecorder_RecordEvent_FullMethodName = "/proto.EventRecorder/RecordEvent" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // EventRecorderClient is the client API for EventRecorder service. // @@ -38,9 +34,8 @@ func NewEventRecorderClient(cc grpc.ClientConnInterface) EventRecorderClient { } func (c *eventRecorderClient) RecordEvent(ctx context.Context, in *RecordEventRequest, opts ...grpc.CallOption) (*RecordEventResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(RecordEventResponse) - err := c.cc.Invoke(ctx, EventRecorder_RecordEvent_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.EventRecorder/RecordEvent", in, out, opts...) if err != nil { return nil, err } @@ -85,7 +80,7 @@ func _EventRecorder_RecordEvent_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EventRecorder_RecordEvent_FullMethodName, + FullMethod: "/proto.EventRecorder/RecordEvent", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EventRecorderServer).RecordEvent(ctx, req.(*RecordEventRequest)) diff --git a/pkg/proto/services.pb.go b/pkg/proto/services.pb.go index b198ccb..80494f7 100644 --- a/pkg/proto/services.pb.go +++ b/pkg/proto/services.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.28.1 // protoc v5.27.1 // source: services.proto @@ -511,7 +511,7 @@ func file_services_proto_rawDescGZIP() []byte { } var file_services_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_services_proto_goTypes = []any{ +var file_services_proto_goTypes = []interface{}{ (*ServiceInfo)(nil), // 0: proto.ServiceInfo (*GetServiceRequest)(nil), // 1: proto.GetServiceRequest (*GetServiceResponse)(nil), // 2: proto.GetServiceResponse @@ -545,7 +545,7 @@ func file_services_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_services_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_services_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServiceInfo); i { case 0: return &v.state @@ -557,7 +557,7 @@ func file_services_proto_init() { return nil } } - file_services_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_services_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetServiceRequest); i { case 0: return &v.state @@ -569,7 +569,7 @@ func file_services_proto_init() { return nil } } - file_services_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_services_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetServiceResponse); i { case 0: return &v.state @@ -581,7 +581,7 @@ func file_services_proto_init() { return nil } } - file_services_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_services_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListServiceRequest); i { case 0: return &v.state @@ -593,7 +593,7 @@ func file_services_proto_init() { return nil } } - file_services_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_services_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListServiceResponse); i { case 0: return &v.state @@ -605,7 +605,7 @@ func file_services_proto_init() { return nil } } - file_services_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_services_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddServiceResponse); i { case 0: return &v.state @@ -617,7 +617,7 @@ func file_services_proto_init() { return nil } } - file_services_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_services_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveServiceRequest); i { case 0: return &v.state @@ -629,7 +629,7 @@ func file_services_proto_init() { return nil } } - file_services_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_services_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveServiceResponse); i { case 0: return &v.state @@ -642,9 +642,9 @@ func file_services_proto_init() { } } } - file_services_proto_msgTypes[0].OneofWrappers = []any{} - file_services_proto_msgTypes[1].OneofWrappers = []any{} - file_services_proto_msgTypes[3].OneofWrappers = []any{} + file_services_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_services_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_services_proto_msgTypes[3].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/services_grpc.pb.go b/pkg/proto/services_grpc.pb.go index ffcef89..49b7e8c 100644 --- a/pkg/proto/services_grpc.pb.go +++ b/pkg/proto/services_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.27.1 // source: services.proto @@ -15,15 +15,8 @@ import ( // 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.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - ServiceDirectory_GetService_FullMethodName = "/proto.ServiceDirectory/GetService" - ServiceDirectory_ListService_FullMethodName = "/proto.ServiceDirectory/ListService" - ServiceDirectory_AddService_FullMethodName = "/proto.ServiceDirectory/AddService" - ServiceDirectory_RemoveService_FullMethodName = "/proto.ServiceDirectory/RemoveService" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // ServiceDirectoryClient is the client API for ServiceDirectory service. // @@ -44,9 +37,8 @@ func NewServiceDirectoryClient(cc grpc.ClientConnInterface) ServiceDirectoryClie } func (c *serviceDirectoryClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetServiceResponse) - err := c.cc.Invoke(ctx, ServiceDirectory_GetService_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.ServiceDirectory/GetService", in, out, opts...) if err != nil { return nil, err } @@ -54,9 +46,8 @@ func (c *serviceDirectoryClient) GetService(ctx context.Context, in *GetServiceR } func (c *serviceDirectoryClient) ListService(ctx context.Context, in *ListServiceRequest, opts ...grpc.CallOption) (*ListServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListServiceResponse) - err := c.cc.Invoke(ctx, ServiceDirectory_ListService_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.ServiceDirectory/ListService", in, out, opts...) if err != nil { return nil, err } @@ -64,9 +55,8 @@ func (c *serviceDirectoryClient) ListService(ctx context.Context, in *ListServic } func (c *serviceDirectoryClient) AddService(ctx context.Context, in *ServiceInfo, opts ...grpc.CallOption) (*AddServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddServiceResponse) - err := c.cc.Invoke(ctx, ServiceDirectory_AddService_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.ServiceDirectory/AddService", in, out, opts...) if err != nil { return nil, err } @@ -74,9 +64,8 @@ func (c *serviceDirectoryClient) AddService(ctx context.Context, in *ServiceInfo } func (c *serviceDirectoryClient) RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(RemoveServiceResponse) - err := c.cc.Invoke(ctx, ServiceDirectory_RemoveService_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.ServiceDirectory/RemoveService", in, out, opts...) if err != nil { return nil, err } @@ -133,7 +122,7 @@ func _ServiceDirectory_GetService_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ServiceDirectory_GetService_FullMethodName, + FullMethod: "/proto.ServiceDirectory/GetService", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceDirectoryServer).GetService(ctx, req.(*GetServiceRequest)) @@ -151,7 +140,7 @@ func _ServiceDirectory_ListService_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ServiceDirectory_ListService_FullMethodName, + FullMethod: "/proto.ServiceDirectory/ListService", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceDirectoryServer).ListService(ctx, req.(*ListServiceRequest)) @@ -169,7 +158,7 @@ func _ServiceDirectory_AddService_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ServiceDirectory_AddService_FullMethodName, + FullMethod: "/proto.ServiceDirectory/AddService", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceDirectoryServer).AddService(ctx, req.(*ServiceInfo)) @@ -187,7 +176,7 @@ func _ServiceDirectory_RemoveService_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ServiceDirectory_RemoveService_FullMethodName, + FullMethod: "/proto.ServiceDirectory/RemoveService", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceDirectoryServer).RemoveService(ctx, req.(*RemoveServiceRequest)) diff --git a/pkg/proto/stream.pb.go b/pkg/proto/stream.pb.go index 95afa84..4a4a013 100644 --- a/pkg/proto/stream.pb.go +++ b/pkg/proto/stream.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.28.1 // protoc v5.27.1 // source: stream.proto @@ -451,7 +451,7 @@ func file_stream_proto_rawDescGZIP() []byte { } var file_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_stream_proto_goTypes = []any{ +var file_stream_proto_goTypes = []interface{}{ (*CountConnectionRequest)(nil), // 0: proto.CountConnectionRequest (*CountConnectionResponse)(nil), // 1: proto.CountConnectionResponse (*PushStreamRequest)(nil), // 2: proto.PushStreamRequest @@ -482,7 +482,7 @@ func file_stream_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_stream_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_stream_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CountConnectionRequest); i { case 0: return &v.state @@ -494,7 +494,7 @@ func file_stream_proto_init() { return nil } } - file_stream_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_stream_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CountConnectionResponse); i { case 0: return &v.state @@ -506,7 +506,7 @@ func file_stream_proto_init() { return nil } } - file_stream_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_stream_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PushStreamRequest); i { case 0: return &v.state @@ -518,7 +518,7 @@ func file_stream_proto_init() { return nil } } - file_stream_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_stream_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PushStreamBatchRequest); i { case 0: return &v.state @@ -530,7 +530,7 @@ func file_stream_proto_init() { return nil } } - file_stream_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_stream_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PushStreamResponse); i { case 0: return &v.state @@ -542,7 +542,7 @@ func file_stream_proto_init() { return nil } } - file_stream_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_stream_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StreamEventRequest); i { case 0: return &v.state @@ -554,7 +554,7 @@ func file_stream_proto_init() { return nil } } - file_stream_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_stream_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StreamEventResponse); i { case 0: return &v.state diff --git a/pkg/proto/stream_grpc.pb.go b/pkg/proto/stream_grpc.pb.go index ef641bd..2f9c071 100644 --- a/pkg/proto/stream_grpc.pb.go +++ b/pkg/proto/stream_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.27.1 // source: stream.proto @@ -15,15 +15,8 @@ import ( // 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.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - StreamController_CountStreamConnection_FullMethodName = "/proto.StreamController/CountStreamConnection" - StreamController_PushStream_FullMethodName = "/proto.StreamController/PushStream" - StreamController_PushStreamBatch_FullMethodName = "/proto.StreamController/PushStreamBatch" - StreamController_EmitStreamEvent_FullMethodName = "/proto.StreamController/EmitStreamEvent" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // StreamControllerClient is the client API for StreamController service. // @@ -44,9 +37,8 @@ func NewStreamControllerClient(cc grpc.ClientConnInterface) StreamControllerClie } func (c *streamControllerClient) CountStreamConnection(ctx context.Context, in *CountConnectionRequest, opts ...grpc.CallOption) (*CountConnectionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CountConnectionResponse) - err := c.cc.Invoke(ctx, StreamController_CountStreamConnection_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.StreamController/CountStreamConnection", in, out, opts...) if err != nil { return nil, err } @@ -54,9 +46,8 @@ func (c *streamControllerClient) CountStreamConnection(ctx context.Context, in * } func (c *streamControllerClient) PushStream(ctx context.Context, in *PushStreamRequest, opts ...grpc.CallOption) (*PushStreamResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PushStreamResponse) - err := c.cc.Invoke(ctx, StreamController_PushStream_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.StreamController/PushStream", in, out, opts...) if err != nil { return nil, err } @@ -64,9 +55,8 @@ func (c *streamControllerClient) PushStream(ctx context.Context, in *PushStreamR } func (c *streamControllerClient) PushStreamBatch(ctx context.Context, in *PushStreamBatchRequest, opts ...grpc.CallOption) (*PushStreamResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PushStreamResponse) - err := c.cc.Invoke(ctx, StreamController_PushStreamBatch_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.StreamController/PushStreamBatch", in, out, opts...) if err != nil { return nil, err } @@ -74,9 +64,8 @@ func (c *streamControllerClient) PushStreamBatch(ctx context.Context, in *PushSt } func (c *streamControllerClient) EmitStreamEvent(ctx context.Context, in *StreamEventRequest, opts ...grpc.CallOption) (*StreamEventResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StreamEventResponse) - err := c.cc.Invoke(ctx, StreamController_EmitStreamEvent_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.StreamController/EmitStreamEvent", in, out, opts...) if err != nil { return nil, err } @@ -133,7 +122,7 @@ func _StreamController_CountStreamConnection_Handler(srv interface{}, ctx contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: StreamController_CountStreamConnection_FullMethodName, + FullMethod: "/proto.StreamController/CountStreamConnection", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StreamControllerServer).CountStreamConnection(ctx, req.(*CountConnectionRequest)) @@ -151,7 +140,7 @@ func _StreamController_PushStream_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: StreamController_PushStream_FullMethodName, + FullMethod: "/proto.StreamController/PushStream", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StreamControllerServer).PushStream(ctx, req.(*PushStreamRequest)) @@ -169,7 +158,7 @@ func _StreamController_PushStreamBatch_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: StreamController_PushStreamBatch_FullMethodName, + FullMethod: "/proto.StreamController/PushStreamBatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StreamControllerServer).PushStreamBatch(ctx, req.(*PushStreamBatchRequest)) @@ -187,7 +176,7 @@ func _StreamController_EmitStreamEvent_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: StreamController_EmitStreamEvent_FullMethodName, + FullMethod: "/proto.StreamController/EmitStreamEvent", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StreamControllerServer).EmitStreamEvent(ctx, req.(*StreamEventRequest))