From 0e18a63f107f11c2b26555263e162ee2b7946df3 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Fri, 18 Aug 2023 23:59:15 +0300 Subject: [PATCH] use worker Signed-off-by: Vasiliy Tolstov --- Makefile | 2 +- cmd/pkgdash/main.go | 49 +- database.db | Bin 0 -> 32768 bytes go.mod | 33 +- go.sum | 64 +- internal/config/config.go | 12 +- internal/database/database.go | 253 ++++ internal/database/embed.go | 8 + .../postgres/000001_init_schema.down.sql | 0 .../postgres/000001_init_schema.up.sql | 0 .../sqlite/000001_init_schema.down.sql | 4 + .../sqlite/000001_init_schema.up.sql | 38 + internal/handler/comments_create.go | 4 +- internal/handler/comments_delete.go | 4 +- internal/handler/comments_list.go | 4 +- internal/handler/handler.go | 40 +- internal/handler/modules_list.go | 4 +- internal/handler/packages_create.go | 25 +- internal/handler/packages_delete.go | 4 +- internal/handler/packages_list.go | 8 +- internal/handler/packages_lookup.go | 33 + internal/handler/packages_update.go | 10 +- internal/models/models.go | 43 +- internal/service/client_git/client_test.go | 81 -- internal/service/service.go | 154 --- .../sqlite/000001_init_schema.down.sql | 5 - .../sqlite/000001_init_schema.up.sql | 39 - internal/storage/sqlite/queries.go | 40 +- internal/storage/sqlite/storage.go | 267 ++-- internal/storage/storage.go | 49 +- .../client_git/client.go => worker/worker.go} | 111 +- local.yaml | 8 + proto/apidocs.swagger.yaml | 90 +- proto/pkgdash.pb.go | 1103 +++++++++++------ proto/pkgdash.pb.validate.go | 542 +++++++- proto/pkgdash.proto | 57 +- proto/pkgdash_micro.pb.go | 4 + proto/pkgdash_micro_http.pb.go | 60 + ui/src/app/api/models.ts | 2 + ui/src/app/api/models/comment.ts | 2 +- ui/src/app/api/models/comments-create-req.ts | 2 +- ui/src/app/api/models/package.ts | 7 +- ui/src/app/api/models/packages-create-rsp.ts | 3 +- ui/src/app/api/models/packages-lookup-rsp.ts | 6 + ui/src/app/api/models/packages-modules-rsp.ts | 6 + .../api/services/pkgdash-service.service.ts | 96 ++ 46 files changed, 2195 insertions(+), 1181 deletions(-) create mode 100644 database.db create mode 100644 internal/database/database.go create mode 100644 internal/database/embed.go rename internal/{storage => database}/migrations/postgres/000001_init_schema.down.sql (100%) rename internal/{storage => database}/migrations/postgres/000001_init_schema.up.sql (100%) create mode 100644 internal/database/migrations/sqlite/000001_init_schema.down.sql create mode 100644 internal/database/migrations/sqlite/000001_init_schema.up.sql create mode 100644 internal/handler/packages_lookup.go delete mode 100644 internal/service/client_git/client_test.go delete mode 100644 internal/service/service.go delete mode 100644 internal/storage/migrations/sqlite/000001_init_schema.down.sql delete mode 100644 internal/storage/migrations/sqlite/000001_init_schema.up.sql rename internal/{service/client_git/client.go => worker/worker.go} (66%) create mode 100644 local.yaml create mode 100644 ui/src/app/api/models/packages-lookup-rsp.ts create mode 100644 ui/src/app/api/models/packages-modules-rsp.ts diff --git a/Makefile b/Makefile index d389b69..c6b7ae8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: build build: - go build -o bin/app -mod=readonly git.unistack.org/unistack-org/pkgdash/cmd/pkgdash + CGO_ENABLED=0 go build -o bin/app -mod=readonly git.unistack.org/unistack-org/pkgdash/cmd/pkgdash .PHONY: test test: diff --git a/cmd/pkgdash/main.go b/cmd/pkgdash/main.go index a24631d..30eb6b3 100644 --- a/cmd/pkgdash/main.go +++ b/cmd/pkgdash/main.go @@ -7,21 +7,27 @@ import ( "time" appconfig "git.unistack.org/unistack-org/pkgdash/internal/config" + "git.unistack.org/unistack-org/pkgdash/internal/database" "git.unistack.org/unistack-org/pkgdash/internal/handler" - "git.unistack.org/unistack-org/pkgdash/internal/service/client_git" + "git.unistack.org/unistack-org/pkgdash/internal/storage" + _ "git.unistack.org/unistack-org/pkgdash/internal/storage/sqlite" + "git.unistack.org/unistack-org/pkgdash/internal/worker" pb "git.unistack.org/unistack-org/pkgdash/proto" jsoncodec "go.unistack.org/micro-codec-json/v4" + jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v4" yamlcodec "go.unistack.org/micro-codec-yaml/v4" envconfig "go.unistack.org/micro-config-env/v4" fileconfig "go.unistack.org/micro-config-file/v4" vaultconfig "go.unistack.org/micro-config-vault/v4" zlogger "go.unistack.org/micro-logger-zerolog/v4" + victoriameter "go.unistack.org/micro-meter-victoriametrics/v4" httpsrv "go.unistack.org/micro-server-http/v4" healthhandler "go.unistack.org/micro-server-http/v4/handler/health" meterhandler "go.unistack.org/micro-server-http/v4/handler/meter" "go.unistack.org/micro/v4" "go.unistack.org/micro/v4/config" "go.unistack.org/micro/v4/logger" + "go.unistack.org/micro/v4/meter" "go.unistack.org/micro/v4/options" "go.unistack.org/micro/v4/server" rutil "go.unistack.org/micro/v4/util/reflect" @@ -38,7 +44,7 @@ func main() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - logger.DefaultLogger = zlogger.NewLogger(zlogger.ReportCaller(), logger.WithLevel(logger.DebugLevel), logger.WithCallerSkipCount(3)) + logger.DefaultLogger = zlogger.NewLogger(zlogger.ReportCaller(), logger.WithLevel(logger.DebugLevel), logger.WithCallerSkipCount(4)) if err := logger.DefaultLogger.Init(); err != nil { logger.Fatalf(ctx, "failed to init logger") } @@ -87,9 +93,17 @@ func main() { logger.Fatalf(ctx, "failed to validate config: %v", err) } + meter.DefaultMeter = victoriameter.NewMeter( + meter.Path(cfg.Meter.Path), + meter.WriteFDMetrics(true), + meter.WriteProcessMetrics(true), + options.Address(cfg.Meter.Addr), + ) + svc := micro.NewService() if err := svc.Init( + micro.Server(httpsrv.NewServer()), micro.Name(cfg.Server.Name), micro.Version(cfg.Server.Version), ); err != nil { @@ -100,13 +114,30 @@ func main() { options.Address(cfg.Server.Addr), options.Name(cfg.Server.Name), server.Version(cfg.Server.Version), + options.Codecs("application/json", jsonpbcodec.NewCodec()), + options.Address(cfg.Server.Addr), + options.Context(ctx), ); err != nil { logger.Fatalf(ctx, "failed to init service: %v", err) } - h := handler.NewHandler(svc, client_git.NewClient(5)) - if err := h.Init(svc.Options().Context); err != nil { - logger.Fatalf(ctx, "failed to init handler: %v", err) + if err := database.ParseDSN(cfg.Database); err != nil { + logger.Fatalf(ctx, "failed to init database: %v", err) + } + + db, err := database.Connect(ctx, cfg.Database, logger.DefaultLogger) + if err != nil { + logger.Fatalf(ctx, "failed to connect database: %v", err) + } + + store, err := storage.NewStorage(cfg.Database.Type, db) + if err != nil { + logger.Fatalf(ctx, "failed to init storage: %v", err) + } + + h, err := handler.NewHandler(store) + if err != nil { + logger.Fatalf(ctx, "failed to create handler: %v", err) } log := logger.NewLogger( @@ -179,4 +210,12 @@ func main() { } } }() + + go func() { + worker.Run(ctx, store, time.Duration(cfg.App.CheckInterval)) + }() + + if err = svc.Run(); err != nil { + logger.Fatalf(ctx, "failed to run svc: %v", err) + } } diff --git a/database.db b/database.db new file mode 100644 index 0000000000000000000000000000000000000000..a72196bb69a05a2a4dbbf17e9fb6deaa3330377d GIT binary patch literal 32768 zcmeI*&rah;90zcl0C5PAN>vphggU1ch)rT+%s;78X+bNrD;9RyYI~xCGZ-te9sCEu zsbX36(0gB@QV)HAK0x20Pf+#VW2>q^+i}E&x%=>hDH<|5*!V*5~__o9SGu9Gkj7OnoyQVK3;fBoh=pD7&kCQ`O?g)0m zee;O>S2jg{`J^Hb!tk!aFUKn z8=Za@`#P!1aqBL+rgB~EE@#$LX^rpJkSz8_iq+|9`R&(boqN|t;3vr9HOLvb43qz~>I*cmET=Nj^P z#de$GwA=ank!zE2Kr`Oq`;Kk-JfuMt6uLOCwzqa)ZL+QHjm_7r{}}dsn++VtX1hDh z*>bVkpyK4TL$4MvaO6;5cMNRq1!fVQ_LmkPH*G&WV+Wqso{O)|<;outy^tUP0SG_< z0uX=z1Rwwb2tWV=5O{b31-VdC#;9F#gU90Z-R-@y4p?44+ zo@jMlt*hO|g1VsB)RmgH!WPsuV`)v(a#3qhwW*Y@ zXLi~M&H^fd8bzO)cGI>!Ehb*aXe#frh3d{sA%_wSM8k&|^iqDW8ll1{C67UM^0G+VX>#B88jkQSj~b`f zHG@VV4V0V+Iaxae8qI0%Tn0@iOe2cyW;`|033AhjdqXso2P4K^|L(jq>Uum=>UvJ4 zac;xsdTrzRlbD+x+F)uRL(ifVzB>EKU0xF%ojS literal 0 HcmV?d00001 diff --git a/go.mod b/go.mod index e685e88..f100896 100644 --- a/go.mod +++ b/go.mod @@ -7,22 +7,35 @@ require ( github.com/go-git/go-git/v5 v5.8.1 github.com/golang-migrate/migrate/v4 v4.15.1 github.com/google/uuid v1.3.0 - github.com/jackc/pgtype v1.14.0 + github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c + github.com/jmoiron/sqlx v1.3.1 github.com/lib/pq v1.10.2 - github.com/mattn/go-sqlite3 v1.14.16 github.com/pkg/errors v0.9.1 + go.unistack.org/micro-client-http/v4 v4.0.2 + go.unistack.org/micro-codec-json/v4 v4.0.0 + go.unistack.org/micro-codec-jsonpb/v4 v4.0.0 + go.unistack.org/micro-codec-yaml/v4 v4.0.0 + go.unistack.org/micro-config-env/v4 v4.0.1 + go.unistack.org/micro-config-file/v4 v4.0.1 go.unistack.org/micro-config-flag/v4 v4.0.2 + go.unistack.org/micro-config-vault/v4 v4.0.2 + go.unistack.org/micro-logger-zerolog/v4 v4.0.3 + go.unistack.org/micro-meter-victoriametrics/v4 v4.0.1 go.unistack.org/micro-proto/v4 v4.0.1 - go.unistack.org/micro-server-http/v4 v4.0.11 + go.unistack.org/micro-server-http/v4 v4.0.12 go.unistack.org/micro/v4 v4.0.7 - go.unistack.org/protoc-gen-go-micro/v4 v4.0.6 + go.unistack.org/protoc-gen-go-micro/v4 v4.0.7 golang.org/x/mod v0.12.0 golang.org/x/sync v0.3.0 google.golang.org/protobuf v1.31.0 - go.unistack.org/micro-client-http/v4 v4.0.2 + modernc.org/sqlite v1.21.0 +) + +require ( dario.cat/mergo v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect + github.com/VictoriaMetrics/metrics v1.24.0 // indirect github.com/acomagu/bufpipe v1.0.4 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/cloudflare/circl v1.3.3 // indirect @@ -54,7 +67,7 @@ require ( github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgproto3/v2 v2.1.1 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect - github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c // indirect + github.com/jackc/pgtype v1.14.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect @@ -71,11 +84,10 @@ require ( github.com/sergi/go-diff v1.1.0 // indirect github.com/skeema/knownhosts v1.2.0 // indirect github.com/spf13/afero v1.3.3 // indirect - github.com/stretchr/testify v1.8.3 // indirect + github.com/valyala/fastrand v1.1.0 // indirect + github.com/valyala/histogram v1.2.0 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect go.uber.org/atomic v1.6.0 // indirect - go.unistack.org/micro-config-vault/v4 v4.0.2 // indirect - go.unistack.org/micro-logger-zerolog/v4 v4.0.3 // indirect golang.org/x/crypto v0.12.0 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect golang.org/x/net v0.14.0 // indirect @@ -84,6 +96,7 @@ require ( golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.11.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/uint128 v1.3.0 // indirect modernc.org/cc/v3 v3.40.0 // indirect @@ -92,7 +105,7 @@ require ( modernc.org/mathutil v1.5.0 // indirect modernc.org/memory v1.5.0 // indirect modernc.org/opt v0.1.3 // indirect - modernc.org/sqlite v1.21.0 // indirect modernc.org/strutil v1.1.3 // indirect modernc.org/token v1.1.0 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index aae8595..a3afacd 100644 --- a/go.sum +++ b/go.sum @@ -98,6 +98,8 @@ github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjA github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= +github.com/VictoriaMetrics/metrics v1.24.0 h1:ILavebReOjYctAGY5QU2F9X0MYvkcrG3aEn2RKa1Zkw= +github.com/VictoriaMetrics/metrics v1.24.0/go.mod h1:eFT25kvsTidQFHb6U0oa0rTrDRdz4xTYjpL8+UPohys= github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -288,7 +290,6 @@ github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= @@ -355,6 +356,7 @@ github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBF github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= @@ -407,8 +409,10 @@ github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8 github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= @@ -566,16 +570,15 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= @@ -682,6 +685,7 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/jmoiron/sqlx v1.3.1 h1:aLN7YINNZ7cYOPK3QC83dbM6KT0NMqVMw961TqrejlE= github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -766,8 +770,6 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -775,7 +777,6 @@ github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vq github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= @@ -920,12 +921,9 @@ github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= -github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -981,8 +979,6 @@ github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -990,11 +986,7 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= @@ -1007,6 +999,10 @@ github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8= +github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= +github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ= +github.com/valyala/histogram v1.2.0/go.mod h1:Hb4kBwb4UxsaNbbbh+RRz8ZR6pdodR57tzWUS3BUzXY= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= @@ -1067,24 +1063,32 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.unistack.org/micro-client-http/v4 v4.0.2 h1:0xsm2RCRWMfb1moeXQQ220uz52XE0R/PZvM9was/4lM= go.unistack.org/micro-client-http/v4 v4.0.2/go.mod h1:Z9QT/upeqrp/rXVkL0lk6AzrkTdes0W3QlFlZ+ytkqM= +go.unistack.org/micro-codec-json/v4 v4.0.0 h1:lkX1s2abwoluGt1MhxxyaNWWOAAq8HZ8SLn9GhC45Pk= +go.unistack.org/micro-codec-json/v4 v4.0.0/go.mod h1:J0y3gsIGxQPVRgESbSKINtU7fOzigthyKil0zlwvNiA= +go.unistack.org/micro-codec-jsonpb/v4 v4.0.0 h1:6ODX2ohojEGjgQ9AOC99nQbtBDaArSwzK2qLPRPLHug= +go.unistack.org/micro-codec-jsonpb/v4 v4.0.0/go.mod h1:le+HSPPTutQlPgrgRCusNvQ57ujHRBr1ZBGJachZJzU= +go.unistack.org/micro-codec-yaml/v4 v4.0.0 h1:DK/+fA69gmnvYmGHe3kqVR0pukS8ank5lPG4MfdPQEk= +go.unistack.org/micro-codec-yaml/v4 v4.0.0/go.mod h1:UG4ouILbUfgNL7nvp7CpmD2IIzO8bQHjzDIahOvIAgM= +go.unistack.org/micro-config-env/v4 v4.0.1 h1:A7W+Xm4WEsN9O6isWncfwNWEUuSuCHgt+aovpZ4XhuE= +go.unistack.org/micro-config-env/v4 v4.0.1/go.mod h1:kJvyLrRbVRrsM1jTdl5lHy4u88PnlK2mskOZ3T57M/0= +go.unistack.org/micro-config-file/v4 v4.0.1 h1:J8CNyOvxfL4CnoL2xocvyWHo77UWF8wvH4To23E0gOA= +go.unistack.org/micro-config-file/v4 v4.0.1/go.mod h1:OSfm+CIjAgb0HRlXCZd0DUtDwV5zJKXMHduSiGsSY0M= go.unistack.org/micro-config-flag/v4 v4.0.2 h1:qoDpT/H8a8TYZS9ucoNC0bLhNdp+UFlhnRWOuqIKAyo= go.unistack.org/micro-config-flag/v4 v4.0.2/go.mod h1:s0AYvz8rRtMHG2tkXoSmF8xFuHG12x3v1NERdMHDdiQ= go.unistack.org/micro-config-vault/v4 v4.0.2 h1:QhDdtVJhQYmJZqAhsLRdnDZSZSzBunWX9a5l/WNKWNY= go.unistack.org/micro-config-vault/v4 v4.0.2/go.mod h1:0gWQVkncMwaG0wZPqC98HhS6AYOcXR0lmPG/roR6AcM= -go.unistack.org/micro-logger-zerolog/v4 v4.0.2 h1:uKj/ZRiyEyiarImCm5Q3F6FvSvombZXB5aW4UGC2wVw= -go.unistack.org/micro-logger-zerolog/v4 v4.0.2/go.mod h1:EOtcMZ5WfBe9sUoYkWPurnY18uaUaeKDlMdSdaaqYz0= go.unistack.org/micro-logger-zerolog/v4 v4.0.3 h1:ao6jGMo8jJG9WcOE738eqrWeabQaqpHMrLx+IniRDpI= go.unistack.org/micro-logger-zerolog/v4 v4.0.3/go.mod h1:w5iq5eT/ZUAczueU5lsChJK/evwofGcs3gz5rZwyivQ= +go.unistack.org/micro-meter-victoriametrics/v4 v4.0.1 h1:r/AyMnwPLfP4l3Ja0X2NTOF8bvr6nIKqGAn33uAfqio= +go.unistack.org/micro-meter-victoriametrics/v4 v4.0.1/go.mod h1:QQo/Hs6XuvFQViCPAJ+CAlP2Q/+QppI0g2hiPfJ76UU= go.unistack.org/micro-proto/v4 v4.0.1 h1:2RKHgtCOOcAFgKsnngGK5bqM/6MWXOjVCdw03dbuoF8= go.unistack.org/micro-proto/v4 v4.0.1/go.mod h1:ArmK7o+uFvxSY3dbJhKBBX4Pm1rhWdLEFf3LxBrMtec= -go.unistack.org/micro-server-http/v4 v4.0.9 h1:ye7LVVJSXlvE1TBvEuk4m3iZrAJk0rzs6vD2/qO/o2w= -go.unistack.org/micro-server-http/v4 v4.0.9/go.mod h1:Cu4utVz2u98fychmjA2Ls6clXrja0sqH6Xu/JTamf7Y= -go.unistack.org/micro/v4 v4.0.6 h1:YFWvTh3VwyOd6NHYTQcf47n2TF5+p/EhpnbuBQX3qhk= -go.unistack.org/micro/v4 v4.0.6/go.mod h1:bVEYTlPi0EsdgZZt311bIroDg9ict7ky3C87dSCCAGk= +go.unistack.org/micro-server-http/v4 v4.0.12 h1:cwlA9t/iNlQ/+LvYRxpreU3v3xRQYKQGVfvLpH3BM8I= +go.unistack.org/micro-server-http/v4 v4.0.12/go.mod h1:mQ18qN/1PxeTCKMNslh5qgswV582DP9QnsaI/ohFo/k= go.unistack.org/micro/v4 v4.0.7 h1:2lwtZlHcSwgkahhFbkI4x1lOS79lw8uLHtcEhlFF+AM= go.unistack.org/micro/v4 v4.0.7/go.mod h1:bVEYTlPi0EsdgZZt311bIroDg9ict7ky3C87dSCCAGk= -go.unistack.org/protoc-gen-go-micro/v4 v4.0.6 h1:qe6huziuXqRnsgvDSiaT1DR20iL676w37PMkdBEjvEk= -go.unistack.org/protoc-gen-go-micro/v4 v4.0.6/go.mod h1:9bsKAlESlPXPBSmY/NDLL//smZbhnEMrnWyG+M8zVFA= +go.unistack.org/protoc-gen-go-micro/v4 v4.0.7 h1:c3CeBvjWV9MBrGGPaQCcHZrnuLY9sVJHv7vACI/dvuM= +go.unistack.org/protoc-gen-go-micro/v4 v4.0.7/go.mod h1:9bsKAlESlPXPBSmY/NDLL//smZbhnEMrnWyG+M8zVFA= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1113,8 +1117,6 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1229,8 +1231,6 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1369,8 +1369,6 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1379,7 +1377,6 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1393,8 +1390,6 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1661,6 +1656,7 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -1764,3 +1760,5 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/internal/config/config.go b/internal/config/config.go index d0818d4..c107624 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,8 +1,14 @@ package config -import "time" +import ( + "time" -type AppConfig struct{} + mtime "go.unistack.org/micro/v4/util/time" +) + +type AppConfig struct { + CheckInterval mtime.Duration `json:"check_interval" yaml:"check_interval" default:"1d"` +} type ServerConfig struct { Name string `json:"name" yaml:"name"` @@ -24,7 +30,7 @@ type TracerConfig struct { type VaultConfig struct { Addr string `env:"VAULT_ADDR" json:"addr" yaml:"addr" default:"http://127.0.0.1:8200"` Token string `env:"VAULT_TOKEN" json:"-" yaml:"-"` - Path string `env:"VAULT_PATH" json:"-" yaml:"-" default:"apigw/data/authn"` + Path string `env:"VAULT_PATH" json:"-" yaml:"-" default:"pkgdash/data/pkgdash"` } type MeterConfig struct { diff --git a/internal/database/database.go b/internal/database/database.go new file mode 100644 index 0000000..2020281 --- /dev/null +++ b/internal/database/database.go @@ -0,0 +1,253 @@ +package database + +import ( + "context" + "fmt" + "net/url" + "strconv" + "strings" + "time" + + appconfig "git.unistack.org/unistack-org/pkgdash/internal/config" + "github.com/golang-migrate/migrate/v4" + "github.com/golang-migrate/migrate/v4/database" + mpgx "github.com/golang-migrate/migrate/v4/database/pgx" + msqlite "github.com/golang-migrate/migrate/v4/database/sqlite" + "github.com/golang-migrate/migrate/v4/source/iofs" + "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/stdlib" + "github.com/jmoiron/sqlx" + "go.unistack.org/micro/v4/logger" + _ "modernc.org/sqlite" +) + +func ParseDSN(cfg *appconfig.DatabaseConfig) error { + var err error + + u, err := url.Parse(cfg.DSN) + if err != nil { + return err + } + + values := u.Query() + var value string + + if value = values.Get("conn_max"); value != "" { + values.Del("conn_max") + maxOpenConns, err := strconv.Atoi(value) + if err != nil { + return err + } + cfg.MaxOpenConns = maxOpenConns + cfg.MaxIdleConns = maxOpenConns / 2 + } + + if value = values.Get("conn_maxidle"); value != "" { + values.Del("conn_maxidle") + maxIdleConns, err := strconv.Atoi(value) + if err != nil { + return err + } + cfg.MaxIdleConns = maxIdleConns + } + + if value = values.Get("conn_lifetime"); value != "" { + values.Del("conn_lifetime") + connMaxLifetime, err := time.ParseDuration(value) + if err != nil { + return err + } + cfg.ConnMaxLifetime = connMaxLifetime + } + + if value = values.Get("conn_maxidletime"); value != "" { + values.Del("conn_maxidletime") + connMaxIdleTime, err := time.ParseDuration(value) + if err != nil { + return err + } + cfg.ConnMaxIdleTime = connMaxIdleTime + } + + if mtype := values.Get("migrate"); mtype != "" { + values.Del("migrate") + cfg.Migrate = mtype + } + + switch u.Scheme { + case "postgres", "pgsql", "postgresql": + u.Scheme = "postgres" + case "sqlite", "sqlite3": + u.Scheme = "sqlite" + default: + return fmt.Errorf("unknown database %s", u.Scheme) + } + + cfg.Type = u.Scheme + u.RawQuery = values.Encode() + + cfg.ConnStr = u.String() + + return nil +} + +func connect(ctx context.Context, cfg *appconfig.DatabaseConfig, log logger.Logger) (*sqlx.DB, error) { + var db *sqlx.DB + var err error + + log.Infof(ctx, "connect to %s", cfg.Type) + switch cfg.Type { + case "postgres", "pgsql", "postgresql": + db, err = connectPostgres(ctx, cfg.ConnStr) + cfg.Type = "postgres" + case "sqlite", "sqlite3": + db, err = connectSqlite(ctx, cfg.ConnStr) + cfg.Type = "sqlite" + default: + return nil, fmt.Errorf("unknown database type %s", cfg.Type) + } + + if err != nil { + return nil, err + } + + return db, nil +} + +func Connect(ctx context.Context, cfg *appconfig.DatabaseConfig, log logger.Logger) (*sqlx.DB, error) { + db, err := connect(ctx, cfg, log) + if err != nil { + return nil, err + } + m, err := migratePrepare(ctx, db, log, cfg.Type) + if err != nil { + return nil, err + } + + switch cfg.Migrate { + case "": + break + case "up": + logger.Infof(ctx, "migrate up") + err = m.Up() + case "down": + logger.Infof(ctx, "migrate down") + err = m.Down() + case "seed": + logger.Infof(ctx, "migrate seed") + if err = m.Drop(); err == nil { + err = m.Up() + } + default: + logger.Infof(ctx, "migrate version") + v, verr := strconv.ParseUint(cfg.Type, 10, 64) + if verr != nil { + return nil, err + } + err = m.Migrate(uint(v)) + } + + if err == nil || err == migrate.ErrNoChange { + srcerr, dberr := m.Close() + if srcerr != nil { + err = srcerr + } else if dberr != nil { + err = dberr + } else { + err = nil + } + } + + if err == nil { + db, err = connect(ctx, cfg, log) + } + + if err != nil { + return nil, err + } + + db.SetConnMaxIdleTime(cfg.ConnMaxIdleTime) + db.SetConnMaxLifetime(cfg.ConnMaxLifetime) + db.SetMaxIdleConns(cfg.MaxIdleConns) + db.SetMaxOpenConns(cfg.MaxOpenConns) + + return db, nil +} + +func connectSqlite(ctx context.Context, connstr string) (*sqlx.DB, error) { + if !strings.Contains(connstr, ":memory:") { + return sqlx.ConnectContext(ctx, "sqlite", "file:"+connstr[9:]) + } + return sqlx.ConnectContext(ctx, "sqlite", connstr[9:]) +} + +func connectPostgres(ctx context.Context, connstr string) (*sqlx.DB, error) { + // parse connection string + dbConf, err := pgx.ParseConfig(connstr) + if err != nil { + return nil, err + } + + // needed for pgbouncer + dbConf.RuntimeParams = map[string]string{ + "standard_conforming_strings": "on", + "application_name": "authn", + } + + // may be needed for pbbouncer, needs to check + // dbConf.PreferSimpleProtocol = true + // register pgx conn + connStr := stdlib.RegisterConnConfig(dbConf) + + db, err := sqlx.ConnectContext(ctx, "pgx", connStr) + if err != nil { + return nil, err + } + + return db, nil +} + +func migratePrepare(ctx context.Context, db *sqlx.DB, log logger.Logger, dbtype string) (*migrate.Migrate, error) { + var driver database.Driver + var err error + + switch dbtype { + case "postgres": + driver, err = mpgx.WithInstance(db.DB, &mpgx.Config{ + DatabaseName: "pkgdash", + MigrationsTable: "schema_migrations", + }) + case "sqlite": + driver, err = msqlite.WithInstance(db.DB, &msqlite.Config{ + DatabaseName: "pkgdash", + MigrationsTable: "schema_migrations", + }) + } + + if err != nil { + return nil, err + } + source, err := iofs.New(assets, "migrations/"+dbtype) + if err != nil { + return nil, err + } + m, err := migrate.NewWithInstance("fs", source, "apigw", driver) + if err != nil { + return nil, err + } + m.Log = &mLog{ctx: ctx, l: log} + return m, nil +} + +type mLog struct { + ctx context.Context + l logger.Logger +} + +func (l *mLog) Verbose() bool { + return l.l.V(logger.DebugLevel) +} + +func (l *mLog) Printf(format string, v ...interface{}) { + l.l.Infof(l.ctx, format, v...) +} diff --git a/internal/database/embed.go b/internal/database/embed.go new file mode 100644 index 0000000..e4476cf --- /dev/null +++ b/internal/database/embed.go @@ -0,0 +1,8 @@ +package database + +import ( + "embed" +) + +//go:embed migrations +var assets embed.FS diff --git a/internal/storage/migrations/postgres/000001_init_schema.down.sql b/internal/database/migrations/postgres/000001_init_schema.down.sql similarity index 100% rename from internal/storage/migrations/postgres/000001_init_schema.down.sql rename to internal/database/migrations/postgres/000001_init_schema.down.sql diff --git a/internal/storage/migrations/postgres/000001_init_schema.up.sql b/internal/database/migrations/postgres/000001_init_schema.up.sql similarity index 100% rename from internal/storage/migrations/postgres/000001_init_schema.up.sql rename to internal/database/migrations/postgres/000001_init_schema.up.sql diff --git a/internal/database/migrations/sqlite/000001_init_schema.down.sql b/internal/database/migrations/sqlite/000001_init_schema.down.sql new file mode 100644 index 0000000..39878a8 --- /dev/null +++ b/internal/database/migrations/sqlite/000001_init_schema.down.sql @@ -0,0 +1,4 @@ +drop table if exists packages; +drop table if exists modules; +drop table if exists issues; +drop table if exists comments; \ No newline at end of file diff --git a/internal/database/migrations/sqlite/000001_init_schema.up.sql b/internal/database/migrations/sqlite/000001_init_schema.up.sql new file mode 100644 index 0000000..6771d97 --- /dev/null +++ b/internal/database/migrations/sqlite/000001_init_schema.up.sql @@ -0,0 +1,38 @@ +create table if not exists comments ( + id integer primary key autoincrement not null, + comment text, + package integer not null, + created timestamp not null default current_timestamp, + updated timestamp not null default current_timestamp +); + +create table if not exists modules ( + id integer primary key autoincrement not null, + name varchar not null , + version varchar not null, + package integer not null, + last_version varchar not null, + created timestamp not null default current_timestamp, + updated timestamp not null default current_timestamp +); + +create table if not exists issues ( + id integer primary key autoincrement not null, + status integer default 0, + comment varchar, + created timestamp not null default current_timestamp, + updated timestamp not null default current_timestamp +); + +create table if not exists packages ( + id integer primary key autoincrement not null, + name varchar not null, + url varchar not null, + modules integer default 0, + issues integer default 0, + comments integer default 0, + created timestamp not null default current_timestamp, + updated timestamp not null default current_timestamp, + status integer default 1, + last_check timestamp +); diff --git a/internal/handler/comments_create.go b/internal/handler/comments_create.go index 7dfa279..747aa33 100644 --- a/internal/handler/comments_create.go +++ b/internal/handler/comments_create.go @@ -6,13 +6,13 @@ import ( "errors" "net/http" - httpsrv "go.unistack.org/micro-server-http/v4" "git.unistack.org/unistack-org/pkgdash/internal/models" pb "git.unistack.org/unistack-org/pkgdash/proto" + httpsrv "go.unistack.org/micro-server-http/v4" + "go.unistack.org/micro/v4/logger" ) func (h *Handler) CommentsCreate(ctx context.Context, req *pb.CommentsCreateReq, rsp *pb.CommentsCreateRsp) error { - logger := h.svc.Logger() logger.Debug(ctx, "Start AddComment") err := req.Validate() diff --git a/internal/handler/comments_delete.go b/internal/handler/comments_delete.go index faf6d4e..eadce29 100644 --- a/internal/handler/comments_delete.go +++ b/internal/handler/comments_delete.go @@ -6,12 +6,12 @@ import ( "errors" "net/http" - httpsrv "go.unistack.org/micro-server-http/v4" pb "git.unistack.org/unistack-org/pkgdash/proto" + httpsrv "go.unistack.org/micro-server-http/v4" + "go.unistack.org/micro/v4/logger" ) func (h *Handler) CommentsDelete(ctx context.Context, req *pb.CommentsDeleteReq, rsp *pb.CommentsDeleteRsp) error { - logger := h.svc.Logger() logger.Debug(ctx, "Start AddComment") err := req.Validate() diff --git a/internal/handler/comments_list.go b/internal/handler/comments_list.go index af888b9..b9a2c5e 100644 --- a/internal/handler/comments_list.go +++ b/internal/handler/comments_list.go @@ -4,13 +4,13 @@ import ( "context" "net/http" - httpsrv "go.unistack.org/micro-server-http/v4" "git.unistack.org/unistack-org/pkgdash/internal/models" pb "git.unistack.org/unistack-org/pkgdash/proto" + httpsrv "go.unistack.org/micro-server-http/v4" + "go.unistack.org/micro/v4/logger" ) func (h *Handler) CommentsList(ctx context.Context, req *pb.CommentsListReq, rsp *pb.CommentsListRsp) error { - logger := h.svc.Logger() logger.Debug(ctx, "Start GetModule") err := req.Validate() diff --git a/internal/handler/handler.go b/internal/handler/handler.go index 64252e6..647e452 100644 --- a/internal/handler/handler.go +++ b/internal/handler/handler.go @@ -1,27 +1,19 @@ package handler import ( - "context" - "errors" "net/http" "strconv" - "github.com/google/uuid" - "go.unistack.org/micro/v4" - cligit "git.unistack.org/unistack-org/pkgdash/internal/service/client_git" "git.unistack.org/unistack-org/pkgdash/internal/storage" pb "git.unistack.org/unistack-org/pkgdash/proto" - "google.golang.org/protobuf/encoding/protojson" + "github.com/google/uuid" + jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v4" + "go.unistack.org/micro/v4/codec" ) type Handler struct { - svc micro.Service - store storage.Storage - - protojson.MarshalOptions - protojson.UnmarshalOptions - - git cligit.Client + store storage.Storage + codec codec.Codec chanUrl chan *pb.PackagesCreateReq } @@ -52,25 +44,11 @@ func NewValidationError(err error) *pb.ErrorRsp { } } -func NewHandler(svc micro.Service, client cligit.Client) *Handler { +func NewHandler(store storage.Storage) (*Handler, error) { h := &Handler{ - svc: svc, - git: client, - } - h.EmitUnpopulated = true - h.UseProtoNames = false - return h -} - -func (h *Handler) Init(ctx context.Context) error { - store, err := storage.FromContext(h.svc.Options().Context) - if err != nil { - return errors.New("missing storage") + codec: jsonpbcodec.NewCodec(), + store: store, } - h.chanUrl = h.git.Run(ctx, store) - - h.store = store - - return nil + return h, nil } diff --git a/internal/handler/modules_list.go b/internal/handler/modules_list.go index bae5a08..c1b3896 100644 --- a/internal/handler/modules_list.go +++ b/internal/handler/modules_list.go @@ -4,13 +4,13 @@ import ( "context" "net/http" - httpsrv "go.unistack.org/micro-server-http/v4" "git.unistack.org/unistack-org/pkgdash/internal/models" pb "git.unistack.org/unistack-org/pkgdash/proto" + httpsrv "go.unistack.org/micro-server-http/v4" + "go.unistack.org/micro/v4/logger" ) func (h *Handler) ModulesList(ctx context.Context, req *pb.ModulesListReq, rsp *pb.ModulesListRsp) error { - logger := h.svc.Logger() logger.Debug(ctx, "Start GetModule") err := req.Validate() diff --git a/internal/handler/packages_create.go b/internal/handler/packages_create.go index dd75b9e..4fdef05 100644 --- a/internal/handler/packages_create.go +++ b/internal/handler/packages_create.go @@ -4,29 +4,30 @@ import ( "context" "net/http" - httpsrv "go.unistack.org/micro-server-http/v4" + "git.unistack.org/unistack-org/pkgdash/internal/models" pb "git.unistack.org/unistack-org/pkgdash/proto" + httpsrv "go.unistack.org/micro-server-http/v4" + "go.unistack.org/micro/v4/logger" ) func (h *Handler) PackagesCreate(ctx context.Context, req *pb.PackagesCreateReq, rsp *pb.PackagesCreateRsp) error { - logger := h.svc.Logger() - logger.Debug(ctx, "Start AddPackage") + logger.Debug(ctx, "PackagesCreate handler start") - err := req.Validate() + if err := req.Validate(); err != nil { + logger.Error(ctx, err) + httpsrv.SetRspCode(ctx, http.StatusBadRequest) + return httpsrv.SetError(NewValidationError(err)) + } + + pkg, err := h.store.PackagesCreate(ctx, req) if err != nil { logger.Error(ctx, err) httpsrv.SetRspCode(ctx, http.StatusBadRequest) return httpsrv.SetError(NewValidationError(err)) } - if h.git.IsClose() { - logger.Error(ctx, "chan is closed") - } else { - h.chanUrl <- req - } + rsp.Package = models.NewPackage(pkg) - rsp.Status = "Sent" - - logger.Debug(ctx, "Success finish addPackage") + logger.Debug(ctx, "PackagesCreate handler stop") return nil } diff --git a/internal/handler/packages_delete.go b/internal/handler/packages_delete.go index 306a475..dc2d52c 100644 --- a/internal/handler/packages_delete.go +++ b/internal/handler/packages_delete.go @@ -4,12 +4,12 @@ import ( "context" "net/http" - httpsrv "go.unistack.org/micro-server-http/v4" pb "git.unistack.org/unistack-org/pkgdash/proto" + httpsrv "go.unistack.org/micro-server-http/v4" + "go.unistack.org/micro/v4/logger" ) func (h *Handler) PackagesDelete(ctx context.Context, req *pb.PackagesDeleteReq, rsp *pb.PackagesDeleteRsp) error { - logger := h.svc.Logger() logger.Debug(ctx, "Start UpdatePackage") if err := req.Validate(); err != nil { diff --git a/internal/handler/packages_list.go b/internal/handler/packages_list.go index 29255b3..a7ca5da 100644 --- a/internal/handler/packages_list.go +++ b/internal/handler/packages_list.go @@ -4,14 +4,14 @@ import ( "context" "net/http" - httpsrv "go.unistack.org/micro-server-http/v4" "git.unistack.org/unistack-org/pkgdash/internal/models" pb "git.unistack.org/unistack-org/pkgdash/proto" + httpsrv "go.unistack.org/micro-server-http/v4" + "go.unistack.org/micro/v4/logger" ) func (h *Handler) PackagesList(ctx context.Context, req *pb.PackagesListReq, rsp *pb.PackagesListRsp) error { - logger := h.svc.Logger() - logger.Debug(ctx, "Start getListPackage") + logger.Debug(ctx, "PackagesList handler start") packages, err := h.store.PackagesList(ctx, req) if err != nil { @@ -23,6 +23,6 @@ func (h *Handler) PackagesList(ctx context.Context, req *pb.PackagesListReq, rsp for _, pkg := range packages { rsp.Packages = append(rsp.Packages, models.NewPackage(pkg)) } - logger.Debug(ctx, "Success finish getListPackage") + logger.Debug(ctx, "PackagesList handler stop") return nil } diff --git a/internal/handler/packages_lookup.go b/internal/handler/packages_lookup.go new file mode 100644 index 0000000..1157b23 --- /dev/null +++ b/internal/handler/packages_lookup.go @@ -0,0 +1,33 @@ +package handler + +import ( + "context" + "net/http" + + "git.unistack.org/unistack-org/pkgdash/internal/models" + pb "git.unistack.org/unistack-org/pkgdash/proto" + httpsrv "go.unistack.org/micro-server-http/v4" + "go.unistack.org/micro/v4/logger" +) + +func (h *Handler) PackagesLookup(ctx context.Context, req *pb.PackagesLookupReq, rsp *pb.PackagesLookupRsp) error { + logger.Debug(ctx, "Start PackagesLookup") + + if err := req.Validate(); err != nil { + logger.Error(ctx, err) + httpsrv.SetRspCode(ctx, http.StatusBadRequest) + return httpsrv.SetError(NewValidationError(err)) + } + + pkg, err := h.store.PackagesLookup(ctx, req) + if err != nil { + logger.Error(ctx, err) + httpsrv.SetRspCode(ctx, http.StatusInternalServerError) + return httpsrv.SetError(NewInternalError(err)) + } + + rsp.Package = models.NewPackage(pkg) + + logger.Debug(ctx, "Success finish PackagesLookup") + return nil +} diff --git a/internal/handler/packages_update.go b/internal/handler/packages_update.go index 1bcf064..7c98181 100644 --- a/internal/handler/packages_update.go +++ b/internal/handler/packages_update.go @@ -4,12 +4,13 @@ import ( "context" "net/http" - httpsrv "go.unistack.org/micro-server-http/v4" + "git.unistack.org/unistack-org/pkgdash/internal/models" pb "git.unistack.org/unistack-org/pkgdash/proto" + httpsrv "go.unistack.org/micro-server-http/v4" + "go.unistack.org/micro/v4/logger" ) func (h *Handler) PackagesUpdate(ctx context.Context, req *pb.PackagesUpdateReq, rsp *pb.PackagesUpdateRsp) error { - logger := h.svc.Logger() logger.Debug(ctx, "Start UpdatePackage") if err := req.Validate(); err != nil { @@ -18,13 +19,14 @@ func (h *Handler) PackagesUpdate(ctx context.Context, req *pb.PackagesUpdateReq, return httpsrv.SetError(NewValidationError(err)) } - if err := h.store.PackagesUpdate(ctx, req); err != nil { + pkg, err := h.store.PackagesUpdate(ctx, req) + if err != nil { logger.Error(ctx, err) httpsrv.SetRspCode(ctx, http.StatusInternalServerError) return httpsrv.SetError(NewInternalError(err)) } - // rsp.Id = req.Id + rsp.Package = models.NewPackage(pkg) logger.Debug(ctx, "Success finish UpdatePackage") return nil diff --git a/internal/models/models.go b/internal/models/models.go index 6a741a6..31e2c50 100644 --- a/internal/models/models.go +++ b/internal/models/models.go @@ -1,6 +1,7 @@ package models import ( + "database/sql" "time" pb "git.unistack.org/unistack-org/pkgdash/proto" @@ -8,18 +9,20 @@ import ( ) type Package struct { - Name string `db:"name" json:"name"` - URL string `db:"url" json:"url"` - Modules []uint64 `db:"modules" json:"modules"` - Issues []uint64 `db:"issues" json:"issues,omitempty"` - Comments []uint64 `db:"comments" json:"comments,omitempty"` - ID uint64 `db:"id" json:"id"` - Created time.Time `db:"created" json:"created"` - Updated time.Time `db:"updated" json:"updated,omitempty"` + Created time.Time `db:"created"` + Updated time.Time `db:"updated"` + Name string `db:"name"` + URL string `db:"url"` + Modules uint64 `db:"modules"` + Issues uint64 `db:"issues"` + Comments uint64 `db:"comments"` + ID uint64 `db:"id"` + Status uint64 `db:"status"` + LastCheck sql.NullTime `db:"last_check"` } func NewPackage(pkg *Package) *pb.Package { - return &pb.Package{ + rsp := &pb.Package{ Name: pkg.Name, Url: pkg.URL, Modules: pkg.Modules, @@ -29,16 +32,20 @@ func NewPackage(pkg *Package) *pb.Package { Created: timestamppb.New(pkg.Created), Updated: timestamppb.New(pkg.Updated), } + if pkg.LastCheck.Valid { + rsp.LastCheck = timestamppb.New(pkg.LastCheck.Time) + } + return rsp } type Module struct { + Created time.Time `db:"created"` + Updated time.Time `db:"updated"` Name string `db:"name"` Version string `db:"version"` LastVersion string `db:"last_version"` ID uint64 `db:"id"` Package uint64 `db:"package"` - Created time.Time `db:"created" json:"created"` - Updated time.Time `db:"updated" json:"updated,omitempty"` } func NewModule(mod *Module) *pb.Module { @@ -54,24 +61,24 @@ func NewModule(mod *Module) *pb.Module { } type Issue struct { - Desc string `db:"desc"` + Comment string `db:"comment"` Modules []int64 `db:"modules"` ID uint64 `db:"id"` Status uint64 `db:"status"` - Package int64 `db:"package"` + Package uint64 `db:"package"` } type Comment struct { - Created time.Time `db:"created" json:"created"` - Updated time.Time `db:"updated" json:"updated,omitempty"` - Text string `db:"value" json:"text"` - ID uint64 `db:"id" json:"id"` + Created time.Time `db:"created"` + Updated time.Time `db:"updated"` + Comment string `db:"comment"` + ID uint64 `db:"id"` } func NewComment(com *Comment) *pb.Comment { return &pb.Comment{ Id: com.ID, - Text: com.Text, + Comment: com.Comment, Created: timestamppb.New(com.Created), Updated: timestamppb.New(com.Updated), } diff --git a/internal/service/client_git/client_test.go b/internal/service/client_git/client_test.go deleted file mode 100644 index edf56ef..0000000 --- a/internal/service/client_git/client_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package client_git - -import ( - "context" - "database/sql" - "embed" - "fmt" - "testing" - - "git.unistack.org/unistack-org/pkgdash/internal/storage" - // "git.unistack.org/unistack-org/pkgdash/internal/storage/postgres" - "git.unistack.org/unistack-org/pkgdash/internal/storage/sqlite" - pb "git.unistack.org/unistack-org/pkgdash/proto" -) - -func TestClientPG(t *testing.T) { - dsn := fmt.Sprintf("file:///database.db") - conn, err := sql.Open("sqlite", dsn) - if err != nil { - t.Fatal(err) - } - defer conn.Close() - if err = conn.Ping(); err != nil { - t.Fatal(err) - } - - fucntion := sqlite.NewStorage() - st := fucntion(conn, embed.FS{}) - s, ok := st.(storage.Storage) - if !ok { - t.Fatal("typecast error") - } - - ctx, cancel := context.WithCancel(context.Background()) - _ = cancel - cli := NewClient(1) - - ch := cli.Run(ctx, s) - - data := &pb.AddPackageReq{ - Name: "test", - Url: "https://github.com/dantedenis/service_history.git", - } - - ch <- data - - <-cli.Done() -} - -func TestClientLite(t *testing.T) { - conn, err := sql.Open("sqlite3", "../../identifier.sqlite") - if err != nil { - t.Fatal(err) - } - defer conn.Close() - if err = conn.Ping(); err != nil { - t.Fatal(err) - } - - function := sqlite.NewStorage() - st := function(conn, embed.FS{}) - s, ok := st.(storage.Storage) - if !ok { - t.Fatal("typecast error") - } - - ctx, cancel := context.WithCancel(context.Background()) - _ = cancel - cli := NewClient(1) - - ch := cli.Run(ctx, s) - - data := &pb.AddPackageReq{ - Name: "test", - Url: "https://github.com/dantedenis/service_history.git", - } - - ch <- data - - <-cli.Done() -} diff --git a/internal/service/service.go b/internal/service/service.go deleted file mode 100644 index 6adfede..0000000 --- a/internal/service/service.go +++ /dev/null @@ -1,154 +0,0 @@ -package service - -import ( - "context" - "database/sql" - "net/url" - "strings" - - httpsrv "go.unistack.org/micro-server-http/v4" // TODO - "go.unistack.org/micro/v4" - "go.unistack.org/micro/v4/config" - microcfg "go.unistack.org/micro/v4/config" - "go.unistack.org/micro/v4/logger" - "go.unistack.org/micro/v4/options" - "go.unistack.org/micro/v4/register" - "go.unistack.org/micro/v4/server" - intcfg "git.unistack.org/unistack-org/pkgdash/config" - "git.unistack.org/unistack-org/pkgdash/handler" - pb "git.unistack.org/unistack-org/pkgdash/proto" - "git.unistack.org/unistack-org/pkgdash/service/client_git" - "git.unistack.org/unistack-org/pkgdash/storage" -) - -func NewService(ctx context.Context) (micro.Service, error) { - var reg register.Register - - cfg := intcfg.NewConfig(ServiceName, Service) - - cs := microcfg.NewConfig(config.Struct(cfg)) - - // TODO - mgsrv := httpsrv.NewServer( - options.Register(reg), - ) - - svc := micro.NewService( - micro.Config(cs), - ) - - h := handler.NewHandler(svc, client_git.NewClient(5)) - - if err := svc.Init( - micro.AfterStart(func(_ context.Context) error { - return h.Init(svc.Options().Context) - }), - micro.BeforeStart(func(ctx context.Context) error { - if err := config.Load(ctx, []config.Config{cs}, config.LoadOverride(true)); err != nil { - return err - } - if err := config.Validate(ctx, cfg); err != nil { - return err - } - - if err := svc.Init( - micro.Name(intcfg.ServiceName), - micro.Version(intcfg.ServiceVersion), - ); err != nil { - return err - } - - if err := svc.Server("http").Init( - options.Address(cfg.Address), - options.Name(cfg.App.Name), - server.Version(cfg.App.Version), - ); err != nil { - return err - } - - return nil - }), - micro.BeforeStart(func(_ context.Context) error { - log := logger.NewLogger( - logger.WithLevel(logger.ParseLevel(cfg.LogLevel)), - logger.WithCallerSkipCount(3), - ) - return svc.Init(micro.Logger(log)) - }), - micro.BeforeStart(func(ctx context.Context) error { - var connstr string - if v, ok := cfg.StorageDSN[cfg.App.Name]; ok { - connstr = v - } else if v, ok = cfg.StorageDSN["all"]; ok { - connstr = v - } - - scheme, dsn, err := storageOptions(connstr) - if err != nil { - return err - } - conn, err := connectDataBase(scheme, dsn) - if err != nil { - return err - } - store, err := storage.NewStorage(scheme, conn) - if err != nil { - return err - } - ctx = storage.InContext(ctx, store) - return svc.Init(micro.Context(ctx)) - }), - ); err != nil { - return nil, err - } - - if err := pb.RegisterPkgdashServiceServer(mgsrv, h); err != nil { - logger.Fatalf(ctx, "failed to register handler: %v", err) - } - - intsvc := httpsrv.NewServer( - server.Codec("application/json", jsoncodec.NewCodec()), - server.Address(cfg.Meter.Addr), server.Context(ctx), - ) - - if err := intsvc.Init(); err != nil { - logger.Fatalf(ctx, "failed to init http srv: %v", err) - } - - if err := healthhandler.RegisterHealthServiceServer(intsvc, healthhandler.NewHandler()); err != nil { - logger.Fatalf(ctx, "failed to set http handler: %v", err) - } - if err := meterhandler.RegisterMeterServiceServer(intsvc, meterhandler.NewHandler()); err != nil { - logger.Fatalf(ctx, "failed to set http handler: %v", err) - } - - if err := intsvc.Start(); err != nil { - logger.Fatalf(ctx, "failed to run http srv: %v", err) - } - - return svc, nil -} - -func storageOptions(dsn string) (string, string, error) { - u, err := url.Parse(dsn) - if err != nil { - return "", "", err - } - scheme := u.Scheme - if idx := strings.Index(u.Scheme, "+"); idx > 0 { - scheme = u.Scheme[:idx] - u.Scheme = u.Scheme[idx+1:] - } - return scheme, u.String(), nil -} - -func connectDataBase(driverName, dsn string) (*sql.DB, error) { - conn, err := sql.Open(driverName, dsn) - if err != nil { - return nil, err - } - if err = conn.Ping(); err != nil { - return nil, err - } - return conn, err -} diff --git a/internal/storage/migrations/sqlite/000001_init_schema.down.sql b/internal/storage/migrations/sqlite/000001_init_schema.down.sql deleted file mode 100644 index b9ce01f..0000000 --- a/internal/storage/migrations/sqlite/000001_init_schema.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -drop table if exists dashboard ; -drop table if exists package ; -drop table if exists module ; -drop table if exists issue ; -drop table if exists comment; \ No newline at end of file diff --git a/internal/storage/migrations/sqlite/000001_init_schema.up.sql b/internal/storage/migrations/sqlite/000001_init_schema.up.sql deleted file mode 100644 index 4d39c19..0000000 --- a/internal/storage/migrations/sqlite/000001_init_schema.up.sql +++ /dev/null @@ -1,39 +0,0 @@ -create table if not exists dashboard ( - id integer primary key autoincrement not null , - "uuid" uuid not null unique , - package integer[] default '{}' -); - -create table if not exists comment ( - id integer primary key autoincrement not null , - "text" text , - package integer not null, - created timestamp not null default current_timestamp , - updated timestamp default current_timestamp -); - -create table if not exists module ( - id integer primary key autoincrement not null , - name varchar not null , - version varchar not null , - last_version varchar not null -); - -create table if not exists issue ( - id serial not null unique primary key , - --package integer references package(id) , - modules integer[] default '[]', - status integer default 0 , - "desc" varchar -); - -create table if not exists package ( - id integer primary key autoincrement not null , - name varchar not null , - url varchar , - modules integer[] default '[]', - issues integer[] default '[]', - comments integer[] default '[]' -); - - diff --git a/internal/storage/sqlite/queries.go b/internal/storage/sqlite/queries.go index b7f54a8..d06ab6a 100644 --- a/internal/storage/sqlite/queries.go +++ b/internal/storage/sqlite/queries.go @@ -1,34 +1,14 @@ package sqlite const ( - queryPackagesList = `select - id, - name, - url, - comments - modules, - issues, - from package; -` - queryCommentsCreate = ` -insert into comment(text) values ($1) returning id; -update package -set comments = json_insert(comments, '$[#]', ( select last_insert_rowid() as id from comment )) -where id = $2 ; -` - queryPackagesCreate = ` -insert into package(name, url, modules) values ($1, $2, $3); -` - queryInsMsgGetIDs = ` -insert into module(name, version, last_version) values -%s -returning id; -` - queryModulesList = ` -select id, name, version, last_version, created, updated from modules; -` - - queryCommentsList = ` -select id, text, created, updated from comments; -` + queryPackagesProcess = `select id, name, url, comments, modules, issues, created, updated from packages where ROUND((JULIANDAY(CURRENT_TIMESTAMP) - JULIANDAY(last_check)) * 86400) > $1 or last_check is NULL` + queryPackagesModulesCount = `update packages set modules = $2, last_check = CURRENT_TIMESTAMP where id = $1;` + queryPackagesList = `select id, name, url, comments, modules, issues, created, updated from packages;` + queryPackagesLookup = `select id, name, url, comments, modules, issues, created, updated from packages where id = $1;` + queryCommentsCreate = `insert into comments (comment) values ($1) returning id;` + queryPackagesCreate = `insert into packages (name, url) values ($1, $2) returning *;` + queryInsMsgGetIDs = `insert into modules(name, version, last_version) values %s returning id;` + queryModulesList = `select id, name, version, last_version, created, updated from modules;` + queryModulesCreate = `insert into modules (name, version, last_version, package) values ($1, $2, $3, $4) returning *;` + queryCommentsList = `select id, text, created, updated from comments;` ) diff --git a/internal/storage/sqlite/storage.go b/internal/storage/sqlite/storage.go index 6d411f2..2bc0129 100644 --- a/internal/storage/sqlite/storage.go +++ b/internal/storage/sqlite/storage.go @@ -2,130 +2,71 @@ package sqlite import ( "context" - "database/sql" - "embed" - "errors" "fmt" "strings" + "time" - "github.com/golang-migrate/migrate/v4" - "github.com/golang-migrate/migrate/v4/database/sqlite" - "github.com/golang-migrate/migrate/v4/source/iofs" - "github.com/lib/pq" - _ "github.com/mattn/go-sqlite3" - "go.unistack.org/micro/v4/logger" "git.unistack.org/unistack-org/pkgdash/internal/models" + "git.unistack.org/unistack-org/pkgdash/internal/storage" pb "git.unistack.org/unistack-org/pkgdash/proto" + "github.com/jmoiron/sqlx" + "go.unistack.org/micro/v4/logger" ) -const ( - pathMigration = `migrations/sqlite` -) +func init() { + storage.RegisterStorage("sqlite", NewStorage()) +} + +var _ storage.Storage = (*Sqlite)(nil) type Sqlite struct { - db *sql.DB - fs embed.FS + db *sqlx.DB } -func NewStorage() func(*sql.DB, embed.FS) interface{} { - return func(db *sql.DB, fs embed.FS) interface{} { - return &Sqlite{db: db, fs: fs} +func NewStorage() func(*sqlx.DB) interface{} { + return func(db *sqlx.DB) interface{} { + return &Sqlite{db: db} } } -func (s *Sqlite) MigrateUp() error { - driver, err := sqlite.WithInstance(s.db, &sqlite.Config{ - MigrationsTable: sqlite.DefaultMigrationsTable, - DatabaseName: "pkgdash", - }) - if err != nil { - return err - } - source, err := iofs.New(s.fs, pathMigration) - if err != nil { - return err - } - - // TODO: pass own logger - m, err := migrate.NewWithInstance("fs", source, "pkgdash", driver) - if err != nil { - return err - } - - if err = m.Up(); err != nil && !errors.Is(err, migrate.ErrNoChange) { - return err - } - - return nil +func (s *Sqlite) PackagesDelete(ctx context.Context, req *pb.PackagesDeleteReq) error { + return fmt.Errorf("need implement") } -func (s *Sqlite) MigrateDown() error { - driver, err := sqlite.WithInstance(s.db, &sqlite.Config{ - MigrationsTable: sqlite.DefaultMigrationsTable, - DatabaseName: "pkgdash", - }) - if err != nil { - return err - } - source, err := iofs.New(s.fs, pathMigration) - if err != nil { - return err - } - - // TODO: pass own logger - m, err := migrate.NewWithInstance("fs", source, "pkgdash", driver) - if err != nil { - return err - } - - if err = m.Down(); err != nil && !errors.Is(err, migrate.ErrNoChange) { - return err - } - - return nil +func (s *Sqlite) PackagesUpdate(ctx context.Context, req *pb.PackagesUpdateReq) (*models.Package, error) { + return nil, fmt.Errorf("need implement") } -func (s *Sqlite) PackagesUpdate(ctx context.Context, req *pb.PackagesUpdateReq) error { - panic("need implement") +func (s *Sqlite) PackagesLookup(ctx context.Context, req *pb.PackagesLookupReq) (*models.Package, error) { + pkg := &models.Package{} + + err := s.db.GetContext(ctx, pkg, queryPackagesLookup, req.Id) + if err != nil { + return nil, err + } + + return pkg, err } func (s *Sqlite) PackagesList(ctx context.Context, req *pb.PackagesListReq) ([]*models.Package, error) { var packages []*models.Package - rows, err := s.db.QueryContext(ctx, queryPackagesList) + err := s.db.SelectContext(ctx, &packages, queryPackagesList) if err != nil { return nil, err } - for ; rows.Err() == nil; rows.Next() { - pkg := &models.Package{} - if err = rows.Scan( - &pkg.ID, - &pkg.Name, - &pkg.URL, - &pkg.Comments, - ); err != nil { - _ = rows.Close() - return nil, err - } - packages = append(packages, pkg) - } - - if err = rows.Err(); err != nil { - return nil, err - } - - if err = rows.Close(); err != nil { - return nil, err - } - - return packages, err + return packages, nil } -func (s *Sqlite) CommentsCreate(ctx context.Context, req *pb.CommentsCreateReq) (id uint64, err error) { +func (s *Sqlite) CommentsDelete(ctx context.Context, req *pb.CommentsDeleteReq) error { + return nil +} + +func (s *Sqlite) CommentsCreate(ctx context.Context, req *pb.CommentsCreateReq) (*models.Comment, error) { tx, err := s.db.BeginTx(ctx, nil) if err != nil { - return 0, err + return nil, err } defer func() { @@ -138,85 +79,61 @@ func (s *Sqlite) CommentsCreate(ctx context.Context, req *pb.CommentsCreateReq) } }() - if err = tx.QueryRowContext(ctx, queryCommentsCreate, req.Text, req.PackageId).Scan(&id); err != nil { - return id, err + if _, err = tx.ExecContext(ctx, queryCommentsCreate, req.Comment, req.PackageId); err != nil { + return nil, err } - return id, err + return nil, nil } -func (s *Sqlite) PackagesCreate(ctx context.Context, req *pb.PackagesCreateReq) error { - tx, err := s.db.BeginTx(ctx, nil) +func (s *Sqlite) PackagesProcess(ctx context.Context, td time.Duration) ([]*models.Package, error) { + var packages []*models.Package + err := s.db.SelectContext(ctx, &packages, queryPackagesProcess, td.Seconds()) + if err != nil { + return nil, err + } + + return packages, nil +} + +func (s *Sqlite) PackagesCreate(ctx context.Context, req *pb.PackagesCreateReq) (*models.Package, error) { + pkg := &models.Package{} + err := s.db.GetContext(ctx, pkg, queryPackagesCreate, req.Name, req.Url) + if err != nil { + return nil, err + } + + return pkg, nil +} + +func (s *Sqlite) PackagesModulesCreate(ctx context.Context, pkg *models.Package, modules []*models.Module) error { + tx, err := s.db.BeginTxx(ctx, nil) if err != nil { return err } - defer func() { + for _, mod := range modules { + err = tx.GetContext(ctx, mod, queryModulesCreate, mod.Name, mod.Version, mod.LastVersion, mod.Package) if err != nil { - if rollbackErr := tx.Rollback(); rollbackErr != nil { - logger.Errorf(ctx, "AddPackage: unable to rollback: %v", rollbackErr) - } - } else { - err = tx.Commit() + _ = tx.Rollback() + return err } - }() + } - res, err := tx.ExecContext(ctx, queryPackagesCreate, req.Name, req.Url, pq.Array(req.Modules)) - if err != nil { + if _, err = tx.ExecContext(ctx, queryPackagesModulesCount, pkg.ID, len(modules)); err != nil { + _ = tx.Rollback() return err } - if aff, affErr := res.RowsAffected(); err != nil { - err = affErr - } else if aff == 0 { - err = errors.New("rows affected is 0") + if err = tx.Commit(); err != nil { + _ = tx.Rollback() + return err } - return err + return nil } -func (s *Sqlite) InsertButchModules(ctx context.Context, req []models.Module) ([]uint64, error) { - tx, err := s.db.BeginTx(ctx, nil) - if err != nil { - return nil, err - } - defer func() { - if err != nil { - if rollbackErr := tx.Rollback(); rollbackErr != nil { - logger.Errorf(ctx, "AddPackage: unable to rollback: %v", rollbackErr) - } - } else { - err = tx.Commit() - } - }() - - query := generateQuery(req) - - rows, err := tx.QueryContext(ctx, query) - if err != nil { - return nil, err - } - defer func() { - if err = rows.Close(); err != nil { - return - } - err = rows.Err() - }() - - result := make([]uint64, 0) - for rows.Next() { - tmp := uint64(0) - if err = rows.Scan(&tmp); err != nil { - return nil, err - } - - result = append(result, tmp) - } - - return result, err -} - -func (s *Sqlite) GetModule(ctx context.Context, req *pb.ModulesListReq) ([]*models.Module, error) { +func (s *Sqlite) ModulesList(ctx context.Context, req *pb.ModulesListReq) ([]*models.Module, error) { var err error var modules []*models.Module @@ -259,50 +176,14 @@ func (s *Sqlite) GetModule(ctx context.Context, req *pb.ModulesListReq) ([]*mode func (s *Sqlite) CommentsList(ctx context.Context, req *pb.CommentsListReq) ([]*models.Comment, error) { var comments []*models.Comment - rows, err := s.db.QueryContext(ctx, queryCommentsList, req.PackageId) + err := s.db.SelectContext(ctx, &comments, queryCommentsList, req.PackageId) if err != nil { return nil, err } - defer func() { - if err = rows.Close(); err != nil { - return - } - err = rows.Err() - }() - for ; rows.Err() == nil; rows.Next() { - com := &models.Comment{} - if err = rows.Scan( - &com.ID, - &com.Text, - &com.Created, - &com.Updated, - ); err != nil { - _ = rows.Close() - return nil, err - } - - comments = append(comments, com) - } - - if err = rows.Err(); err != nil { - return nil, err - } - - if err = rows.Close(); err != nil { - return nil, err - } return comments, nil } -func convertSliceUInt(arg ...uint64) []interface{} { - result := make([]interface{}, 0, len(arg)) - for i := range arg { - result = append(result, arg[i]) - } - return result -} - func generateQuery(rsp []models.Module) string { const pattern = `%c('%s', '%s', '%s')` build := strings.Builder{} @@ -315,7 +196,3 @@ func generateQuery(rsp []models.Module) string { return fmt.Sprintf(queryInsMsgGetIDs, build.String()) } - -func generateArrayIneq(count int) string { - return "(?" + strings.Repeat(",?", count-1) + ")" -} diff --git a/internal/storage/storage.go b/internal/storage/storage.go index 2e9e03a..55e818e 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -2,68 +2,43 @@ package storage import ( "context" - "database/sql" - "embed" "errors" + "time" "git.unistack.org/unistack-org/pkgdash/internal/models" - // "git.unistack.org/unistack-org/pkgdash/internal/storage/postgres" - - "git.unistack.org/unistack-org/pkgdash/internal/storage/sqlite" pb "git.unistack.org/unistack-org/pkgdash/proto" + "github.com/jmoiron/sqlx" ) -//go:embed migrations -var fs embed.FS - -var storages = map[string]func(*sql.DB, embed.FS) interface{}{ - //"postgres": postgres.NewStorage(), - "sqlite": sqlite.NewStorage(), +func RegisterStorage(name string, fn func(*sqlx.DB) interface{}) { + storages[name] = fn } -type contextKey string - -var storeIdent = contextKey("store") - -type Migrate interface { - MigrateUp() error - MigrateDown() error -} +var storages = map[string]func(*sqlx.DB) interface{}{} type Storage interface { - Migrate - PackagesCreate(ctx context.Context, req *pb.PackagesCreateReq) error + PackagesProcess(ctx context.Context, td time.Duration) ([]*models.Package, error) + PackagesCreate(ctx context.Context, req *pb.PackagesCreateReq) (*models.Package, error) PackagesList(ctx context.Context, req *pb.PackagesListReq) ([]*models.Package, error) - PackagesUpdate(ctx context.Context, req *pb.PackagesUpdateReq) error + PackagesLookup(ctx context.Context, req *pb.PackagesLookupReq) (*models.Package, error) + PackagesUpdate(ctx context.Context, req *pb.PackagesUpdateReq) (*models.Package, error) PackagesDelete(ctx context.Context, req *pb.PackagesDeleteReq) error CommentsCreate(ctx context.Context, req *pb.CommentsCreateReq) (*models.Comment, error) CommentsDelete(ctx context.Context, req *pb.CommentsDeleteReq) error CommentsList(ctx context.Context, req *pb.CommentsListReq) ([]*models.Comment, error) - InsertButchModules(ctx context.Context, req []models.Module) ([]uint64, error) ModulesList(ctx context.Context, req *pb.ModulesListReq) ([]*models.Module, error) + PackagesModulesCreate(ctx context.Context, pkg *models.Package, modules []*models.Module) error } -func NewStorage(name string, db *sql.DB) (Storage, error) { +func NewStorage(name string, db *sqlx.DB) (Storage, error) { function, ok := storages[name] if !ok { return nil, errors.New("incorrect name store") } - store := function(db, fs) + store := function(db) database, ok := store.(Storage) if !ok { return nil, errors.New("dont implements interface Storage") } return database, nil } - -func InContext(ctx context.Context, val Storage) context.Context { - return context.WithValue(ctx, storeIdent, val) -} - -func FromContext(ctx context.Context) (Storage, error) { - if store, ok := ctx.Value(storeIdent).(Storage); !ok { - return nil, errors.New("empty store") - } else { - return store, nil - } -} diff --git a/internal/service/client_git/client.go b/internal/worker/worker.go similarity index 66% rename from internal/service/client_git/client.go rename to internal/worker/worker.go index c76d5f0..e0e459d 100644 --- a/internal/service/client_git/client.go +++ b/internal/worker/worker.go @@ -1,96 +1,76 @@ -package client_git +package worker import ( "context" + "database/sql" "fmt" "io" "net/url" "os" "sort" "strings" + "sync" + "time" + "git.unistack.org/unistack-org/pkgdash/internal" + "git.unistack.org/unistack-org/pkgdash/internal/models" + "git.unistack.org/unistack-org/pkgdash/internal/storage" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing/filemode" "github.com/go-git/go-git/v5/plumbing/object" "github.com/go-git/go-git/v5/storage/memory" "github.com/pkg/errors" "go.unistack.org/micro/v4/logger" - "git.unistack.org/unistack-org/pkgdash/internal" - "git.unistack.org/unistack-org/pkgdash/internal/models" - "git.unistack.org/unistack-org/pkgdash/internal/storage" - pb "git.unistack.org/unistack-org/pkgdash/proto" "golang.org/x/mod/modfile" "golang.org/x/mod/module" ) -type Client interface { - Run(ctx context.Context, st storage.Storage) chan *pb.PackagesCreateReq - IsClose() bool - Done() <-chan struct{} -} - -type client struct { - worker chan *pb.PackagesCreateReq - closed bool - lock chan struct{} -} - -func NewClient(cap uint) Client { - return &client{ - make(chan *pb.PackagesCreateReq, cap), - false, - make(chan struct{}), - } -} - -func (c *client) Run(ctx context.Context, st storage.Storage) chan *pb.PackagesCreateReq { - go func() { - defer close(c.worker) - for { - select { - case data := <-c.worker: - go func() { - runner(ctx, st, data) - }() - case <-ctx.Done(): - logger.Info(ctx, ctx.Err()) - return +func Run(ctx context.Context, store storage.Storage, td time.Duration) { + ticker := time.NewTicker(5 * time.Second) + defer ticker.Stop() + var wg sync.WaitGroup + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + logger.Infof(ctx, "check packages to process") + packages, err := store.PackagesProcess(ctx, td) + logger.Infof(ctx, "check packages to process %#+v, err: %v", packages, err) + if err != nil && err != sql.ErrNoRows { + logger.Fatalf(ctx, "failed to get packages to process: %v", err) } + wg.Add(len(packages)) + for _, pkg := range packages { + go func(p *models.Package) { + if err := process(ctx, store, p); err != nil { + logger.Errorf(ctx, "failed to process package %s: %v", p.Name, err) + } + wg.Done() + }(pkg) + } + wg.Wait() } - }() - - return c.worker + } } -func (c *client) IsClose() bool { - return c.closed -} - -// Done for locked goroutine -func (c *client) Done() <-chan struct{} { - return c.lock -} - -func runner(ctx context.Context, st storage.Storage, req *pb.PackagesCreateReq) { - modules, err := getGoModule(ctx, req.Url) +func process(ctx context.Context, store storage.Storage, pkg *models.Package) error { + logger.Infof(ctx, "process package %v", pkg) + modules, err := getGoModule(ctx, pkg.ID, pkg.URL) if err != nil { - logger.Error(ctx, err) - return + logger.Errorf(ctx, "failed to get modules: %v", err) + return err } - logger.Infof(ctx, "success get list mod", modules) - - if req.Modules, err = st.InsertButchModules(ctx, modules); err != nil { - logger.Error(ctx, err) - return + if err = store.PackagesModulesCreate(ctx, pkg, modules); err != nil { + logger.Errorf(ctx, "failed to set create modules: %v", err) + return err } - if err = st.PackagesCreate(ctx, req); err != nil { - logger.Error(ctx, err) - } + return nil } -func getGoModule(ctx context.Context, gitUrl string) ([]models.Module, error) { +func getGoModule(ctx context.Context, pkgID uint64, gitUrl string) ([]*models.Module, error) { u, err := url.Parse(gitUrl) if err != nil { logger.Fatal(ctx, err) @@ -135,7 +115,7 @@ func getGoModule(ctx context.Context, gitUrl string) ([]models.Module, error) { return nil, err } - unique := make(map[string]models.Module) + unique := make(map[string]*models.Module) var mvs []module.Version err = tree.Files().ForEach(func(file *object.File) error { if file == nil { @@ -151,7 +131,8 @@ func getGoModule(ctx context.Context, gitUrl string) ([]models.Module, error) { return err } for i := range mvs { - unique[mvs[i].Path] = models.Module{ + unique[mvs[i].Path] = &models.Module{ + Package: pkgID, Name: mvs[i].Path, Version: mvs[i].Version, LastVersion: mvs[i].Version, @@ -177,7 +158,7 @@ func getGoModule(ctx context.Context, gitUrl string) ([]models.Module, error) { return nil }) - result := make([]models.Module, 0, len(unique)) + result := make([]*models.Module, 0, len(unique)) for _, v := range unique { result = append(result, v) } diff --git a/local.yaml b/local.yaml new file mode 100644 index 0000000..d1c0a17 --- /dev/null +++ b/local.yaml @@ -0,0 +1,8 @@ +server: + addr: ":9091" + logger_level: "debug" +meter: + addr: ":8081" + path: "/metrics" +database: + dsn: "sqlite://./database.db?migrate=up" \ No newline at end of file diff --git a/proto/apidocs.swagger.yaml b/proto/apidocs.swagger.yaml index 643e277..7e323a1 100644 --- a/proto/apidocs.swagger.yaml +++ b/proto/apidocs.swagger.yaml @@ -95,6 +95,30 @@ paths: schema: $ref: '#/components/schemas/PackagesCreateRsp' /v1/packages/{id}: + get: + tags: + - PkgdashService + operationId: PackagesLookup + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint64 + responses: + default: + description: Default + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorRsp' + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PackagesLookupRsp' put: tags: - PkgdashService @@ -149,6 +173,31 @@ paths: application/json: schema: $ref: '#/components/schemas/PackagesDeleteRsp' + /v1/packages/{id}/modules: + get: + tags: + - PkgdashService + operationId: PackagesModules + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint64 + responses: + default: + description: Default + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorRsp' + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PackagesModulesRsp' /v1/packages/{package_id}/comments: get: tags: @@ -246,7 +295,7 @@ components: package: type: integer format: uint64 - text: + comment: type: string created: type: string @@ -260,7 +309,7 @@ components: package_id: type: integer format: uint64 - text: + comment: type: string CommentsCreateRsp: type: object @@ -332,26 +381,23 @@ components: url: type: string modules: - type: array - items: - type: integer - format: uint64 + type: integer + format: uint64 issues: - type: array - items: - type: integer - format: uint64 + type: integer + format: uint64 comments: - type: array - items: - type: integer - format: uint64 + type: integer + format: uint64 created: type: string format: RFC3339 updated: type: string format: RFC3339 + last_check: + type: string + format: RFC3339 PackagesCreateReq: type: object properties: @@ -367,8 +413,8 @@ components: PackagesCreateRsp: type: object properties: - status: - type: string + package: + $ref: '#/components/schemas/Package' PackagesDeleteRsp: type: object properties: {} @@ -379,6 +425,18 @@ components: type: array items: $ref: '#/components/schemas/Package' + PackagesLookupRsp: + type: object + properties: + package: + $ref: '#/components/schemas/Package' + PackagesModulesRsp: + type: object + properties: + modules: + type: array + items: + $ref: '#/components/schemas/Module' PackagesUpdateReq: type: object properties: diff --git a/proto/pkgdash.pb.go b/proto/pkgdash.pb.go index 9944a6b..85d8695 100644 --- a/proto/pkgdash.pb.go +++ b/proto/pkgdash.pb.go @@ -24,6 +24,194 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type PackagesModulesReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *PackagesModulesReq) Reset() { + *x = PackagesModulesReq{} + if protoimpl.UnsafeEnabled { + mi := &file_pkgdash_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PackagesModulesReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PackagesModulesReq) ProtoMessage() {} + +func (x *PackagesModulesReq) ProtoReflect() protoreflect.Message { + mi := &file_pkgdash_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 PackagesModulesReq.ProtoReflect.Descriptor instead. +func (*PackagesModulesReq) Descriptor() ([]byte, []int) { + return file_pkgdash_proto_rawDescGZIP(), []int{0} +} + +func (x *PackagesModulesReq) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +type PackagesModulesRsp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Modules []*Module `protobuf:"bytes,1,rep,name=modules,proto3" json:"modules,omitempty"` +} + +func (x *PackagesModulesRsp) Reset() { + *x = PackagesModulesRsp{} + if protoimpl.UnsafeEnabled { + mi := &file_pkgdash_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PackagesModulesRsp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PackagesModulesRsp) ProtoMessage() {} + +func (x *PackagesModulesRsp) ProtoReflect() protoreflect.Message { + mi := &file_pkgdash_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 PackagesModulesRsp.ProtoReflect.Descriptor instead. +func (*PackagesModulesRsp) Descriptor() ([]byte, []int) { + return file_pkgdash_proto_rawDescGZIP(), []int{1} +} + +func (x *PackagesModulesRsp) GetModules() []*Module { + if x != nil { + return x.Modules + } + return nil +} + +type PackagesLookupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *PackagesLookupReq) Reset() { + *x = PackagesLookupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_pkgdash_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PackagesLookupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PackagesLookupReq) ProtoMessage() {} + +func (x *PackagesLookupReq) ProtoReflect() protoreflect.Message { + mi := &file_pkgdash_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 PackagesLookupReq.ProtoReflect.Descriptor instead. +func (*PackagesLookupReq) Descriptor() ([]byte, []int) { + return file_pkgdash_proto_rawDescGZIP(), []int{2} +} + +func (x *PackagesLookupReq) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +type PackagesLookupRsp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Package *Package `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` +} + +func (x *PackagesLookupRsp) Reset() { + *x = PackagesLookupRsp{} + if protoimpl.UnsafeEnabled { + mi := &file_pkgdash_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PackagesLookupRsp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PackagesLookupRsp) ProtoMessage() {} + +func (x *PackagesLookupRsp) ProtoReflect() protoreflect.Message { + mi := &file_pkgdash_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 PackagesLookupRsp.ProtoReflect.Descriptor instead. +func (*PackagesLookupRsp) Descriptor() ([]byte, []int) { + return file_pkgdash_proto_rawDescGZIP(), []int{3} +} + +func (x *PackagesLookupRsp) GetPackage() *Package { + if x != nil { + return x.Package + } + return nil +} + type ErrorRsp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -38,7 +226,7 @@ type ErrorRsp struct { func (x *ErrorRsp) Reset() { *x = ErrorRsp{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[0] + mi := &file_pkgdash_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -51,7 +239,7 @@ func (x *ErrorRsp) String() string { func (*ErrorRsp) ProtoMessage() {} func (x *ErrorRsp) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[0] + mi := &file_pkgdash_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -64,7 +252,7 @@ func (x *ErrorRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use ErrorRsp.ProtoReflect.Descriptor instead. func (*ErrorRsp) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{0} + return file_pkgdash_proto_rawDescGZIP(), []int{4} } func (x *ErrorRsp) GetCode() string { @@ -100,20 +288,21 @@ type Package struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` - Modules []uint64 `protobuf:"varint,4,rep,packed,name=modules,proto3" json:"modules,omitempty"` - Issues []uint64 `protobuf:"varint,5,rep,packed,name=issues,proto3" json:"issues,omitempty"` - Comments []uint64 `protobuf:"varint,6,rep,packed,name=comments,proto3" json:"comments,omitempty"` - Created *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created,proto3" json:"created,omitempty"` - Updated *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated,proto3" json:"updated,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` + Modules uint64 `protobuf:"varint,4,opt,name=modules,proto3" json:"modules,omitempty"` + Issues uint64 `protobuf:"varint,5,opt,name=issues,proto3" json:"issues,omitempty"` + Comments uint64 `protobuf:"varint,6,opt,name=comments,proto3" json:"comments,omitempty"` + Created *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created,proto3" json:"created,omitempty"` + Updated *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated,proto3" json:"updated,omitempty"` + LastCheck *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=last_check,json=lastCheck,proto3" json:"last_check,omitempty"` } func (x *Package) Reset() { *x = Package{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[1] + mi := &file_pkgdash_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -126,7 +315,7 @@ func (x *Package) String() string { func (*Package) ProtoMessage() {} func (x *Package) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[1] + mi := &file_pkgdash_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -139,7 +328,7 @@ func (x *Package) ProtoReflect() protoreflect.Message { // Deprecated: Use Package.ProtoReflect.Descriptor instead. func (*Package) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{1} + return file_pkgdash_proto_rawDescGZIP(), []int{5} } func (x *Package) GetId() uint64 { @@ -163,25 +352,25 @@ func (x *Package) GetUrl() string { return "" } -func (x *Package) GetModules() []uint64 { +func (x *Package) GetModules() uint64 { if x != nil { return x.Modules } - return nil + return 0 } -func (x *Package) GetIssues() []uint64 { +func (x *Package) GetIssues() uint64 { if x != nil { return x.Issues } - return nil + return 0 } -func (x *Package) GetComments() []uint64 { +func (x *Package) GetComments() uint64 { if x != nil { return x.Comments } - return nil + return 0 } func (x *Package) GetCreated() *timestamppb.Timestamp { @@ -198,6 +387,13 @@ func (x *Package) GetUpdated() *timestamppb.Timestamp { return nil } +func (x *Package) GetLastCheck() *timestamppb.Timestamp { + if x != nil { + return x.LastCheck + } + return nil +} + type Module struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -215,7 +411,7 @@ type Module struct { func (x *Module) Reset() { *x = Module{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[2] + mi := &file_pkgdash_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -228,7 +424,7 @@ func (x *Module) String() string { func (*Module) ProtoMessage() {} func (x *Module) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[2] + mi := &file_pkgdash_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -241,7 +437,7 @@ func (x *Module) ProtoReflect() protoreflect.Message { // Deprecated: Use Module.ProtoReflect.Descriptor instead. func (*Module) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{2} + return file_pkgdash_proto_rawDescGZIP(), []int{6} } func (x *Module) GetId() uint64 { @@ -310,7 +506,7 @@ type Issue struct { func (x *Issue) Reset() { *x = Issue{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[3] + mi := &file_pkgdash_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -323,7 +519,7 @@ func (x *Issue) String() string { func (*Issue) ProtoMessage() {} func (x *Issue) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[3] + mi := &file_pkgdash_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -336,7 +532,7 @@ func (x *Issue) ProtoReflect() protoreflect.Message { // Deprecated: Use Issue.ProtoReflect.Descriptor instead. func (*Issue) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{3} + return file_pkgdash_proto_rawDescGZIP(), []int{7} } func (x *Issue) GetId() uint64 { @@ -395,7 +591,7 @@ type Comment struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Package uint64 `protobuf:"varint,2,opt,name=package,proto3" json:"package,omitempty"` - Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"` + Comment string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"` Created *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"` Updated *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated,proto3" json:"updated,omitempty"` } @@ -403,7 +599,7 @@ type Comment struct { func (x *Comment) Reset() { *x = Comment{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[4] + mi := &file_pkgdash_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -416,7 +612,7 @@ func (x *Comment) String() string { func (*Comment) ProtoMessage() {} func (x *Comment) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[4] + mi := &file_pkgdash_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -429,7 +625,7 @@ func (x *Comment) ProtoReflect() protoreflect.Message { // Deprecated: Use Comment.ProtoReflect.Descriptor instead. func (*Comment) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{4} + return file_pkgdash_proto_rawDescGZIP(), []int{8} } func (x *Comment) GetId() uint64 { @@ -446,9 +642,9 @@ func (x *Comment) GetPackage() uint64 { return 0 } -func (x *Comment) GetText() string { +func (x *Comment) GetComment() string { if x != nil { - return x.Text + return x.Comment } return "" } @@ -479,7 +675,7 @@ type CommentsDeleteReq struct { func (x *CommentsDeleteReq) Reset() { *x = CommentsDeleteReq{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[5] + mi := &file_pkgdash_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -492,7 +688,7 @@ func (x *CommentsDeleteReq) String() string { func (*CommentsDeleteReq) ProtoMessage() {} func (x *CommentsDeleteReq) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[5] + mi := &file_pkgdash_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -505,7 +701,7 @@ func (x *CommentsDeleteReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentsDeleteReq.ProtoReflect.Descriptor instead. func (*CommentsDeleteReq) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{5} + return file_pkgdash_proto_rawDescGZIP(), []int{9} } func (x *CommentsDeleteReq) GetId() uint64 { @@ -531,7 +727,7 @@ type CommentsDeleteRsp struct { func (x *CommentsDeleteRsp) Reset() { *x = CommentsDeleteRsp{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[6] + mi := &file_pkgdash_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -544,7 +740,7 @@ func (x *CommentsDeleteRsp) String() string { func (*CommentsDeleteRsp) ProtoMessage() {} func (x *CommentsDeleteRsp) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[6] + mi := &file_pkgdash_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -557,7 +753,7 @@ func (x *CommentsDeleteRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentsDeleteRsp.ProtoReflect.Descriptor instead. func (*CommentsDeleteRsp) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{6} + return file_pkgdash_proto_rawDescGZIP(), []int{10} } type PackagesDeleteReq struct { @@ -571,7 +767,7 @@ type PackagesDeleteReq struct { func (x *PackagesDeleteReq) Reset() { *x = PackagesDeleteReq{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[7] + mi := &file_pkgdash_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -584,7 +780,7 @@ func (x *PackagesDeleteReq) String() string { func (*PackagesDeleteReq) ProtoMessage() {} func (x *PackagesDeleteReq) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[7] + mi := &file_pkgdash_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -597,7 +793,7 @@ func (x *PackagesDeleteReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PackagesDeleteReq.ProtoReflect.Descriptor instead. func (*PackagesDeleteReq) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{7} + return file_pkgdash_proto_rawDescGZIP(), []int{11} } func (x *PackagesDeleteReq) GetId() uint64 { @@ -616,7 +812,7 @@ type PackagesDeleteRsp struct { func (x *PackagesDeleteRsp) Reset() { *x = PackagesDeleteRsp{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[8] + mi := &file_pkgdash_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -629,7 +825,7 @@ func (x *PackagesDeleteRsp) String() string { func (*PackagesDeleteRsp) ProtoMessage() {} func (x *PackagesDeleteRsp) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[8] + mi := &file_pkgdash_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -642,7 +838,7 @@ func (x *PackagesDeleteRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use PackagesDeleteRsp.ProtoReflect.Descriptor instead. func (*PackagesDeleteRsp) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{8} + return file_pkgdash_proto_rawDescGZIP(), []int{12} } type PackagesListReq struct { @@ -654,7 +850,7 @@ type PackagesListReq struct { func (x *PackagesListReq) Reset() { *x = PackagesListReq{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[9] + mi := &file_pkgdash_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -667,7 +863,7 @@ func (x *PackagesListReq) String() string { func (*PackagesListReq) ProtoMessage() {} func (x *PackagesListReq) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[9] + mi := &file_pkgdash_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -680,7 +876,7 @@ func (x *PackagesListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PackagesListReq.ProtoReflect.Descriptor instead. func (*PackagesListReq) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{9} + return file_pkgdash_proto_rawDescGZIP(), []int{13} } type PackagesListRsp struct { @@ -694,7 +890,7 @@ type PackagesListRsp struct { func (x *PackagesListRsp) Reset() { *x = PackagesListRsp{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[10] + mi := &file_pkgdash_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -707,7 +903,7 @@ func (x *PackagesListRsp) String() string { func (*PackagesListRsp) ProtoMessage() {} func (x *PackagesListRsp) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[10] + mi := &file_pkgdash_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -720,7 +916,7 @@ func (x *PackagesListRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use PackagesListRsp.ProtoReflect.Descriptor instead. func (*PackagesListRsp) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{10} + return file_pkgdash_proto_rawDescGZIP(), []int{14} } func (x *PackagesListRsp) GetPackages() []*Package { @@ -745,7 +941,7 @@ type PackagesUpdateReq struct { func (x *PackagesUpdateReq) Reset() { *x = PackagesUpdateReq{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[11] + mi := &file_pkgdash_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -758,7 +954,7 @@ func (x *PackagesUpdateReq) String() string { func (*PackagesUpdateReq) ProtoMessage() {} func (x *PackagesUpdateReq) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[11] + mi := &file_pkgdash_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -771,7 +967,7 @@ func (x *PackagesUpdateReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PackagesUpdateReq.ProtoReflect.Descriptor instead. func (*PackagesUpdateReq) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{11} + return file_pkgdash_proto_rawDescGZIP(), []int{15} } func (x *PackagesUpdateReq) GetId() uint64 { @@ -820,7 +1016,7 @@ type PackagesUpdateRsp struct { func (x *PackagesUpdateRsp) Reset() { *x = PackagesUpdateRsp{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[12] + mi := &file_pkgdash_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -833,7 +1029,7 @@ func (x *PackagesUpdateRsp) String() string { func (*PackagesUpdateRsp) ProtoMessage() {} func (x *PackagesUpdateRsp) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[12] + mi := &file_pkgdash_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -846,7 +1042,7 @@ func (x *PackagesUpdateRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use PackagesUpdateRsp.ProtoReflect.Descriptor instead. func (*PackagesUpdateRsp) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{12} + return file_pkgdash_proto_rawDescGZIP(), []int{16} } func (x *PackagesUpdateRsp) GetPackage() *Package { @@ -862,13 +1058,13 @@ type CommentsCreateReq struct { unknownFields protoimpl.UnknownFields PackageId uint64 `protobuf:"varint,1,opt,name=package_id,proto3" json:"package_id,omitempty"` - Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` + Comment string `protobuf:"bytes,2,opt,name=comment,proto3" json:"comment,omitempty"` } func (x *CommentsCreateReq) Reset() { *x = CommentsCreateReq{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[13] + mi := &file_pkgdash_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -881,7 +1077,7 @@ func (x *CommentsCreateReq) String() string { func (*CommentsCreateReq) ProtoMessage() {} func (x *CommentsCreateReq) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[13] + mi := &file_pkgdash_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -894,7 +1090,7 @@ func (x *CommentsCreateReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentsCreateReq.ProtoReflect.Descriptor instead. func (*CommentsCreateReq) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{13} + return file_pkgdash_proto_rawDescGZIP(), []int{17} } func (x *CommentsCreateReq) GetPackageId() uint64 { @@ -904,9 +1100,9 @@ func (x *CommentsCreateReq) GetPackageId() uint64 { return 0 } -func (x *CommentsCreateReq) GetText() string { +func (x *CommentsCreateReq) GetComment() string { if x != nil { - return x.Text + return x.Comment } return "" } @@ -922,7 +1118,7 @@ type CommentsCreateRsp struct { func (x *CommentsCreateRsp) Reset() { *x = CommentsCreateRsp{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[14] + mi := &file_pkgdash_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -935,7 +1131,7 @@ func (x *CommentsCreateRsp) String() string { func (*CommentsCreateRsp) ProtoMessage() {} func (x *CommentsCreateRsp) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[14] + mi := &file_pkgdash_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -948,7 +1144,7 @@ func (x *CommentsCreateRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentsCreateRsp.ProtoReflect.Descriptor instead. func (*CommentsCreateRsp) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{14} + return file_pkgdash_proto_rawDescGZIP(), []int{18} } func (x *CommentsCreateRsp) GetComment() *Comment { @@ -971,7 +1167,7 @@ type PackagesCreateReq struct { func (x *PackagesCreateReq) Reset() { *x = PackagesCreateReq{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[15] + mi := &file_pkgdash_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -984,7 +1180,7 @@ func (x *PackagesCreateReq) String() string { func (*PackagesCreateReq) ProtoMessage() {} func (x *PackagesCreateReq) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[15] + mi := &file_pkgdash_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -997,7 +1193,7 @@ func (x *PackagesCreateReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PackagesCreateReq.ProtoReflect.Descriptor instead. func (*PackagesCreateReq) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{15} + return file_pkgdash_proto_rawDescGZIP(), []int{19} } func (x *PackagesCreateReq) GetName() string { @@ -1026,13 +1222,13 @@ type PackagesCreateRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Package *Package `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` } func (x *PackagesCreateRsp) Reset() { *x = PackagesCreateRsp{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[16] + mi := &file_pkgdash_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1045,7 +1241,7 @@ func (x *PackagesCreateRsp) String() string { func (*PackagesCreateRsp) ProtoMessage() {} func (x *PackagesCreateRsp) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[16] + mi := &file_pkgdash_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1058,14 +1254,14 @@ func (x *PackagesCreateRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use PackagesCreateRsp.ProtoReflect.Descriptor instead. func (*PackagesCreateRsp) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{16} + return file_pkgdash_proto_rawDescGZIP(), []int{20} } -func (x *PackagesCreateRsp) GetStatus() string { +func (x *PackagesCreateRsp) GetPackage() *Package { if x != nil { - return x.Status + return x.Package } - return "" + return nil } type ModulesListReq struct { @@ -1077,7 +1273,7 @@ type ModulesListReq struct { func (x *ModulesListReq) Reset() { *x = ModulesListReq{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[17] + mi := &file_pkgdash_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1090,7 +1286,7 @@ func (x *ModulesListReq) String() string { func (*ModulesListReq) ProtoMessage() {} func (x *ModulesListReq) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[17] + mi := &file_pkgdash_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1103,7 +1299,7 @@ func (x *ModulesListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ModulesListReq.ProtoReflect.Descriptor instead. func (*ModulesListReq) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{17} + return file_pkgdash_proto_rawDescGZIP(), []int{21} } type ModulesListRsp struct { @@ -1117,7 +1313,7 @@ type ModulesListRsp struct { func (x *ModulesListRsp) Reset() { *x = ModulesListRsp{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[18] + mi := &file_pkgdash_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1130,7 +1326,7 @@ func (x *ModulesListRsp) String() string { func (*ModulesListRsp) ProtoMessage() {} func (x *ModulesListRsp) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[18] + mi := &file_pkgdash_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1143,7 +1339,7 @@ func (x *ModulesListRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use ModulesListRsp.ProtoReflect.Descriptor instead. func (*ModulesListRsp) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{18} + return file_pkgdash_proto_rawDescGZIP(), []int{22} } func (x *ModulesListRsp) GetModules() []*Module { @@ -1164,7 +1360,7 @@ type CommentsListReq struct { func (x *CommentsListReq) Reset() { *x = CommentsListReq{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[19] + mi := &file_pkgdash_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1177,7 +1373,7 @@ func (x *CommentsListReq) String() string { func (*CommentsListReq) ProtoMessage() {} func (x *CommentsListReq) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[19] + mi := &file_pkgdash_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1190,7 +1386,7 @@ func (x *CommentsListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentsListReq.ProtoReflect.Descriptor instead. func (*CommentsListReq) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{19} + return file_pkgdash_proto_rawDescGZIP(), []int{23} } func (x *CommentsListReq) GetPackageId() uint64 { @@ -1211,7 +1407,7 @@ type CommentsListRsp struct { func (x *CommentsListRsp) Reset() { *x = CommentsListRsp{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[20] + mi := &file_pkgdash_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1224,7 +1420,7 @@ func (x *CommentsListRsp) String() string { func (*CommentsListRsp) ProtoMessage() {} func (x *CommentsListRsp) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[20] + mi := &file_pkgdash_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1237,7 +1433,7 @@ func (x *CommentsListRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentsListRsp.ProtoReflect.Descriptor instead. func (*CommentsListRsp) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{20} + return file_pkgdash_proto_rawDescGZIP(), []int{24} } func (x *CommentsListRsp) GetComments() []*Comment { @@ -1259,7 +1455,7 @@ type CommentsLookupReq struct { func (x *CommentsLookupReq) Reset() { *x = CommentsLookupReq{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[21] + mi := &file_pkgdash_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1272,7 +1468,7 @@ func (x *CommentsLookupReq) String() string { func (*CommentsLookupReq) ProtoMessage() {} func (x *CommentsLookupReq) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[21] + mi := &file_pkgdash_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1285,7 +1481,7 @@ func (x *CommentsLookupReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentsLookupReq.ProtoReflect.Descriptor instead. func (*CommentsLookupReq) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{21} + return file_pkgdash_proto_rawDescGZIP(), []int{25} } func (x *CommentsLookupReq) GetId() uint64 { @@ -1313,7 +1509,7 @@ type CommentsLookupRsp struct { func (x *CommentsLookupRsp) Reset() { *x = CommentsLookupRsp{} if protoimpl.UnsafeEnabled { - mi := &file_pkgdash_proto_msgTypes[22] + mi := &file_pkgdash_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1326,7 +1522,7 @@ func (x *CommentsLookupRsp) String() string { func (*CommentsLookupRsp) ProtoMessage() {} func (x *CommentsLookupRsp) ProtoReflect() protoreflect.Message { - mi := &file_pkgdash_proto_msgTypes[22] + mi := &file_pkgdash_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1339,7 +1535,7 @@ func (x *CommentsLookupRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentsLookupRsp.ProtoReflect.Descriptor instead. func (*CommentsLookupRsp) Descriptor() ([]byte, []int) { - return file_pkgdash_proto_rawDescGZIP(), []int{22} + return file_pkgdash_proto_rawDescGZIP(), []int{26} } func (x *CommentsLookupRsp) GetComment() *Comment { @@ -1355,245 +1551,282 @@ var file_pkgdash_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x1a, 0x15, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1b, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x62, 0x0a, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, - 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x75, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, - 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x94, 0x02, 0x0a, 0x07, 0x50, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x03, - 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x04, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x04, 0x52, 0x08, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x22, 0x9c, 0x02, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, - 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, - 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x2a, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x22, 0x87, 0x02, 0x0a, 0x05, 0x49, 0x73, 0x73, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x64, 0x65, 0x73, - 0x63, 0x12, 0x21, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x07, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x34, - 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0xc5, 0x01, 0x0a, 0x07, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x21, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1b, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x24, 0x0a, 0x12, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x73, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3f, 0x0a, 0x12, + 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, + 0x73, 0x70, 0x12, 0x29, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x23, 0x0a, + 0x11, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x3f, 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x6f, + 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, + 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x22, 0x62, 0x0a, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0x12, + 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xcf, 0x02, 0x0a, 0x07, 0x50, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, + 0x03, 0x75, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x39, + 0x0a, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x6c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x22, 0x9c, 0x02, 0x0a, 0x06, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, + 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x12, 0x2a, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, + 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x07, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0x87, 0x02, 0x0a, 0x05, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x32, 0x02, 0x20, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x04, + 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x10, 0x01, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x21, 0x0a, 0x07, 0x70, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, + 0x02, 0x20, 0x00, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x22, 0x43, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, 0x23, 0x0a, 0x11, - 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, - 0x64, 0x22, 0x13, 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, 0x11, 0x0a, 0x0f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x3f, 0x0a, 0x0f, 0x50, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x08, - 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, + 0x65, 0x64, 0x22, 0xcb, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x17, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, + 0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, + 0x00, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x22, 0x43, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, 0x23, 0x0a, 0x11, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x13, 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x73, 0x70, 0x22, 0x11, 0x0a, 0x0f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x3f, 0x0a, 0x0f, 0x50, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x08, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, + 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x08, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, + 0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, + 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, + 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, + 0x73, 0x22, 0x3f, 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, + 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x22, 0x56, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x32, 0x02, 0x20, 0x00, 0x52, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x3f, 0x0a, 0x11, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x12, + 0x2a, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x65, 0x0a, 0x11, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, + 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, + 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x3b, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x29, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, + 0x73, 0x68, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x3f, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6b, 0x67, + 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x43, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x3f, 0x0a, 0x11, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x73, 0x70, + 0x12, 0x2a, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0xd5, 0x0d, 0x0a, + 0x0e, 0x50, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x91, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, + 0x75, 0x70, 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x11, 0x50, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, - 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x04, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x69, - 0x73, 0x73, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6b, 0x67, 0x64, - 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x07, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x22, 0x50, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, - 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3f, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, - 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x07, - 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x65, 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, - 0x03, 0x75, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x34, - 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x52, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x3b, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x29, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x6b, 0x67, 0x64, - 0x61, 0x73, 0x68, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x3f, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x08, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6b, - 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x43, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x3f, 0x0a, 0x11, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x73, - 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0xa1, 0x0b, - 0x0a, 0x0e, 0x50, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x8f, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x43, 0x72, 0x65, + 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x73, 0x70, 0x22, 0x47, 0xaa, 0x84, 0x9e, 0x03, + 0x29, 0x2a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, + 0x70, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, + 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x13, + 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x12, 0x8f, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, + 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, 0x45, + 0xaa, 0x84, 0x9e, 0x03, 0x29, 0x2a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, + 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, + 0xff, 0xf9, 0x01, 0x11, 0x22, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x91, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, + 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x73, 0x70, + 0x22, 0x47, 0xaa, 0x84, 0x9e, 0x03, 0x29, 0x2a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, + 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, + 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x13, 0x2a, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x84, 0x01, 0x0a, 0x0c, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x6b, 0x67, + 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x22, 0x40, + 0xaa, 0x84, 0x9e, 0x03, 0x27, 0x2a, 0x0c, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, + 0x69, 0x73, 0x74, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, + 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, + 0x01, 0x0e, 0x12, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, + 0x12, 0x9d, 0x01, 0x0a, 0x0f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x73, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x73, 0x70, 0x22, 0x50, + 0xaa, 0x84, 0x9e, 0x03, 0x2a, 0x2a, 0x0f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, + 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, + 0xea, 0xff, 0xf9, 0x01, 0x1b, 0x12, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x12, 0x94, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, - 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, 0x45, 0xaa, 0x84, 0x9e, - 0x03, 0x29, 0x2a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, + 0x65, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, 0x4a, 0xaa, 0x84, 0x9e, + 0x03, 0x29, 0x2a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, 0x01, - 0x11, 0x22, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x3a, - 0x01, 0x2a, 0x12, 0x91, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, - 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, 0x47, 0xaa, - 0x84, 0x9e, 0x03, 0x29, 0x2a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, - 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, - 0xf9, 0x01, 0x13, 0x2a, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x84, 0x01, 0x0a, 0x0c, 0x50, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, - 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x22, 0x40, 0xaa, 0x84, 0x9e, - 0x03, 0x27, 0x2a, 0x0c, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, - 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, - 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x0e, 0x12, - 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x12, 0x94, 0x01, - 0x0a, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, - 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, 0x4a, 0xaa, 0x84, 0x9e, 0x03, 0x29, 0x2a, - 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, - 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x16, 0x1a, 0x11, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, - 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xa5, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, - 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x16, 0x1a, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xa5, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, + 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x73, 0x70, 0x22, 0x5b, 0xaa, 0x84, 0x9e, 0x03, 0x29, 0x2a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, + 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x27, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, + 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x01, 0x2a, 0x12, + 0xc5, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, + 0x75, 0x70, 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1a, + 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x73, 0x70, 0x22, 0x7b, 0xaa, 0x84, 0x9e, 0x03, + 0x29, 0x2a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, + 0x70, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, + 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x47, + 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x5a, 0x29, 0x12, 0x27, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, + 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x22, 0x56, 0xaa, 0x84, + 0x9e, 0x03, 0x27, 0x2a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x69, 0x73, + 0x74, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, + 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x24, + 0x12, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x7b, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x12, 0xbc, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, + 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, - 0x5b, 0xaa, 0x84, 0x9e, 0x03, 0x29, 0x2a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, + 0x72, 0xaa, 0x84, 0x9e, 0x03, 0x29, 0x2a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, - 0xea, 0xff, 0xf9, 0x01, 0x27, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0xea, 0xff, 0xf9, 0x01, 0x3e, 0x2a, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x7d, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xc5, 0x01, 0x0a, - 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x12, - 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x6b, - 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x6f, - 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x73, 0x70, 0x22, 0x7b, 0xaa, 0x84, 0x9e, 0x03, 0x29, 0x2a, 0x0e, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x42, 0x17, - 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x47, 0x12, 0x1a, 0x2f, - 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x5a, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, - 0x18, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x22, 0x56, 0xaa, 0x84, 0x9e, 0x03, 0x27, - 0x2a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x17, - 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x24, 0x12, 0x22, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0xbc, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x1a, 0x1a, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, 0x72, 0xaa, 0x84, - 0x9e, 0x03, 0x29, 0x2a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x64, - 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, 0xff, 0xf9, - 0x01, 0x3e, 0x2a, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, - 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x5a, 0x13, 0x2a, 0x11, 0x2f, - 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, - 0x12, 0x7f, 0x0a, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x17, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, - 0x73, 0x68, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, - 0x70, 0x22, 0x3e, 0xaa, 0x84, 0x9e, 0x03, 0x26, 0x2a, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x73, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, 0x2e, 0x70, 0x6b, - 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, 0x70, 0xb2, 0xea, - 0xff, 0xf9, 0x01, 0x0d, 0x12, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x73, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x6f, 0x2e, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, - 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2d, 0x6f, 0x72, - 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, - 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x5a, 0x13, + 0x2a, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x12, 0x7f, 0x0a, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x17, 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x6b, + 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x73, 0x70, 0x22, 0x3e, 0xaa, 0x84, 0x9e, 0x03, 0x26, 0x2a, 0x0b, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x17, 0x0a, 0x15, 0x12, 0x13, 0x0a, 0x11, + 0x2e, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x73, + 0x70, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x0d, 0x12, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x6f, 0x2e, 0x75, 0x6e, 0x69, 0x73, 0x74, + 0x61, 0x63, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, + 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x3b, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1608,71 +1841,83 @@ func file_pkgdash_proto_rawDescGZIP() []byte { return file_pkgdash_proto_rawDescData } -var file_pkgdash_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_pkgdash_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_pkgdash_proto_goTypes = []interface{}{ - (*ErrorRsp)(nil), // 0: pkgdash.ErrorRsp - (*Package)(nil), // 1: pkgdash.Package - (*Module)(nil), // 2: pkgdash.Module - (*Issue)(nil), // 3: pkgdash.Issue - (*Comment)(nil), // 4: pkgdash.Comment - (*CommentsDeleteReq)(nil), // 5: pkgdash.CommentsDeleteReq - (*CommentsDeleteRsp)(nil), // 6: pkgdash.CommentsDeleteRsp - (*PackagesDeleteReq)(nil), // 7: pkgdash.PackagesDeleteReq - (*PackagesDeleteRsp)(nil), // 8: pkgdash.PackagesDeleteRsp - (*PackagesListReq)(nil), // 9: pkgdash.PackagesListReq - (*PackagesListRsp)(nil), // 10: pkgdash.PackagesListRsp - (*PackagesUpdateReq)(nil), // 11: pkgdash.PackagesUpdateReq - (*PackagesUpdateRsp)(nil), // 12: pkgdash.PackagesUpdateRsp - (*CommentsCreateReq)(nil), // 13: pkgdash.CommentsCreateReq - (*CommentsCreateRsp)(nil), // 14: pkgdash.CommentsCreateRsp - (*PackagesCreateReq)(nil), // 15: pkgdash.PackagesCreateReq - (*PackagesCreateRsp)(nil), // 16: pkgdash.PackagesCreateRsp - (*ModulesListReq)(nil), // 17: pkgdash.ModulesListReq - (*ModulesListRsp)(nil), // 18: pkgdash.ModulesListRsp - (*CommentsListReq)(nil), // 19: pkgdash.CommentsListReq - (*CommentsListRsp)(nil), // 20: pkgdash.CommentsListRsp - (*CommentsLookupReq)(nil), // 21: pkgdash.CommentsLookupReq - (*CommentsLookupRsp)(nil), // 22: pkgdash.CommentsLookupRsp - (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp + (*PackagesModulesReq)(nil), // 0: pkgdash.PackagesModulesReq + (*PackagesModulesRsp)(nil), // 1: pkgdash.PackagesModulesRsp + (*PackagesLookupReq)(nil), // 2: pkgdash.PackagesLookupReq + (*PackagesLookupRsp)(nil), // 3: pkgdash.PackagesLookupRsp + (*ErrorRsp)(nil), // 4: pkgdash.ErrorRsp + (*Package)(nil), // 5: pkgdash.Package + (*Module)(nil), // 6: pkgdash.Module + (*Issue)(nil), // 7: pkgdash.Issue + (*Comment)(nil), // 8: pkgdash.Comment + (*CommentsDeleteReq)(nil), // 9: pkgdash.CommentsDeleteReq + (*CommentsDeleteRsp)(nil), // 10: pkgdash.CommentsDeleteRsp + (*PackagesDeleteReq)(nil), // 11: pkgdash.PackagesDeleteReq + (*PackagesDeleteRsp)(nil), // 12: pkgdash.PackagesDeleteRsp + (*PackagesListReq)(nil), // 13: pkgdash.PackagesListReq + (*PackagesListRsp)(nil), // 14: pkgdash.PackagesListRsp + (*PackagesUpdateReq)(nil), // 15: pkgdash.PackagesUpdateReq + (*PackagesUpdateRsp)(nil), // 16: pkgdash.PackagesUpdateRsp + (*CommentsCreateReq)(nil), // 17: pkgdash.CommentsCreateReq + (*CommentsCreateRsp)(nil), // 18: pkgdash.CommentsCreateRsp + (*PackagesCreateReq)(nil), // 19: pkgdash.PackagesCreateReq + (*PackagesCreateRsp)(nil), // 20: pkgdash.PackagesCreateRsp + (*ModulesListReq)(nil), // 21: pkgdash.ModulesListReq + (*ModulesListRsp)(nil), // 22: pkgdash.ModulesListRsp + (*CommentsListReq)(nil), // 23: pkgdash.CommentsListReq + (*CommentsListRsp)(nil), // 24: pkgdash.CommentsListRsp + (*CommentsLookupReq)(nil), // 25: pkgdash.CommentsLookupReq + (*CommentsLookupRsp)(nil), // 26: pkgdash.CommentsLookupRsp + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp } var file_pkgdash_proto_depIdxs = []int32{ - 23, // 0: pkgdash.Package.created:type_name -> google.protobuf.Timestamp - 23, // 1: pkgdash.Package.updated:type_name -> google.protobuf.Timestamp - 23, // 2: pkgdash.Module.created:type_name -> google.protobuf.Timestamp - 23, // 3: pkgdash.Module.updated:type_name -> google.protobuf.Timestamp - 23, // 4: pkgdash.Issue.created:type_name -> google.protobuf.Timestamp - 23, // 5: pkgdash.Issue.updated:type_name -> google.protobuf.Timestamp - 23, // 6: pkgdash.Comment.created:type_name -> google.protobuf.Timestamp - 23, // 7: pkgdash.Comment.updated:type_name -> google.protobuf.Timestamp - 1, // 8: pkgdash.PackagesListRsp.packages:type_name -> pkgdash.Package - 1, // 9: pkgdash.PackagesUpdateRsp.package:type_name -> pkgdash.Package - 4, // 10: pkgdash.CommentsCreateRsp.comment:type_name -> pkgdash.Comment - 2, // 11: pkgdash.ModulesListRsp.modules:type_name -> pkgdash.Module - 4, // 12: pkgdash.CommentsListRsp.comments:type_name -> pkgdash.Comment - 4, // 13: pkgdash.CommentsLookupRsp.comment:type_name -> pkgdash.Comment - 15, // 14: pkgdash.PkgdashService.PackagesCreate:input_type -> pkgdash.PackagesCreateReq - 7, // 15: pkgdash.PkgdashService.PackagesDelete:input_type -> pkgdash.PackagesDeleteReq - 9, // 16: pkgdash.PkgdashService.PackagesList:input_type -> pkgdash.PackagesListReq - 11, // 17: pkgdash.PkgdashService.PackagesUpdate:input_type -> pkgdash.PackagesUpdateReq - 13, // 18: pkgdash.PkgdashService.CommentsCreate:input_type -> pkgdash.CommentsCreateReq - 21, // 19: pkgdash.PkgdashService.CommentsLookup:input_type -> pkgdash.CommentsLookupReq - 19, // 20: pkgdash.PkgdashService.CommentsList:input_type -> pkgdash.CommentsListReq - 5, // 21: pkgdash.PkgdashService.CommentsDelete:input_type -> pkgdash.CommentsDeleteReq - 17, // 22: pkgdash.PkgdashService.ModulesList:input_type -> pkgdash.ModulesListReq - 16, // 23: pkgdash.PkgdashService.PackagesCreate:output_type -> pkgdash.PackagesCreateRsp - 8, // 24: pkgdash.PkgdashService.PackagesDelete:output_type -> pkgdash.PackagesDeleteRsp - 10, // 25: pkgdash.PkgdashService.PackagesList:output_type -> pkgdash.PackagesListRsp - 12, // 26: pkgdash.PkgdashService.PackagesUpdate:output_type -> pkgdash.PackagesUpdateRsp - 14, // 27: pkgdash.PkgdashService.CommentsCreate:output_type -> pkgdash.CommentsCreateRsp - 22, // 28: pkgdash.PkgdashService.CommentsLookup:output_type -> pkgdash.CommentsLookupRsp - 20, // 29: pkgdash.PkgdashService.CommentsList:output_type -> pkgdash.CommentsListRsp - 6, // 30: pkgdash.PkgdashService.CommentsDelete:output_type -> pkgdash.CommentsDeleteRsp - 18, // 31: pkgdash.PkgdashService.ModulesList:output_type -> pkgdash.ModulesListRsp - 23, // [23:32] is the sub-list for method output_type - 14, // [14:23] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 6, // 0: pkgdash.PackagesModulesRsp.modules:type_name -> pkgdash.Module + 5, // 1: pkgdash.PackagesLookupRsp.package:type_name -> pkgdash.Package + 27, // 2: pkgdash.Package.created:type_name -> google.protobuf.Timestamp + 27, // 3: pkgdash.Package.updated:type_name -> google.protobuf.Timestamp + 27, // 4: pkgdash.Package.last_check:type_name -> google.protobuf.Timestamp + 27, // 5: pkgdash.Module.created:type_name -> google.protobuf.Timestamp + 27, // 6: pkgdash.Module.updated:type_name -> google.protobuf.Timestamp + 27, // 7: pkgdash.Issue.created:type_name -> google.protobuf.Timestamp + 27, // 8: pkgdash.Issue.updated:type_name -> google.protobuf.Timestamp + 27, // 9: pkgdash.Comment.created:type_name -> google.protobuf.Timestamp + 27, // 10: pkgdash.Comment.updated:type_name -> google.protobuf.Timestamp + 5, // 11: pkgdash.PackagesListRsp.packages:type_name -> pkgdash.Package + 5, // 12: pkgdash.PackagesUpdateRsp.package:type_name -> pkgdash.Package + 8, // 13: pkgdash.CommentsCreateRsp.comment:type_name -> pkgdash.Comment + 5, // 14: pkgdash.PackagesCreateRsp.package:type_name -> pkgdash.Package + 6, // 15: pkgdash.ModulesListRsp.modules:type_name -> pkgdash.Module + 8, // 16: pkgdash.CommentsListRsp.comments:type_name -> pkgdash.Comment + 8, // 17: pkgdash.CommentsLookupRsp.comment:type_name -> pkgdash.Comment + 2, // 18: pkgdash.PkgdashService.PackagesLookup:input_type -> pkgdash.PackagesLookupReq + 19, // 19: pkgdash.PkgdashService.PackagesCreate:input_type -> pkgdash.PackagesCreateReq + 11, // 20: pkgdash.PkgdashService.PackagesDelete:input_type -> pkgdash.PackagesDeleteReq + 13, // 21: pkgdash.PkgdashService.PackagesList:input_type -> pkgdash.PackagesListReq + 0, // 22: pkgdash.PkgdashService.PackagesModules:input_type -> pkgdash.PackagesModulesReq + 15, // 23: pkgdash.PkgdashService.PackagesUpdate:input_type -> pkgdash.PackagesUpdateReq + 17, // 24: pkgdash.PkgdashService.CommentsCreate:input_type -> pkgdash.CommentsCreateReq + 25, // 25: pkgdash.PkgdashService.CommentsLookup:input_type -> pkgdash.CommentsLookupReq + 23, // 26: pkgdash.PkgdashService.CommentsList:input_type -> pkgdash.CommentsListReq + 9, // 27: pkgdash.PkgdashService.CommentsDelete:input_type -> pkgdash.CommentsDeleteReq + 21, // 28: pkgdash.PkgdashService.ModulesList:input_type -> pkgdash.ModulesListReq + 3, // 29: pkgdash.PkgdashService.PackagesLookup:output_type -> pkgdash.PackagesLookupRsp + 20, // 30: pkgdash.PkgdashService.PackagesCreate:output_type -> pkgdash.PackagesCreateRsp + 12, // 31: pkgdash.PkgdashService.PackagesDelete:output_type -> pkgdash.PackagesDeleteRsp + 14, // 32: pkgdash.PkgdashService.PackagesList:output_type -> pkgdash.PackagesListRsp + 1, // 33: pkgdash.PkgdashService.PackagesModules:output_type -> pkgdash.PackagesModulesRsp + 16, // 34: pkgdash.PkgdashService.PackagesUpdate:output_type -> pkgdash.PackagesUpdateRsp + 18, // 35: pkgdash.PkgdashService.CommentsCreate:output_type -> pkgdash.CommentsCreateRsp + 26, // 36: pkgdash.PkgdashService.CommentsLookup:output_type -> pkgdash.CommentsLookupRsp + 24, // 37: pkgdash.PkgdashService.CommentsList:output_type -> pkgdash.CommentsListRsp + 10, // 38: pkgdash.PkgdashService.CommentsDelete:output_type -> pkgdash.CommentsDeleteRsp + 22, // 39: pkgdash.PkgdashService.ModulesList:output_type -> pkgdash.ModulesListRsp + 29, // [29:40] is the sub-list for method output_type + 18, // [18:29] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_pkgdash_proto_init() } @@ -1682,7 +1927,7 @@ func file_pkgdash_proto_init() { } if !protoimpl.UnsafeEnabled { file_pkgdash_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ErrorRsp); i { + switch v := v.(*PackagesModulesReq); i { case 0: return &v.state case 1: @@ -1694,7 +1939,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Package); i { + switch v := v.(*PackagesModulesRsp); i { case 0: return &v.state case 1: @@ -1706,7 +1951,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Module); i { + switch v := v.(*PackagesLookupReq); i { case 0: return &v.state case 1: @@ -1718,7 +1963,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Issue); i { + switch v := v.(*PackagesLookupRsp); i { case 0: return &v.state case 1: @@ -1730,7 +1975,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Comment); i { + switch v := v.(*ErrorRsp); i { case 0: return &v.state case 1: @@ -1742,7 +1987,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommentsDeleteReq); i { + switch v := v.(*Package); i { case 0: return &v.state case 1: @@ -1754,7 +1999,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommentsDeleteRsp); i { + switch v := v.(*Module); i { case 0: return &v.state case 1: @@ -1766,7 +2011,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackagesDeleteReq); i { + switch v := v.(*Issue); i { case 0: return &v.state case 1: @@ -1778,7 +2023,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackagesDeleteRsp); i { + switch v := v.(*Comment); i { case 0: return &v.state case 1: @@ -1790,7 +2035,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackagesListReq); i { + switch v := v.(*CommentsDeleteReq); i { case 0: return &v.state case 1: @@ -1802,7 +2047,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackagesListRsp); i { + switch v := v.(*CommentsDeleteRsp); i { case 0: return &v.state case 1: @@ -1814,7 +2059,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackagesUpdateReq); i { + switch v := v.(*PackagesDeleteReq); i { case 0: return &v.state case 1: @@ -1826,7 +2071,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackagesUpdateRsp); i { + switch v := v.(*PackagesDeleteRsp); i { case 0: return &v.state case 1: @@ -1838,7 +2083,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommentsCreateReq); i { + switch v := v.(*PackagesListReq); i { case 0: return &v.state case 1: @@ -1850,7 +2095,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommentsCreateRsp); i { + switch v := v.(*PackagesListRsp); i { case 0: return &v.state case 1: @@ -1862,7 +2107,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackagesCreateReq); i { + switch v := v.(*PackagesUpdateReq); i { case 0: return &v.state case 1: @@ -1874,7 +2119,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackagesCreateRsp); i { + switch v := v.(*PackagesUpdateRsp); i { case 0: return &v.state case 1: @@ -1886,7 +2131,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModulesListReq); i { + switch v := v.(*CommentsCreateReq); i { case 0: return &v.state case 1: @@ -1898,7 +2143,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModulesListRsp); i { + switch v := v.(*CommentsCreateRsp); i { case 0: return &v.state case 1: @@ -1910,7 +2155,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommentsListReq); i { + switch v := v.(*PackagesCreateReq); i { case 0: return &v.state case 1: @@ -1922,7 +2167,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommentsListRsp); i { + switch v := v.(*PackagesCreateRsp); i { case 0: return &v.state case 1: @@ -1934,7 +2179,7 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommentsLookupReq); i { + switch v := v.(*ModulesListReq); i { case 0: return &v.state case 1: @@ -1946,6 +2191,54 @@ func file_pkgdash_proto_init() { } } file_pkgdash_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ModulesListRsp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkgdash_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommentsListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkgdash_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommentsListRsp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkgdash_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommentsLookupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkgdash_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CommentsLookupRsp); i { case 0: return &v.state @@ -1964,7 +2257,7 @@ func file_pkgdash_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pkgdash_proto_rawDesc, NumEnums: 0, - NumMessages: 23, + NumMessages: 27, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/pkgdash.pb.validate.go b/proto/pkgdash.pb.validate.go index 3a048ba..1bfe30c 100644 --- a/proto/pkgdash.pb.validate.go +++ b/proto/pkgdash.pb.validate.go @@ -35,6 +35,477 @@ var ( _ = sort.Sort ) +// Validate checks the field values on PackagesModulesReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *PackagesModulesReq) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PackagesModulesReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// PackagesModulesReqMultiError, or nil if none found. +func (m *PackagesModulesReq) ValidateAll() error { + return m.validate(true) +} + +func (m *PackagesModulesReq) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return PackagesModulesReqMultiError(errors) + } + return nil +} + +// PackagesModulesReqMultiError is an error wrapping multiple validation errors +// returned by PackagesModulesReq.ValidateAll() if the designated constraints +// aren't met. +type PackagesModulesReqMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PackagesModulesReqMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PackagesModulesReqMultiError) AllErrors() []error { return m } + +// PackagesModulesReqValidationError is the validation error returned by +// PackagesModulesReq.Validate if the designated constraints aren't met. +type PackagesModulesReqValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PackagesModulesReqValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PackagesModulesReqValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PackagesModulesReqValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PackagesModulesReqValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PackagesModulesReqValidationError) ErrorName() string { + return "PackagesModulesReqValidationError" +} + +// Error satisfies the builtin error interface +func (e PackagesModulesReqValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPackagesModulesReq.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PackagesModulesReqValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PackagesModulesReqValidationError{} + +// Validate checks the field values on PackagesModulesRsp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *PackagesModulesRsp) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PackagesModulesRsp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// PackagesModulesRspMultiError, or nil if none found. +func (m *PackagesModulesRsp) ValidateAll() error { + return m.validate(true) +} + +func (m *PackagesModulesRsp) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetModules() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, PackagesModulesRspValidationError{ + field: fmt.Sprintf("Modules[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, PackagesModulesRspValidationError{ + field: fmt.Sprintf("Modules[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PackagesModulesRspValidationError{ + field: fmt.Sprintf("Modules[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return PackagesModulesRspMultiError(errors) + } + return nil +} + +// PackagesModulesRspMultiError is an error wrapping multiple validation errors +// returned by PackagesModulesRsp.ValidateAll() if the designated constraints +// aren't met. +type PackagesModulesRspMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PackagesModulesRspMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PackagesModulesRspMultiError) AllErrors() []error { return m } + +// PackagesModulesRspValidationError is the validation error returned by +// PackagesModulesRsp.Validate if the designated constraints aren't met. +type PackagesModulesRspValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PackagesModulesRspValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PackagesModulesRspValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PackagesModulesRspValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PackagesModulesRspValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PackagesModulesRspValidationError) ErrorName() string { + return "PackagesModulesRspValidationError" +} + +// Error satisfies the builtin error interface +func (e PackagesModulesRspValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPackagesModulesRsp.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PackagesModulesRspValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PackagesModulesRspValidationError{} + +// Validate checks the field values on PackagesLookupReq with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *PackagesLookupReq) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PackagesLookupReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// PackagesLookupReqMultiError, or nil if none found. +func (m *PackagesLookupReq) ValidateAll() error { + return m.validate(true) +} + +func (m *PackagesLookupReq) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return PackagesLookupReqMultiError(errors) + } + return nil +} + +// PackagesLookupReqMultiError is an error wrapping multiple validation errors +// returned by PackagesLookupReq.ValidateAll() if the designated constraints +// aren't met. +type PackagesLookupReqMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PackagesLookupReqMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PackagesLookupReqMultiError) AllErrors() []error { return m } + +// PackagesLookupReqValidationError is the validation error returned by +// PackagesLookupReq.Validate if the designated constraints aren't met. +type PackagesLookupReqValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PackagesLookupReqValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PackagesLookupReqValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PackagesLookupReqValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PackagesLookupReqValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PackagesLookupReqValidationError) ErrorName() string { + return "PackagesLookupReqValidationError" +} + +// Error satisfies the builtin error interface +func (e PackagesLookupReqValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPackagesLookupReq.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PackagesLookupReqValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PackagesLookupReqValidationError{} + +// Validate checks the field values on PackagesLookupRsp with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *PackagesLookupRsp) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PackagesLookupRsp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// PackagesLookupRspMultiError, or nil if none found. +func (m *PackagesLookupRsp) ValidateAll() error { + return m.validate(true) +} + +func (m *PackagesLookupRsp) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetPackage()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, PackagesLookupRspValidationError{ + field: "Package", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, PackagesLookupRspValidationError{ + field: "Package", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPackage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PackagesLookupRspValidationError{ + field: "Package", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return PackagesLookupRspMultiError(errors) + } + return nil +} + +// PackagesLookupRspMultiError is an error wrapping multiple validation errors +// returned by PackagesLookupRsp.ValidateAll() if the designated constraints +// aren't met. +type PackagesLookupRspMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PackagesLookupRspMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PackagesLookupRspMultiError) AllErrors() []error { return m } + +// PackagesLookupRspValidationError is the validation error returned by +// PackagesLookupRsp.Validate if the designated constraints aren't met. +type PackagesLookupRspValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PackagesLookupRspValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PackagesLookupRspValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PackagesLookupRspValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PackagesLookupRspValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PackagesLookupRspValidationError) ErrorName() string { + return "PackagesLookupRspValidationError" +} + +// Error satisfies the builtin error interface +func (e PackagesLookupRspValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPackagesLookupRsp.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PackagesLookupRspValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PackagesLookupRspValidationError{} + // Validate checks the field values on ErrorRsp with the rules defined in the // proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. @@ -195,6 +666,12 @@ func (m *Package) validate(all bool) error { errors = append(errors, err) } + // no validation rules for Modules + + // no validation rules for Issues + + // no validation rules for Comments + if all { switch v := interface{}(m.GetCreated()).(type) { case interface{ ValidateAll() error }: @@ -253,6 +730,35 @@ func (m *Package) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetLastCheck()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, PackageValidationError{ + field: "LastCheck", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, PackageValidationError{ + field: "LastCheck", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLastCheck()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PackageValidationError{ + field: "LastCheck", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return PackageMultiError(errors) } @@ -781,7 +1287,7 @@ func (m *Comment) validate(all bool) error { errors = append(errors, err) } - // no validation rules for Text + // no validation rules for Comment if all { switch v := interface{}(m.GetCreated()).(type) { @@ -1856,7 +2362,7 @@ func (m *CommentsCreateReq) validate(all bool) error { errors = append(errors, err) } - // no validation rules for Text + // no validation rules for Comment if len(errors) > 0 { return CommentsCreateReqMultiError(errors) @@ -2212,15 +2718,33 @@ func (m *PackagesCreateRsp) validate(all bool) error { var errors []error - if utf8.RuneCountInString(m.GetStatus()) < 1 { - err := PackagesCreateRspValidationError{ - field: "Status", - reason: "value length must be at least 1 runes", + if all { + switch v := interface{}(m.GetPackage()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, PackagesCreateRspValidationError{ + field: "Package", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, PackagesCreateRspValidationError{ + field: "Package", + reason: "embedded message failed validation", + cause: err, + }) + } } - if !all { - return err + } else if v, ok := interface{}(m.GetPackage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PackagesCreateRspValidationError{ + field: "Package", + reason: "embedded message failed validation", + cause: err, + } } - errors = append(errors, err) } if len(errors) > 0 { diff --git a/proto/pkgdash.proto b/proto/pkgdash.proto index ea2148e..20f4776 100644 --- a/proto/pkgdash.proto +++ b/proto/pkgdash.proto @@ -3,13 +3,26 @@ syntax = "proto3"; package pkgdash; import "api/annotations.proto"; +import "google/protobuf/timestamp.proto"; import "openapiv3/annotations.proto"; import "validate/validate.proto"; -import "google/protobuf/timestamp.proto"; option go_package = "go.unistack.org/unistack-org/pkgdash/proto;pkgdashpb"; service PkgdashService { + rpc PackagesLookup(PackagesLookupReq) returns (PackagesLookupRsp) { + option (micro.openapiv3.openapiv3_operation) = { + operation_id: "PackagesLookup"; + responses: { + default: { + reference: {_ref: ".pkgdash.ErrorRsp"}; + }; + }; + }; + option (micro.api.http) = { + get: "/v1/packages/{id}"; + }; + } rpc PackagesCreate(PackagesCreateReq) returns (PackagesCreateRsp) { option (micro.openapiv3.openapiv3_operation) = { operation_id: "PackagesCreate"; @@ -46,6 +59,17 @@ service PkgdashService { }; option (micro.api.http) = {get: "/v1/packages"}; } + rpc PackagesModules(PackagesModulesReq) returns (PackagesModulesRsp) { + option (micro.openapiv3.openapiv3_operation) = { + operation_id: "PackagesModules"; + responses: { + default: { + reference: {_ref: ".pkgdash.ErrorRsp"}; + }; + }; + }; + option (micro.api.http) = {get: "/v1/packages/{id}/modules"}; + } rpc PackagesUpdate(PackagesUpdateReq) returns (PackagesUpdateRsp) { option (micro.openapiv3.openapiv3_operation) = { operation_id: "PackagesUpdate"; @@ -126,6 +150,22 @@ service PkgdashService { } } +message PackagesModulesReq { + uint64 id = 1 [json_name = "id"]; +} + +message PackagesModulesRsp { + repeated Module modules = 1 [json_name = "modules"]; +} + +message PackagesLookupReq { + uint64 id = 1 [json_name = "id"]; +} + +message PackagesLookupRsp { + Package package = 1 [json_name = "package"]; +} + message ErrorRsp { string code = 1 [json_name = "code"]; string title = 2 [json_name = "title"]; @@ -137,11 +177,12 @@ message Package { uint64 id = 1 [(validate.rules).uint64.gt = 0]; string name = 2 [(validate.rules).string.min_len = 1]; string url = 3 [(validate.rules).string.min_len = 1]; - repeated uint64 modules = 4; - repeated uint64 issues = 5; - repeated uint64 comments = 6; + uint64 modules = 4; + uint64 issues = 5; + uint64 comments = 6; google.protobuf.Timestamp created = 7; google.protobuf.Timestamp updated = 8; + google.protobuf.Timestamp last_check = 9; } message Module { @@ -167,7 +208,7 @@ message Issue { message Comment { uint64 id = 1 [(validate.rules).uint64.gt = 0]; uint64 package = 2 [(validate.rules).uint64.gt = 0]; - string text = 3; + string comment = 3; google.protobuf.Timestamp created = 4; google.protobuf.Timestamp updated = 5; } @@ -208,7 +249,7 @@ message CommentsCreateReq { json_name = "package_id", (validate.rules).uint64.gt = 0 ]; - string text = 2; + string comment = 2; } message CommentsCreateRsp { @@ -222,13 +263,13 @@ message PackagesCreateReq { } message PackagesCreateRsp { - string status = 1 [(validate.rules).string.min_len = 1]; + Package package = 1 [json_name="package"]; } message ModulesListReq {} message ModulesListRsp { - repeated Module modules = 1; + repeated Module modules = 1 [json_name="modules"]; } message CommentsListReq { diff --git a/proto/pkgdash_micro.pb.go b/proto/pkgdash_micro.pb.go index 4dc5a08..cfce687 100644 --- a/proto/pkgdash_micro.pb.go +++ b/proto/pkgdash_micro.pb.go @@ -17,9 +17,11 @@ var ( ) type PkgdashServiceClient interface { + PackagesLookup(ctx context.Context, req *PackagesLookupReq, opts ...options.Option) (*PackagesLookupRsp, error) PackagesCreate(ctx context.Context, req *PackagesCreateReq, opts ...options.Option) (*PackagesCreateRsp, error) PackagesDelete(ctx context.Context, req *PackagesDeleteReq, opts ...options.Option) (*PackagesDeleteRsp, error) PackagesList(ctx context.Context, req *PackagesListReq, opts ...options.Option) (*PackagesListRsp, error) + PackagesModules(ctx context.Context, req *PackagesModulesReq, opts ...options.Option) (*PackagesModulesRsp, error) PackagesUpdate(ctx context.Context, req *PackagesUpdateReq, opts ...options.Option) (*PackagesUpdateRsp, error) CommentsCreate(ctx context.Context, req *CommentsCreateReq, opts ...options.Option) (*CommentsCreateRsp, error) CommentsLookup(ctx context.Context, req *CommentsLookupReq, opts ...options.Option) (*CommentsLookupRsp, error) @@ -29,9 +31,11 @@ type PkgdashServiceClient interface { } type PkgdashServiceServer interface { + PackagesLookup(ctx context.Context, req *PackagesLookupReq, rsp *PackagesLookupRsp) error PackagesCreate(ctx context.Context, req *PackagesCreateReq, rsp *PackagesCreateRsp) error PackagesDelete(ctx context.Context, req *PackagesDeleteReq, rsp *PackagesDeleteRsp) error PackagesList(ctx context.Context, req *PackagesListReq, rsp *PackagesListRsp) error + PackagesModules(ctx context.Context, req *PackagesModulesReq, rsp *PackagesModulesRsp) error PackagesUpdate(ctx context.Context, req *PackagesUpdateReq, rsp *PackagesUpdateRsp) error CommentsCreate(ctx context.Context, req *CommentsCreateReq, rsp *CommentsCreateRsp) error CommentsLookup(ctx context.Context, req *CommentsLookupReq, rsp *CommentsLookupRsp) error diff --git a/proto/pkgdash_micro_http.pb.go b/proto/pkgdash_micro_http.pb.go index 90f599c..ccf69a2 100644 --- a/proto/pkgdash_micro_http.pb.go +++ b/proto/pkgdash_micro_http.pb.go @@ -16,6 +16,13 @@ import ( var ( PkgdashServiceServerEndpoints = []v4.EndpointMetadata{ + { + Name: "PkgdashService.PackagesLookup", + Path: "/v1/packages/{id}", + Method: "GET", + Body: "", + Stream: false, + }, { Name: "PkgdashService.PackagesCreate", Path: "/v1/packages", @@ -37,6 +44,13 @@ var ( Body: "", Stream: false, }, + { + Name: "PkgdashService.PackagesModules", + Path: "/v1/packages/{id}/modules", + Method: "GET", + Body: "", + Stream: false, + }, { Name: "PkgdashService.PackagesUpdate", Path: "/v1/packages/{id}", @@ -105,6 +119,24 @@ func NewPkgdashServiceClient(name string, c client.Client) PkgdashServiceClient return &pkgdashServiceClient{c: c, name: name} } +func (c *pkgdashServiceClient) PackagesLookup(ctx context.Context, req *PackagesLookupReq, opts ...options.Option) (*PackagesLookupRsp, error) { + errmap := make(map[string]interface{}, 1) + errmap["default"] = &ErrorRsp{} + opts = append(opts, + v41.ErrorMap(errmap), + ) + opts = append(opts, + v41.Method(http.MethodGet), + v41.Path("/v1/packages/{id}"), + ) + rsp := &PackagesLookupRsp{} + err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackagesLookup", req), rsp, opts...) + if err != nil { + return nil, err + } + return rsp, nil +} + func (c *pkgdashServiceClient) PackagesCreate(ctx context.Context, req *PackagesCreateReq, opts ...options.Option) (*PackagesCreateRsp, error) { errmap := make(map[string]interface{}, 1) errmap["default"] = &ErrorRsp{} @@ -160,6 +192,24 @@ func (c *pkgdashServiceClient) PackagesList(ctx context.Context, req *PackagesLi return rsp, nil } +func (c *pkgdashServiceClient) PackagesModules(ctx context.Context, req *PackagesModulesReq, opts ...options.Option) (*PackagesModulesRsp, error) { + errmap := make(map[string]interface{}, 1) + errmap["default"] = &ErrorRsp{} + opts = append(opts, + v41.ErrorMap(errmap), + ) + opts = append(opts, + v41.Method(http.MethodGet), + v41.Path("/v1/packages/{id}/modules"), + ) + rsp := &PackagesModulesRsp{} + err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackagesModules", req), rsp, opts...) + if err != nil { + return nil, err + } + return rsp, nil +} + func (c *pkgdashServiceClient) PackagesUpdate(ctx context.Context, req *PackagesUpdateReq, opts ...options.Option) (*PackagesUpdateRsp, error) { errmap := make(map[string]interface{}, 1) errmap["default"] = &ErrorRsp{} @@ -274,6 +324,10 @@ type pkgdashServiceServer struct { PkgdashServiceServer } +func (h *pkgdashServiceServer) PackagesLookup(ctx context.Context, req *PackagesLookupReq, rsp *PackagesLookupRsp) error { + return h.PkgdashServiceServer.PackagesLookup(ctx, req, rsp) +} + func (h *pkgdashServiceServer) PackagesCreate(ctx context.Context, req *PackagesCreateReq, rsp *PackagesCreateRsp) error { return h.PkgdashServiceServer.PackagesCreate(ctx, req, rsp) } @@ -286,6 +340,10 @@ func (h *pkgdashServiceServer) PackagesList(ctx context.Context, req *PackagesLi return h.PkgdashServiceServer.PackagesList(ctx, req, rsp) } +func (h *pkgdashServiceServer) PackagesModules(ctx context.Context, req *PackagesModulesReq, rsp *PackagesModulesRsp) error { + return h.PkgdashServiceServer.PackagesModules(ctx, req, rsp) +} + func (h *pkgdashServiceServer) PackagesUpdate(ctx context.Context, req *PackagesUpdateReq, rsp *PackagesUpdateRsp) error { return h.PkgdashServiceServer.PackagesUpdate(ctx, req, rsp) } @@ -312,9 +370,11 @@ func (h *pkgdashServiceServer) ModulesList(ctx context.Context, req *ModulesList func RegisterPkgdashServiceServer(s server.Server, sh PkgdashServiceServer, opts ...options.Option) error { type pkgdashService interface { + PackagesLookup(ctx context.Context, req *PackagesLookupReq, rsp *PackagesLookupRsp) error PackagesCreate(ctx context.Context, req *PackagesCreateReq, rsp *PackagesCreateRsp) error PackagesDelete(ctx context.Context, req *PackagesDeleteReq, rsp *PackagesDeleteRsp) error PackagesList(ctx context.Context, req *PackagesListReq, rsp *PackagesListRsp) error + PackagesModules(ctx context.Context, req *PackagesModulesReq, rsp *PackagesModulesRsp) error PackagesUpdate(ctx context.Context, req *PackagesUpdateReq, rsp *PackagesUpdateRsp) error CommentsCreate(ctx context.Context, req *CommentsCreateReq, rsp *CommentsCreateRsp) error CommentsLookup(ctx context.Context, req *CommentsLookupReq, rsp *CommentsLookupRsp) error diff --git a/ui/src/app/api/models.ts b/ui/src/app/api/models.ts index 2e0c5b9..aced0c2 100644 --- a/ui/src/app/api/models.ts +++ b/ui/src/app/api/models.ts @@ -14,5 +14,7 @@ export { PackagesCreateReq } from './models/packages-create-req'; export { PackagesCreateRsp } from './models/packages-create-rsp'; export { PackagesDeleteRsp } from './models/packages-delete-rsp'; export { PackagesListRsp } from './models/packages-list-rsp'; +export { PackagesLookupRsp } from './models/packages-lookup-rsp'; +export { PackagesModulesRsp } from './models/packages-modules-rsp'; export { PackagesUpdateReq } from './models/packages-update-req'; export { PackagesUpdateRsp } from './models/packages-update-rsp'; diff --git a/ui/src/app/api/models/comment.ts b/ui/src/app/api/models/comment.ts index bbf3a61..6768f1b 100644 --- a/ui/src/app/api/models/comment.ts +++ b/ui/src/app/api/models/comment.ts @@ -1,9 +1,9 @@ /* tslint:disable */ /* eslint-disable */ export interface Comment { + comment?: string; created?: string; id?: number; package?: number; - text?: string; updated?: string; } diff --git a/ui/src/app/api/models/comments-create-req.ts b/ui/src/app/api/models/comments-create-req.ts index 62ebf2c..42ead4b 100644 --- a/ui/src/app/api/models/comments-create-req.ts +++ b/ui/src/app/api/models/comments-create-req.ts @@ -1,6 +1,6 @@ /* tslint:disable */ /* eslint-disable */ export interface CommentsCreateReq { + comment?: string; package_id?: number; - text?: string; } diff --git a/ui/src/app/api/models/package.ts b/ui/src/app/api/models/package.ts index b8c470c..255f26a 100644 --- a/ui/src/app/api/models/package.ts +++ b/ui/src/app/api/models/package.ts @@ -1,11 +1,12 @@ /* tslint:disable */ /* eslint-disable */ export interface Package { - comments?: Array; + comments?: number; created?: string; id?: number; - issues?: Array; - modules?: Array; + issues?: number; + last_check?: string; + modules?: number; name?: string; updated?: string; url?: string; diff --git a/ui/src/app/api/models/packages-create-rsp.ts b/ui/src/app/api/models/packages-create-rsp.ts index 5fb2fb5..c7c5024 100644 --- a/ui/src/app/api/models/packages-create-rsp.ts +++ b/ui/src/app/api/models/packages-create-rsp.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +import { Package } from './package'; export interface PackagesCreateRsp { - status?: string; + package?: Package; } diff --git a/ui/src/app/api/models/packages-lookup-rsp.ts b/ui/src/app/api/models/packages-lookup-rsp.ts new file mode 100644 index 0000000..01ff7ce --- /dev/null +++ b/ui/src/app/api/models/packages-lookup-rsp.ts @@ -0,0 +1,6 @@ +/* tslint:disable */ +/* eslint-disable */ +import { Package } from './package'; +export interface PackagesLookupRsp { + package?: Package; +} diff --git a/ui/src/app/api/models/packages-modules-rsp.ts b/ui/src/app/api/models/packages-modules-rsp.ts new file mode 100644 index 0000000..763f551 --- /dev/null +++ b/ui/src/app/api/models/packages-modules-rsp.ts @@ -0,0 +1,6 @@ +/* tslint:disable */ +/* eslint-disable */ +import { Module } from './module'; +export interface PackagesModulesRsp { + modules?: Array; +} diff --git a/ui/src/app/api/services/pkgdash-service.service.ts b/ui/src/app/api/services/pkgdash-service.service.ts index 65c0f17..4fc2855 100644 --- a/ui/src/app/api/services/pkgdash-service.service.ts +++ b/ui/src/app/api/services/pkgdash-service.service.ts @@ -20,6 +20,8 @@ import { PackagesCreateReq } from '../models/packages-create-req'; import { PackagesCreateRsp } from '../models/packages-create-rsp'; import { PackagesDeleteRsp } from '../models/packages-delete-rsp'; import { PackagesListRsp } from '../models/packages-list-rsp'; +import { PackagesLookupRsp } from '../models/packages-lookup-rsp'; +import { PackagesModulesRsp } from '../models/packages-modules-rsp'; import { PackagesUpdateReq } from '../models/packages-update-req'; import { PackagesUpdateRsp } from '../models/packages-update-rsp'; @@ -214,6 +216,53 @@ export class PkgdashServiceService extends BaseService { ); } + /** Path part for operation `packagesLookup()` */ + static readonly PackagesLookupPath = '/v1/packages/{id}'; + + /** + * This method provides access to the full `HttpResponse`, allowing access to response headers. + * To access only the response body, use `packagesLookup()` instead. + * + * This method doesn't expect any request body. + */ + packagesLookup$Response( + params: { + id: number; + }, + context?: HttpContext + ): Observable> { + const rb = new RequestBuilder(this.rootUrl, PkgdashServiceService.PackagesLookupPath, 'get'); + if (params) { + rb.path('id', params.id, {}); + } + + return this.http.request( + rb.build({ responseType: 'json', accept: 'application/json', context }) + ).pipe( + filter((r: any): r is HttpResponse => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse; + }) + ); + } + + /** + * This method provides access only to the response body. + * To access the full response (for headers, for example), `packagesLookup$Response()` instead. + * + * This method doesn't expect any request body. + */ + packagesLookup( + params: { + id: number; + }, + context?: HttpContext + ): Observable { + return this.packagesLookup$Response(params, context).pipe( + map((r: StrictHttpResponse): PackagesLookupRsp => r.body) + ); + } + /** Path part for operation `packagesUpdate()` */ static readonly PackagesUpdatePath = '/v1/packages/{id}'; @@ -311,6 +360,53 @@ export class PkgdashServiceService extends BaseService { ); } + /** Path part for operation `packagesModules()` */ + static readonly PackagesModulesPath = '/v1/packages/{id}/modules'; + + /** + * This method provides access to the full `HttpResponse`, allowing access to response headers. + * To access only the response body, use `packagesModules()` instead. + * + * This method doesn't expect any request body. + */ + packagesModules$Response( + params: { + id: number; + }, + context?: HttpContext + ): Observable> { + const rb = new RequestBuilder(this.rootUrl, PkgdashServiceService.PackagesModulesPath, 'get'); + if (params) { + rb.path('id', params.id, {}); + } + + return this.http.request( + rb.build({ responseType: 'json', accept: 'application/json', context }) + ).pipe( + filter((r: any): r is HttpResponse => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse; + }) + ); + } + + /** + * This method provides access only to the response body. + * To access the full response (for headers, for example), `packagesModules$Response()` instead. + * + * This method doesn't expect any request body. + */ + packagesModules( + params: { + id: number; + }, + context?: HttpContext + ): Observable { + return this.packagesModules$Response(params, context).pipe( + map((r: StrictHttpResponse): PackagesModulesRsp => r.body) + ); + } + /** Path part for operation `commentsList()` */ static readonly CommentsListPath = '/v1/packages/{package_id}/comments';