Repository: aliliin/kratos-shop Branch: main Commit: d1d5a83aa99d Files: 525 Total size: 3.3 MB Directory structure: gitextract_r9kzrcto/ ├── .gitignore ├── LICENSE ├── README.md ├── admin/ │ ├── .gitignore │ ├── Dockerfile │ ├── LICENSE │ ├── Makefile │ ├── api/ │ │ ├── admin/ │ │ │ └── v1/ │ │ │ ├── admin.pb.go │ │ │ ├── admin.pb.validate.go │ │ │ ├── admin.proto │ │ │ ├── admin_grpc.pb.go │ │ │ ├── admin_http.pb.go │ │ │ ├── error_reason.pb.go │ │ │ ├── error_reason.pb.validate.go │ │ │ ├── error_reason.proto │ │ │ └── error_reason_errors.pb.go │ │ └── service/ │ │ └── user/ │ │ └── v1/ │ │ ├── user.pb.go │ │ ├── user.pb.validate.go │ │ ├── user.proto │ │ └── user_grpc.pb.go │ ├── cmd/ │ │ └── admin/ │ │ ├── main.go │ │ ├── wire.go │ │ └── wire_gen.go │ ├── configs/ │ │ ├── config.yaml │ │ └── registry.yaml │ ├── generate.go │ ├── go.mod │ ├── go.sum │ ├── internal/ │ │ ├── biz/ │ │ │ ├── README.md │ │ │ ├── address.go │ │ │ ├── biz.go │ │ │ └── user.go │ │ ├── conf/ │ │ │ ├── conf.pb.go │ │ │ └── conf.proto │ │ ├── data/ │ │ │ ├── README.md │ │ │ ├── address.go │ │ │ ├── data.go │ │ │ └── user.go │ │ ├── pkg/ │ │ │ ├── captcha/ │ │ │ │ └── captcha.go │ │ │ └── middleware/ │ │ │ └── auth/ │ │ │ └── auth.go │ │ ├── server/ │ │ │ ├── http.go │ │ │ └── server.go │ │ └── service/ │ │ ├── README.md │ │ ├── service.go │ │ └── user.go │ ├── openapi.yaml │ └── third_party/ │ ├── README.md │ ├── errors/ │ │ └── errors.proto │ ├── google/ │ │ ├── api/ │ │ │ ├── annotations.proto │ │ │ ├── client.proto │ │ │ ├── field_behavior.proto │ │ │ ├── http.proto │ │ │ └── httpbody.proto │ │ └── protobuf/ │ │ └── descriptor.proto │ ├── protoc-gen-openapiv2/ │ │ └── options/ │ │ ├── annotations.proto │ │ └── openapiv2.proto │ └── validate/ │ ├── README.md │ └── validate.proto ├── service/ │ ├── cart/ │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── api/ │ │ │ └── cart/ │ │ │ └── v1/ │ │ │ ├── cart.pb.go │ │ │ ├── cart.pb.validate.go │ │ │ ├── cart.proto │ │ │ └── cart_grpc.pb.go │ │ ├── cmd/ │ │ │ └── cart/ │ │ │ ├── main.go │ │ │ ├── wire.go │ │ │ └── wire_gen.go │ │ ├── configs/ │ │ │ ├── config.yaml │ │ │ └── registry.yaml │ │ ├── go.mod │ │ ├── go.sum │ │ ├── internal/ │ │ │ ├── biz/ │ │ │ │ ├── README.md │ │ │ │ ├── biz.go │ │ │ │ └── cart.go │ │ │ ├── conf/ │ │ │ │ ├── conf.pb.go │ │ │ │ └── conf.proto │ │ │ ├── data/ │ │ │ │ ├── README.md │ │ │ │ ├── cart.go │ │ │ │ ├── cart_test.go │ │ │ │ ├── data.go │ │ │ │ ├── data_suite_test.go │ │ │ │ └── docker_mysql.go │ │ │ ├── domain/ │ │ │ │ └── cart.go │ │ │ ├── server/ │ │ │ │ ├── grpc.go │ │ │ │ └── server.go │ │ │ └── service/ │ │ │ ├── README.md │ │ │ ├── cart.go │ │ │ └── service.go │ │ ├── openapi.yaml │ │ └── third_party/ │ │ ├── README.md │ │ ├── errors/ │ │ │ └── errors.proto │ │ ├── google/ │ │ │ ├── api/ │ │ │ │ ├── annotations.proto │ │ │ │ ├── client.proto │ │ │ │ ├── field_behavior.proto │ │ │ │ ├── http.proto │ │ │ │ └── httpbody.proto │ │ │ └── protobuf/ │ │ │ ├── any.proto │ │ │ ├── api.proto │ │ │ ├── compiler/ │ │ │ │ └── plugin.proto │ │ │ ├── descriptor.proto │ │ │ ├── duration.proto │ │ │ ├── empty.proto │ │ │ ├── field_mask.proto │ │ │ ├── source_context.proto │ │ │ ├── struct.proto │ │ │ ├── timestamp.proto │ │ │ ├── type.proto │ │ │ └── wrappers.proto │ │ ├── openapi/ │ │ │ └── v3/ │ │ │ ├── annotations.proto │ │ │ └── openapi.proto │ │ └── validate/ │ │ ├── README.md │ │ └── validate.proto │ ├── goods/ │ │ ├── Dockerfile │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── api/ │ │ │ └── goods/ │ │ │ └── v1/ │ │ │ ├── error_reason.pb.go │ │ │ ├── error_reason.pb.validate.go │ │ │ ├── error_reason.proto │ │ │ ├── goods.pb.go │ │ │ ├── goods.pb.validate.go │ │ │ ├── goods.proto │ │ │ └── goods_grpc.pb.go │ │ ├── cmd/ │ │ │ └── goods/ │ │ │ ├── main.go │ │ │ ├── wire.go │ │ │ └── wire_gen.go │ │ ├── configs/ │ │ │ ├── config.yaml │ │ │ └── registry.yaml │ │ ├── generate.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── internal/ │ │ │ ├── biz/ │ │ │ │ ├── README.md │ │ │ │ ├── biz.go │ │ │ │ ├── brand.go │ │ │ │ ├── category.go │ │ │ │ ├── es_goods.go │ │ │ │ ├── goods.go │ │ │ │ ├── goods_attr.go │ │ │ │ ├── goods_image.go │ │ │ │ ├── goods_sku.go │ │ │ │ ├── goods_type.go │ │ │ │ ├── inventory.go │ │ │ │ └── specifications.go │ │ │ ├── conf/ │ │ │ │ ├── conf.pb.go │ │ │ │ └── conf.proto │ │ │ ├── data/ │ │ │ │ ├── README.md │ │ │ │ ├── base.go │ │ │ │ ├── brand.go │ │ │ │ ├── category.go │ │ │ │ ├── data.go │ │ │ │ ├── entity/ │ │ │ │ │ └── goods.go │ │ │ │ ├── es_goods.go │ │ │ │ ├── good_type.go │ │ │ │ ├── goods.go │ │ │ │ ├── goods_attr.go │ │ │ │ ├── goods_image.go │ │ │ │ ├── goods_sku.go │ │ │ │ ├── inventory.go │ │ │ │ └── specifications.go │ │ │ ├── domain/ │ │ │ │ ├── brand.go │ │ │ │ ├── es_goods.go │ │ │ │ ├── goods.go │ │ │ │ ├── goods_attr.go │ │ │ │ ├── goods_sku.go │ │ │ │ ├── goods_type.go │ │ │ │ ├── inventory.go │ │ │ │ └── specification.go │ │ │ ├── server/ │ │ │ │ ├── grpc.go │ │ │ │ └── server.go │ │ │ └── service/ │ │ │ ├── README.md │ │ │ ├── brand.go │ │ │ ├── category.go │ │ │ ├── goods.go │ │ │ ├── goods_attr.go │ │ │ ├── goods_type.go │ │ │ ├── service.go │ │ │ └── specifications.go │ │ ├── openapi.yaml │ │ └── third_party/ │ │ ├── README.md │ │ ├── errors/ │ │ │ └── errors.proto │ │ ├── google/ │ │ │ ├── api/ │ │ │ │ ├── annotations.proto │ │ │ │ ├── client.proto │ │ │ │ ├── field_behavior.proto │ │ │ │ ├── http.proto │ │ │ │ └── httpbody.proto │ │ │ └── protobuf/ │ │ │ ├── any.proto │ │ │ ├── api.proto │ │ │ ├── compiler/ │ │ │ │ └── plugin.proto │ │ │ ├── descriptor.proto │ │ │ ├── duration.proto │ │ │ ├── empty.proto │ │ │ ├── field_mask.proto │ │ │ ├── source_context.proto │ │ │ ├── struct.proto │ │ │ ├── timestamp.proto │ │ │ ├── type.proto │ │ │ └── wrappers.proto │ │ ├── openapi/ │ │ │ └── v3/ │ │ │ ├── annotations.proto │ │ │ └── openapi.proto │ │ └── validate/ │ │ ├── README.md │ │ └── validate.proto │ ├── order/ │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── api/ │ │ │ ├── cart/ │ │ │ │ └── v1/ │ │ │ │ ├── cart.pb.go │ │ │ │ ├── cart.pb.validate.go │ │ │ │ ├── cart.proto │ │ │ │ └── cart_grpc.pb.go │ │ │ ├── goods/ │ │ │ │ └── v1/ │ │ │ │ ├── error_reason.pb.go │ │ │ │ ├── error_reason.pb.validate.go │ │ │ │ ├── error_reason.proto │ │ │ │ ├── goods.pb.go │ │ │ │ ├── goods.pb.validate.go │ │ │ │ ├── goods.proto │ │ │ │ └── goods_grpc.pb.go │ │ │ ├── order/ │ │ │ │ └── v1/ │ │ │ │ ├── error_reason.pb.go │ │ │ │ ├── error_reason.pb.validate.go │ │ │ │ ├── error_reason.proto │ │ │ │ ├── order.pb.go │ │ │ │ ├── order.pb.validate.go │ │ │ │ ├── order.proto │ │ │ │ └── order_grpc.pb.go │ │ │ └── user/ │ │ │ └── v1/ │ │ │ ├── user.pb.go │ │ │ ├── user.pb.validate.go │ │ │ ├── user.proto │ │ │ └── user_grpc.pb.go │ │ ├── cmd/ │ │ │ └── order/ │ │ │ ├── main.go │ │ │ ├── wire.go │ │ │ └── wire_gen.go │ │ ├── configs/ │ │ │ ├── config.yaml │ │ │ └── registry.yaml │ │ ├── go.mod │ │ ├── go.sum │ │ ├── internal/ │ │ │ ├── biz/ │ │ │ │ ├── README.md │ │ │ │ ├── biz.go │ │ │ │ └── order.go │ │ │ ├── conf/ │ │ │ │ ├── conf.pb.go │ │ │ │ └── conf.proto │ │ │ ├── data/ │ │ │ │ ├── data.go │ │ │ │ ├── data_suite_test.go │ │ │ │ ├── docker_mysql.go │ │ │ │ ├── order.go │ │ │ │ ├── orderaddress.go │ │ │ │ ├── ordergoods.go │ │ │ │ └── orderpay.go │ │ │ ├── domain/ │ │ │ │ ├── order.go │ │ │ │ └── orderaddress.go │ │ │ ├── mocks/ │ │ │ │ └── mrepo/ │ │ │ │ └── order.go │ │ │ ├── server/ │ │ │ │ ├── grpc.go │ │ │ │ └── server.go │ │ │ └── service/ │ │ │ ├── README.md │ │ │ ├── order.go │ │ │ └── service.go │ │ ├── openapi.yaml │ │ └── third_party/ │ │ ├── README.md │ │ ├── errors/ │ │ │ └── errors.proto │ │ ├── google/ │ │ │ ├── api/ │ │ │ │ ├── annotations.proto │ │ │ │ ├── client.proto │ │ │ │ ├── field_behavior.proto │ │ │ │ ├── http.proto │ │ │ │ └── httpbody.proto │ │ │ └── protobuf/ │ │ │ ├── any.proto │ │ │ ├── api.proto │ │ │ ├── compiler/ │ │ │ │ └── plugin.proto │ │ │ ├── descriptor.proto │ │ │ ├── duration.proto │ │ │ ├── empty.proto │ │ │ ├── field_mask.proto │ │ │ ├── source_context.proto │ │ │ ├── struct.proto │ │ │ ├── timestamp.proto │ │ │ ├── type.proto │ │ │ └── wrappers.proto │ │ ├── openapi/ │ │ │ └── v3/ │ │ │ ├── annotations.proto │ │ │ └── openapi.proto │ │ └── validate/ │ │ ├── README.md │ │ └── validate.proto │ └── user/ │ ├── .gitignore │ ├── Dockerfile │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── api/ │ │ └── user/ │ │ └── v1/ │ │ ├── error_reason.pb.go │ │ ├── error_reason.pb.validate.go │ │ ├── error_reason.proto │ │ ├── error_reason_errors.pb.go │ │ ├── user.pb.go │ │ ├── user.pb.validate.go │ │ ├── user.proto │ │ └── user_grpc.pb.go │ ├── cmd/ │ │ └── user/ │ │ ├── main.go │ │ ├── wire.go │ │ └── wire_gen.go │ ├── configs/ │ │ ├── config.yaml │ │ └── registry.yaml │ ├── generate.go │ ├── go.mod │ ├── go.sum │ ├── internal/ │ │ ├── biz/ │ │ │ ├── README.md │ │ │ ├── address.go │ │ │ ├── address_test.go │ │ │ ├── biz.go │ │ │ ├── biz_suite_test.go │ │ │ ├── user.go │ │ │ └── user_test.go │ │ ├── conf/ │ │ │ ├── conf.pb.go │ │ │ └── conf.proto │ │ ├── data/ │ │ │ ├── README.md │ │ │ ├── address.go │ │ │ ├── address_test.go │ │ │ ├── data.go │ │ │ ├── data_suite_test.go │ │ │ ├── docker_mysql.go │ │ │ ├── entity/ │ │ │ │ └── user.go │ │ │ ├── user.go │ │ │ └── user_test.go │ │ ├── domain/ │ │ │ └── address.go │ │ ├── mocks/ │ │ │ ├── mrepo/ │ │ │ │ ├── address.go │ │ │ │ └── user.go │ │ │ └── usecase/ │ │ │ └── biz.go │ │ ├── server/ │ │ │ ├── grpc.go │ │ │ └── server.go │ │ ├── service/ │ │ │ ├── README.md │ │ │ ├── address.go │ │ │ ├── service.go │ │ │ └── user.go │ │ └── testdata/ │ │ └── user.go │ ├── openapi.yaml │ ├── test/ │ │ └── user.go │ └── third_party/ │ ├── README.md │ ├── errors/ │ │ └── errors.proto │ ├── google/ │ │ ├── api/ │ │ │ ├── annotations.proto │ │ │ ├── client.proto │ │ │ ├── field_behavior.proto │ │ │ ├── http.proto │ │ │ └── httpbody.proto │ │ └── protobuf/ │ │ ├── any.proto │ │ ├── api.proto │ │ ├── compiler/ │ │ │ └── plugin.proto │ │ ├── descriptor.proto │ │ ├── duration.proto │ │ ├── empty.proto │ │ ├── field_mask.proto │ │ ├── source_context.proto │ │ ├── struct.proto │ │ ├── timestamp.proto │ │ ├── type.proto │ │ └── wrappers.proto │ ├── openapi/ │ │ └── v3/ │ │ ├── annotations.proto │ │ └── openapi.proto │ └── validate/ │ ├── README.md │ └── validate.proto ├── shop/ │ ├── .gitignore │ ├── Dockerfile │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── api/ │ │ ├── service/ │ │ │ └── user/ │ │ │ └── v1/ │ │ │ ├── user.pb.go │ │ │ ├── user.pb.validate.go │ │ │ ├── user.proto │ │ │ └── user_grpc.pb.go │ │ └── shop/ │ │ └── v1/ │ │ ├── error_reason.pb.go │ │ ├── error_reason.pb.validate.go │ │ ├── error_reason.proto │ │ ├── error_reason_errors.pb.go │ │ ├── shop.pb.go │ │ ├── shop.pb.validate.go │ │ ├── shop.proto │ │ ├── shop_grpc.pb.go │ │ └── shop_http.pb.go │ ├── cmd/ │ │ └── shop/ │ │ ├── main.go │ │ ├── wire.go │ │ └── wire_gen.go │ ├── configs/ │ │ ├── config.yaml │ │ └── registry.yaml │ ├── generate.go │ ├── go.mod │ ├── go.sum │ ├── internal/ │ │ ├── biz/ │ │ │ ├── README.md │ │ │ ├── address.go │ │ │ ├── biz.go │ │ │ └── user.go │ │ ├── conf/ │ │ │ ├── conf.pb.go │ │ │ └── conf.proto │ │ ├── data/ │ │ │ ├── README.md │ │ │ ├── address.go │ │ │ ├── data.go │ │ │ └── user.go │ │ ├── pkg/ │ │ │ ├── captcha/ │ │ │ │ └── captcha.go │ │ │ └── middleware/ │ │ │ └── auth/ │ │ │ └── auth.go │ │ ├── server/ │ │ │ ├── grpc.go │ │ │ ├── http.go │ │ │ └── server.go │ │ └── service/ │ │ ├── README.md │ │ ├── service.go │ │ └── user.go │ ├── openapi.yaml │ └── third_party/ │ ├── README.md │ ├── errors/ │ │ └── errors.proto │ ├── google/ │ │ ├── api/ │ │ │ ├── annotations.proto │ │ │ ├── client.proto │ │ │ ├── field_behavior.proto │ │ │ ├── http.proto │ │ │ └── httpbody.proto │ │ └── protobuf/ │ │ └── descriptor.proto │ ├── protoc-gen-openapiv2/ │ │ └── options/ │ │ ├── annotations.proto │ │ └── openapiv2.proto │ └── validate/ │ ├── README.md │ └── validate.proto └── web/ └── admin/ ├── config/ │ ├── config.dev.js │ ├── config.js │ ├── defaultSettings.js │ ├── oneapi.json │ ├── proxy.js │ └── routes.js ├── jest.config.js ├── jsconfig.json ├── package.json ├── public/ │ └── CNAME ├── src/ │ ├── access.js │ ├── app.jsx │ ├── components/ │ │ ├── Footer/ │ │ │ └── index.jsx │ │ ├── HeaderDropdown/ │ │ │ ├── index.jsx │ │ │ └── index.less │ │ ├── HeaderSearch/ │ │ │ ├── index.jsx │ │ │ └── index.less │ │ ├── NoticeIcon/ │ │ │ ├── NoticeIcon.jsx │ │ │ ├── NoticeList.jsx │ │ │ ├── NoticeList.less │ │ │ ├── index.jsx │ │ │ └── index.less │ │ ├── RightContent/ │ │ │ ├── AvatarDropdown.jsx │ │ │ ├── index.jsx │ │ │ └── index.less │ │ └── index.md │ ├── e2e/ │ │ └── baseLayout.e2e.spec.js │ ├── global.jsx │ ├── global.less │ ├── locales/ │ │ ├── bn-BD/ │ │ │ ├── component.js │ │ │ ├── globalHeader.js │ │ │ ├── menu.js │ │ │ ├── pages.js │ │ │ ├── pwa.js │ │ │ ├── settingDrawer.js │ │ │ └── settings.js │ │ ├── bn-BD.js │ │ ├── en-US/ │ │ │ ├── component.js │ │ │ ├── globalHeader.js │ │ │ ├── menu.js │ │ │ ├── pages.js │ │ │ ├── pwa.js │ │ │ ├── settingDrawer.js │ │ │ └── settings.js │ │ ├── en-US.js │ │ ├── fa-IR/ │ │ │ ├── component.js │ │ │ ├── globalHeader.js │ │ │ ├── menu.js │ │ │ ├── pages.js │ │ │ ├── pwa.js │ │ │ ├── settingDrawer.js │ │ │ └── settings.js │ │ ├── fa-IR.js │ │ ├── id-ID/ │ │ │ ├── component.js │ │ │ ├── globalHeader.js │ │ │ ├── menu.js │ │ │ ├── pages.js │ │ │ ├── pwa.js │ │ │ ├── settingDrawer.js │ │ │ └── settings.js │ │ ├── id-ID.js │ │ ├── ja-JP/ │ │ │ ├── component.js │ │ │ ├── globalHeader.js │ │ │ ├── menu.js │ │ │ ├── pages.js │ │ │ ├── pwa.js │ │ │ ├── settingDrawer.js │ │ │ └── settings.js │ │ ├── ja-JP.js │ │ ├── pt-BR/ │ │ │ ├── component.js │ │ │ ├── globalHeader.js │ │ │ ├── menu.js │ │ │ ├── pages.js │ │ │ ├── pwa.js │ │ │ ├── settingDrawer.js │ │ │ └── settings.js │ │ ├── pt-BR.js │ │ ├── zh-CN/ │ │ │ ├── component.js │ │ │ ├── globalHeader.js │ │ │ ├── menu.js │ │ │ ├── pages.js │ │ │ ├── pwa.js │ │ │ ├── settingDrawer.js │ │ │ └── settings.js │ │ ├── zh-CN.js │ │ ├── zh-TW/ │ │ │ ├── component.js │ │ │ ├── globalHeader.js │ │ │ ├── menu.js │ │ │ ├── pwa.js │ │ │ ├── settingDrawer.js │ │ │ └── settings.js │ │ └── zh-TW.js │ ├── manifest.json │ ├── pages/ │ │ ├── 404.jsx │ │ ├── Admin.jsx │ │ ├── TableList/ │ │ │ ├── components/ │ │ │ │ └── UpdateForm.jsx │ │ │ └── index.jsx │ │ ├── Welcome.jsx │ │ ├── Welcome.less │ │ ├── document.ejs │ │ └── user/ │ │ └── Login/ │ │ ├── index.jsx │ │ └── index.less │ ├── service-worker.js │ └── services/ │ ├── ant-design-pro/ │ │ ├── api.js │ │ ├── index.js │ │ └── login.js │ └── swagger/ │ ├── index.js │ ├── pet.js │ ├── store.js │ └── user.js └── tests/ ├── run-tests.js └── setupTests.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .idea/ ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2022 高永立 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # kratos-shop kratos 框架写商品微服务 本项目是一个使用 Kratos 框架创建的很简单的微服务商城项目。 > 注: 本项目中但凡 kratos 提供包,就不会自己封装第三方的包。 主要是为了学习 kratos 如何使用,尤其各种中间件之间的调用,包括微服务的一些技术点。 项目具体目录结构初步设计如下: ``` |-- kratos-shop |-- service |-- user // 用户服务 grpc |-- goods // 商品服务 grpc |-- cart // 购物车服务 grpc |-- order // 订单服务 grpc |-- inventory // 库存服务服务 grpc |-- shop // shop 商城服务 http (后期会考虑把订单单独拆出来) ├── api // 商城 api │   ├── service │   │   └── user │   │   └── v1 // 用户服务的 proto │   │   └── goods │   │   └── v1 // 商品服务的 proto │   │   │   └── shop │   └── v1 │   ├── error_reason.proto │   ├── shop.proto │── cmd │── internal │..... |-- admin // 后端管理系统 web ``` * 有任何建议,请扫码添加我微信进行交流。 ![扫码提建议](https://cdn.jsdelivr.net/gh/aliliin/blog-image@main/uPic/扫码_搜索联合传播样式-白色版.png) ================================================ FILE: admin/.gitignore ================================================ # Reference https://github.com/github/gitignore/blob/master/Go.gitignore # Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Dependency directories (remove the comment below to include it) vendor/ # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # OS General Thumbs.db .DS_Store # project *.cert *.key *.log bin/ # Develop tools .vscode/ .idea/ *.swp ================================================ FILE: admin/Dockerfile ================================================ FROM golang:1.16 AS builder COPY . /src WORKDIR /src RUN GOPROXY=https://goproxy.cn make build FROM debian:stable-slim RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/ \ && apt-get autoremove -y && apt-get autoclean -y COPY --from=builder /src/bin /app WORKDIR /app EXPOSE 8000 EXPOSE 9000 VOLUME /data/conf CMD ["./server", "-conf", "/data/conf"] ================================================ FILE: admin/LICENSE ================================================ MIT License Copyright (c) 2020 go-kratos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: admin/Makefile ================================================ GOPATH:=$(shell go env GOPATH) VERSION=$(shell git describe --tags --always) INTERNAL_PROTO_FILES=$(shell find internal -name *.proto) API_PROTO_FILES=$(shell find api -name *.proto) .PHONY: init # init env init: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest go install github.com/go-kratos/kratos/cmd/kratos/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest go install github.com/google/gnostic/cmd/protoc-gen-openapi@v0.6.1 .PHONY: errors # generate errors code errors: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ --go-errors_out=paths=source_relative:. \ $(API_PROTO_FILES) .PHONY: config # generate internal proto config: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ $(INTERNAL_PROTO_FILES) .PHONY: api # generate api proto api: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ --go-http_out=paths=source_relative:. \ --go-grpc_out=paths=source_relative:. \ --openapi_out==paths=source_relative:. \ --validate_out=paths=source_relative,lang=go:. \ $(API_PROTO_FILES) .PHONY: build # build build: mkdir -p bin/ && go build -ldflags "-X main.Version=$(VERSION)" -o ./bin/ ./... .PHONY: generate # generate generate: go generate ./... # wire wire: cd cmd/admin/ && wire .PHONY: test # 快速测试,运行repo以外的所有测试 test: ginkgo -r -cover -v . .PHONY: all # generate all all: make api; make errors; make config; make generate; # show help help: @echo '' @echo 'Usage:' @echo ' make [target]' @echo '' @echo 'Targets:' @awk '/^[a-zA-Z\-\_0-9]+:/ { \ helpMessage = match(lastLine, /^# (.*)/); \ if (helpMessage) { \ helpCommand = substr($$1, 0, index($$1, ":")-1); \ helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ } \ } \ { lastLine = $$0 }' $(MAKEFILE_LIST) .DEFAULT_GOAL := help ================================================ FILE: admin/api/admin/v1/admin.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 // protoc v3.17.3 // source: api/admin/v1/admin.proto package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type CreateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *CreateAddressReq) Reset() { *x = CreateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateAddressReq) ProtoMessage() {} func (x *CreateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_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 CreateAddressReq.ProtoReflect.Descriptor instead. func (*CreateAddressReq) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{0} } func (x *CreateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *CreateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *CreateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *CreateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *CreateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *CreateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *CreateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *CreateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *CreateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type UpdateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` Id int64 `protobuf:"varint,10,opt,name=id,proto3" json:"id,omitempty"` } func (x *UpdateAddressReq) Reset() { *x = UpdateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateAddressReq) ProtoMessage() {} func (x *UpdateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_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 UpdateAddressReq.ProtoReflect.Descriptor instead. func (*UpdateAddressReq) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{1} } func (x *UpdateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *UpdateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *UpdateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UpdateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *UpdateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *UpdateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *UpdateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *UpdateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *UpdateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } func (x *UpdateAddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } type AddressInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *AddressInfo) Reset() { *x = AddressInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressInfo) ProtoMessage() {} func (x *AddressInfo) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_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 AddressInfo.ProtoReflect.Descriptor instead. func (*AddressInfo) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{2} } func (x *AddressInfo) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressInfo) GetName() string { if x != nil { return x.Name } return "" } func (x *AddressInfo) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *AddressInfo) GetProvince() string { if x != nil { return x.Province } return "" } func (x *AddressInfo) GetCity() string { if x != nil { return x.City } return "" } func (x *AddressInfo) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *AddressInfo) GetAddress() string { if x != nil { return x.Address } return "" } func (x *AddressInfo) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *AddressInfo) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type ListAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *ListAddressReq) Reset() { *x = ListAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReq) ProtoMessage() {} func (x *ListAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_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 ListAddressReq.ProtoReflect.Descriptor instead. func (*ListAddressReq) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{3} } func (x *ListAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type ListAddressReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Results []*AddressInfo `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } func (x *ListAddressReply) Reset() { *x = ListAddressReply{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReply) ProtoMessage() {} func (x *ListAddressReply) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ListAddressReply.ProtoReflect.Descriptor instead. func (*ListAddressReply) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{4} } func (x *ListAddressReply) GetResults() []*AddressInfo { if x != nil { return x.Results } return nil } type AddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Uid int64 `protobuf:"varint,2,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *AddressReq) Reset() { *x = AddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressReq) ProtoMessage() {} func (x *AddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AddressReq.ProtoReflect.Descriptor instead. func (*AddressReq) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{5} } func (x *AddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type CheckResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } func (x *CheckResponse) Reset() { *x = CheckResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CheckResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CheckResponse) ProtoMessage() {} func (x *CheckResponse) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_proto_msgTypes[6] 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 CheckResponse.ProtoReflect.Descriptor instead. func (*CheckResponse) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{6} } func (x *CheckResponse) GetSuccess() bool { if x != nil { return x.Success } return false } // Data returned by registration and login type RegisterReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` ExpiredAt int64 `protobuf:"varint,6,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"` } func (x *RegisterReply) Reset() { *x = RegisterReply{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *RegisterReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*RegisterReply) ProtoMessage() {} func (x *RegisterReply) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_proto_msgTypes[7] 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 RegisterReply.ProtoReflect.Descriptor instead. func (*RegisterReply) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{7} } func (x *RegisterReply) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *RegisterReply) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *RegisterReply) GetUsername() string { if x != nil { return x.Username } return "" } func (x *RegisterReply) GetToken() string { if x != nil { return x.Token } return "" } func (x *RegisterReply) GetExpiredAt() int64 { if x != nil { return x.ExpiredAt } return 0 } type RegisterReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` } func (x *RegisterReq) Reset() { *x = RegisterReq{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *RegisterReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*RegisterReq) ProtoMessage() {} func (x *RegisterReq) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_proto_msgTypes[8] 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 RegisterReq.ProtoReflect.Descriptor instead. func (*RegisterReq) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{8} } func (x *RegisterReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *RegisterReq) GetUsername() string { if x != nil { return x.Username } return "" } func (x *RegisterReq) GetPassword() string { if x != nil { return x.Password } return "" } type LoginReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` } func (x *LoginReq) Reset() { *x = LoginReq{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *LoginReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*LoginReq) ProtoMessage() {} func (x *LoginReq) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_proto_msgTypes[9] 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 LoginReq.ProtoReflect.Descriptor instead. func (*LoginReq) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{9} } func (x *LoginReq) GetUsername() string { if x != nil { return x.Username } return "" } func (x *LoginReq) GetPassword() string { if x != nil { return x.Password } return "" } // user Detail returned type UserDetailResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Mobile string `protobuf:"bytes,2,opt,name=mobile,proto3" json:"mobile,omitempty"` NickName string `protobuf:"bytes,3,opt,name=nickName,proto3" json:"nickName,omitempty"` Birthday int64 `protobuf:"varint,4,opt,name=birthday,proto3" json:"birthday,omitempty"` Gender string `protobuf:"bytes,5,opt,name=gender,proto3" json:"gender,omitempty"` Role int32 `protobuf:"varint,6,opt,name=role,proto3" json:"role,omitempty"` } func (x *UserDetailResponse) Reset() { *x = UserDetailResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UserDetailResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*UserDetailResponse) ProtoMessage() {} func (x *UserDetailResponse) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_proto_msgTypes[10] 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 UserDetailResponse.ProtoReflect.Descriptor instead. func (*UserDetailResponse) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{10} } func (x *UserDetailResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UserDetailResponse) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UserDetailResponse) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *UserDetailResponse) GetBirthday() int64 { if x != nil { return x.Birthday } return 0 } func (x *UserDetailResponse) GetGender() string { if x != nil { return x.Gender } return "" } func (x *UserDetailResponse) GetRole() int32 { if x != nil { return x.Role } return 0 } type CaptchaReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields CaptchaId string `protobuf:"bytes,1,opt,name=captchaId,proto3" json:"captchaId,omitempty"` PicPath string `protobuf:"bytes,2,opt,name=picPath,proto3" json:"picPath,omitempty"` } func (x *CaptchaReply) Reset() { *x = CaptchaReply{} if protoimpl.UnsafeEnabled { mi := &file_api_admin_v1_admin_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CaptchaReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*CaptchaReply) ProtoMessage() {} func (x *CaptchaReply) ProtoReflect() protoreflect.Message { mi := &file_api_admin_v1_admin_proto_msgTypes[11] 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 CaptchaReply.ProtoReflect.Descriptor instead. func (*CaptchaReply) Descriptor() ([]byte, []int) { return file_api_admin_v1_admin_proto_rawDescGZIP(), []int{11} } func (x *CaptchaReply) GetCaptchaId() string { if x != nil { return x.CaptchaId } return "" } func (x *CaptchaReply) GetPicPath() string { if x != nil { return x.PicPath } return "" } var File_api_admin_v1_admin_proto protoreflect.FileDescriptor var file_api_admin_v1_admin_proto_rawDesc = []byte{ 0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 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, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xab, 0x02, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 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, 0x20, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x0b, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x25, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0xbb, 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x0b, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x25, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x80, 0x02, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 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, 0x20, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x0b, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x22, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x49, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x35, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x37, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x87, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x22, 0x7b, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x0b, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x03, 0x18, 0x0f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x08, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x54, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x23, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x08, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0xa0, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x46, 0x0a, 0x0c, 0x43, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x69, 0x63, 0x50, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x69, 0x63, 0x50, 0x61, 0x74, 0x68, 0x32, 0xb2, 0x07, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x66, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x5d, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x3a, 0x01, 0x2a, 0x12, 0x5b, 0x0a, 0x07, 0x43, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x12, 0x5f, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x22, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x6e, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x6b, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x55, 0x69, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x20, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x75, 0x69, 0x64, 0x12, 0x70, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x1a, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x6c, 0x0a, 0x0e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x1a, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x67, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x2a, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x17, 0x5a, 0x15, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_api_admin_v1_admin_proto_rawDescOnce sync.Once file_api_admin_v1_admin_proto_rawDescData = file_api_admin_v1_admin_proto_rawDesc ) func file_api_admin_v1_admin_proto_rawDescGZIP() []byte { file_api_admin_v1_admin_proto_rawDescOnce.Do(func() { file_api_admin_v1_admin_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_admin_v1_admin_proto_rawDescData) }) return file_api_admin_v1_admin_proto_rawDescData } var file_api_admin_v1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_api_admin_v1_admin_proto_goTypes = []interface{}{ (*CreateAddressReq)(nil), // 0: admin.admin.v1.CreateAddressReq (*UpdateAddressReq)(nil), // 1: admin.admin.v1.UpdateAddressReq (*AddressInfo)(nil), // 2: admin.admin.v1.AddressInfo (*ListAddressReq)(nil), // 3: admin.admin.v1.ListAddressReq (*ListAddressReply)(nil), // 4: admin.admin.v1.ListAddressReply (*AddressReq)(nil), // 5: admin.admin.v1.AddressReq (*CheckResponse)(nil), // 6: admin.admin.v1.CheckResponse (*RegisterReply)(nil), // 7: admin.admin.v1.RegisterReply (*RegisterReq)(nil), // 8: admin.admin.v1.RegisterReq (*LoginReq)(nil), // 9: admin.admin.v1.LoginReq (*UserDetailResponse)(nil), // 10: admin.admin.v1.UserDetailResponse (*CaptchaReply)(nil), // 11: admin.admin.v1.CaptchaReply (*emptypb.Empty)(nil), // 12: google.protobuf.Empty } var file_api_admin_v1_admin_proto_depIdxs = []int32{ 2, // 0: admin.admin.v1.ListAddressReply.results:type_name -> admin.admin.v1.AddressInfo 8, // 1: admin.admin.v1.admin.Register:input_type -> admin.admin.v1.RegisterReq 9, // 2: admin.admin.v1.admin.Login:input_type -> admin.admin.v1.LoginReq 12, // 3: admin.admin.v1.admin.Captcha:input_type -> google.protobuf.Empty 12, // 4: admin.admin.v1.admin.Detail:input_type -> google.protobuf.Empty 0, // 5: admin.admin.v1.admin.CreateAddress:input_type -> admin.admin.v1.CreateAddressReq 12, // 6: admin.admin.v1.admin.AddressListByUid:input_type -> google.protobuf.Empty 1, // 7: admin.admin.v1.admin.UpdateAddress:input_type -> admin.admin.v1.UpdateAddressReq 5, // 8: admin.admin.v1.admin.DefaultAddress:input_type -> admin.admin.v1.AddressReq 5, // 9: admin.admin.v1.admin.DeleteAddress:input_type -> admin.admin.v1.AddressReq 7, // 10: admin.admin.v1.admin.Register:output_type -> admin.admin.v1.RegisterReply 7, // 11: admin.admin.v1.admin.Login:output_type -> admin.admin.v1.RegisterReply 11, // 12: admin.admin.v1.admin.Captcha:output_type -> admin.admin.v1.CaptchaReply 10, // 13: admin.admin.v1.admin.Detail:output_type -> admin.admin.v1.UserDetailResponse 2, // 14: admin.admin.v1.admin.CreateAddress:output_type -> admin.admin.v1.AddressInfo 4, // 15: admin.admin.v1.admin.AddressListByUid:output_type -> admin.admin.v1.ListAddressReply 6, // 16: admin.admin.v1.admin.UpdateAddress:output_type -> admin.admin.v1.CheckResponse 6, // 17: admin.admin.v1.admin.DefaultAddress:output_type -> admin.admin.v1.CheckResponse 6, // 18: admin.admin.v1.admin.DeleteAddress:output_type -> admin.admin.v1.CheckResponse 10, // [10:19] is the sub-list for method output_type 1, // [1:10] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name } func init() { file_api_admin_v1_admin_proto_init() } func file_api_admin_v1_admin_proto_init() { if File_api_admin_v1_admin_proto != nil { return } if !protoimpl.UnsafeEnabled { file_api_admin_v1_admin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoginReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserDetailResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_admin_v1_admin_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CaptchaReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_admin_v1_admin_proto_rawDesc, NumEnums: 0, NumMessages: 12, NumExtensions: 0, NumServices: 1, }, GoTypes: file_api_admin_v1_admin_proto_goTypes, DependencyIndexes: file_api_admin_v1_admin_proto_depIdxs, MessageInfos: file_api_admin_v1_admin_proto_msgTypes, }.Build() File_api_admin_v1_admin_proto = out.File file_api_admin_v1_admin_proto_rawDesc = nil file_api_admin_v1_admin_proto_goTypes = nil file_api_admin_v1_admin_proto_depIdxs = nil } ================================================ FILE: admin/api/admin/v1/admin.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: api/admin/v1/admin.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on CreateAddressReq 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 *CreateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateAddressReq 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 // CreateAddressReqMultiError, or nil if none found. func (m *CreateAddressReq) ValidateAll() error { return m.validate(true) } func (m *CreateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid if utf8.RuneCountInString(m.GetName()) < 1 { err := CreateAddressReqValidationError{ field: "Name", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetMobile()) != 11 { err := CreateAddressReqValidationError{ field: "Mobile", reason: "value length must be 11 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetProvince()) < 1 { err := CreateAddressReqValidationError{ field: "Province", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetCity()) < 1 { err := CreateAddressReqValidationError{ field: "City", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetDistricts()) < 1 { err := CreateAddressReqValidationError{ field: "Districts", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetAddress()) < 1 { err := CreateAddressReqValidationError{ field: "Address", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return CreateAddressReqMultiError(errors) } return nil } // CreateAddressReqMultiError is an error wrapping multiple validation errors // returned by CreateAddressReq.ValidateAll() if the designated constraints // aren't met. type CreateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateAddressReqMultiError) 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 CreateAddressReqMultiError) AllErrors() []error { return m } // CreateAddressReqValidationError is the validation error returned by // CreateAddressReq.Validate if the designated constraints aren't met. type CreateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateAddressReqValidationError) ErrorName() string { return "CreateAddressReqValidationError" } // Error satisfies the builtin error interface func (e CreateAddressReqValidationError) 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 %sCreateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateAddressReqValidationError{} // Validate checks the field values on UpdateAddressReq 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 *UpdateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateAddressReq 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 // UpdateAddressReqMultiError, or nil if none found. func (m *UpdateAddressReq) ValidateAll() error { return m.validate(true) } func (m *UpdateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid // no validation rules for Name if utf8.RuneCountInString(m.GetMobile()) != 11 { err := UpdateAddressReqValidationError{ field: "Mobile", reason: "value length must be 11 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetProvince()) < 1 { err := UpdateAddressReqValidationError{ field: "Province", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetCity()) < 1 { err := UpdateAddressReqValidationError{ field: "City", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetDistricts()) < 1 { err := UpdateAddressReqValidationError{ field: "Districts", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetAddress()) < 1 { err := UpdateAddressReqValidationError{ field: "Address", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for PostCode // no validation rules for IsDefault if m.GetId() < 1 { err := UpdateAddressReqValidationError{ field: "Id", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return UpdateAddressReqMultiError(errors) } return nil } // UpdateAddressReqMultiError is an error wrapping multiple validation errors // returned by UpdateAddressReq.ValidateAll() if the designated constraints // aren't met. type UpdateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateAddressReqMultiError) 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 UpdateAddressReqMultiError) AllErrors() []error { return m } // UpdateAddressReqValidationError is the validation error returned by // UpdateAddressReq.Validate if the designated constraints aren't met. type UpdateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateAddressReqValidationError) ErrorName() string { return "UpdateAddressReqValidationError" } // Error satisfies the builtin error interface func (e UpdateAddressReqValidationError) 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 %sUpdateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateAddressReqValidationError{} // Validate checks the field values on AddressInfo 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 *AddressInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressInfo 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 AddressInfoMultiError, or // nil if none found. func (m *AddressInfo) ValidateAll() error { return m.validate(true) } func (m *AddressInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if utf8.RuneCountInString(m.GetName()) < 1 { err := AddressInfoValidationError{ field: "Name", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetMobile()) != 11 { err := AddressInfoValidationError{ field: "Mobile", reason: "value length must be 11 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return AddressInfoMultiError(errors) } return nil } // AddressInfoMultiError is an error wrapping multiple validation errors // returned by AddressInfo.ValidateAll() if the designated constraints aren't met. type AddressInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressInfoMultiError) 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 AddressInfoMultiError) AllErrors() []error { return m } // AddressInfoValidationError is the validation error returned by // AddressInfo.Validate if the designated constraints aren't met. type AddressInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressInfoValidationError) ErrorName() string { return "AddressInfoValidationError" } // Error satisfies the builtin error interface func (e AddressInfoValidationError) 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 %sAddressInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressInfoValidationError{} // Validate checks the field values on ListAddressReq 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 *ListAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReq 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 ListAddressReqMultiError, // or nil if none found. func (m *ListAddressReq) ValidateAll() error { return m.validate(true) } func (m *ListAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid if len(errors) > 0 { return ListAddressReqMultiError(errors) } return nil } // ListAddressReqMultiError is an error wrapping multiple validation errors // returned by ListAddressReq.ValidateAll() if the designated constraints // aren't met. type ListAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReqMultiError) 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 ListAddressReqMultiError) AllErrors() []error { return m } // ListAddressReqValidationError is the validation error returned by // ListAddressReq.Validate if the designated constraints aren't met. type ListAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReqValidationError) ErrorName() string { return "ListAddressReqValidationError" } // Error satisfies the builtin error interface func (e ListAddressReqValidationError) 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 %sListAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReqValidationError{} // Validate checks the field values on ListAddressReply 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 *ListAddressReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReply 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 // ListAddressReplyMultiError, or nil if none found. func (m *ListAddressReply) ValidateAll() error { return m.validate(true) } func (m *ListAddressReply) validate(all bool) error { if m == nil { return nil } var errors []error for idx, item := range m.GetResults() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%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 ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return ListAddressReplyMultiError(errors) } return nil } // ListAddressReplyMultiError is an error wrapping multiple validation errors // returned by ListAddressReply.ValidateAll() if the designated constraints // aren't met. type ListAddressReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReplyMultiError) 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 ListAddressReplyMultiError) AllErrors() []error { return m } // ListAddressReplyValidationError is the validation error returned by // ListAddressReply.Validate if the designated constraints aren't met. type ListAddressReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReplyValidationError) ErrorName() string { return "ListAddressReplyValidationError" } // Error satisfies the builtin error interface func (e ListAddressReplyValidationError) 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 %sListAddressReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReplyValidationError{} // Validate checks the field values on AddressReq 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 *AddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressReq 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 AddressReqMultiError, or // nil if none found. func (m *AddressReq) ValidateAll() error { return m.validate(true) } func (m *AddressReq) validate(all bool) error { if m == nil { return nil } var errors []error if m.GetId() < 1 { err := AddressReqValidationError{ field: "Id", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } // no validation rules for Uid if len(errors) > 0 { return AddressReqMultiError(errors) } return nil } // AddressReqMultiError is an error wrapping multiple validation errors // returned by AddressReq.ValidateAll() if the designated constraints aren't met. type AddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressReqMultiError) 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 AddressReqMultiError) AllErrors() []error { return m } // AddressReqValidationError is the validation error returned by // AddressReq.Validate if the designated constraints aren't met. type AddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressReqValidationError) ErrorName() string { return "AddressReqValidationError" } // Error satisfies the builtin error interface func (e AddressReqValidationError) 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 %sAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressReqValidationError{} // Validate checks the field values on CheckResponse 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 *CheckResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CheckResponse 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 CheckResponseMultiError, or // nil if none found. func (m *CheckResponse) ValidateAll() error { return m.validate(true) } func (m *CheckResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Success if len(errors) > 0 { return CheckResponseMultiError(errors) } return nil } // CheckResponseMultiError is an error wrapping multiple validation errors // returned by CheckResponse.ValidateAll() if the designated constraints // aren't met. type CheckResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CheckResponseMultiError) 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 CheckResponseMultiError) AllErrors() []error { return m } // CheckResponseValidationError is the validation error returned by // CheckResponse.Validate if the designated constraints aren't met. type CheckResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CheckResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CheckResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CheckResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CheckResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CheckResponseValidationError) ErrorName() string { return "CheckResponseValidationError" } // Error satisfies the builtin error interface func (e CheckResponseValidationError) 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 %sCheckResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CheckResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CheckResponseValidationError{} // Validate checks the field values on RegisterReply 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 *RegisterReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on RegisterReply 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 RegisterReplyMultiError, or // nil if none found. func (m *RegisterReply) ValidateAll() error { return m.validate(true) } func (m *RegisterReply) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Mobile // no validation rules for Username // no validation rules for Token // no validation rules for ExpiredAt if len(errors) > 0 { return RegisterReplyMultiError(errors) } return nil } // RegisterReplyMultiError is an error wrapping multiple validation errors // returned by RegisterReply.ValidateAll() if the designated constraints // aren't met. type RegisterReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m RegisterReplyMultiError) 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 RegisterReplyMultiError) AllErrors() []error { return m } // RegisterReplyValidationError is the validation error returned by // RegisterReply.Validate if the designated constraints aren't met. type RegisterReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e RegisterReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e RegisterReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e RegisterReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e RegisterReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e RegisterReplyValidationError) ErrorName() string { return "RegisterReplyValidationError" } // Error satisfies the builtin error interface func (e RegisterReplyValidationError) 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 %sRegisterReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = RegisterReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = RegisterReplyValidationError{} // Validate checks the field values on RegisterReq 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 *RegisterReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on RegisterReq 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 RegisterReqMultiError, or // nil if none found. func (m *RegisterReq) ValidateAll() error { return m.validate(true) } func (m *RegisterReq) validate(all bool) error { if m == nil { return nil } var errors []error if utf8.RuneCountInString(m.GetMobile()) != 11 { err := RegisterReqValidationError{ field: "Mobile", reason: "value length must be 11 runes", } if !all { return err } errors = append(errors, err) } if l := utf8.RuneCountInString(m.GetUsername()); l < 3 || l > 15 { err := RegisterReqValidationError{ field: "Username", reason: "value length must be between 3 and 15 runes, inclusive", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetPassword()) < 8 { err := RegisterReqValidationError{ field: "Password", reason: "value length must be at least 8 runes", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return RegisterReqMultiError(errors) } return nil } // RegisterReqMultiError is an error wrapping multiple validation errors // returned by RegisterReq.ValidateAll() if the designated constraints aren't met. type RegisterReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m RegisterReqMultiError) 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 RegisterReqMultiError) AllErrors() []error { return m } // RegisterReqValidationError is the validation error returned by // RegisterReq.Validate if the designated constraints aren't met. type RegisterReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e RegisterReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e RegisterReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e RegisterReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e RegisterReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e RegisterReqValidationError) ErrorName() string { return "RegisterReqValidationError" } // Error satisfies the builtin error interface func (e RegisterReqValidationError) 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 %sRegisterReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = RegisterReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = RegisterReqValidationError{} // Validate checks the field values on LoginReq 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 *LoginReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on LoginReq 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 LoginReqMultiError, or nil // if none found. func (m *LoginReq) ValidateAll() error { return m.validate(true) } func (m *LoginReq) validate(all bool) error { if m == nil { return nil } var errors []error if utf8.RuneCountInString(m.GetUsername()) < 3 { err := LoginReqValidationError{ field: "Username", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetPassword()) < 8 { err := LoginReqValidationError{ field: "Password", reason: "value length must be at least 8 runes", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return LoginReqMultiError(errors) } return nil } // LoginReqMultiError is an error wrapping multiple validation errors returned // by LoginReq.ValidateAll() if the designated constraints aren't met. type LoginReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m LoginReqMultiError) 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 LoginReqMultiError) AllErrors() []error { return m } // LoginReqValidationError is the validation error returned by // LoginReq.Validate if the designated constraints aren't met. type LoginReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e LoginReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e LoginReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e LoginReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e LoginReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e LoginReqValidationError) ErrorName() string { return "LoginReqValidationError" } // Error satisfies the builtin error interface func (e LoginReqValidationError) 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 %sLoginReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = LoginReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = LoginReqValidationError{} // Validate checks the field values on UserDetailResponse 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 *UserDetailResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UserDetailResponse 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 // UserDetailResponseMultiError, or nil if none found. func (m *UserDetailResponse) ValidateAll() error { return m.validate(true) } func (m *UserDetailResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Mobile // no validation rules for NickName // no validation rules for Birthday // no validation rules for Gender // no validation rules for Role if len(errors) > 0 { return UserDetailResponseMultiError(errors) } return nil } // UserDetailResponseMultiError is an error wrapping multiple validation errors // returned by UserDetailResponse.ValidateAll() if the designated constraints // aren't met. type UserDetailResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UserDetailResponseMultiError) 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 UserDetailResponseMultiError) AllErrors() []error { return m } // UserDetailResponseValidationError is the validation error returned by // UserDetailResponse.Validate if the designated constraints aren't met. type UserDetailResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UserDetailResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UserDetailResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UserDetailResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UserDetailResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UserDetailResponseValidationError) ErrorName() string { return "UserDetailResponseValidationError" } // Error satisfies the builtin error interface func (e UserDetailResponseValidationError) 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 %sUserDetailResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UserDetailResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UserDetailResponseValidationError{} // Validate checks the field values on CaptchaReply 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 *CaptchaReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CaptchaReply 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 CaptchaReplyMultiError, or // nil if none found. func (m *CaptchaReply) ValidateAll() error { return m.validate(true) } func (m *CaptchaReply) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for CaptchaId // no validation rules for PicPath if len(errors) > 0 { return CaptchaReplyMultiError(errors) } return nil } // CaptchaReplyMultiError is an error wrapping multiple validation errors // returned by CaptchaReply.ValidateAll() if the designated constraints aren't met. type CaptchaReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CaptchaReplyMultiError) 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 CaptchaReplyMultiError) AllErrors() []error { return m } // CaptchaReplyValidationError is the validation error returned by // CaptchaReply.Validate if the designated constraints aren't met. type CaptchaReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CaptchaReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CaptchaReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CaptchaReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CaptchaReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CaptchaReplyValidationError) ErrorName() string { return "CaptchaReplyValidationError" } // Error satisfies the builtin error interface func (e CaptchaReplyValidationError) 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 %sCaptchaReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CaptchaReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CaptchaReplyValidationError{} ================================================ FILE: admin/api/admin/v1/admin.proto ================================================ syntax = "proto3"; package admin.admin.v1; // 这里可以把 proto 文件下载下来,放到项目的 third_party 目录下 import "validate/validate.proto"; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; option go_package = "admin/api/admin/v1;v1"; // The admin service definition. service admin { rpc Register (RegisterReq) returns (RegisterReply) { option (google.api.http) = { post: "/api/users/register", body: "*", }; } rpc Login (LoginReq) returns (RegisterReply) { option (google.api.http) = { post: "/api/users/login", body: "*", }; } rpc Captcha (google.protobuf.Empty) returns (CaptchaReply) { option (google.api.http) = { get: "/api/users/captcha", }; } rpc Detail (google.protobuf.Empty) returns (UserDetailResponse) { option (google.api.http) = { get: "/api/users/detail", }; } rpc CreateAddress (CreateAddressReq) returns (AddressInfo) { option (google.api.http) = { post: "/api/address/create", body: "*", }; } rpc AddressListByUid (google.protobuf.Empty) returns (ListAddressReply) { option (google.api.http) = { get: "/api/address/list/uid", }; } rpc UpdateAddress (UpdateAddressReq) returns (CheckResponse) { option (google.api.http) = { put: "/api/address/update", body: "*", }; } rpc DefaultAddress (AddressReq) returns (CheckResponse) { option (google.api.http) = { put: "/api/address/default", body: "*", }; } rpc DeleteAddress (AddressReq) returns (CheckResponse) { option (google.api.http) = { delete: "/api/address/delete", }; } } message CreateAddressReq { int64 uid = 1; string name = 2 [(validate.rules).string ={min_len: 1}]; string mobile = 3 [(validate.rules).string.len = 11]; string Province = 4 [(validate.rules).string ={min_len: 1}]; string City = 5 [(validate.rules).string ={min_len: 1}]; string Districts = 6 [(validate.rules).string ={min_len: 1}]; string address = 7 [(validate.rules).string ={min_len: 1}]; string post_code = 8; int32 is_default = 9; } message UpdateAddressReq { int64 uid = 1; string name = 2; string mobile = 3 [(validate.rules).string.len = 11]; string Province = 4 [(validate.rules).string ={min_len: 1}]; string City = 5 [(validate.rules).string ={min_len: 1}]; string Districts = 6 [(validate.rules).string ={min_len: 1}]; string address = 7 [(validate.rules).string ={min_len: 1}]; string post_code = 8; int32 is_default = 9; int64 id = 10 [(validate.rules).int64.gte = 1]; } message AddressInfo { int64 id = 1; string name = 2 [(validate.rules).string ={min_len: 1}]; string mobile = 3 [(validate.rules).string.len = 11]; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; } message ListAddressReq { int64 uid = 1; } message ListAddressReply { repeated AddressInfo results = 1; } message AddressReq { int64 id = 1 [(validate.rules).int64.gte = 1]; int64 uid = 2; } message CheckResponse{ bool success = 1; } // Data returned by registration and login message RegisterReply { int64 id = 1; string mobile = 3; string username = 4; string token = 5; int64 expiredAt = 6; } message RegisterReq { string mobile = 1 [(validate.rules).string.len = 11]; string username = 2 [(validate.rules).string = {min_len: 3, max_len: 15}]; string password = 3 [(validate.rules).string = {min_len: 8}]; } message LoginReq { string username = 1 [(validate.rules).string = {min_len: 3}]; string password = 2 [(validate.rules).string = {min_len: 8}]; // string captcha = 3 [(validate.rules).string = {min_len: 5,max_len:5}]; // string captchaId = 4 [(validate.rules).string ={min_len: 1}]; } // user Detail returned message UserDetailResponse{ int64 id = 1; string mobile = 2; string nickName = 3; int64 birthday = 4; string gender = 5; int32 role = 6; } message CaptchaReply{ string captchaId = 1; string picPath = 2; } ================================================ FILE: admin/api/admin/v1/admin_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.17.3 // source: api/admin/v1/admin.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // AdminClient is the client API for Admin service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type AdminClient interface { Register(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*RegisterReply, error) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*RegisterReply, error) Captcha(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CaptchaReply, error) Detail(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserDetailResponse, error) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) AddressListByUid(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListAddressReply, error) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) } type adminClient struct { cc grpc.ClientConnInterface } func NewAdminClient(cc grpc.ClientConnInterface) AdminClient { return &adminClient{cc} } func (c *adminClient) Register(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*RegisterReply, error) { out := new(RegisterReply) err := c.cc.Invoke(ctx, "/admin.admin.v1.admin/Register", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *adminClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*RegisterReply, error) { out := new(RegisterReply) err := c.cc.Invoke(ctx, "/admin.admin.v1.admin/Login", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *adminClient) Captcha(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CaptchaReply, error) { out := new(CaptchaReply) err := c.cc.Invoke(ctx, "/admin.admin.v1.admin/Captcha", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *adminClient) Detail(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserDetailResponse, error) { out := new(UserDetailResponse) err := c.cc.Invoke(ctx, "/admin.admin.v1.admin/Detail", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *adminClient) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) { out := new(AddressInfo) err := c.cc.Invoke(ctx, "/admin.admin.v1.admin/CreateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *adminClient) AddressListByUid(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListAddressReply, error) { out := new(ListAddressReply) err := c.cc.Invoke(ctx, "/admin.admin.v1.admin/AddressListByUid", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *adminClient) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/admin.admin.v1.admin/UpdateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *adminClient) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/admin.admin.v1.admin/DefaultAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *adminClient) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/admin.admin.v1.admin/DeleteAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } // AdminServer is the s API for Admin service. // All implementations must embed UnimplementedAdminServer // for forward compatibility type AdminServer interface { Register(context.Context, *RegisterReq) (*RegisterReply, error) Login(context.Context, *LoginReq) (*RegisterReply, error) Captcha(context.Context, *emptypb.Empty) (*CaptchaReply, error) Detail(context.Context, *emptypb.Empty) (*UserDetailResponse, error) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) AddressListByUid(context.Context, *emptypb.Empty) (*ListAddressReply, error) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) mustEmbedUnimplementedAdminServer() } // UnimplementedAdminServer must be embedded to have forward compatible implementations. type UnimplementedAdminServer struct { } func (UnimplementedAdminServer) Register(context.Context, *RegisterReq) (*RegisterReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") } func (UnimplementedAdminServer) Login(context.Context, *LoginReq) (*RegisterReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") } func (UnimplementedAdminServer) Captcha(context.Context, *emptypb.Empty) (*CaptchaReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Captcha not implemented") } func (UnimplementedAdminServer) Detail(context.Context, *emptypb.Empty) (*UserDetailResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Detail not implemented") } func (UnimplementedAdminServer) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAddress not implemented") } func (UnimplementedAdminServer) AddressListByUid(context.Context, *emptypb.Empty) (*ListAddressReply, error) { return nil, status.Errorf(codes.Unimplemented, "method AddressListByUid not implemented") } func (UnimplementedAdminServer) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateAddress not implemented") } func (UnimplementedAdminServer) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DefaultAddress not implemented") } func (UnimplementedAdminServer) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteAddress not implemented") } func (UnimplementedAdminServer) mustEmbedUnimplementedAdminServer() {} // UnsafeAdminServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to AdminServer will // result in compilation errors. type UnsafeAdminServer interface { mustEmbedUnimplementedAdminServer() } func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer) { s.RegisterService(&Admin_ServiceDesc, srv) } func _Admin_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RegisterReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AdminServer).Register(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/admin.admin.v1.admin/Register", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).Register(ctx, req.(*RegisterReq)) } return interceptor(ctx, in, info, handler) } func _Admin_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LoginReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AdminServer).Login(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/admin.admin.v1.admin/Login", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).Login(ctx, req.(*LoginReq)) } return interceptor(ctx, in, info, handler) } func _Admin_Captcha_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AdminServer).Captcha(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/admin.admin.v1.admin/Captcha", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).Captcha(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _Admin_Detail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AdminServer).Detail(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/admin.admin.v1.admin/Detail", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).Detail(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _Admin_CreateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AdminServer).CreateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/admin.admin.v1.admin/CreateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).CreateAddress(ctx, req.(*CreateAddressReq)) } return interceptor(ctx, in, info, handler) } func _Admin_AddressListByUid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AdminServer).AddressListByUid(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/admin.admin.v1.admin/AddressListByUid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).AddressListByUid(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _Admin_UpdateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AdminServer).UpdateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/admin.admin.v1.admin/UpdateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).UpdateAddress(ctx, req.(*UpdateAddressReq)) } return interceptor(ctx, in, info, handler) } func _Admin_DefaultAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AdminServer).DefaultAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/admin.admin.v1.admin/DefaultAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).DefaultAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } func _Admin_DeleteAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AdminServer).DeleteAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/admin.admin.v1.admin/DeleteAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).DeleteAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } // Admin_ServiceDesc is the grpc.ServiceDesc for Admin service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Admin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "admin.admin.v1.admin", HandlerType: (*AdminServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _Admin_Register_Handler, }, { MethodName: "Login", Handler: _Admin_Login_Handler, }, { MethodName: "Captcha", Handler: _Admin_Captcha_Handler, }, { MethodName: "Detail", Handler: _Admin_Detail_Handler, }, { MethodName: "CreateAddress", Handler: _Admin_CreateAddress_Handler, }, { MethodName: "AddressListByUid", Handler: _Admin_AddressListByUid_Handler, }, { MethodName: "UpdateAddress", Handler: _Admin_UpdateAddress_Handler, }, { MethodName: "DefaultAddress", Handler: _Admin_DefaultAddress_Handler, }, { MethodName: "DeleteAddress", Handler: _Admin_DeleteAddress_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/admin/v1/admin.proto", } ================================================ FILE: admin/api/admin/v1/admin_http.pb.go ================================================ // Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: // protoc-gen-go-http v2.1.4 package v1 import ( context "context" http "github.com/go-kratos/kratos/v2/transport/http" binding "github.com/go-kratos/kratos/v2/transport/http/binding" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the kratos package it is being compiled against. var _ = new(context.Context) var _ = binding.EncodeURL const _ = http.SupportPackageIsVersion1 type AdminHTTPServer interface { AddressListByUid(context.Context, *emptypb.Empty) (*ListAddressReply, error) Captcha(context.Context, *emptypb.Empty) (*CaptchaReply, error) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) Detail(context.Context, *emptypb.Empty) (*UserDetailResponse, error) Login(context.Context, *LoginReq) (*RegisterReply, error) Register(context.Context, *RegisterReq) (*RegisterReply, error) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) } func RegisterAdminHTTPServer(s *http.Server, srv AdminHTTPServer) { r := s.Route("/") r.POST("/api/users/register", _Admin_Register0_HTTP_Handler(srv)) r.POST("/api/users/login", _Admin_Login0_HTTP_Handler(srv)) r.GET("/api/users/captcha", _Admin_Captcha0_HTTP_Handler(srv)) r.GET("/api/users/detail", _Admin_Detail0_HTTP_Handler(srv)) r.POST("/api/address/create", _Admin_CreateAddress0_HTTP_Handler(srv)) r.GET("/api/address/list/uid", _Admin_AddressListByUid0_HTTP_Handler(srv)) r.PUT("/api/address/update", _Admin_UpdateAddress0_HTTP_Handler(srv)) r.PUT("/api/address/default", _Admin_DefaultAddress0_HTTP_Handler(srv)) r.DELETE("/api/address/delete", _Admin_DeleteAddress0_HTTP_Handler(srv)) } func _Admin_Register0_HTTP_Handler(srv AdminHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in RegisterReq if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, "/admin.admin.v1.admin/Register") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Register(ctx, req.(*RegisterReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*RegisterReply) return ctx.Result(200, reply) } } func _Admin_Login0_HTTP_Handler(srv AdminHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in LoginReq if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, "/admin.admin.v1.admin/Login") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Login(ctx, req.(*LoginReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*RegisterReply) return ctx.Result(200, reply) } } func _Admin_Captcha0_HTTP_Handler(srv AdminHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in emptypb.Empty if err := ctx.BindQuery(&in); err != nil { return err } http.SetOperation(ctx, "/admin.admin.v1.admin/Captcha") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Captcha(ctx, req.(*emptypb.Empty)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CaptchaReply) return ctx.Result(200, reply) } } func _Admin_Detail0_HTTP_Handler(srv AdminHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in emptypb.Empty if err := ctx.BindQuery(&in); err != nil { return err } http.SetOperation(ctx, "/admin.admin.v1.admin/Detail") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Detail(ctx, req.(*emptypb.Empty)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*UserDetailResponse) return ctx.Result(200, reply) } } func _Admin_CreateAddress0_HTTP_Handler(srv AdminHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in CreateAddressReq if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, "/admin.admin.v1.admin/CreateAddress") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.CreateAddress(ctx, req.(*CreateAddressReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*AddressInfo) return ctx.Result(200, reply) } } func _Admin_AddressListByUid0_HTTP_Handler(srv AdminHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in emptypb.Empty if err := ctx.BindQuery(&in); err != nil { return err } http.SetOperation(ctx, "/admin.admin.v1.admin/AddressListByUid") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.AddressListByUid(ctx, req.(*emptypb.Empty)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*ListAddressReply) return ctx.Result(200, reply) } } func _Admin_UpdateAddress0_HTTP_Handler(srv AdminHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in UpdateAddressReq if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, "/admin.admin.v1.admin/UpdateAddress") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.UpdateAddress(ctx, req.(*UpdateAddressReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CheckResponse) return ctx.Result(200, reply) } } func _Admin_DefaultAddress0_HTTP_Handler(srv AdminHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in AddressReq if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, "/admin.admin.v1.admin/DefaultAddress") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.DefaultAddress(ctx, req.(*AddressReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CheckResponse) return ctx.Result(200, reply) } } func _Admin_DeleteAddress0_HTTP_Handler(srv AdminHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in AddressReq if err := ctx.BindQuery(&in); err != nil { return err } http.SetOperation(ctx, "/admin.admin.v1.admin/DeleteAddress") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.DeleteAddress(ctx, req.(*AddressReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CheckResponse) return ctx.Result(200, reply) } } type AdminHTTPClient interface { AddressListByUid(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *ListAddressReply, err error) Captcha(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *CaptchaReply, err error) CreateAddress(ctx context.Context, req *CreateAddressReq, opts ...http.CallOption) (rsp *AddressInfo, err error) DefaultAddress(ctx context.Context, req *AddressReq, opts ...http.CallOption) (rsp *CheckResponse, err error) DeleteAddress(ctx context.Context, req *AddressReq, opts ...http.CallOption) (rsp *CheckResponse, err error) Detail(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *UserDetailResponse, err error) Login(ctx context.Context, req *LoginReq, opts ...http.CallOption) (rsp *RegisterReply, err error) Register(ctx context.Context, req *RegisterReq, opts ...http.CallOption) (rsp *RegisterReply, err error) UpdateAddress(ctx context.Context, req *UpdateAddressReq, opts ...http.CallOption) (rsp *CheckResponse, err error) } type AdminHTTPClientImpl struct { cc *http.Client } func NewAdminHTTPClient(client *http.Client) AdminHTTPClient { return &AdminHTTPClientImpl{client} } func (c *AdminHTTPClientImpl) AddressListByUid(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*ListAddressReply, error) { var out ListAddressReply pattern := "/api/address/list/uid" path := binding.EncodeURL(pattern, in, true) opts = append(opts, http.Operation("/admin.admin.v1.admin/AddressListByUid")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *AdminHTTPClientImpl) Captcha(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*CaptchaReply, error) { var out CaptchaReply pattern := "/api/users/captcha" path := binding.EncodeURL(pattern, in, true) opts = append(opts, http.Operation("/admin.admin.v1.admin/Captcha")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *AdminHTTPClientImpl) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...http.CallOption) (*AddressInfo, error) { var out AddressInfo pattern := "/api/address/create" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/admin.admin.v1.admin/CreateAddress")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *AdminHTTPClientImpl) DefaultAddress(ctx context.Context, in *AddressReq, opts ...http.CallOption) (*CheckResponse, error) { var out CheckResponse pattern := "/api/address/default" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/admin.admin.v1.admin/DefaultAddress")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "PUT", path, in, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *AdminHTTPClientImpl) DeleteAddress(ctx context.Context, in *AddressReq, opts ...http.CallOption) (*CheckResponse, error) { var out CheckResponse pattern := "/api/address/delete" path := binding.EncodeURL(pattern, in, true) opts = append(opts, http.Operation("/admin.admin.v1.admin/DeleteAddress")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *AdminHTTPClientImpl) Detail(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*UserDetailResponse, error) { var out UserDetailResponse pattern := "/api/users/detail" path := binding.EncodeURL(pattern, in, true) opts = append(opts, http.Operation("/admin.admin.v1.admin/Detail")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *AdminHTTPClientImpl) Login(ctx context.Context, in *LoginReq, opts ...http.CallOption) (*RegisterReply, error) { var out RegisterReply pattern := "/api/users/login" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/admin.admin.v1.admin/Login")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *AdminHTTPClientImpl) Register(ctx context.Context, in *RegisterReq, opts ...http.CallOption) (*RegisterReply, error) { var out RegisterReply pattern := "/api/users/register" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/admin.admin.v1.admin/Register")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *AdminHTTPClientImpl) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...http.CallOption) (*CheckResponse, error) { var out CheckResponse pattern := "/api/address/update" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/admin.admin.v1.admin/UpdateAddress")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "PUT", path, in, &out, opts...) if err != nil { return nil, err } return &out, err } ================================================ FILE: admin/api/admin/v1/error_reason.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 // protoc v3.17.3 // source: api/admin/v1/error_reason.proto package v1 import ( _ "github.com/go-kratos/kratos/v2/errors" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ErrorReason int32 const ( ErrorReason_USER_NOT_FOUND ErrorReason = 0 ErrorReason_CONTENT_MISSING ErrorReason = 1 ) // Enum value maps for ErrorReason. var ( ErrorReason_name = map[int32]string{ 0: "USER_NOT_FOUND", 1: "CONTENT_MISSING", } ErrorReason_value = map[string]int32{ "USER_NOT_FOUND": 0, "CONTENT_MISSING": 1, } ) func (x ErrorReason) Enum() *ErrorReason { p := new(ErrorReason) *p = x return p } func (x ErrorReason) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ErrorReason) Descriptor() protoreflect.EnumDescriptor { return file_api_admin_v1_error_reason_proto_enumTypes[0].Descriptor() } func (ErrorReason) Type() protoreflect.EnumType { return &file_api_admin_v1_error_reason_proto_enumTypes[0] } func (x ErrorReason) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ErrorReason.Descriptor instead. func (ErrorReason) EnumDescriptor() ([]byte, []int) { return file_api_admin_v1_error_reason_proto_rawDescGZIP(), []int{0} } var File_api_admin_v1_error_reason_proto protoreflect.FileDescriptor var file_api_admin_v1_error_reason_proto_rawDesc = []byte{ 0x0a, 0x1f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0x48, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x1a, 0x04, 0xa8, 0x45, 0x94, 0x03, 0x12, 0x19, 0x0a, 0x0f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x42, 0x40, 0x0a, 0x0f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x50, 0x01, 0x5a, 0x15, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0xa2, 0x02, 0x13, 0x41, 0x50, 0x49, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_api_admin_v1_error_reason_proto_rawDescOnce sync.Once file_api_admin_v1_error_reason_proto_rawDescData = file_api_admin_v1_error_reason_proto_rawDesc ) func file_api_admin_v1_error_reason_proto_rawDescGZIP() []byte { file_api_admin_v1_error_reason_proto_rawDescOnce.Do(func() { file_api_admin_v1_error_reason_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_admin_v1_error_reason_proto_rawDescData) }) return file_api_admin_v1_error_reason_proto_rawDescData } var file_api_admin_v1_error_reason_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_api_admin_v1_error_reason_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: helloworld.v1.ErrorReason } var file_api_admin_v1_error_reason_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_api_admin_v1_error_reason_proto_init() } func file_api_admin_v1_error_reason_proto_init() { if File_api_admin_v1_error_reason_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_admin_v1_error_reason_proto_rawDesc, NumEnums: 1, NumMessages: 0, NumExtensions: 0, NumServices: 0, }, GoTypes: file_api_admin_v1_error_reason_proto_goTypes, DependencyIndexes: file_api_admin_v1_error_reason_proto_depIdxs, EnumInfos: file_api_admin_v1_error_reason_proto_enumTypes, }.Build() File_api_admin_v1_error_reason_proto = out.File file_api_admin_v1_error_reason_proto_rawDesc = nil file_api_admin_v1_error_reason_proto_goTypes = nil file_api_admin_v1_error_reason_proto_depIdxs = nil } ================================================ FILE: admin/api/admin/v1/error_reason.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: api/admin/v1/error_reason.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) ================================================ FILE: admin/api/admin/v1/error_reason.proto ================================================ syntax = "proto3"; package helloworld.v1; import "errors/errors.proto"; option go_package = "admin/api/admin/v1;v1"; option java_multiple_files = true; option java_package = "admin.v1.errors"; option objc_class_prefix = "APIHelloworldErrors"; enum ErrorReason { option (errors.default_code) = 500; USER_NOT_FOUND = 0 [(errors.code) = 404]; CONTENT_MISSING = 1 [(errors.code) = 400]; } ================================================ FILE: admin/api/admin/v1/error_reason_errors.pb.go ================================================ // Code generated by protoc-gen-go-errors. DO NOT EDIT. package v1 import ( fmt "fmt" errors "github.com/go-kratos/kratos/v2/errors" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the kratos package it is being compiled against. const _ = errors.SupportPackageIsVersion1 func IsUserNotFound(err error) bool { e := errors.FromError(err) return e.Reason == ErrorReason_USER_NOT_FOUND.String() && e.Code == 404 } func ErrorUserNotFound(format string, args ...interface{}) *errors.Error { return errors.New(404, ErrorReason_USER_NOT_FOUND.String(), fmt.Sprintf(format, args...)) } func IsContentMissing(err error) bool { e := errors.FromError(err) return e.Reason == ErrorReason_CONTENT_MISSING.String() && e.Code == 400 } func ErrorContentMissing(format string, args ...interface{}) *errors.Error { return errors.New(400, ErrorReason_CONTENT_MISSING.String(), fmt.Sprintf(format, args...)) } ================================================ FILE: admin/api/service/user/v1/user.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 // protoc v3.17.3 // source: api/service/user/v1/user.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ListAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *ListAddressReq) Reset() { *x = ListAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReq) ProtoMessage() {} func (x *ListAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_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 ListAddressReq.ProtoReflect.Descriptor instead. func (*ListAddressReq) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{0} } func (x *ListAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type AddressInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *AddressInfo) Reset() { *x = AddressInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressInfo) ProtoMessage() {} func (x *AddressInfo) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_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 AddressInfo.ProtoReflect.Descriptor instead. func (*AddressInfo) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{1} } func (x *AddressInfo) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressInfo) GetName() string { if x != nil { return x.Name } return "" } func (x *AddressInfo) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *AddressInfo) GetProvince() string { if x != nil { return x.Province } return "" } func (x *AddressInfo) GetCity() string { if x != nil { return x.City } return "" } func (x *AddressInfo) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *AddressInfo) GetAddress() string { if x != nil { return x.Address } return "" } func (x *AddressInfo) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *AddressInfo) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type ListAddressReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Results []*AddressInfo `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } func (x *ListAddressReply) Reset() { *x = ListAddressReply{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReply) ProtoMessage() {} func (x *ListAddressReply) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_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 ListAddressReply.ProtoReflect.Descriptor instead. func (*ListAddressReply) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{2} } func (x *ListAddressReply) GetResults() []*AddressInfo { if x != nil { return x.Results } return nil } type CreateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *CreateAddressReq) Reset() { *x = CreateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateAddressReq) ProtoMessage() {} func (x *CreateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_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 CreateAddressReq.ProtoReflect.Descriptor instead. func (*CreateAddressReq) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{3} } func (x *CreateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *CreateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *CreateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *CreateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *CreateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *CreateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *CreateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *CreateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *CreateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type UpdateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` Id int64 `protobuf:"varint,10,opt,name=id,proto3" json:"id,omitempty"` } func (x *UpdateAddressReq) Reset() { *x = UpdateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateAddressReq) ProtoMessage() {} func (x *UpdateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use UpdateAddressReq.ProtoReflect.Descriptor instead. func (*UpdateAddressReq) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{4} } func (x *UpdateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *UpdateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *UpdateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UpdateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *UpdateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *UpdateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *UpdateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *UpdateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *UpdateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } func (x *UpdateAddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } type AddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Uid int64 `protobuf:"varint,2,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *AddressReq) Reset() { *x = AddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressReq) ProtoMessage() {} func (x *AddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AddressReq.ProtoReflect.Descriptor instead. func (*AddressReq) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{5} } func (x *AddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type CheckResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } func (x *CheckResponse) Reset() { *x = CheckResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CheckResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CheckResponse) ProtoMessage() {} func (x *CheckResponse) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[6] 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 CheckResponse.ProtoReflect.Descriptor instead. func (*CheckResponse) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{6} } func (x *CheckResponse) GetSuccess() bool { if x != nil { return x.Success } return false } // 分页 type PageInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Pn uint32 `protobuf:"varint,1,opt,name=pn,proto3" json:"pn,omitempty"` PSize uint32 `protobuf:"varint,2,opt,name=pSize,proto3" json:"pSize,omitempty"` } func (x *PageInfo) Reset() { *x = PageInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PageInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*PageInfo) ProtoMessage() {} func (x *PageInfo) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[7] 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 PageInfo.ProtoReflect.Descriptor instead. func (*PageInfo) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{7} } func (x *PageInfo) GetPn() uint32 { if x != nil { return x.Pn } return 0 } func (x *PageInfo) GetPSize() uint32 { if x != nil { return x.PSize } return 0 } // 用户信息 type UserInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` NickName string `protobuf:"bytes,4,opt,name=nickName,proto3" json:"nickName,omitempty"` Birthday uint64 `protobuf:"varint,5,opt,name=birthday,proto3" json:"birthday,omitempty"` Gender string `protobuf:"bytes,6,opt,name=gender,proto3" json:"gender,omitempty"` Role int32 `protobuf:"varint,7,opt,name=role,proto3" json:"role,omitempty"` } func (x *UserInfoResponse) Reset() { *x = UserInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UserInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*UserInfoResponse) ProtoMessage() {} func (x *UserInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[8] 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 UserInfoResponse.ProtoReflect.Descriptor instead. func (*UserInfoResponse) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{8} } func (x *UserInfoResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UserInfoResponse) GetPassword() string { if x != nil { return x.Password } return "" } func (x *UserInfoResponse) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UserInfoResponse) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *UserInfoResponse) GetBirthday() uint64 { if x != nil { return x.Birthday } return 0 } func (x *UserInfoResponse) GetGender() string { if x != nil { return x.Gender } return "" } func (x *UserInfoResponse) GetRole() int32 { if x != nil { return x.Role } return 0 } // 用户列表 type UserListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Data []*UserInfoResponse `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` } func (x *UserListResponse) Reset() { *x = UserListResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UserListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*UserListResponse) ProtoMessage() {} func (x *UserListResponse) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[9] 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 UserListResponse.ProtoReflect.Descriptor instead. func (*UserListResponse) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{9} } func (x *UserListResponse) GetTotal() int32 { if x != nil { return x.Total } return 0 } func (x *UserListResponse) GetData() []*UserInfoResponse { if x != nil { return x.Data } return nil } type MobileRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"` } func (x *MobileRequest) Reset() { *x = MobileRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *MobileRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*MobileRequest) ProtoMessage() {} func (x *MobileRequest) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[10] 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 MobileRequest.ProtoReflect.Descriptor instead. func (*MobileRequest) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{10} } func (x *MobileRequest) GetMobile() string { if x != nil { return x.Mobile } return "" } type IdRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *IdRequest) Reset() { *x = IdRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *IdRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*IdRequest) ProtoMessage() {} func (x *IdRequest) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[11] 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 IdRequest.ProtoReflect.Descriptor instead. func (*IdRequest) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{11} } func (x *IdRequest) GetId() int64 { if x != nil { return x.Id } return 0 } // 创建用户 type CreateUserInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields NickName string `protobuf:"bytes,1,opt,name=nickName,proto3" json:"nickName,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` } func (x *CreateUserInfo) Reset() { *x = CreateUserInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateUserInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateUserInfo) ProtoMessage() {} func (x *CreateUserInfo) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[12] 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 CreateUserInfo.ProtoReflect.Descriptor instead. func (*CreateUserInfo) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{12} } func (x *CreateUserInfo) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *CreateUserInfo) GetPassword() string { if x != nil { return x.Password } return "" } func (x *CreateUserInfo) GetMobile() string { if x != nil { return x.Mobile } return "" } type UpdateUserInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` NickName string `protobuf:"bytes,2,opt,name=nickName,proto3" json:"nickName,omitempty"` Gender string `protobuf:"bytes,3,opt,name=gender,proto3" json:"gender,omitempty"` Birthday uint64 `protobuf:"varint,4,opt,name=birthday,proto3" json:"birthday,omitempty"` } func (x *UpdateUserInfo) Reset() { *x = UpdateUserInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateUserInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateUserInfo) ProtoMessage() {} func (x *UpdateUserInfo) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[13] 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 UpdateUserInfo.ProtoReflect.Descriptor instead. func (*UpdateUserInfo) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{13} } func (x *UpdateUserInfo) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UpdateUserInfo) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *UpdateUserInfo) GetGender() string { if x != nil { return x.Gender } return "" } func (x *UpdateUserInfo) GetBirthday() uint64 { if x != nil { return x.Birthday } return 0 } type PasswordCheckInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` EncryptedPassword string `protobuf:"bytes,2,opt,name=encryptedPassword,proto3" json:"encryptedPassword,omitempty"` } func (x *PasswordCheckInfo) Reset() { *x = PasswordCheckInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PasswordCheckInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*PasswordCheckInfo) ProtoMessage() {} func (x *PasswordCheckInfo) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[14] 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 PasswordCheckInfo.ProtoReflect.Descriptor instead. func (*PasswordCheckInfo) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{14} } func (x *PasswordCheckInfo) GetPassword() string { if x != nil { return x.Password } return "" } func (x *PasswordCheckInfo) GetEncryptedPassword() string { if x != nil { return x.EncryptedPassword } return "" } var File_api_service_user_v1_user_proto protoreflect.FileDescriptor var file_api_service_user_v1_user_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x22, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0xed, 0x01, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x42, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xf4, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x84, 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x30, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x70, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xba, 0x01, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x57, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x27, 0x0a, 0x0d, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x22, 0x1b, 0x0a, 0x09, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x60, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x22, 0x70, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x22, 0x5d, 0x0a, 0x11, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0xe9, 0x05, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x12, 0x12, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x15, 0x5a, 0x13, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_api_service_user_v1_user_proto_rawDescOnce sync.Once file_api_service_user_v1_user_proto_rawDescData = file_api_service_user_v1_user_proto_rawDesc ) func file_api_service_user_v1_user_proto_rawDescGZIP() []byte { file_api_service_user_v1_user_proto_rawDescOnce.Do(func() { file_api_service_user_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_service_user_v1_user_proto_rawDescData) }) return file_api_service_user_v1_user_proto_rawDescData } var file_api_service_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_api_service_user_v1_user_proto_goTypes = []interface{}{ (*ListAddressReq)(nil), // 0: user.v1.ListAddressReq (*AddressInfo)(nil), // 1: user.v1.AddressInfo (*ListAddressReply)(nil), // 2: user.v1.ListAddressReply (*CreateAddressReq)(nil), // 3: user.v1.CreateAddressReq (*UpdateAddressReq)(nil), // 4: user.v1.UpdateAddressReq (*AddressReq)(nil), // 5: user.v1.AddressReq (*CheckResponse)(nil), // 6: user.v1.CheckResponse (*PageInfo)(nil), // 7: user.v1.PageInfo (*UserInfoResponse)(nil), // 8: user.v1.UserInfoResponse (*UserListResponse)(nil), // 9: user.v1.UserListResponse (*MobileRequest)(nil), // 10: user.v1.MobileRequest (*IdRequest)(nil), // 11: user.v1.IdRequest (*CreateUserInfo)(nil), // 12: user.v1.CreateUserInfo (*UpdateUserInfo)(nil), // 13: user.v1.UpdateUserInfo (*PasswordCheckInfo)(nil), // 14: user.v1.PasswordCheckInfo (*emptypb.Empty)(nil), // 15: google.protobuf.Empty } var file_api_service_user_v1_user_proto_depIdxs = []int32{ 1, // 0: user.v1.ListAddressReply.results:type_name -> user.v1.AddressInfo 8, // 1: user.v1.UserListResponse.data:type_name -> user.v1.UserInfoResponse 7, // 2: user.v1.User.GetUserList:input_type -> user.v1.PageInfo 10, // 3: user.v1.User.GetUserByMobile:input_type -> user.v1.MobileRequest 11, // 4: user.v1.User.GetUserById:input_type -> user.v1.IdRequest 12, // 5: user.v1.User.CreateUser:input_type -> user.v1.CreateUserInfo 13, // 6: user.v1.User.UpdateUser:input_type -> user.v1.UpdateUserInfo 14, // 7: user.v1.User.CheckPassword:input_type -> user.v1.PasswordCheckInfo 0, // 8: user.v1.User.ListAddress:input_type -> user.v1.ListAddressReq 3, // 9: user.v1.User.CreateAddress:input_type -> user.v1.CreateAddressReq 4, // 10: user.v1.User.UpdateAddress:input_type -> user.v1.UpdateAddressReq 5, // 11: user.v1.User.DefaultAddress:input_type -> user.v1.AddressReq 5, // 12: user.v1.User.DeleteAddress:input_type -> user.v1.AddressReq 9, // 13: user.v1.User.GetUserList:output_type -> user.v1.UserListResponse 8, // 14: user.v1.User.GetUserByMobile:output_type -> user.v1.UserInfoResponse 8, // 15: user.v1.User.GetUserById:output_type -> user.v1.UserInfoResponse 8, // 16: user.v1.User.CreateUser:output_type -> user.v1.UserInfoResponse 15, // 17: user.v1.User.UpdateUser:output_type -> google.protobuf.Empty 6, // 18: user.v1.User.CheckPassword:output_type -> user.v1.CheckResponse 2, // 19: user.v1.User.ListAddress:output_type -> user.v1.ListAddressReply 1, // 20: user.v1.User.CreateAddress:output_type -> user.v1.AddressInfo 6, // 21: user.v1.User.UpdateAddress:output_type -> user.v1.CheckResponse 6, // 22: user.v1.User.DefaultAddress:output_type -> user.v1.CheckResponse 6, // 23: user.v1.User.DeleteAddress:output_type -> user.v1.CheckResponse 13, // [13:24] is the sub-list for method output_type 2, // [2:13] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } func init() { file_api_service_user_v1_user_proto_init() } func file_api_service_user_v1_user_proto_init() { if File_api_service_user_v1_user_proto != nil { return } if !protoimpl.UnsafeEnabled { file_api_service_user_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PageInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MobileRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IdRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateUserInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateUserInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PasswordCheckInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_service_user_v1_user_proto_rawDesc, NumEnums: 0, NumMessages: 15, NumExtensions: 0, NumServices: 1, }, GoTypes: file_api_service_user_v1_user_proto_goTypes, DependencyIndexes: file_api_service_user_v1_user_proto_depIdxs, MessageInfos: file_api_service_user_v1_user_proto_msgTypes, }.Build() File_api_service_user_v1_user_proto = out.File file_api_service_user_v1_user_proto_rawDesc = nil file_api_service_user_v1_user_proto_goTypes = nil file_api_service_user_v1_user_proto_depIdxs = nil } ================================================ FILE: admin/api/service/user/v1/user.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: api/service/user/v1/user.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on ListAddressReq 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 *ListAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReq 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 ListAddressReqMultiError, // or nil if none found. func (m *ListAddressReq) ValidateAll() error { return m.validate(true) } func (m *ListAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid if len(errors) > 0 { return ListAddressReqMultiError(errors) } return nil } // ListAddressReqMultiError is an error wrapping multiple validation errors // returned by ListAddressReq.ValidateAll() if the designated constraints // aren't met. type ListAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReqMultiError) 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 ListAddressReqMultiError) AllErrors() []error { return m } // ListAddressReqValidationError is the validation error returned by // ListAddressReq.Validate if the designated constraints aren't met. type ListAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReqValidationError) ErrorName() string { return "ListAddressReqValidationError" } // Error satisfies the builtin error interface func (e ListAddressReqValidationError) 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 %sListAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReqValidationError{} // Validate checks the field values on AddressInfo 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 *AddressInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressInfo 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 AddressInfoMultiError, or // nil if none found. func (m *AddressInfo) ValidateAll() error { return m.validate(true) } func (m *AddressInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return AddressInfoMultiError(errors) } return nil } // AddressInfoMultiError is an error wrapping multiple validation errors // returned by AddressInfo.ValidateAll() if the designated constraints aren't met. type AddressInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressInfoMultiError) 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 AddressInfoMultiError) AllErrors() []error { return m } // AddressInfoValidationError is the validation error returned by // AddressInfo.Validate if the designated constraints aren't met. type AddressInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressInfoValidationError) ErrorName() string { return "AddressInfoValidationError" } // Error satisfies the builtin error interface func (e AddressInfoValidationError) 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 %sAddressInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressInfoValidationError{} // Validate checks the field values on ListAddressReply 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 *ListAddressReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReply 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 // ListAddressReplyMultiError, or nil if none found. func (m *ListAddressReply) ValidateAll() error { return m.validate(true) } func (m *ListAddressReply) validate(all bool) error { if m == nil { return nil } var errors []error for idx, item := range m.GetResults() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%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 ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return ListAddressReplyMultiError(errors) } return nil } // ListAddressReplyMultiError is an error wrapping multiple validation errors // returned by ListAddressReply.ValidateAll() if the designated constraints // aren't met. type ListAddressReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReplyMultiError) 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 ListAddressReplyMultiError) AllErrors() []error { return m } // ListAddressReplyValidationError is the validation error returned by // ListAddressReply.Validate if the designated constraints aren't met. type ListAddressReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReplyValidationError) ErrorName() string { return "ListAddressReplyValidationError" } // Error satisfies the builtin error interface func (e ListAddressReplyValidationError) 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 %sListAddressReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReplyValidationError{} // Validate checks the field values on CreateAddressReq 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 *CreateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateAddressReq 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 // CreateAddressReqMultiError, or nil if none found. func (m *CreateAddressReq) ValidateAll() error { return m.validate(true) } func (m *CreateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return CreateAddressReqMultiError(errors) } return nil } // CreateAddressReqMultiError is an error wrapping multiple validation errors // returned by CreateAddressReq.ValidateAll() if the designated constraints // aren't met. type CreateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateAddressReqMultiError) 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 CreateAddressReqMultiError) AllErrors() []error { return m } // CreateAddressReqValidationError is the validation error returned by // CreateAddressReq.Validate if the designated constraints aren't met. type CreateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateAddressReqValidationError) ErrorName() string { return "CreateAddressReqValidationError" } // Error satisfies the builtin error interface func (e CreateAddressReqValidationError) 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 %sCreateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateAddressReqValidationError{} // Validate checks the field values on UpdateAddressReq 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 *UpdateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateAddressReq 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 // UpdateAddressReqMultiError, or nil if none found. func (m *UpdateAddressReq) ValidateAll() error { return m.validate(true) } func (m *UpdateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault // no validation rules for Id if len(errors) > 0 { return UpdateAddressReqMultiError(errors) } return nil } // UpdateAddressReqMultiError is an error wrapping multiple validation errors // returned by UpdateAddressReq.ValidateAll() if the designated constraints // aren't met. type UpdateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateAddressReqMultiError) 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 UpdateAddressReqMultiError) AllErrors() []error { return m } // UpdateAddressReqValidationError is the validation error returned by // UpdateAddressReq.Validate if the designated constraints aren't met. type UpdateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateAddressReqValidationError) ErrorName() string { return "UpdateAddressReqValidationError" } // Error satisfies the builtin error interface func (e UpdateAddressReqValidationError) 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 %sUpdateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateAddressReqValidationError{} // Validate checks the field values on AddressReq 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 *AddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressReq 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 AddressReqMultiError, or // nil if none found. func (m *AddressReq) ValidateAll() error { return m.validate(true) } func (m *AddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Uid if len(errors) > 0 { return AddressReqMultiError(errors) } return nil } // AddressReqMultiError is an error wrapping multiple validation errors // returned by AddressReq.ValidateAll() if the designated constraints aren't met. type AddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressReqMultiError) 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 AddressReqMultiError) AllErrors() []error { return m } // AddressReqValidationError is the validation error returned by // AddressReq.Validate if the designated constraints aren't met. type AddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressReqValidationError) ErrorName() string { return "AddressReqValidationError" } // Error satisfies the builtin error interface func (e AddressReqValidationError) 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 %sAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressReqValidationError{} // Validate checks the field values on CheckResponse 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 *CheckResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CheckResponse 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 CheckResponseMultiError, or // nil if none found. func (m *CheckResponse) ValidateAll() error { return m.validate(true) } func (m *CheckResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Success if len(errors) > 0 { return CheckResponseMultiError(errors) } return nil } // CheckResponseMultiError is an error wrapping multiple validation errors // returned by CheckResponse.ValidateAll() if the designated constraints // aren't met. type CheckResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CheckResponseMultiError) 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 CheckResponseMultiError) AllErrors() []error { return m } // CheckResponseValidationError is the validation error returned by // CheckResponse.Validate if the designated constraints aren't met. type CheckResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CheckResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CheckResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CheckResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CheckResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CheckResponseValidationError) ErrorName() string { return "CheckResponseValidationError" } // Error satisfies the builtin error interface func (e CheckResponseValidationError) 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 %sCheckResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CheckResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CheckResponseValidationError{} // Validate checks the field values on PageInfo 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 *PageInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PageInfo 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 PageInfoMultiError, or nil // if none found. func (m *PageInfo) ValidateAll() error { return m.validate(true) } func (m *PageInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Pn // no validation rules for PSize if len(errors) > 0 { return PageInfoMultiError(errors) } return nil } // PageInfoMultiError is an error wrapping multiple validation errors returned // by PageInfo.ValidateAll() if the designated constraints aren't met. type PageInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PageInfoMultiError) 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 PageInfoMultiError) AllErrors() []error { return m } // PageInfoValidationError is the validation error returned by // PageInfo.Validate if the designated constraints aren't met. type PageInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PageInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PageInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PageInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PageInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PageInfoValidationError) ErrorName() string { return "PageInfoValidationError" } // Error satisfies the builtin error interface func (e PageInfoValidationError) 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 %sPageInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PageInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PageInfoValidationError{} // Validate checks the field values on UserInfoResponse 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 *UserInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UserInfoResponse 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 // UserInfoResponseMultiError, or nil if none found. func (m *UserInfoResponse) ValidateAll() error { return m.validate(true) } func (m *UserInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Password // no validation rules for Mobile // no validation rules for NickName // no validation rules for Birthday // no validation rules for Gender // no validation rules for Role if len(errors) > 0 { return UserInfoResponseMultiError(errors) } return nil } // UserInfoResponseMultiError is an error wrapping multiple validation errors // returned by UserInfoResponse.ValidateAll() if the designated constraints // aren't met. type UserInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UserInfoResponseMultiError) 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 UserInfoResponseMultiError) AllErrors() []error { return m } // UserInfoResponseValidationError is the validation error returned by // UserInfoResponse.Validate if the designated constraints aren't met. type UserInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UserInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UserInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UserInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UserInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UserInfoResponseValidationError) ErrorName() string { return "UserInfoResponseValidationError" } // Error satisfies the builtin error interface func (e UserInfoResponseValidationError) 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 %sUserInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UserInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UserInfoResponseValidationError{} // Validate checks the field values on UserListResponse 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 *UserListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UserListResponse 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 // UserListResponseMultiError, or nil if none found. func (m *UserListResponse) ValidateAll() error { return m.validate(true) } func (m *UserListResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Total for idx, item := range m.GetData() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, UserListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, UserListResponseValidationError{ field: fmt.Sprintf("Data[%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 UserListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return UserListResponseMultiError(errors) } return nil } // UserListResponseMultiError is an error wrapping multiple validation errors // returned by UserListResponse.ValidateAll() if the designated constraints // aren't met. type UserListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UserListResponseMultiError) 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 UserListResponseMultiError) AllErrors() []error { return m } // UserListResponseValidationError is the validation error returned by // UserListResponse.Validate if the designated constraints aren't met. type UserListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UserListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UserListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UserListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UserListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UserListResponseValidationError) ErrorName() string { return "UserListResponseValidationError" } // Error satisfies the builtin error interface func (e UserListResponseValidationError) 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 %sUserListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UserListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UserListResponseValidationError{} // Validate checks the field values on MobileRequest 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 *MobileRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on MobileRequest 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 MobileRequestMultiError, or // nil if none found. func (m *MobileRequest) ValidateAll() error { return m.validate(true) } func (m *MobileRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Mobile if len(errors) > 0 { return MobileRequestMultiError(errors) } return nil } // MobileRequestMultiError is an error wrapping multiple validation errors // returned by MobileRequest.ValidateAll() if the designated constraints // aren't met. type MobileRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m MobileRequestMultiError) 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 MobileRequestMultiError) AllErrors() []error { return m } // MobileRequestValidationError is the validation error returned by // MobileRequest.Validate if the designated constraints aren't met. type MobileRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e MobileRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e MobileRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e MobileRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e MobileRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e MobileRequestValidationError) ErrorName() string { return "MobileRequestValidationError" } // Error satisfies the builtin error interface func (e MobileRequestValidationError) 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 %sMobileRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = MobileRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = MobileRequestValidationError{} // Validate checks the field values on IdRequest 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 *IdRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on IdRequest 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 IdRequestMultiError, or nil // if none found. func (m *IdRequest) ValidateAll() error { return m.validate(true) } func (m *IdRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return IdRequestMultiError(errors) } return nil } // IdRequestMultiError is an error wrapping multiple validation errors returned // by IdRequest.ValidateAll() if the designated constraints aren't met. type IdRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m IdRequestMultiError) 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 IdRequestMultiError) AllErrors() []error { return m } // IdRequestValidationError is the validation error returned by // IdRequest.Validate if the designated constraints aren't met. type IdRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e IdRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e IdRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e IdRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e IdRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e IdRequestValidationError) ErrorName() string { return "IdRequestValidationError" } // Error satisfies the builtin error interface func (e IdRequestValidationError) 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 %sIdRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = IdRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = IdRequestValidationError{} // Validate checks the field values on CreateUserInfo 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 *CreateUserInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateUserInfo 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 CreateUserInfoMultiError, // or nil if none found. func (m *CreateUserInfo) ValidateAll() error { return m.validate(true) } func (m *CreateUserInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for NickName // no validation rules for Password // no validation rules for Mobile if len(errors) > 0 { return CreateUserInfoMultiError(errors) } return nil } // CreateUserInfoMultiError is an error wrapping multiple validation errors // returned by CreateUserInfo.ValidateAll() if the designated constraints // aren't met. type CreateUserInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateUserInfoMultiError) 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 CreateUserInfoMultiError) AllErrors() []error { return m } // CreateUserInfoValidationError is the validation error returned by // CreateUserInfo.Validate if the designated constraints aren't met. type CreateUserInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateUserInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateUserInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateUserInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateUserInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateUserInfoValidationError) ErrorName() string { return "CreateUserInfoValidationError" } // Error satisfies the builtin error interface func (e CreateUserInfoValidationError) 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 %sCreateUserInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateUserInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateUserInfoValidationError{} // Validate checks the field values on UpdateUserInfo 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 *UpdateUserInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateUserInfo 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 UpdateUserInfoMultiError, // or nil if none found. func (m *UpdateUserInfo) ValidateAll() error { return m.validate(true) } func (m *UpdateUserInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for NickName // no validation rules for Gender // no validation rules for Birthday if len(errors) > 0 { return UpdateUserInfoMultiError(errors) } return nil } // UpdateUserInfoMultiError is an error wrapping multiple validation errors // returned by UpdateUserInfo.ValidateAll() if the designated constraints // aren't met. type UpdateUserInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateUserInfoMultiError) 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 UpdateUserInfoMultiError) AllErrors() []error { return m } // UpdateUserInfoValidationError is the validation error returned by // UpdateUserInfo.Validate if the designated constraints aren't met. type UpdateUserInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateUserInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateUserInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateUserInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateUserInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateUserInfoValidationError) ErrorName() string { return "UpdateUserInfoValidationError" } // Error satisfies the builtin error interface func (e UpdateUserInfoValidationError) 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 %sUpdateUserInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateUserInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateUserInfoValidationError{} // Validate checks the field values on PasswordCheckInfo 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 *PasswordCheckInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PasswordCheckInfo 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 // PasswordCheckInfoMultiError, or nil if none found. func (m *PasswordCheckInfo) ValidateAll() error { return m.validate(true) } func (m *PasswordCheckInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Password // no validation rules for EncryptedPassword if len(errors) > 0 { return PasswordCheckInfoMultiError(errors) } return nil } // PasswordCheckInfoMultiError is an error wrapping multiple validation errors // returned by PasswordCheckInfo.ValidateAll() if the designated constraints // aren't met. type PasswordCheckInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PasswordCheckInfoMultiError) 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 PasswordCheckInfoMultiError) AllErrors() []error { return m } // PasswordCheckInfoValidationError is the validation error returned by // PasswordCheckInfo.Validate if the designated constraints aren't met. type PasswordCheckInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PasswordCheckInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PasswordCheckInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PasswordCheckInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PasswordCheckInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PasswordCheckInfoValidationError) ErrorName() string { return "PasswordCheckInfoValidationError" } // Error satisfies the builtin error interface func (e PasswordCheckInfoValidationError) 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 %sPasswordCheckInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PasswordCheckInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PasswordCheckInfoValidationError{} ================================================ FILE: admin/api/service/user/v1/user.proto ================================================ syntax = "proto3"; package user.v1; import "google/protobuf/empty.proto"; option go_package = "user/api/user/v1;v1"; service User{ rpc GetUserList(PageInfo) returns (UserListResponse){}; // 用户列表 rpc GetUserByMobile(MobileRequest) returns (UserInfoResponse){}; // 通过 mobile 查询用户 rpc GetUserById(IdRequest) returns (UserInfoResponse){}; // 通过 Id 查询用户 rpc CreateUser(CreateUserInfo) returns (UserInfoResponse){}; // 创建用户 rpc UpdateUser(UpdateUserInfo) returns (google.protobuf.Empty){}; // 更新用户 rpc CheckPassword(PasswordCheckInfo) returns (CheckResponse){}; // 检查用户密码 // 收货地址 rpc ListAddress(ListAddressReq) returns (ListAddressReply) {} // 所有收货地址列表 rpc CreateAddress(CreateAddressReq) returns (AddressInfo) {} // 新增收货地址 rpc UpdateAddress(UpdateAddressReq) returns (CheckResponse) {} // 修改收货地址 rpc DefaultAddress(AddressReq) returns (CheckResponse) {} // 设置默认地址 rpc DeleteAddress(AddressReq) returns (CheckResponse) {} // 删除收货地址 } message ListAddressReq { int64 uid = 1; } message AddressInfo { int64 id = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; } message ListAddressReply { repeated AddressInfo results = 1; } message CreateAddressReq { int64 uid = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; } message UpdateAddressReq { int64 uid = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; int64 id = 10; } message AddressReq { int64 id = 1; int64 uid = 2; } message CheckResponse{ bool success = 1; } // 分页 message PageInfo{ uint32 pn = 1; uint32 pSize = 2; } // 用户信息 message UserInfoResponse{ int64 id = 1; string password = 2; string mobile = 3; string nickName = 4; uint64 birthday = 5; string gender = 6; int32 role = 7; } // 用户列表 message UserListResponse{ int32 total = 1; repeated UserInfoResponse data = 2; } message MobileRequest{ string mobile = 1; } message IdRequest{ int64 id = 1; } // 创建用户 message CreateUserInfo{ string nickName = 1; string password = 2; string mobile = 3; } message UpdateUserInfo{ int64 id = 1; string nickName = 2; string gender = 3; uint64 birthday = 4; } message PasswordCheckInfo{ string password = 1; string encryptedPassword = 2; } ================================================ FILE: admin/api/service/user/v1/user_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.17.3 // source: api/service/user/v1/user.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // UserClient is the client API for User service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type UserClient interface { GetUserList(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*UserListResponse, error) GetUserByMobile(ctx context.Context, in *MobileRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) GetUserById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) CreateUser(ctx context.Context, in *CreateUserInfo, opts ...grpc.CallOption) (*UserInfoResponse, error) UpdateUser(ctx context.Context, in *UpdateUserInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) CheckPassword(ctx context.Context, in *PasswordCheckInfo, opts ...grpc.CallOption) (*CheckResponse, error) // 收货地址 ListAddress(ctx context.Context, in *ListAddressReq, opts ...grpc.CallOption) (*ListAddressReply, error) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) } type userClient struct { cc grpc.ClientConnInterface } func NewUserClient(cc grpc.ClientConnInterface) UserClient { return &userClient{cc} } func (c *userClient) GetUserList(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*UserListResponse, error) { out := new(UserListResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserList", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) GetUserByMobile(ctx context.Context, in *MobileRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserByMobile", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) GetUserById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserById", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CreateUser(ctx context.Context, in *CreateUserInfo, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/CreateUser", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) UpdateUser(ctx context.Context, in *UpdateUserInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/user.v1.User/UpdateUser", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CheckPassword(ctx context.Context, in *PasswordCheckInfo, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/CheckPassword", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) ListAddress(ctx context.Context, in *ListAddressReq, opts ...grpc.CallOption) (*ListAddressReply, error) { out := new(ListAddressReply) err := c.cc.Invoke(ctx, "/user.v1.User/ListAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) { out := new(AddressInfo) err := c.cc.Invoke(ctx, "/user.v1.User/CreateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/UpdateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/DefaultAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/DeleteAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } // UserServer is the s API for User service. // All implementations must embed UnimplementedUserServer // for forward compatibility type UserServer interface { GetUserList(context.Context, *PageInfo) (*UserListResponse, error) GetUserByMobile(context.Context, *MobileRequest) (*UserInfoResponse, error) GetUserById(context.Context, *IdRequest) (*UserInfoResponse, error) CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error) UpdateUser(context.Context, *UpdateUserInfo) (*emptypb.Empty, error) CheckPassword(context.Context, *PasswordCheckInfo) (*CheckResponse, error) // 收货地址 ListAddress(context.Context, *ListAddressReq) (*ListAddressReply, error) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) mustEmbedUnimplementedUserServer() } // UnimplementedUserServer must be embedded to have forward compatible implementations. type UnimplementedUserServer struct { } func (UnimplementedUserServer) GetUserList(context.Context, *PageInfo) (*UserListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserList not implemented") } func (UnimplementedUserServer) GetUserByMobile(context.Context, *MobileRequest) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserByMobile not implemented") } func (UnimplementedUserServer) GetUserById(context.Context, *IdRequest) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserById not implemented") } func (UnimplementedUserServer) CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") } func (UnimplementedUserServer) UpdateUser(context.Context, *UpdateUserInfo) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") } func (UnimplementedUserServer) CheckPassword(context.Context, *PasswordCheckInfo) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CheckPassword not implemented") } func (UnimplementedUserServer) ListAddress(context.Context, *ListAddressReq) (*ListAddressReply, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAddress not implemented") } func (UnimplementedUserServer) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAddress not implemented") } func (UnimplementedUserServer) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateAddress not implemented") } func (UnimplementedUserServer) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DefaultAddress not implemented") } func (UnimplementedUserServer) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteAddress not implemented") } func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {} // UnsafeUserServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to UserServer will // result in compilation errors. type UnsafeUserServer interface { mustEmbedUnimplementedUserServer() } func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer) { s.RegisterService(&User_ServiceDesc, srv) } func _User_GetUserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PageInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserList(ctx, req.(*PageInfo)) } return interceptor(ctx, in, info, handler) } func _User_GetUserByMobile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MobileRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserByMobile(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserByMobile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserByMobile(ctx, req.(*MobileRequest)) } return interceptor(ctx, in, info, handler) } func _User_GetUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserById(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserById", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserById(ctx, req.(*IdRequest)) } return interceptor(ctx, in, info, handler) } func _User_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateUserInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CreateUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CreateUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CreateUser(ctx, req.(*CreateUserInfo)) } return interceptor(ctx, in, info, handler) } func _User_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateUserInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).UpdateUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/UpdateUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).UpdateUser(ctx, req.(*UpdateUserInfo)) } return interceptor(ctx, in, info, handler) } func _User_CheckPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PasswordCheckInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CheckPassword(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CheckPassword", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CheckPassword(ctx, req.(*PasswordCheckInfo)) } return interceptor(ctx, in, info, handler) } func _User_ListAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).ListAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/ListAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).ListAddress(ctx, req.(*ListAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_CreateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CreateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CreateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CreateAddress(ctx, req.(*CreateAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_UpdateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).UpdateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/UpdateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).UpdateAddress(ctx, req.(*UpdateAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_DefaultAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).DefaultAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/DefaultAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).DefaultAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } func _User_DeleteAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).DeleteAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/DeleteAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).DeleteAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } // User_ServiceDesc is the grpc.ServiceDesc for User service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.v1.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUserList", Handler: _User_GetUserList_Handler, }, { MethodName: "GetUserByMobile", Handler: _User_GetUserByMobile_Handler, }, { MethodName: "GetUserById", Handler: _User_GetUserById_Handler, }, { MethodName: "CreateUser", Handler: _User_CreateUser_Handler, }, { MethodName: "UpdateUser", Handler: _User_UpdateUser_Handler, }, { MethodName: "CheckPassword", Handler: _User_CheckPassword_Handler, }, { MethodName: "ListAddress", Handler: _User_ListAddress_Handler, }, { MethodName: "CreateAddress", Handler: _User_CreateAddress_Handler, }, { MethodName: "UpdateAddress", Handler: _User_UpdateAddress_Handler, }, { MethodName: "DefaultAddress", Handler: _User_DefaultAddress_Handler, }, { MethodName: "DeleteAddress", Handler: _User_DeleteAddress_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/service/user/v1/user.proto", } ================================================ FILE: admin/cmd/admin/main.go ================================================ package main import ( "flag" "os" "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/http" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/exporters/jaeger" "go.opentelemetry.io/otel/sdk/resource" tracesdk "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.7.0" "admin/internal/conf" ) // go build -ldflags "-X main.Version=x.y.z" var ( // Name is the name of the compiled software. Name = "admin.api" // Version is the version of the compiled software. Version = "admin.api.v1" // flagconf is the config flag. flagconf string id, _ = os.Hostname() ) func init() { flag.StringVar(&flagconf, "conf", "../../configs", "config path, eg: -conf config.yaml") } func newApp(logger log.Logger, hs *http.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.ID(id+"admin.api"), kratos.Name(Name), kratos.Version(Version), kratos.Metadata(map[string]string{}), kratos.Logger(logger), kratos.Server( hs, ), kratos.Registrar(rr), ) } func main() { flag.Parse() logger := log.With(log.NewStdLogger(os.Stdout), "ts", log.DefaultTimestamp, "caller", log.DefaultCaller, "service.id", id, "service.name", Name, "service.version", Version, "trace_id", tracing.TraceID(), "span_id", tracing.SpanID(), ) c := config.New( config.WithSource( file.NewSource(flagconf), ), ) defer c.Close() if err := c.Load(); err != nil { panic(err) } var bc conf.Bootstrap if err := c.Scan(&bc); err != nil { panic(err) } var rc conf.Registry if err := c.Scan(&rc); err != nil { panic(err) } err := setTracerProvider(bc.Trace.Endpoint) if err != nil { panic(err) } app, cleanup, err := initApp(bc.Server, bc.Data, bc.Auth, bc.Service, &rc, logger) if err != nil { panic(err) } defer cleanup() // start and wait for stop signal if err := app.Run(); err != nil { panic(err) } } func setTracerProvider(url string) error { // Create the Jaeger exporter exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url))) if err != nil { return err } tp := tracesdk.NewTracerProvider( // Set the sampling rate based on the parent span to 100% tracesdk.WithSampler(tracesdk.ParentBased(tracesdk.TraceIDRatioBased(1.0))), // Always be sure to batch in production. tracesdk.WithBatcher(exp), // Record information about this application in an Resource. tracesdk.WithResource(resource.NewSchemaless( semconv.ServiceNameKey.String(Name), attribute.String("env", "dev"), )), ) otel.SetTracerProvider(tp) return nil } ================================================ FILE: admin/cmd/admin/wire.go ================================================ //go:build wireinject // +build wireinject // The build tag makes sure the stub is not built in the final build. package main import ( "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" "github.com/google/wire" "admin/internal/biz" "admin/internal/conf" "admin/internal/data" "admin/internal/server" "admin/internal/service" ) // initApp init admin application. func initApp(*conf.Server, *conf.Data, *conf.Auth, *conf.Service, *conf.Registry, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } ================================================ FILE: admin/cmd/admin/wire_gen.go ================================================ // Code generated by Wire. DO NOT EDIT. //go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject package main import ( "admin/internal/biz" "admin/internal/conf" "admin/internal/data" "admin/internal/server" "admin/internal/service" "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" ) // Injectors from wire.go: // initApp init admin application. func initApp(confServer *conf.Server, confData *conf.Data, auth *conf.Auth, confService *conf.Service, registry *conf.Registry, logger log.Logger) (*kratos.App, func(), error) { discovery := data.NewDiscovery(registry) userClient := data.NewUserServiceClient(auth, confService, discovery) dataData, err := data.NewData(confData, userClient, logger) if err != nil { return nil, nil, err } userRepo := data.NewUserRepo(dataData, logger) userUsecase := biz.NewUserUsecase(userRepo, logger, auth) addressRepo := data.NewAddressRepo(dataData, logger) addressUsecase := biz.NewAddressUsecase(userRepo, addressRepo, logger, auth) adminService := service.NewAdminService(userUsecase, addressUsecase, logger) httpServer := server.NewHTTPServer(confServer, auth, adminService, logger) registrar := data.NewRegistrar(registry) app := newApp(logger, httpServer, registrar) return app, func() { }, nil } ================================================ FILE: admin/configs/config.yaml ================================================ name: admin.api server: http: addr: 0.0.0.0:9099 timeout: 1s data: database: driver: mysql source: root:root@tcp(127.0.0.1:3306)/test redis: addr: 127.0.0.1:6379 read_timeout: 0.2s write_timeout: 0.2s trace: endpoint: http://127.0.0.1:14268/api/traces auth: jwt_key: hqFr%3ddt32DGlSTOI5cO6@TH#Admin service: user: endpoint: discovery:///shop.user.service goods: endpoint: discovery:///shop.goods.service ================================================ FILE: admin/configs/registry.yaml ================================================ consul: address: 127.0.0.1:8500 scheme: http ================================================ FILE: admin/generate.go ================================================ package generate //go:generate kratos proto client api ================================================ FILE: admin/go.mod ================================================ module admin go 1.16 require ( github.com/envoyproxy/protoc-gen-validate v0.6.3 github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220209030627-9662ef3c213d github.com/go-kratos/kratos/v2 v2.1.5 github.com/golang-jwt/jwt/v4 v4.0.0 github.com/google/wire v0.5.0 github.com/gorilla/handlers v1.5.1 github.com/hashicorp/consul/api v1.12.0 github.com/mojocn/base64Captcha v1.3.5 go.opentelemetry.io/otel v1.4.0 go.opentelemetry.io/otel/exporters/jaeger v1.4.0 go.opentelemetry.io/otel/sdk v1.4.0 google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb google.golang.org/grpc v1.43.0 google.golang.org/protobuf v1.27.1 gopkg.in/yaml.v2 v2.4.0 // indirect ) ================================================ FILE: admin/go.sum ================================================ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.3 h1:HkntewfZJ9RofA/FX38zBCeIAqlLDFLbAI6eTpZqFJw= github.com/envoyproxy/protoc-gen-validate v0.6.3/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kratos/aegis v0.1.1/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220209030627-9662ef3c213d h1:UHNb0QKaftYtQhvcD3o7xlZbMIQs5SPB9NPKZsoqUtU= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220209030627-9662ef3c213d/go.mod h1:gCxmEdB6yLypq2c14QMH6JgvbNxsF4eqxqHQTMogVKA= github.com/go-kratos/kratos/v2 v2.1.5 h1:q8kTXyY1KkNJS3tmhvGUJfysipM5AIuoJaXBEvDBnFI= github.com/go-kratos/kratos/v2 v2.1.5/go.mod h1:zMonCKAf8+He4b9NQ/QHr20tMznd4NO5XrNds36w/5k= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.9.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= 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/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 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-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0 h1:8+567mCcFDnS5ADl7lrpxPMWiFCElyUEeW0gtj34fMA= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6 h1:uuEX1kLR6aoda1TBttmJQKDLZE1Ob7KN0NPdE7EtCDc= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mojocn/base64Captcha v1.3.5 h1:Qeilr7Ta6eDtG4S+tQuZ5+hO+QHbiGAJdi4PfoagaA0= github.com/mojocn/base64Captcha v1.3.5/go.mod h1:/tTTXn4WTpX9CfrmipqRytCpJ27Uw3G6I7NcP2WwcmY= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 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 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel v1.4.0 h1:7ESuKPq6zpjRaY5nvVDGiuwK7VAJ8MwkKnmNJ9whNZ4= go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= go.opentelemetry.io/otel/exporters/jaeger v1.4.0 h1:EX/spHhVkHbobTeSozT1zpbuc3oO70CISkw+dspgR9M= go.opentelemetry.io/otel/exporters/jaeger v1.4.0/go.mod h1:C4UfuVfyi7qAk/PAz6QodaEkES7RnLNHeAAj6QOu2gI= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/sdk v1.4.0 h1:LJE4SW3jd4lQTESnlpQZcBhQ3oci0U2MLR5uhicfTHQ= go.opentelemetry.io/otel/sdk v1.4.0/go.mod h1:71GJPNJh4Qju6zJuYl1CrYtXbrgfau/M9UAggqiy1UE= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/otel/trace v1.4.0 h1:4OOUrPZdVFQkbzl/JSdvGCWIdw5ONXXxzHlaLlWppmo= go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/image v0.0.0-20190501045829-6d32002ffd75 h1:TbGuee8sSq15Iguxu4deQ7+Bqq/d2rsQejGcEtADAMQ= golang.org/x/image v0.0.0-20190501045829-6d32002ffd75/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 h1:uCLL3g5wH2xjxVREVuAbP9JM5PPKjRbXKRa6IBjkzmU= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb h1:ZrsicilzPCS/Xr8qtBZZLpy4P9TYXAfl49ctG1/5tgw= google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= ================================================ FILE: admin/internal/biz/README.md ================================================ # Biz ================================================ FILE: admin/internal/biz/address.go ================================================ package biz import ( "context" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/auth/jwt" jwt2 "github.com/golang-jwt/jwt/v4" v1 "admin/api/admin/v1" "admin/internal/conf" ) type Address struct { ID int64 UserID int64 IsDefault int32 Mobile string Name string Province string City string Districts string Address string PostCode string } type AddressRepo interface { CreateAddress(ctx context.Context, a *Address) (*Address, error) AddressListByUid(ctx context.Context, uid int64) ([]*Address, error) UpdateAddress(ctx context.Context, a *Address) error DefaultAddress(ctx context.Context, a *Address) error DeleteAddress(ctx context.Context, a *Address) error } type AddressUsecase struct { uRepo UserRepo aRepo AddressRepo log *log.Helper signingKey string } func NewAddressUsecase(repo UserRepo, arepo AddressRepo, logger log.Logger, conf *conf.Auth) *AddressUsecase { helper := log.NewHelper(log.With(logger, "module", "usecase/admin")) return &AddressUsecase{ uRepo: repo, aRepo: arepo, log: helper, signingKey: conf.JwtKey} } func (ua *AddressUsecase) CreateAddress(ctx context.Context, r *v1.CreateAddressReq) (*v1.AddressInfo, error) { // 在上下文 context 中取出 claims 对象 uId, err := getUid(ctx) if err != nil { return nil, err } req := Address{ UserID: uId, IsDefault: 0, Mobile: r.Mobile, Name: r.Name, Province: r.Province, City: r.City, Districts: r.Districts, Address: r.Address, PostCode: r.PostCode, } res, err := ua.aRepo.CreateAddress(ctx, &req) if err != nil { return nil, err } result := &v1.AddressInfo{ Id: res.ID, Name: res.Name, Mobile: res.Mobile, Province: res.Province, City: res.City, Districts: res.Districts, Address: res.Address, PostCode: res.PostCode, IsDefault: int32(res.IsDefault), } return result, nil } func (ua *AddressUsecase) AddressListByUid(ctx context.Context) (*v1.ListAddressReply, error) { // 在上下文 context 中取出 claims 对象 uId, err := getUid(ctx) if err != nil { return nil, err } addressList, err := ua.aRepo.AddressListByUid(ctx, uId) var res v1.ListAddressReply for _, v := range addressList { addressInfoTmp := &v1.AddressInfo{ Id: v.ID, Name: v.Name, Mobile: v.Mobile, Province: v.Province, City: v.City, Districts: v.Districts, Address: v.Address, PostCode: v.PostCode, IsDefault: v.IsDefault, } res.Results = append(res.Results, addressInfoTmp) } return &res, err } func (ua *AddressUsecase) UpdateAddress(ctx context.Context, a *Address) (bool, error) { uId, err := getUid(ctx) if err != nil { return false, err } a.UserID = uId if err := ua.aRepo.UpdateAddress(ctx, a); err != nil { return false, err } return true, nil } func getUid(ctx context.Context) (int64, error) { // 在上下文 context 中取出 claims 对象 var uId int64 if claims, ok := jwt.FromContext(ctx); ok { c := claims.(jwt2.MapClaims) v, ok := c["ID"] if !ok { return 0, ErrAuthFailed } uId = int64(v.(float64)) } return uId, nil } func (ua *AddressUsecase) DefaultAddress(ctx context.Context, a *Address) (bool, error) { uId, err := getUid(ctx) if err != nil { return false, err } a.UserID = uId if err := ua.aRepo.DefaultAddress(ctx, a); err != nil { return false, err } return true, nil } func (ua *AddressUsecase) DeleteAddress(ctx context.Context, a *Address) (bool, error) { uId, err := getUid(ctx) if err != nil { return false, err } a.UserID = uId if err := ua.aRepo.DeleteAddress(ctx, a); err != nil { return false, err } return true, nil } ================================================ FILE: admin/internal/biz/biz.go ================================================ package biz import "github.com/google/wire" // ProviderSet is biz providers. var ProviderSet = wire.NewSet(NewUserUsecase, NewAddressUsecase) ================================================ FILE: admin/internal/biz/user.go ================================================ package biz import ( v1 "admin/api/admin/v1" "admin/internal/conf" "admin/internal/pkg/captcha" "admin/internal/pkg/middleware/auth" "context" "errors" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/auth/jwt" jwt2 "github.com/golang-jwt/jwt/v4" "time" ) var ( ErrPasswordInvalid = errors.New("password invalid") ErrUsernameInvalid = errors.New("username invalid") ErrCaptchaInvalid = errors.New("verification code error") ErrMobileInvalid = errors.New("mobile invalid") ErrUserNotFound = errors.New("user not found") ErrLoginFailed = errors.New("login failed") ErrGenerateTokenFailed = errors.New("generate token failed") ErrAuthFailed = errors.New("authentication failed") ) type User struct { ID int64 Mobile string Password string NickName string Birthday int64 Gender string Role int CreatedAt time.Time } type UserRepo interface { CreateUser(c context.Context, u *User) (*User, error) UserByMobile(ctx context.Context, mobile string) (*User, error) UserById(ctx context.Context, Id int64) (*User, error) CheckPassword(ctx context.Context, password, encryptedPassword string) (bool, error) //ListUser(ctx context.Context, pageNum, pageSize int) ([]*User, int, error) //UpdateUser(context.Context, *User) (bool, error) } type UserUsecase struct { uRepo UserRepo log *log.Helper signingKey string } func NewUserUsecase(repo UserRepo, logger log.Logger, conf *conf.Auth) *UserUsecase { helper := log.NewHelper(log.With(logger, "module", "usecase/admin")) return &UserUsecase{uRepo: repo, log: helper, signingKey: conf.JwtKey} } // GetCaptcha 验证码 func (uc *UserUsecase) GetCaptcha(ctx context.Context) (*v1.CaptchaReply, error) { captchaInfo, err := captcha.GetCaptcha(ctx) if err != nil { return nil, err } return &v1.CaptchaReply{ CaptchaId: captchaInfo.CaptchaId, PicPath: captchaInfo.PicPath, }, nil } func (uc *UserUsecase) UserDetailByID(ctx context.Context) (*v1.UserDetailResponse, error) { // 在上下文 context 中取出 claims 对象 var uId int64 if claims, ok := jwt.FromContext(ctx); ok { c := claims.(jwt2.MapClaims) i, ok := c["ID"].(float64) if !ok { return nil, ErrAuthFailed } uId = int64(i) } user, err := uc.uRepo.UserById(ctx, uId) if err != nil { return nil, err } return &v1.UserDetailResponse{ Id: user.ID, NickName: user.NickName, Mobile: user.Mobile, }, nil } func (uc *UserUsecase) PassWordLogin(ctx context.Context, req *v1.LoginReq) (*v1.RegisterReply, error) { // 表单验证 if len(req.Username) <= 0 { return nil, ErrMobileInvalid } if len(req.Password) <= 0 { return nil, ErrUsernameInvalid } // 验证验证码是否正确 //if !captcha.Store.Verify(req.CaptchaId, req.Captcha, true) { // return nil, ErrCaptchaInvalid //} mobile := "13501167215" if user, err := uc.uRepo.UserByMobile(ctx, mobile); err != nil { return nil, ErrUserNotFound } else { // 用户存在检查密码 if passRsp, pasErr := uc.uRepo.CheckPassword(ctx, req.Password, user.Password); pasErr != nil { return nil, ErrPasswordInvalid } else { if passRsp { claims := auth.CustomClaims{ ID: user.ID, NickName: user.NickName, AuthorityId: user.Role, StandardClaims: jwt2.StandardClaims{ NotBefore: time.Now().Unix(), // 签名的生效时间 ExpiresAt: time.Now().Unix() + 60*60*24*30, // 30天过期 Issuer: "Gyl", }, } token, err := auth.CreateToken(claims, uc.signingKey) if err != nil { return nil, ErrGenerateTokenFailed } return &v1.RegisterReply{ Id: user.ID, Mobile: user.Mobile, Username: user.NickName, Token: token, ExpiredAt: time.Now().Unix() + 60*60*24*30, }, nil } else { return nil, ErrLoginFailed } } } } func (uc *UserUsecase) CreateUser(ctx context.Context, req *v1.RegisterReq) (*v1.RegisterReply, error) { newUser, err := NewUser(req.Mobile, req.Username, req.Password) if err != nil { return nil, err } createUser, err := uc.uRepo.CreateUser(ctx, &newUser) if err != nil { return nil, err } claims := auth.CustomClaims{ ID: createUser.ID, NickName: createUser.NickName, AuthorityId: createUser.Role, StandardClaims: jwt2.StandardClaims{ NotBefore: time.Now().Unix(), // 签名的生效时间 ExpiresAt: time.Now().Unix() + 60*60*24*30, // 30天过期 Issuer: "Gyl", }, } token, err := auth.CreateToken(claims, uc.signingKey) if err != nil { return nil, err } return &v1.RegisterReply{ Id: createUser.ID, Mobile: createUser.Mobile, Username: createUser.NickName, Token: token, ExpiredAt: time.Now().Unix() + 60*60*24*30, }, nil } func NewUser(mobile, username, password string) (User, error) { // check mobile if len(mobile) <= 0 { return User{}, ErrMobileInvalid } // check username if len(username) <= 0 { return User{}, ErrUsernameInvalid } // check password if len(password) <= 0 { return User{}, ErrPasswordInvalid } return User{ Mobile: mobile, NickName: username, Password: password, }, nil } ================================================ FILE: admin/internal/conf/conf.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 // protoc v3.17.3 // source: internal/conf/conf.proto package conf import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Bootstrap struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=s,proto3" json:"s,omitempty"` Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Trace *Trace `protobuf:"bytes,3,opt,name=trace,proto3" json:"trace,omitempty"` Auth *Auth `protobuf:"bytes,4,opt,name=auth,proto3" json:"auth,omitempty"` Service *Service `protobuf:"bytes,5,opt,name=service,proto3" json:"service,omitempty"` } func (x *Bootstrap) Reset() { *x = Bootstrap{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Bootstrap) String() string { return protoimpl.X.MessageStringOf(x) } func (*Bootstrap) ProtoMessage() {} func (x *Bootstrap) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Bootstrap.ProtoReflect.Descriptor instead. func (*Bootstrap) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{0} } func (x *Bootstrap) GetServer() *Server { if x != nil { return x.Server } return nil } func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data } return nil } func (x *Bootstrap) GetTrace() *Trace { if x != nil { return x.Trace } return nil } func (x *Bootstrap) GetAuth() *Auth { if x != nil { return x.Auth } return nil } func (x *Bootstrap) GetService() *Service { if x != nil { return x.Service } return nil } type Server struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Http *Server_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` } func (x *Server) Reset() { *x = Server{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server) ProtoMessage() {} func (x *Server) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Server.ProtoReflect.Descriptor instead. func (*Server) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1} } func (x *Server) GetHttp() *Server_HTTP { if x != nil { return x.Http } return nil } type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` } func (x *Data) Reset() { *x = Data{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data) ProtoMessage() {} func (x *Data) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Data.ProtoReflect.Descriptor instead. func (*Data) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2} } func (x *Data) GetDatabase() *Data_Database { if x != nil { return x.Database } return nil } func (x *Data) GetRedis() *Data_Redis { if x != nil { return x.Redis } return nil } type Service struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields User *Service_User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Goods *Service_Goods `protobuf:"bytes,2,opt,name=goods,proto3" json:"goods,omitempty"` } func (x *Service) Reset() { *x = Service{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Service) String() string { return protoimpl.X.MessageStringOf(x) } func (*Service) ProtoMessage() {} func (x *Service) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Service.ProtoReflect.Descriptor instead. func (*Service) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{3} } func (x *Service) GetUser() *Service_User { if x != nil { return x.User } return nil } func (x *Service) GetGoods() *Service_Goods { if x != nil { return x.Goods } return nil } type Trace struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Trace) Reset() { *x = Trace{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Trace) String() string { return protoimpl.X.MessageStringOf(x) } func (*Trace) ProtoMessage() {} func (x *Trace) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Trace.ProtoReflect.Descriptor instead. func (*Trace) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{4} } func (x *Trace) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Registry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` } func (x *Registry) Reset() { *x = Registry{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry) ProtoMessage() {} func (x *Registry) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Registry.ProtoReflect.Descriptor instead. func (*Registry) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{5} } func (x *Registry) GetConsul() *Registry_Consul { if x != nil { return x.Consul } return nil } type Auth struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields JwtKey string `protobuf:"bytes,1,opt,name=jwt_key,json=jwtKey,proto3" json:"jwt_key,omitempty"` } func (x *Auth) Reset() { *x = Auth{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Auth) String() string { return protoimpl.X.MessageStringOf(x) } func (*Auth) ProtoMessage() {} func (x *Auth) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[6] 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 Auth.ProtoReflect.Descriptor instead. func (*Auth) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{6} } func (x *Auth) GetJwtKey() string { if x != nil { return x.JwtKey } return "" } type Server_HTTP struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_HTTP) Reset() { *x = Server_HTTP{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_HTTP) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_HTTP) ProtoMessage() {} func (x *Server_HTTP) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[7] 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 Server_HTTP.ProtoReflect.Descriptor instead. func (*Server_HTTP) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1, 0} } func (x *Server_HTTP) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_HTTP) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_HTTP) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Data_Database struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` } func (x *Data_Database) Reset() { *x = Data_Database{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Database) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Database) ProtoMessage() {} func (x *Data_Database) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[8] 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 Data_Database.ProtoReflect.Descriptor instead. func (*Data_Database) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} } func (x *Data_Database) GetDriver() string { if x != nil { return x.Driver } return "" } func (x *Data_Database) GetSource() string { if x != nil { return x.Source } return "" } type Data_Redis struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` ReadTimeout *durationpb.Duration `protobuf:"bytes,3,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"` WriteTimeout *durationpb.Duration `protobuf:"bytes,4,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"` } func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Redis) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[9] 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 Data_Redis.ProtoReflect.Descriptor instead. func (*Data_Redis) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2, 1} } func (x *Data_Redis) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Data_Redis) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Data_Redis) GetReadTimeout() *durationpb.Duration { if x != nil { return x.ReadTimeout } return nil } func (x *Data_Redis) GetWriteTimeout() *durationpb.Duration { if x != nil { return x.WriteTimeout } return nil } type Service_User struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Service_User) Reset() { *x = Service_User{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Service_User) String() string { return protoimpl.X.MessageStringOf(x) } func (*Service_User) ProtoMessage() {} func (x *Service_User) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[10] 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 Service_User.ProtoReflect.Descriptor instead. func (*Service_User) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} } func (x *Service_User) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Service_Goods struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Service_Goods) Reset() { *x = Service_Goods{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Service_Goods) String() string { return protoimpl.X.MessageStringOf(x) } func (*Service_Goods) ProtoMessage() {} func (x *Service_Goods) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[11] 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 Service_Goods.ProtoReflect.Descriptor instead. func (*Service_Goods) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{3, 1} } func (x *Service_Goods) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Registry_Consul struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` } func (x *Registry_Consul) Reset() { *x = Registry_Consul{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry_Consul) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry_Consul) ProtoMessage() {} func (x *Registry_Consul) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[12] 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 Registry_Consul.ProtoReflect.Descriptor instead. func (*Registry_Consul) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{5, 0} } func (x *Registry_Consul) GetAddress() string { if x != nil { return x.Address } return "" } func (x *Registry_Consul) GetScheme() string { if x != nil { return x.Scheme } return "" } var File_internal_conf_conf_proto protoreflect.FileDescriptor var file_internal_conf_conf_proto_rawDesc = []byte{ 0x0a, 0x18, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x2c, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x1a, 0x69, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xdb, 0x02, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x34, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x1a, 0x3a, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0xb3, 0x01, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xaf, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x1a, 0x22, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x1a, 0x23, 0x0a, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x23, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x7a, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x32, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x1f, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x77, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6a, 0x77, 0x74, 0x4b, 0x65, 0x79, 0x42, 0x1a, 0x5a, 0x18, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_internal_conf_conf_proto_rawDescOnce sync.Once file_internal_conf_conf_proto_rawDescData = file_internal_conf_conf_proto_rawDesc ) func file_internal_conf_conf_proto_rawDescGZIP() []byte { file_internal_conf_conf_proto_rawDescOnce.Do(func() { file_internal_conf_conf_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_conf_conf_proto_rawDescData) }) return file_internal_conf_conf_proto_rawDescData } var file_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_internal_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: admin.api.Bootstrap (*Server)(nil), // 1: admin.api.Server (*Data)(nil), // 2: admin.api.Data (*Service)(nil), // 3: admin.api.Service (*Trace)(nil), // 4: admin.api.Trace (*Registry)(nil), // 5: admin.api.Registry (*Auth)(nil), // 6: admin.api.Auth (*Server_HTTP)(nil), // 7: admin.api.Server.HTTP (*Data_Database)(nil), // 8: admin.api.Data.Database (*Data_Redis)(nil), // 9: admin.api.Data.Redis (*Service_User)(nil), // 10: admin.api.Service.User (*Service_Goods)(nil), // 11: admin.api.Service.Goods (*Registry_Consul)(nil), // 12: admin.api.Registry.Consul (*durationpb.Duration)(nil), // 13: google.protobuf.Duration } var file_internal_conf_conf_proto_depIdxs = []int32{ 1, // 0: admin.api.Bootstrap.s:type_name -> admin.api.Server 2, // 1: admin.api.Bootstrap.data:type_name -> admin.api.Data 4, // 2: admin.api.Bootstrap.trace:type_name -> admin.api.Trace 6, // 3: admin.api.Bootstrap.auth:type_name -> admin.api.Auth 3, // 4: admin.api.Bootstrap.service:type_name -> admin.api.Service 7, // 5: admin.api.Server.http:type_name -> admin.api.Server.HTTP 8, // 6: admin.api.Data.database:type_name -> admin.api.Data.Database 9, // 7: admin.api.Data.redis:type_name -> admin.api.Data.Redis 10, // 8: admin.api.Service.user:type_name -> admin.api.Service.User 11, // 9: admin.api.Service.goods:type_name -> admin.api.Service.Goods 12, // 10: admin.api.Registry.consul:type_name -> admin.api.Registry.Consul 13, // 11: admin.api.Server.HTTP.timeout:type_name -> google.protobuf.Duration 13, // 12: admin.api.Data.Redis.read_timeout:type_name -> google.protobuf.Duration 13, // 13: admin.api.Data.Redis.write_timeout:type_name -> google.protobuf.Duration 14, // [14:14] is the sub-list for method output_type 14, // [14:14] is the sub-list for method input_type 14, // [14:14] is the sub-list for extension type_name 14, // [14:14] is the sub-list for extension extendee 0, // [0:14] is the sub-list for field type_name } func init() { file_internal_conf_conf_proto_init() } func file_internal_conf_conf_proto_init() { if File_internal_conf_conf_proto != nil { return } if !protoimpl.UnsafeEnabled { file_internal_conf_conf_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Bootstrap); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Trace); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Auth); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_HTTP); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Database); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service_User); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service_Goods); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry_Consul); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_internal_conf_conf_proto_rawDesc, NumEnums: 0, NumMessages: 13, NumExtensions: 0, NumServices: 0, }, GoTypes: file_internal_conf_conf_proto_goTypes, DependencyIndexes: file_internal_conf_conf_proto_depIdxs, MessageInfos: file_internal_conf_conf_proto_msgTypes, }.Build() File_internal_conf_conf_proto = out.File file_internal_conf_conf_proto_rawDesc = nil file_internal_conf_conf_proto_goTypes = nil file_internal_conf_conf_proto_depIdxs = nil } ================================================ FILE: admin/internal/conf/conf.proto ================================================ syntax = "proto3"; package admin.api; option go_package = "admin/internal/conf;conf"; import "google/protobuf/duration.proto"; message Bootstrap { Server server = 1; Data data = 2; Trace trace = 3; Auth auth = 4; Service service = 5; } message Server { message HTTP { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } HTTP http = 1; } message Data { message Database { string driver = 1; string source = 2; } message Redis { string network = 1; string addr = 2; google.protobuf.Duration read_timeout = 3; google.protobuf.Duration write_timeout = 4; } Database database = 1; Redis redis = 2; } message Service { message User { string endpoint = 1; } message Goods { string endpoint = 1; } User user = 1; Goods goods = 2; } message Trace { string endpoint = 1; } message Registry { message Consul { string address = 1; string scheme = 2; } Consul consul = 1; } message Auth { string jwt_key = 1; } ================================================ FILE: admin/internal/data/README.md ================================================ # Data ================================================ FILE: admin/internal/data/address.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/v2/log" addressService "admin/api/service/user/v1" "admin/internal/biz" ) type addressRepo struct { data *Data log *log.Helper } func NewAddressRepo(data *Data, logger log.Logger) biz.AddressRepo { return &addressRepo{ data: data, log: log.NewHelper(log.With(logger, "module", "repo/address")), } } func (a *addressRepo) CreateAddress(c context.Context, address *biz.Address) (*biz.Address, error) { createAddress, err := a.data.uc.CreateAddress(c, &addressService.CreateAddressReq{ Uid: address.UserID, Name: address.Name, Mobile: address.Mobile, Province: address.Province, City: address.City, Districts: address.Districts, Address: address.Address, PostCode: address.PostCode, IsDefault: int32(address.IsDefault), }) if err != nil { return nil, err } res := &biz.Address{ ID: createAddress.Id, IsDefault: createAddress.IsDefault, Mobile: createAddress.Mobile, Name: createAddress.Name, Province: createAddress.Province, City: createAddress.City, Districts: createAddress.Districts, Address: createAddress.Address, PostCode: createAddress.PostCode, } return res, nil } func (a *addressRepo) DeleteAddress(ctx context.Context, address *biz.Address) error { _, err := a.data.uc.DeleteAddress(ctx, &addressService.AddressReq{ Id: address.ID, Uid: address.UserID, }) if err != nil { return err } return nil } func (a *addressRepo) DefaultAddress(ctx context.Context, address *biz.Address) error { _, err := a.data.uc.DefaultAddress(ctx, &addressService.AddressReq{ Id: address.ID, Uid: address.UserID, }) if err != nil { return err } return nil } func (a *addressRepo) UpdateAddress(c context.Context, address *biz.Address) error { _, err := a.data.uc.UpdateAddress(c, &addressService.UpdateAddressReq{ Id: address.ID, Uid: address.UserID, Name: address.Name, Mobile: address.Mobile, Province: address.Province, City: address.City, Districts: address.Districts, Address: address.Address, PostCode: address.PostCode, IsDefault: int32(address.IsDefault), }) if err != nil { return err } return nil } func (a *addressRepo) AddressListByUid(ctx context.Context, uid int64) ([]*biz.Address, error) { addressList, err := a.data.uc.ListAddress(ctx, &addressService.ListAddressReq{ Uid: uid, }) if err != nil { return nil, err } var res []*biz.Address for _, v := range addressList.Results { addressTmp := &biz.Address{ ID: v.Id, UserID: uid, IsDefault: v.IsDefault, Mobile: v.Mobile, Name: v.Name, Province: v.Province, City: v.City, Districts: v.Districts, Address: v.Address, PostCode: v.PostCode, } res = append(res, addressTmp) } return res, nil } ================================================ FILE: admin/internal/data/data.go ================================================ package data import ( userV1 "admin/api/service/user/v1" "admin/internal/conf" "context" consul "github.com/go-kratos/kratos/contrib/registry/consul/v2" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/google/wire" consulAPI "github.com/hashicorp/consul/api" grpcx "google.golang.org/grpc" "time" ) // ProviderSet is data providers. var ProviderSet = wire.NewSet(NewData, NewUserRepo, NewAddressRepo, NewUserServiceClient, NewRegistrar, NewDiscovery) // Data . type Data struct { log *log.Helper uc userV1.UserClient } // NewData . func NewData(c *conf.Data, uc userV1.UserClient, logger log.Logger) (*Data, error) { l := log.NewHelper(log.With(logger, "module", "data")) return &Data{log: l, uc: uc}, nil } // NewUserServiceClient 链接用户服务 grpc func NewUserServiceClient(ac *conf.Auth, sr *conf.Service, rr registry.Discovery) userV1.UserClient { conn, err := grpc.DialInsecure( context.Background(), grpc.WithEndpoint(sr.User.Endpoint), grpc.WithDiscovery(rr), grpc.WithMiddleware( tracing.Client(), recovery.Recovery(), ), grpc.WithTimeout(2*time.Second), grpc.WithOptions(grpcx.WithStatsHandler(&tracing.ClientHandler{})), ) if err != nil { panic(err) } c := userV1.NewUserClient(conn) return c } // NewRegistrar add consul func NewRegistrar(conf *conf.Registry) registry.Registrar { c := consulAPI.DefaultConfig() c.Address = conf.Consul.Address c.Scheme = conf.Consul.Scheme cli, err := consulAPI.NewClient(c) if err != nil { panic(err) } r := consul.New(cli, consul.WithHealthCheck(false)) return r } func NewDiscovery(conf *conf.Registry) registry.Discovery { c := consulAPI.DefaultConfig() c.Address = conf.Consul.Address c.Scheme = conf.Consul.Scheme cli, err := consulAPI.NewClient(c) if err != nil { panic(err) } r := consul.New(cli, consul.WithHealthCheck(false)) return r } ================================================ FILE: admin/internal/data/user.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/v2/log" userService "admin/api/service/user/v1" "admin/internal/biz" ) type userRepo struct { data *Data log *log.Helper } // NewUserRepo . func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo { return &userRepo{ data: data, log: log.NewHelper(log.With(logger, "module", "repo/user")), } } func (u *userRepo) CreateUser(c context.Context, user *biz.User) (*biz.User, error) { createUser, err := u.data.uc.CreateUser(c, &userService.CreateUserInfo{ NickName: user.NickName, Password: user.Password, Mobile: user.Mobile, }) if err != nil { return nil, err } return &biz.User{ ID: createUser.Id, Mobile: createUser.Mobile, NickName: createUser.NickName, }, nil } func (u *userRepo) UserByMobile(c context.Context, mobile string) (*biz.User, error) { byMobile, err := u.data.uc.GetUserByMobile(c, &userService.MobileRequest{Mobile: mobile}) if err != nil { return nil, err } return &biz.User{ Mobile: byMobile.Mobile, ID: byMobile.Id, Password: byMobile.Password, NickName: byMobile.NickName, }, nil } func (u *userRepo) CheckPassword(c context.Context, password, encryptedPassword string) (bool, error) { if byMobile, err := u.data.uc.CheckPassword(c, &userService.PasswordCheckInfo{Password: password, EncryptedPassword: encryptedPassword}); err != nil { return false, err } else { return byMobile.Success, nil } } func (u *userRepo) UserById(c context.Context, id int64) (*biz.User, error) { user, err := u.data.uc.GetUserById(c, &userService.IdRequest{Id: id}) if err != nil { return nil, err } return &biz.User{ ID: user.Id, Mobile: user.Mobile, NickName: user.NickName, Gender: user.Gender, Role: int(user.Role), Birthday: int64(user.Birthday), }, nil } ================================================ FILE: admin/internal/pkg/captcha/captcha.go ================================================ package captcha import ( "context" "github.com/mojocn/base64Captcha" ) var Store = base64Captcha.DefaultMemStore type CaptchaInfo struct { CaptchaId string PicPath string } // GetCaptcha 生成验证码 func GetCaptcha(ctx context.Context) (*CaptchaInfo, error) { driver := base64Captcha.NewDriverDigit(80, 250, 5, 0.7, 80) cp := base64Captcha.NewCaptcha(driver, Store) id, b64s, err := cp.Generate() if err != nil { return nil, err } return &CaptchaInfo{ CaptchaId: id, PicPath: b64s, }, nil } ================================================ FILE: admin/internal/pkg/middleware/auth/auth.go ================================================ package auth import ( "errors" "github.com/golang-jwt/jwt/v4" ) type CustomClaims struct { ID int64 NickName string AuthorityId int jwt.StandardClaims } // CreateToken generate token func CreateToken(c CustomClaims, key string) (string, error) { claims := jwt.NewWithClaims(jwt.SigningMethodHS256, c) signedString, err := claims.SignedString([]byte(key)) if err != nil { return "", errors.New("generate token failed" + err.Error()) } return signedString, nil } ================================================ FILE: admin/internal/server/http.go ================================================ package server import ( v1 "admin/api/admin/v1" "admin/internal/conf" "admin/internal/service" "context" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/auth/jwt" "github.com/go-kratos/kratos/v2/middleware/logging" "github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/selector" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/middleware/validate" "github.com/go-kratos/kratos/v2/transport/http" jwt2 "github.com/golang-jwt/jwt/v4" "github.com/gorilla/handlers" ) // NewHTTPServer new an HTTP s. func NewHTTPServer(c *conf.Server, ac *conf.Auth, s *service.AdminService, logger log.Logger) *http.Server { var opts = []http.ServerOption{ http.Middleware( recovery.Recovery(), validate.Validator(), tracing.Server(), selector.Server( jwt.Server(func(token *jwt2.Token) (interface{}, error) { return []byte(ac.JwtKey), nil }, jwt.WithSigningMethod(jwt2.SigningMethodHS256)), ).Match(NewWhiteListMatcher()).Build(), logging.Server(logger), ), http.Filter(handlers.CORS( handlers.AllowedHeaders([]string{"X-Requested-With", "Content-Type", "Authorization"}), handlers.AllowedMethods([]string{"GET", "POST", "PUT", "HEAD", "OPTIONS"}), handlers.AllowedOrigins([]string{"*"}), )), } if c.Http.Network != "" { opts = append(opts, http.Network(c.Http.Network)) } if c.Http.Addr != "" { opts = append(opts, http.Address(c.Http.Addr)) } if c.Http.Timeout != nil { opts = append(opts, http.Timeout(c.Http.Timeout.AsDuration())) } srv := http.NewServer(opts...) v1.RegisterAdminHTTPServer(srv, s) return srv } // NewWhiteListMatcher 白名单不需要token验证的接口 func NewWhiteListMatcher() selector.MatchFunc { whiteList := make(map[string]struct{}) whiteList["/admin.admin.v1.admin/Captcha"] = struct{}{} whiteList["/admin.admin.v1.admin/Login"] = struct{}{} whiteList["/admin.admin.v1.admin/Register"] = struct{}{} return func(ctx context.Context, operation string) bool { if _, ok := whiteList[operation]; ok { return false } return true } } ================================================ FILE: admin/internal/server/server.go ================================================ package server import ( "github.com/google/wire" ) // ProviderSet is s providers. var ProviderSet = wire.NewSet(NewHTTPServer) ================================================ FILE: admin/internal/service/README.md ================================================ # Service ================================================ FILE: admin/internal/service/service.go ================================================ package service import ( v1 "admin/api/admin/v1" "admin/internal/biz" "github.com/go-kratos/kratos/v2/log" "github.com/google/wire" ) // ProviderSet is service providers. var ProviderSet = wire.NewSet(NewAdminService) // AdminService is a admin service. type AdminService struct { v1.UnimplementedAdminServer uc *biz.UserUsecase ua *biz.AddressUsecase log *log.Helper } // NewAdminService new a admin service. func NewAdminService(uc *biz.UserUsecase, ua *biz.AddressUsecase, logger log.Logger) *AdminService { return &AdminService{ uc: uc, ua: ua, log: log.NewHelper(log.With(logger, "module", "service/admin")), } } ================================================ FILE: admin/internal/service/user.go ================================================ package service import ( "admin/internal/biz" "context" "go.opentelemetry.io/otel" "google.golang.org/protobuf/types/known/emptypb" v1 "admin/api/admin/v1" ) func (s *AdminService) Register(ctx context.Context, req *v1.RegisterReq) (*v1.RegisterReply, error) { // add trace tr := otel.Tracer("service") ctx, span := tr.Start(ctx, "get user info by mobile") span.SpanContext() defer span.End() return s.uc.CreateUser(ctx, req) } func (s *AdminService) Login(ctx context.Context, req *v1.LoginReq) (*v1.RegisterReply, error) { return s.uc.PassWordLogin(ctx, req) } func (s *AdminService) Captcha(ctx context.Context, r *emptypb.Empty) (*v1.CaptchaReply, error) { return s.uc.GetCaptcha(ctx) } func (s *AdminService) Detail(ctx context.Context, r *emptypb.Empty) (*v1.UserDetailResponse, error) { return s.uc.UserDetailByID(ctx) } func (s *AdminService) CreateAddress(ctx context.Context, r *v1.CreateAddressReq) (*v1.AddressInfo, error) { return s.ua.CreateAddress(ctx, r) } func (s *AdminService) AddressListByUid(ctx context.Context, empty *emptypb.Empty) (*v1.ListAddressReply, error) { return s.ua.AddressListByUid(ctx) } func (s *AdminService) UpdateAddress(ctx context.Context, r *v1.UpdateAddressReq) (*v1.CheckResponse, error) { req := toBizAddress(r) address, err := s.ua.UpdateAddress(ctx, req) if err != nil { return nil, err } return &v1.CheckResponse{Success: address}, nil } func toBizAddress(r *v1.UpdateAddressReq) *biz.Address { return &biz.Address{ ID: r.Id, IsDefault: r.IsDefault, Mobile: r.Mobile, Name: r.Name, Province: r.Province, City: r.City, Districts: r.Districts, Address: r.Address, PostCode: r.PostCode, } } func (s *AdminService) DefaultAddress(ctx context.Context, r *v1.AddressReq) (*v1.CheckResponse, error) { address, err := s.ua.DefaultAddress(ctx, &biz.Address{ ID: r.Id, }) if err != nil { return nil, err } return &v1.CheckResponse{Success: address}, nil } func (s *AdminService) DeleteAddress(ctx context.Context, r *v1.AddressReq) (*v1.CheckResponse, error) { address, err := s.ua.DeleteAddress(ctx, &biz.Address{ ID: r.Id, }) if err != nil { return nil, err } return &v1.CheckResponse{Success: address}, nil } ================================================ FILE: admin/openapi.yaml ================================================ # Generated with protoc-gen-openapi # https://github.com/google/gnostic/tree/master/apps/protoc-gen-openapi openapi: 3.0.3 info: title: Admin API description: The admin service definition. version: 0.0.1 paths: /api/address/create: post: tags: - Admin operationId: Admin_CreateAddress requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateAddressReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/AddressInfo' /api/address/default: put: tags: - Admin operationId: Admin_DefaultAddress requestBody: content: application/json: schema: $ref: '#/components/schemas/AddressReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/CheckResponse' /api/address/delete: delete: tags: - Admin operationId: Admin_DeleteAddress parameters: - name: id in: query schema: type: integer format: int64 - name: uid in: query schema: type: integer format: int64 responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/CheckResponse' /api/address/list/uid: get: tags: - Admin operationId: Admin_AddressListByUid responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ListAddressReply' /api/address/update: put: tags: - Admin operationId: Admin_UpdateAddress requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateAddressReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/CheckResponse' /api/users/captcha: get: tags: - Admin operationId: Admin_Captcha responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/CaptchaReply' /api/users/detail: get: tags: - Admin operationId: Admin_Detail responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/UserDetailResponse' /api/users/login: post: tags: - Admin operationId: Admin_Login requestBody: content: application/json: schema: $ref: '#/components/schemas/LoginReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/RegisterReply' /api/users/register: post: tags: - Admin operationId: Admin_Register requestBody: content: application/json: schema: $ref: '#/components/schemas/RegisterReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/RegisterReply' components: schemas: AddressInfo: type: object properties: id: type: integer format: int64 name: type: string mobile: type: string Province: type: string City: type: string Districts: type: string address: type: string postCode: type: string isDefault: type: integer format: int32 AddressReq: type: object properties: id: type: integer format: int64 uid: type: integer format: int64 CaptchaReply: type: object properties: captchaId: type: string picPath: type: string CheckResponse: type: object properties: success: type: boolean CreateAddressReq: type: object properties: uid: type: integer format: int64 name: type: string mobile: type: string Province: type: string City: type: string Districts: type: string address: type: string postCode: type: string isDefault: type: integer format: int32 ListAddressReply: type: object properties: results: type: array items: $ref: '#/components/schemas/AddressInfo' LoginReq: type: object properties: username: type: string password: type: string RegisterReply: type: object properties: id: type: integer format: int64 mobile: type: string username: type: string token: type: string expiredAt: type: integer format: int64 description: Data returned by registration and login RegisterReq: type: object properties: mobile: type: string username: type: string password: type: string UpdateAddressReq: type: object properties: uid: type: integer format: int64 name: type: string mobile: type: string Province: type: string City: type: string Districts: type: string address: type: string postCode: type: string isDefault: type: integer format: int32 id: type: integer format: int64 UserDetailResponse: type: object properties: id: type: integer format: int64 mobile: type: string nickName: type: string birthday: type: integer format: int64 gender: type: string role: type: integer format: int32 description: user Detail returned tags: - name: Admin ================================================ FILE: admin/third_party/README.md ================================================ # third_party ================================================ FILE: admin/third_party/errors/errors.proto ================================================ syntax = "proto3"; package errors; option go_package = "github.com/go-kratos/kratos/v2/errors;errors"; option java_multiple_files = true; option java_package = "com.github.kratos.errors"; option objc_class_prefix = "KratosErrors"; import "google/protobuf/descriptor.proto"; extend google.protobuf.EnumOptions { int32 default_code = 1108; } extend google.protobuf.EnumValueOptions { int32 code = 1109; } ================================================ FILE: admin/third_party/google/api/annotations.proto ================================================ // Copyright (c) 2015, Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/api/http.proto"; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "AnnotationsProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.MethodOptions { // See `HttpRule`. HttpRule http = 72295728; } ================================================ FILE: admin/third_party/google/api/client.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "ClientProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.ServiceOptions { // The hostname for this service. // This should be specified with no prefix or protocol. // // Example: // // service Foo { // option (google.api.default_host) = "foo.googleapi.com"; // ... // } string default_host = 1049; // OAuth scopes needed for the client. // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform"; // ... // } // // If there is more than one scope, use a comma-separated string: // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform," // "https://www.googleapis.com/auth/monitoring"; // ... // } string oauth_scopes = 1050; } extend google.protobuf.MethodOptions { // A definition of a client library method signature. // // In client libraries, each proto RPC corresponds to one or more methods // which the end user is able to call, and calls the underlying RPC. // Normally, this method receives a single argument (a struct or instance // corresponding to the RPC request object). Defining this field will // add one or more overloads providing flattened or simpler method signatures // in some languages. // // The fields on the method signature are provided as a comma-separated // string. // // For example, the proto RPC and annotation: // // rpc CreateSubscription(CreateSubscriptionRequest) // returns (Subscription) { // option (google.api.method_signature) = "name,topic"; // } // // Would add the following Java overload (in addition to the method accepting // the request object): // // public final Subscription createSubscription(String name, String topic) // // The following backwards-compatibility guidelines apply: // // * Adding this annotation to an unannotated method is backwards // compatible. // * Adding this annotation to a method which already has existing // method signature annotations is backwards compatible if and only if // the new method signature annotation is last in the sequence. // * Modifying or removing an existing method signature annotation is // a breaking change. // * Re-ordering existing method signature annotations is a breaking // change. repeated string method_signature = 1051; } ================================================ FILE: admin/third_party/google/api/field_behavior.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "FieldBehaviorProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // An indicator of the behavior of a given field (for example, that a field // is required in requests, or given as output but ignored as input). // This **does not** change the behavior in protocol buffers itself; it only // denotes the behavior and may affect how API tooling handles the field. // // Note: This enum **may** receive new values in the future. enum FieldBehavior { // Conventional default for enums. Do not use this. FIELD_BEHAVIOR_UNSPECIFIED = 0; // Specifically denotes a field as optional. // While all fields in protocol buffers are optional, this may be specified // for emphasis if appropriate. OPTIONAL = 1; // Denotes a field as required. // This indicates that the field **must** be provided as part of the request, // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). REQUIRED = 2; // Denotes a field as output only. // This indicates that the field is provided in responses, but including the // field in a request does nothing (the server *must* ignore it and // *must not* throw an error as a result of the field's presence). OUTPUT_ONLY = 3; // Denotes a field as input only. // This indicates that the field is provided in requests, and the // corresponding field is not included in output. INPUT_ONLY = 4; // Denotes a field as immutable. // This indicates that the field may be set once in a request to create a // resource, but may not be changed thereafter. IMMUTABLE = 5; } extend google.protobuf.FieldOptions { // A designation of a specific field behavior (required, output only, etc.) // in protobuf messages. // // Examples: // // string name = 1 [(google.api.field_behavior) = REQUIRED]; // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // google.protobuf.Duration ttl = 1 // [(google.api.field_behavior) = INPUT_ONLY]; // google.protobuf.Timestamp expire_time = 1 // [(google.api.field_behavior) = OUTPUT_ONLY, // (google.api.field_behavior) = IMMUTABLE]; repeated FieldBehavior field_behavior = 1052; } ================================================ FILE: admin/third_party/google/api/http.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "HttpProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Defines the HTTP configuration for an API service. It contains a list of // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method // to one or more HTTP REST API methods. message Http { // A list of HTTP configuration rules that apply to individual API methods. // // **NOTE:** All service configuration rules follow "last one wins" order. repeated HttpRule rules = 1; // When set to true, URL path parameters will be fully URI-decoded except in // cases of single segment matches in reserved expansion, where "%2F" will be // left encoded. // // The default behavior is to not decode RFC 6570 reserved characters in multi // segment matches. bool fully_decode_reserved_expansion = 2; } // # gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service // that supports both gRPC APIs and REST APIs. Many systems, including [Google // APIs](https://github.com/googleapis/googleapis), // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC // Gateway](https://github.com/grpc-ecosystem/grpc-gateway), // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature // and use it for large scale production services. // // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies // how different portions of the gRPC request message are mapped to the URL // path, URL query parameters, and HTTP request body. It also controls how the // gRPC response message is mapped to the HTTP response body. `HttpRule` is // typically specified as an `google.api.http` annotation on the gRPC method. // // Each mapping specifies a URL path template and an HTTP method. The path // template may refer to one or more fields in the gRPC request message, as long // as each field is a non-repeated field with a primitive (non-message) type. // The path template controls how fields of the request message are mapped to // the URL path. // // Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/{name=messages/*}" // }; // } // } // message GetMessageRequest { // string name = 1; // Mapped to URL path. // } // message Message { // string text = 1; // The resource content. // } // // This enables an HTTP REST to gRPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. // For example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get:"/v1/messages/{message_id}" // }; // } // } // message GetMessageRequest { // message SubMessage { // string subfield = 1; // } // string message_id = 1; // Mapped to URL path. // int64 revision = 2; // Mapped to URL query parameter `revision`. // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. // } // // This enables a HTTP JSON to RPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: // "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. // In the case of a repeated type, the parameter can be repeated in the URL // as `...?param=A¶m=B`. In the case of a message type, each field of the // message is mapped to a separate parameter, such as // `...?foo.a=A&foo.b=B&foo.c=C`. // // For HTTP methods that allow a request body, the `body` field // specifies the mapping. Consider a REST update method on the // message resource collection: // // service Messaging { // rpc UpdateMessage(UpdateMessageRequest) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "message" // }; // } // } // message UpdateMessageRequest { // string message_id = 1; // mapped to the URL // Message message = 2; // mapped to the body // } // // The following HTTP JSON to RPC mapping is enabled, where the // representation of the JSON in the request body is determined by // protos JSON encoding: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the // request body. This enables the following alternative definition of // the update method: // // service Messaging { // rpc UpdateMessage(Message) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "*" // }; // } // } // message Message { // string message_id = 1; // string text = 2; // } // // // The following HTTP JSON to RPC mapping is enabled: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in // the body. This makes this option more rarely used in practice when // defining REST APIs. The common usage of `*` is in custom methods // which don't use the URL at all for transferring data. // // It is possible to define multiple HTTP methods for one RPC by using // the `additional_bindings` option. Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/messages/{message_id}" // additional_bindings { // get: "/v1/users/{user_id}/messages/{message_id}" // } // }; // } // } // message GetMessageRequest { // string message_id = 1; // string user_id = 2; // } // // This enables the following two alternative HTTP JSON to RPC mappings: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: // "123456")` // // ## Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: // - Fields referred by the path template. They are passed via the URL path. // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP // request body. // - All other fields are passed via the URL query parameters, and the // parameter name is the field path in the request message. A repeated // field can be represented as multiple query parameters under the same // name. // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields // are passed via URL path and HTTP request body. // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all // fields are passed via URL path and URL query parameters. // // ### Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; // Segment = "*" | "**" | LITERAL | Variable ; // Variable = "{" FieldPath [ "=" Segments ] "}" ; // FieldPath = IDENT { "." IDENT } ; // Verb = ":" LITERAL ; // // The syntax `*` matches a single URL path segment. The syntax `**` matches // zero or more URL path segments, which must be the last part of the URL path // except the `Verb`. // // The syntax `Variable` matches part of the URL path as specified by its // template. A variable template must not contain other variables. If a variable // matches a single path segment, its template may be omitted, e.g. `{var}` // is equivalent to `{var=*}`. // // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` // contains any reserved character, such characters should be percent-encoded // before the matching. // // If a variable contains exactly one path segment, such as `"{var}"` or // `"{var=*}"`, when such a variable is expanded into a URL path on the client // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The // server side does the reverse decoding. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{var}`. // // If a variable contains multiple path segments, such as `"{var=foo/*}"` // or `"{var=**}"`, when such a variable is expanded into a URL path on the // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. // The server side does the reverse decoding, except "%2F" and "%2f" are left // unchanged. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // // ## Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The // service config is simply the YAML representation of the `google.api.Service` // proto message. // // As an alternative to annotating your proto file, you can configure gRPC // transcoding in your service config YAML files. You do this by specifying a // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same // effect as the proto annotation. This can be particularly useful if you // have a proto that is reused in multiple services. Note that any transcoding // specified in the service config will override any matching transcoding // configuration in the proto. // // Example: // // http: // rules: // # Selects a gRPC method and applies HttpRule to it. // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // // ## Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 // specification](https://developers.google.com/protocol-buffers/docs/proto3#json). // // While the single segment variable follows the semantics of // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String // Expansion, the multi segment variable **does not** follow RFC 6570 Section // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion // does not expand special characters like `?` and `#`, which would lead // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding // for multi segment variables. // // The path variables **must not** refer to any repeated or mapped field, // because client libraries are not capable of handling such variable expansion. // // The path variables **must not** capture the leading "/" character. The reason // is that the most common use case "{var}" does not capture the leading "/" // character. For consistency, all path variables must share the same behavior. // // Repeated message fields must not be mapped to URL query parameters, because // no client library can support such complicated mapping. // // If an API needs to use a JSON array for request or response body, it can map // the request or response body to a repeated field. However, some gRPC // Transcoding implementations may not support this feature. message HttpRule { // Selects a method to which this rule applies. // // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. string selector = 1; // Determines the URL pattern is matched by this rules. This pattern can be // used with any of the {get|put|post|delete|patch} methods. A custom method // can be defined using the 'custom' field. oneof pattern { // Maps to HTTP GET. Used for listing and getting information about // resources. string get = 2; // Maps to HTTP PUT. Used for replacing a resource. string put = 3; // Maps to HTTP POST. Used for creating a resource or performing an action. string post = 4; // Maps to HTTP DELETE. Used for deleting a resource. string delete = 5; // Maps to HTTP PATCH. Used for updating a resource. string patch = 6; // The custom pattern is used for specifying an HTTP method that is not // included in the `pattern` field, such as HEAD, or "*" to leave the // HTTP method unspecified for this rule. The wild-card rule is useful // for services that provide content to Web (HTML) clients. CustomHttpPattern custom = 8; } // The name of the request field whose value is mapped to the HTTP request // body, or `*` for mapping all request fields not captured by the path // pattern to the HTTP body, or omitted for not having any HTTP request body. // // NOTE: the referred field must be present at the top-level of the request // message type. string body = 7; // Optional. The name of the response field whose value is mapped to the HTTP // response body. When omitted, the entire response message will be used // as the HTTP response body. // // NOTE: The referred field must be present at the top-level of the response // message type. string response_body = 12; // Additional HTTP bindings for the selector. Nested bindings must // not contain an `additional_bindings` field themselves (that is, // the nesting may only be one level deep). repeated HttpRule additional_bindings = 11; } // A custom pattern is used for defining custom HTTP verb. message CustomHttpPattern { // The name of this custom HTTP verb. string kind = 1; // The path matched by this custom verb. string path = 2; } ================================================ FILE: admin/third_party/google/api/httpbody.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/any.proto"; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; option java_multiple_files = true; option java_outer_classname = "HttpBodyProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Message that represents an arbitrary HTTP body. It should only be used for // payload formats that can't be represented as JSON, such as raw binary or // an HTML page. // // // This message can be used both in streaming and non-streaming API methods in // the request as well as the response. // // It can be used as a top-level request field, which is convenient if one // wants to extract parameters from either the URL or HTTP template into the // request fields and also want access to the raw HTTP body. // // Example: // // message GetResourceRequest { // // A unique request id. // string request_id = 1; // // // The raw HTTP body is bound to this field. // google.api.HttpBody http_body = 2; // } // // service ResourceService { // rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); // rpc UpdateResource(google.api.HttpBody) returns // (google.protobuf.Empty); // } // // Example with streaming methods: // // service CaldavService { // rpc GetCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // rpc UpdateCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // } // // Use of this type only changes how the request and response bodies are // handled, all other features will continue to work unchanged. message HttpBody { // The HTTP Content-Type header value specifying the content type of the body. string content_type = 1; // The HTTP request/response body as raw binary. bytes data = 2; // Application specific response metadata. Must be set in the first response // for streaming APIs. repeated google.protobuf.Any extensions = 3; } ================================================ FILE: admin/third_party/google/protobuf/descriptor.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. // // The messages in this file describe the definitions found in .proto files. // A valid .proto file can be translated directly to a FileDescriptorProto // without any other information (e.g. without reading its imports). syntax = "proto2"; package google.protobuf; option go_package = "google.golang.org/protobuf/types/descriptorpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; option csharp_namespace = "Google.Protobuf.Reflection"; option objc_class_prefix = "GPB"; option cc_enable_arenas = true; // descriptor.proto must be optimized for speed because reflection-based // algorithms don't work during bootstrapping. option optimize_for = SPEED; // The protocol compiler can output a FileDescriptorSet containing the .proto // files it parses. message FileDescriptorSet { repeated FileDescriptorProto file = 1; } // Describes a complete .proto file. message FileDescriptorProto { optional string name = 1; // file name, relative to root of source tree optional string package = 2; // e.g. "foo", "foo.bar", etc. // Names of files imported by this file. repeated string dependency = 3; // Indexes of the public imported files in the dependency list above. repeated int32 public_dependency = 10; // Indexes of the weak imported files in the dependency list. // For Google-internal migration only. Do not use. repeated int32 weak_dependency = 11; // All top-level definitions in this file. repeated DescriptorProto message_type = 4; repeated EnumDescriptorProto enum_type = 5; repeated ServiceDescriptorProto service = 6; repeated FieldDescriptorProto extension = 7; optional FileOptions options = 8; // This field contains optional information about the original source code. // You may safely remove this entire field without harming runtime // functionality of the descriptors -- the information is needed only by // development tools. optional SourceCodeInfo source_code_info = 9; // The syntax of the proto file. // The supported values are "proto2" and "proto3". optional string syntax = 12; } // Describes a message type. message DescriptorProto { optional string name = 1; repeated FieldDescriptorProto field = 2; repeated FieldDescriptorProto extension = 6; repeated DescriptorProto nested_type = 3; repeated EnumDescriptorProto enum_type = 4; message ExtensionRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. optional ExtensionRangeOptions options = 3; } repeated ExtensionRange extension_range = 5; repeated OneofDescriptorProto oneof_decl = 8; optional MessageOptions options = 7; // Range of reserved tag numbers. Reserved tag numbers may not be used by // fields or extension ranges in the same message. Reserved ranges may // not overlap. message ReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. } repeated ReservedRange reserved_range = 9; // Reserved field names, which may not be used by fields in the same message. // A given name may only be reserved once. repeated string reserved_name = 10; } message ExtensionRangeOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // Describes a field within a message. message FieldDescriptorProto { enum Type { // 0 is reserved for errors. // Order is weird for historical reasons. TYPE_DOUBLE = 1; TYPE_FLOAT = 2; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. TYPE_INT64 = 3; TYPE_UINT64 = 4; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. TYPE_INT32 = 5; TYPE_FIXED64 = 6; TYPE_FIXED32 = 7; TYPE_BOOL = 8; TYPE_STRING = 9; // Tag-delimited aggregate. // Group type is deprecated and not supported in proto3. However, Proto3 // implementations should still be able to parse the group wire format and // treat group fields as unknown fields. TYPE_GROUP = 10; TYPE_MESSAGE = 11; // Length-delimited aggregate. // New in version 2. TYPE_BYTES = 12; TYPE_UINT32 = 13; TYPE_ENUM = 14; TYPE_SFIXED32 = 15; TYPE_SFIXED64 = 16; TYPE_SINT32 = 17; // Uses ZigZag encoding. TYPE_SINT64 = 18; // Uses ZigZag encoding. } enum Label { // 0 is reserved for errors LABEL_OPTIONAL = 1; LABEL_REQUIRED = 2; LABEL_REPEATED = 3; } optional string name = 1; optional int32 number = 3; optional Label label = 4; // If type_name is set, this need not be set. If both this and type_name // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. optional Type type = 5; // For message and enum types, this is the name of the type. If the name // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping // rules are used to find the type (i.e. first the nested types within this // message are searched, then within the parent, on up to the root // namespace). optional string type_name = 6; // For extensions, this is the name of the type being extended. It is // resolved in the same manner as type_name. optional string extendee = 2; // For numeric types, contains the original text representation of the value. // For booleans, "true" or "false". // For strings, contains the default text contents (not escaped in any way). // For bytes, contains the C escaped value. All bytes >= 128 are escaped. // TODO(kenton): Base-64 encode? optional string default_value = 7; // If set, gives the index of a oneof in the containing type's oneof_decl // list. This field is a member of that oneof. optional int32 oneof_index = 9; // JSON name of this field. The value is set by protocol compiler. If the // user has set a "json_name" option on this field, that option's value // will be used. Otherwise, it's deduced from the field's name by converting // it to camelCase. optional string json_name = 10; optional FieldOptions options = 8; // If true, this is a proto3 "optional". When a proto3 field is optional, it // tracks presence regardless of field type. // // When proto3_optional is true, this field must be belong to a oneof to // signal to old proto3 clients that presence is tracked for this field. This // oneof is known as a "synthetic" oneof, and this field must be its sole // member (each proto3 optional field gets its own synthetic oneof). Synthetic // oneofs exist in the descriptor only, and do not generate any API. Synthetic // oneofs must be ordered after all "real" oneofs. // // For message fields, proto3_optional doesn't create any semantic change, // since non-repeated message fields always track presence. However it still // indicates the semantic detail of whether the user wrote "optional" or not. // This can be useful for round-tripping the .proto file. For consistency we // give message fields a synthetic oneof also, even though it is not required // to track presence. This is especially important because the parser can't // tell if a field is a message or an enum, so it must always create a // synthetic oneof. // // Proto2 optional fields do not set this flag, because they already indicate // optional with `LABEL_OPTIONAL`. optional bool proto3_optional = 17; } // Describes a oneof. message OneofDescriptorProto { optional string name = 1; optional OneofOptions options = 2; } // Describes an enum type. message EnumDescriptorProto { optional string name = 1; repeated EnumValueDescriptorProto value = 2; optional EnumOptions options = 3; // Range of reserved numeric values. Reserved values may not be used by // entries in the same enum. Reserved ranges may not overlap. // // Note that this is distinct from DescriptorProto.ReservedRange in that it // is inclusive such that it can appropriately represent the entire int32 // domain. message EnumReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Inclusive. } // Range of reserved numeric values. Reserved numeric values may not be used // by enum values in the same enum declaration. Reserved ranges may not // overlap. repeated EnumReservedRange reserved_range = 4; // Reserved enum value names, which may not be reused. A given name may only // be reserved once. repeated string reserved_name = 5; } // Describes a value within an enum. message EnumValueDescriptorProto { optional string name = 1; optional int32 number = 2; optional EnumValueOptions options = 3; } // Describes a service. message ServiceDescriptorProto { optional string name = 1; repeated MethodDescriptorProto method = 2; optional ServiceOptions options = 3; } // Describes a method of a service. message MethodDescriptorProto { optional string name = 1; // Input and output type names. These are resolved in the same way as // FieldDescriptorProto.type_name, but must refer to a message type. optional string input_type = 2; optional string output_type = 3; optional MethodOptions options = 4; // Identifies if client streams multiple client messages optional bool client_streaming = 5 [default = false]; // Identifies if server streams multiple server messages optional bool server_streaming = 6 [default = false]; } // =================================================================== // Options // Each of the definitions above may have "options" attached. These are // just annotations which may cause code to be generated slightly differently // or may contain hints for code that manipulates protocol messages. // // Clients may define custom options as extensions of the *Options messages. // These extensions may not yet be known at parsing time, so the parser cannot // store the values in them. Instead it stores them in a field in the *Options // message called uninterpreted_option. This field must have the same name // across all *Options messages. We then use this field to populate the // extensions when we build a descriptor, at which point all protos have been // parsed and so all extensions are known. // // Extension numbers for custom options may be chosen as follows: // * For options which will only be used within a single application or // organization, or for experimental options, use field numbers 50000 // through 99999. It is up to you to ensure that you do not use the // same number for multiple options. // * For options which will be published and used publicly by multiple // independent entities, e-mail protobuf-global-extension-registry@google.com // to reserve extension numbers. Simply provide your project name (e.g. // Objective-C plugin) and your project website (if available) -- there's no // need to explain how you intend to use them. Usually you only need one // extension number. You can declare multiple options with only one extension // number by putting them in a sub-message. See the Custom Options section of // the docs for examples: // https://developers.google.com/protocol-buffers/docs/proto#options // If this turns out to be popular, a web service will be set up // to automatically assign option numbers. message FileOptions { // Sets the Java package where classes generated from this .proto will be // placed. By default, the proto package is used, but this is often // inappropriate because proto packages do not normally start with backwards // domain names. optional string java_package = 1; // Controls the name of the wrapper Java class generated for the .proto file. // That class will always contain the .proto file's getDescriptor() method as // well as any top-level extensions defined in the .proto file. // If java_multiple_files is disabled, then all the other classes from the // .proto file will be nested inside the single wrapper outer class. optional string java_outer_classname = 8; // If enabled, then the Java code generator will generate a separate .java // file for each top-level message, enum, and service defined in the .proto // file. Thus, these types will *not* be nested inside the wrapper class // named by java_outer_classname. However, the wrapper class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. optional bool java_multiple_files = 10 [default = false]; // This option does nothing. optional bool java_generate_equals_and_hash = 20 [deprecated=true]; // If set true, then the Java2 code generator will generate code that // throws an exception whenever an attempt is made to assign a non-UTF-8 // byte sequence to a string field. // Message reflection will do the same. // However, an extension field still accepts non-UTF-8 byte sequences. // This option has no effect on when used with the lite runtime. optional bool java_string_check_utf8 = 27 [default = false]; // Generated classes can be optimized for speed or code size. enum OptimizeMode { SPEED = 1; // Generate complete code for parsing, serialization, // etc. CODE_SIZE = 2; // Use ReflectionOps to implement these methods. LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. } optional OptimizeMode optimize_for = 9 [default = SPEED]; // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: // - The basename of the package import path, if provided. // - Otherwise, the package statement in the .proto file, if present. // - Otherwise, the basename of the .proto file, without extension. optional string go_package = 11; // Should generic services be generated in each language? "Generic" services // are not specific to any particular RPC system. They are generated by the // main code generators in each language (without additional plugins). // Generic services were the only kind of service generation supported by // early versions of google.protobuf. // // Generic services are now considered deprecated in favor of using plugins // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. optional bool cc_generic_services = 16 [default = false]; optional bool java_generic_services = 17 [default = false]; optional bool py_generic_services = 18 [default = false]; optional bool php_generic_services = 42 [default = false]; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. optional bool deprecated = 23 [default = false]; // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. optional bool cc_enable_arenas = 31 [default = true]; // Sets the objective c class prefix which is prepended to all objective c // generated classes from this .proto. There is no default. optional string objc_class_prefix = 36; // Namespace for generated classes; defaults to the package. optional string csharp_namespace = 37; // By default Swift generators will take the proto package and CamelCase it // replacing '.' with underscore and use that to prefix the types/symbols // defined. When this options is provided, they will use this value instead // to prefix the types/symbols defined. optional string swift_prefix = 39; // Sets the php class prefix which is prepended to all php generated classes // from this .proto. Default is empty. optional string php_class_prefix = 40; // Use this option to change the namespace of php generated classes. Default // is empty. When this option is empty, the package name will be used for // determining the namespace. optional string php_namespace = 41; // Use this option to change the namespace of php generated metadata classes. // Default is empty. When this option is empty, the proto file name will be // used for determining the namespace. optional string php_metadata_namespace = 44; // Use this option to change the package of ruby generated classes. Default // is empty. When this option is not set, the package name will be used for // determining the ruby package. optional string ruby_package = 45; // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. // See the documentation for the "Options" section above. extensions 1000 to max; reserved 38; } message MessageOptions { // Set true to use the old proto1 MessageSet wire format for extensions. // This is provided for backwards-compatibility with the MessageSet wire // format. You should not use this for any other reason: It's less // efficient, has fewer features, and is more complicated. // // The message must be defined exactly as follows: // message Foo { // option message_set_wire_format = true; // extensions 4 to max; // } // Note that the message cannot have any defined fields; MessageSets only // have extensions. // // All extensions of your type must be singular messages; e.g. they cannot // be int32s, enums, or repeated messages. // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. optional bool message_set_wire_format = 1 [default = false]; // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". optional bool no_standard_descriptor_accessor = 2 [default = false]; // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. optional bool deprecated = 3 [default = false]; reserved 4, 5, 6; // Whether the message is an automatically generated map entry type for the // maps field. // // For maps fields: // map map_field = 1; // The parsed descriptor looks like: // message MapFieldEntry { // option map_entry = true; // optional KeyType key = 1; // optional ValueType value = 2; // } // repeated MapFieldEntry map_field = 1; // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax // instead. The option should only be implicitly set by the proto compiler // parser. optional bool map_entry = 7; reserved 8; // javalite_serializable reserved 9; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message FieldOptions { // The ctype option instructs the C++ code generator to use a different // representation of the field than it normally would. See the specific // options below. This option is not yet implemented in the open source // release -- sorry, we'll try to include it in a future version! optional CType ctype = 1 [default = STRING]; enum CType { // Default mode. STRING = 0; CORD = 1; STRING_PIECE = 2; } // The packed option can be enabled for repeated primitive fields to enable // a more efficient representation on the wire. Rather than repeatedly // writing the tag and type for each element, the entire array is encoded as // a single length-delimited blob. In proto3, only explicit setting it to // false will avoid using packed encoding. optional bool packed = 2; // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING // is represented as JavaScript string, which avoids loss of precision that // can happen when a large value is converted to a floating point JavaScript. // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to // use the JavaScript "number" type. The behavior of the default option // JS_NORMAL is implementation dependent. // // This option is an enum to permit additional types to be added, e.g. // goog.math.Integer. optional JSType jstype = 6 [default = JS_NORMAL]; enum JSType { // Use the default type. JS_NORMAL = 0; // Use JavaScript strings. JS_STRING = 1; // Use JavaScript numbers. JS_NUMBER = 2; } // Should this field be parsed lazily? Lazy applies only to message-type // fields. It means that when the outer message is initially parsed, the // inner message's contents will not be parsed but instead stored in encoded // form. The inner message will actually be parsed when it is first accessed. // // This is only a hint. Implementations are free to choose whether to use // eager or lazy parsing regardless of the value of this option. However, // setting this option true suggests that the protocol author believes that // using lazy parsing on this field is worth the additional bookkeeping // overhead typically needed to implement it. // // This option does not affect the public interface of any generated code; // all method signatures remain the same. Furthermore, thread-safety of the // interface is not affected by this option; const methods remain safe to // call from multiple threads concurrently, while non-const methods continue // to require exclusive access. // // // Note that implementations may choose not to check required fields within // a lazy sub-message. That is, calling IsInitialized() on the outer message // may return true even if the inner message has missing required fields. // This is necessary because otherwise the inner message would have to be // parsed in order to perform the check, defeating the purpose of lazy // parsing. An implementation which chooses not to check required fields // must be consistent about it. That is, for any particular sub-message, the // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. optional bool lazy = 5 [default = false]; // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. optional bool deprecated = 3 [default = false]; // For Google-internal migration only. Do not use. optional bool weak = 10 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; reserved 4; // removed jtype } message OneofOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumOptions { // Set this option to true to allow mapping different tag names to the same // value. optional bool allow_alias = 2; // Is this enum deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. optional bool deprecated = 3 [default = false]; reserved 5; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumValueOptions { // Is this enum value deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. optional bool deprecated = 1 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message ServiceOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this service deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. optional bool deprecated = 33 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message MethodOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this method deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. optional bool deprecated = 33 [default = false]; // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, // or neither? HTTP based RPC implementation may choose GET verb for safe // methods, and PUT verb for idempotent methods instead of the default POST. enum IdempotencyLevel { IDEMPOTENCY_UNKNOWN = 0; NO_SIDE_EFFECTS = 1; // implies idempotent IDEMPOTENT = 2; // idempotent, but may have side effects } optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // A message representing a option the parser does not recognize. This only // appears in options protos created by the compiler::Parser class. // DescriptorPool resolves these when building Descriptor objects. Therefore, // options protos in descriptor objects (e.g. returned by Descriptor::options(), // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions // in them. message UninterpretedOption { // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents // "foo.(bar.baz).qux". message NamePart { required string name_part = 1; required bool is_extension = 2; } repeated NamePart name = 2; // The value of the uninterpreted option, in whatever type the tokenizer // identified it as during parsing. Exactly one of these should be set. optional string identifier_value = 3; optional uint64 positive_int_value = 4; optional int64 negative_int_value = 5; optional double double_value = 6; optional bytes string_value = 7; optional string aggregate_value = 8; } // =================================================================== // Optional source code info // Encapsulates information about the original source file from which a // FileDescriptorProto was generated. message SourceCodeInfo { // A Location identifies a piece of source code in a .proto file which // corresponds to a particular definition. This information is intended // to be useful to IDEs, code indexers, documentation generators, and similar // tools. // // For example, say we have a file like: // message Foo { // optional string foo = 1; // } // Let's look at just the field definition: // optional string foo = 1; // ^ ^^ ^^ ^ ^^^ // a bc de f ghi // We have the following locations: // span path represents // [a,i) [ 4, 0, 2, 0 ] The whole field definition. // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). // // Notes: // - A location may refer to a repeated field itself (i.e. not to any // particular index within it). This is used whenever a set of elements are // logically enclosed in a single code segment. For example, an entire // extend block (possibly containing multiple extension definitions) will // have an outer location whose path refers to the "extensions" repeated // field without an index. // - Multiple locations may have the same path. This happens when a single // logical declaration is spread out across multiple places. The most // obvious example is the "extend" block again -- there may be multiple // extend blocks in the same scope, each of which will have the same path. // - A location's span is not always a subset of its parent's span. For // example, the "extendee" of an extension declaration appears at the // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span // does not mean that it is a descendant. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to // ignore those that it doesn't understand, as more types of locations could // be recorded in the future. repeated Location location = 1; message Location { // Identifies which part of the FileDescriptorProto was defined at this // location. // // Each element is a field number or an index. They form a path from // the root FileDescriptorProto to the place where the definition occurs. For // example, this path: // [ 4, 3, 2, 7, 1 ] // refers to: // file.message_type(3) // 4, 3 // .field(7) // 2, 7 // .name() // 1 // This is because FileDescriptorProto.message_type has field number 4: // repeated DescriptorProto message_type = 4; // and DescriptorProto.field has field number 2: // repeated FieldDescriptorProto field = 2; // and FieldDescriptorProto.name has field number 1: // optional string name = 1; // // Thus, the above path gives the location of a field name. If we removed // the last element: // [ 4, 3, 2, 7 ] // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). repeated int32 path = 1 [packed = true]; // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. repeated int32 span = 2 [packed = true]; // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be // attached to the declaration. // // A series of line comments appearing on consecutive lines, with no other // tokens appearing on those lines, will be treated as a single comment. // // leading_detached_comments will keep paragraphs of comments that appear // before (but not connected to) the current element. Each paragraph, // separated by empty lines, will be one comment element in the repeated // field. // // Only the comment content is provided; comment markers (e.g. //) are // stripped out. For block comments, leading whitespace and an asterisk // will be stripped from the beginning of each line other than the first. // Newlines are included in the output. // // Examples: // // optional int32 foo = 1; // Comment attached to foo. // // Comment attached to bar. // optional int32 bar = 2; // // optional string baz = 3; // // Comment attached to baz. // // Another line attached to baz. // // // Comment attached to qux. // // // // Another line attached to qux. // optional double qux = 4; // // // Detached comment for corge. This is not leading or trailing comments // // to qux or corge because there are blank lines separating it from // // both. // // // Detached comment for corge paragraph 2. // // optional string corge = 5; // /* Block comment attached // * to corge. Leading asterisks // * will be removed. */ // /* Block comment attached to // * grault. */ // optional int32 grault = 6; // // // ignored detached comments. optional string leading_comments = 3; optional string trailing_comments = 4; repeated string leading_detached_comments = 6; } } // Describes the relationship between generated code and its original source // file. A GeneratedCodeInfo message is associated with only one generated // source file, but may contain references to different source .proto files. message GeneratedCodeInfo { // An Annotation connects some span of text in generated code to an element // of its generating .proto file. repeated Annotation annotation = 1; message Annotation { // Identifies the element in the original source .proto file. This field // is formatted the same as SourceCodeInfo.Location.path. repeated int32 path = 1 [packed = true]; // Identifies the filesystem path to the original source .proto. optional string source_file = 2; // Identifies the starting offset in bytes in the generated code // that relates to the identified object. optional int32 begin = 3; // Identifies the ending offset in bytes in the generated code that // relates to the identified offset. The end offset should be one past // the last relevant byte (so the length of the text = end - begin). optional int32 end = 4; } } ================================================ FILE: admin/third_party/protoc-gen-openapiv2/options/annotations.proto ================================================ syntax = "proto3"; package grpc.gateway.protoc_gen_openapiv2.options; option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; import "google/protobuf/descriptor.proto"; import "protoc-gen-openapiv2/options/openapiv2.proto"; extend google.protobuf.FileOptions { // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. // // All IDs are the same, as assigned. It is okay that they are the same, as they extend // different descriptor messages. Swagger openapiv2_swagger = 1042; } extend google.protobuf.MethodOptions { // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. // // All IDs are the same, as assigned. It is okay that they are the same, as they extend // different descriptor messages. Operation openapiv2_operation = 1042; } extend google.protobuf.MessageOptions { // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. // // All IDs are the same, as assigned. It is okay that they are the same, as they extend // different descriptor messages. Schema openapiv2_schema = 1042; } extend google.protobuf.ServiceOptions { // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. // // All IDs are the same, as assigned. It is okay that they are the same, as they extend // different descriptor messages. Tag openapiv2_tag = 1042; } extend google.protobuf.FieldOptions { // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. // // All IDs are the same, as assigned. It is okay that they are the same, as they extend // different descriptor messages. JSONSchema openapiv2_field = 1042; } ================================================ FILE: admin/third_party/protoc-gen-openapiv2/options/openapiv2.proto ================================================ syntax = "proto3"; package grpc.gateway.protoc_gen_openapiv2.options; option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; import "google/protobuf/struct.proto"; // Scheme describes the schemes supported by the OpenAPI Swagger // and Operation objects. enum Scheme { UNKNOWN = 0; HTTP = 1; HTTPS = 2; WS = 3; WSS = 4; } // `Swagger` is a representation of OpenAPI v2 specification's Swagger object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject // // Example: // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // info: { // title: "Echo API"; // version: "1.0"; // description: "; // contact: { // name: "gRPC-Gateway project"; // url: "https://github.com/grpc-ecosystem/grpc-gateway"; // email: "none@example.com"; // }; // license: { // name: "BSD 3-Clause License"; // url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; // }; // }; // schemes: HTTPS; // consumes: "application/json"; // produces: "application/json"; // }; // message Swagger { // Specifies the OpenAPI Specification version being used. It can be // used by the OpenAPI UI and other clients to interpret the API listing. The // value MUST be "2.0". string swagger = 1; // Provides metadata about the API. The metadata can be used by the // clients if needed. Info info = 2; // The host (name or ip) serving the API. This MUST be the host only and does // not include the scheme nor sub-paths. It MAY include a port. If the host is // not included, the host serving the documentation is to be used (including // the port). The host does not support path templating. string host = 3; // The base path on which the API is served, which is relative to the host. If // it is not included, the API is served directly under the host. The value // MUST start with a leading slash (/). The basePath does not support path // templating. // Note that using `base_path` does not change the endpoint paths that are // generated in the resulting OpenAPI file. If you wish to use `base_path` // with relatively generated OpenAPI paths, the `base_path` prefix must be // manually removed from your `google.api.http` paths and your code changed to // serve the API from the `base_path`. string base_path = 4; // The transfer protocol of the API. Values MUST be from the list: "http", // "https", "ws", "wss". If the schemes is not included, the default scheme to // be used is the one used to access the OpenAPI definition itself. repeated Scheme schemes = 5; // A list of MIME types the APIs can consume. This is global to all APIs but // can be overridden on specific API calls. Value MUST be as described under // Mime Types. repeated string consumes = 6; // A list of MIME types the APIs can produce. This is global to all APIs but // can be overridden on specific API calls. Value MUST be as described under // Mime Types. repeated string produces = 7; // field 8 is reserved for 'paths'. reserved 8; // field 9 is reserved for 'definitions', which at this time are already // exposed as and customizable as proto messages. reserved 9; // An object to hold responses that can be used across operations. This // property does not define global responses for all operations. map responses = 10; // Security scheme definitions that can be used across the specification. SecurityDefinitions security_definitions = 11; // A declaration of which security schemes are applied for the API as a whole. // The list of values describes alternative security schemes that can be used // (that is, there is a logical OR between the security requirements). // Individual operations can override this definition. repeated SecurityRequirement security = 12; // field 13 is reserved for 'tags', which are supposed to be exposed as and // customizable as proto services. TODO(ivucica): add processing of proto // service objects into OpenAPI v2 Tag objects. reserved 13; // Additional external documentation. ExternalDocumentation external_docs = 14; map extensions = 15; } // `Operation` is a representation of OpenAPI v2 specification's Operation object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject // // Example: // // service EchoService { // rpc Echo(SimpleMessage) returns (SimpleMessage) { // option (google.api.http) = { // get: "/v1/example/echo/{id}" // }; // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { // summary: "Get a message."; // operation_id: "getMessage"; // tags: "echo"; // responses: { // key: "200" // value: { // description: "OK"; // } // } // }; // } // } message Operation { // A list of tags for API documentation control. Tags can be used for logical // grouping of operations by resources or any other qualifier. repeated string tags = 1; // A short summary of what the operation does. For maximum readability in the // swagger-ui, this field SHOULD be less than 120 characters. string summary = 2; // A verbose explanation of the operation behavior. GFM syntax can be used for // rich text representation. string description = 3; // Additional external documentation for this operation. ExternalDocumentation external_docs = 4; // Unique string used to identify the operation. The id MUST be unique among // all operations described in the API. Tools and libraries MAY use the // operationId to uniquely identify an operation, therefore, it is recommended // to follow common programming naming conventions. string operation_id = 5; // A list of MIME types the operation can consume. This overrides the consumes // definition at the OpenAPI Object. An empty value MAY be used to clear the // global definition. Value MUST be as described under Mime Types. repeated string consumes = 6; // A list of MIME types the operation can produce. This overrides the produces // definition at the OpenAPI Object. An empty value MAY be used to clear the // global definition. Value MUST be as described under Mime Types. repeated string produces = 7; // field 8 is reserved for 'parameters'. reserved 8; // The list of possible responses as they are returned from executing this // operation. map responses = 9; // The transfer protocol for the operation. Values MUST be from the list: // "http", "https", "ws", "wss". The value overrides the OpenAPI Object // schemes definition. repeated Scheme schemes = 10; // Declares this operation to be deprecated. Usage of the declared operation // should be refrained. Default value is false. bool deprecated = 11; // A declaration of which security schemes are applied for this operation. The // list of values describes alternative security schemes that can be used // (that is, there is a logical OR between the security requirements). This // definition overrides any declared top-level security. To remove a top-level // security declaration, an empty array can be used. repeated SecurityRequirement security = 12; map extensions = 13; } // `Header` is a representation of OpenAPI v2 specification's Header object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject // message Header { // `Description` is a short description of the header. string description = 1; // The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. string type = 2; // `Format` The extending format for the previously mentioned type. string format = 3; // field 4 is reserved for 'items', but in OpenAPI-specific way. reserved 4; // field 5 is reserved `Collection Format` Determines the format of the array if type array is used. reserved 5; // `Default` Declares the value of the header that the server will use if none is provided. // See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. // Unlike JSON Schema this value MUST conform to the defined type for the header. string default = 6; // field 7 is reserved for 'maximum'. reserved 7; // field 8 is reserved for 'exclusiveMaximum'. reserved 8; // field 9 is reserved for 'minimum'. reserved 9; // field 10 is reserved for 'exclusiveMinimum'. reserved 10; // field 11 is reserved for 'maxLength'. reserved 11; // field 12 is reserved for 'minLength'. reserved 12; // 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. string pattern = 13; // field 14 is reserved for 'maxItems'. reserved 14; // field 15 is reserved for 'minItems'. reserved 15; // field 16 is reserved for 'uniqueItems'. reserved 16; // field 17 is reserved for 'enum'. reserved 17; // field 18 is reserved for 'multipleOf'. reserved 18; } // `Response` is a representation of OpenAPI v2 specification's Response object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject // message Response { // `Description` is a short description of the response. // GFM syntax can be used for rich text representation. string description = 1; // `Schema` optionally defines the structure of the response. // If `Schema` is not provided, it means there is no content to the response. Schema schema = 2; // `Headers` A list of headers that are sent with the response. // `Header` name is expected to be a string in the canonical format of the MIME header key // See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey map headers = 3; // `Examples` gives per-mimetype response examples. // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object map examples = 4; map extensions = 5; } // `Info` is a representation of OpenAPI v2 specification's Info object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject // // Example: // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // info: { // title: "Echo API"; // version: "1.0"; // description: "; // contact: { // name: "gRPC-Gateway project"; // url: "https://github.com/grpc-ecosystem/grpc-gateway"; // email: "none@example.com"; // }; // license: { // name: "BSD 3-Clause License"; // url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; // }; // }; // ... // }; // message Info { // The title of the application. string title = 1; // A short description of the application. GFM syntax can be used for rich // text representation. string description = 2; // The Terms of Service for the API. string terms_of_service = 3; // The contact information for the exposed API. Contact contact = 4; // The license information for the exposed API. License license = 5; // Provides the version of the application API (not to be confused // with the specification version). string version = 6; map extensions = 7; } // `Contact` is a representation of OpenAPI v2 specification's Contact object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject // // Example: // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // info: { // ... // contact: { // name: "gRPC-Gateway project"; // url: "https://github.com/grpc-ecosystem/grpc-gateway"; // email: "none@example.com"; // }; // ... // }; // ... // }; // message Contact { // The identifying name of the contact person/organization. string name = 1; // The URL pointing to the contact information. MUST be in the format of a // URL. string url = 2; // The email address of the contact person/organization. MUST be in the format // of an email address. string email = 3; } // `License` is a representation of OpenAPI v2 specification's License object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject // // Example: // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // info: { // ... // license: { // name: "BSD 3-Clause License"; // url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; // }; // ... // }; // ... // }; // message License { // The license name used for the API. string name = 1; // A URL to the license used for the API. MUST be in the format of a URL. string url = 2; } // `ExternalDocumentation` is a representation of OpenAPI v2 specification's // ExternalDocumentation object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject // // Example: // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // ... // external_docs: { // description: "More about gRPC-Gateway"; // url: "https://github.com/grpc-ecosystem/grpc-gateway"; // } // ... // }; // message ExternalDocumentation { // A short description of the target documentation. GFM syntax can be used for // rich text representation. string description = 1; // The URL for the target documentation. Value MUST be in the format // of a URL. string url = 2; } // `Schema` is a representation of OpenAPI v2 specification's Schema object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject // message Schema { JSONSchema json_schema = 1; // Adds support for polymorphism. The discriminator is the schema property // name that is used to differentiate between other schema that inherit this // schema. The property name used MUST be defined at this schema and it MUST // be in the required property list. When used, the value MUST be the name of // this schema or any schema that inherits it. string discriminator = 2; // Relevant only for Schema "properties" definitions. Declares the property as // "read only". This means that it MAY be sent as part of a response but MUST // NOT be sent as part of the request. Properties marked as readOnly being // true SHOULD NOT be in the required list of the defined schema. Default // value is false. bool read_only = 3; // field 4 is reserved for 'xml'. reserved 4; // Additional external documentation for this schema. ExternalDocumentation external_docs = 5; // A free-form property to include an example of an instance for this schema in JSON. // This is copied verbatim to the output. string example = 6; } // `JSONSchema` represents properties from JSON Schema taken, and as used, in // the OpenAPI v2 spec. // // This includes changes made by OpenAPI v2. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject // // See also: https://cswr.github.io/JsonSchema/spec/basic_types/, // https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json // // Example: // // message SimpleMessage { // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { // json_schema: { // title: "SimpleMessage" // description: "A simple message." // required: ["id"] // } // }; // // // Id represents the message identifier. // string id = 1; [ // (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { // {description: "The unique identifier of the simple message." // }]; // } // message JSONSchema { // field 1 is reserved for '$id', omitted from OpenAPI v2. reserved 1; // field 2 is reserved for '$schema', omitted from OpenAPI v2. reserved 2; // Ref is used to define an external reference to include in the message. // This could be a fully qualified proto message reference, and that type must // be imported into the protofile. If no message is identified, the Ref will // be used verbatim in the output. // For example: // `ref: ".google.protobuf.Timestamp"`. string ref = 3; // field 4 is reserved for '$comment', omitted from OpenAPI v2. reserved 4; // The title of the schema. string title = 5; // A short description of the schema. string description = 6; string default = 7; bool read_only = 8; // A free-form property to include a JSON example of this field. This is copied // verbatim to the output swagger.json. Quotes must be escaped. // This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject string example = 9; double multiple_of = 10; // Maximum represents an inclusive upper limit for a numeric instance. The // value of MUST be a number, double maximum = 11; bool exclusive_maximum = 12; // minimum represents an inclusive lower limit for a numeric instance. The // value of MUST be a number, double minimum = 13; bool exclusive_minimum = 14; uint64 max_length = 15; uint64 min_length = 16; string pattern = 17; // field 18 is reserved for 'additionalItems', omitted from OpenAPI v2. reserved 18; // field 19 is reserved for 'items', but in OpenAPI-specific way. // TODO(ivucica): add 'items'? reserved 19; uint64 max_items = 20; uint64 min_items = 21; bool unique_items = 22; // field 23 is reserved for 'contains', omitted from OpenAPI v2. reserved 23; uint64 max_properties = 24; uint64 min_properties = 25; repeated string required = 26; // field 27 is reserved for 'additionalProperties', but in OpenAPI-specific // way. TODO(ivucica): add 'additionalProperties'? reserved 27; // field 28 is reserved for 'definitions', omitted from OpenAPI v2. reserved 28; // field 29 is reserved for 'properties', but in OpenAPI-specific way. // TODO(ivucica): add 'additionalProperties'? reserved 29; // following fields are reserved, as the properties have been omitted from // OpenAPI v2: // patternProperties, dependencies, propertyNames, const reserved 30 to 33; // Items in 'array' must be unique. repeated string array = 34; enum JSONSchemaSimpleTypes { UNKNOWN = 0; ARRAY = 1; BOOLEAN = 2; INTEGER = 3; NULL = 4; NUMBER = 5; OBJECT = 6; STRING = 7; } repeated JSONSchemaSimpleTypes type = 35; // `Format` string format = 36; // following fields are reserved, as the properties have been omitted from // OpenAPI v2: contentMediaType, contentEncoding, if, then, else reserved 37 to 41; // field 42 is reserved for 'allOf', but in OpenAPI-specific way. // TODO(ivucica): add 'allOf'? reserved 42; // following fields are reserved, as the properties have been omitted from // OpenAPI v2: // anyOf, oneOf, not reserved 43 to 45; // Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 repeated string enum = 46; } // `Tag` is a representation of OpenAPI v2 specification's Tag object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject // message Tag { // field 1 is reserved for 'name'. In our generator, this is (to be) extracted // from the name of proto service, and thus not exposed to the user, as // changing tag object's name would break the link to the references to the // tag in individual operation specifications. // // TODO(ivucica): Add 'name' property. Use it to allow override of the name of // global Tag object, then use that name to reference the tag throughout the // OpenAPI file. reserved 1; // A short description for the tag. GFM syntax can be used for rich text // representation. string description = 2; // Additional external documentation for this tag. ExternalDocumentation external_docs = 3; } // `SecurityDefinitions` is a representation of OpenAPI v2 specification's // Security Definitions object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject // // A declaration of the security schemes available to be used in the // specification. This does not enforce the security schemes on the operations // and only serves to provide the relevant details for each scheme. message SecurityDefinitions { // A single security scheme definition, mapping a "name" to the scheme it // defines. map security = 1; } // `SecurityScheme` is a representation of OpenAPI v2 specification's // Security Scheme object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject // // Allows the definition of a security scheme that can be used by the // operations. Supported schemes are basic authentication, an API key (either as // a header or as a query parameter) and OAuth2's common flows (implicit, // password, application and access code). message SecurityScheme { // The type of the security scheme. Valid values are "basic", // "apiKey" or "oauth2". enum Type { TYPE_INVALID = 0; TYPE_BASIC = 1; TYPE_API_KEY = 2; TYPE_OAUTH2 = 3; } // The location of the API key. Valid values are "query" or "header". enum In { IN_INVALID = 0; IN_QUERY = 1; IN_HEADER = 2; } // The flow used by the OAuth2 security scheme. Valid values are // "implicit", "password", "application" or "accessCode". enum Flow { FLOW_INVALID = 0; FLOW_IMPLICIT = 1; FLOW_PASSWORD = 2; FLOW_APPLICATION = 3; FLOW_ACCESS_CODE = 4; } // The type of the security scheme. Valid values are "basic", // "apiKey" or "oauth2". Type type = 1; // A short description for security scheme. string description = 2; // The name of the header or query parameter to be used. // Valid for apiKey. string name = 3; // The location of the API key. Valid values are "query" or // "header". // Valid for apiKey. In in = 4; // The flow used by the OAuth2 security scheme. Valid values are // "implicit", "password", "application" or "accessCode". // Valid for oauth2. Flow flow = 5; // The authorization URL to be used for this flow. This SHOULD be in // the form of a URL. // Valid for oauth2/implicit and oauth2/accessCode. string authorization_url = 6; // The token URL to be used for this flow. This SHOULD be in the // form of a URL. // Valid for oauth2/password, oauth2/application and oauth2/accessCode. string token_url = 7; // The available scopes for the OAuth2 security scheme. // Valid for oauth2. Scopes scopes = 8; map extensions = 9; } // `SecurityRequirement` is a representation of OpenAPI v2 specification's // Security Requirement object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject // // Lists the required security schemes to execute this operation. The object can // have multiple security schemes declared in it which are all required (that // is, there is a logical AND between the schemes). // // The name used for each property MUST correspond to a security scheme // declared in the Security Definitions. message SecurityRequirement { // If the security scheme is of type "oauth2", then the value is a list of // scope names required for the execution. For other security scheme types, // the array MUST be empty. message SecurityRequirementValue { repeated string scope = 1; } // Each name must correspond to a security scheme which is declared in // the Security Definitions. If the security scheme is of type "oauth2", // then the value is a list of scope names required for the execution. // For other security scheme types, the array MUST be empty. map security_requirement = 1; } // `Scopes` is a representation of OpenAPI v2 specification's Scopes object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject // // Lists the available scopes for an OAuth2 security scheme. message Scopes { // Maps between a name of a scope to a short description of it (as the value // of the property). map scope = 1; } ================================================ FILE: admin/third_party/validate/README.md ================================================ # protoc-gen-validate (PGV) * https://github.com/envoyproxy/protoc-gen-validate ================================================ FILE: admin/third_party/validate/validate.proto ================================================ syntax = "proto2"; package validate; option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; option java_package = "io.envoyproxy.pgv.validate"; import "google/protobuf/descriptor.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; // Validation rules applied at the message level extend google.protobuf.MessageOptions { // Disabled nullifies any validation rules for this message, including any // message fields associated with it that do support validation. optional bool disabled = 1071; // Ignore skips generation of validation methods for this message. optional bool ignored = 1072; } // Validation rules applied at the oneof level extend google.protobuf.OneofOptions { // Required ensures that exactly one the field options in a oneof is set; // validation fails if no fields in the oneof are set. optional bool required = 1071; } // Validation rules applied at the field level extend google.protobuf.FieldOptions { // Rules specify the validations to be performed on this field. By default, // no validation is performed against a field. optional FieldRules rules = 1071; } // FieldRules encapsulates the rules for each type of field. Depending on the // field, the correct set should be used to ensure proper validations. message FieldRules { optional MessageRules message = 17; oneof type { // Scalar Field Types FloatRules float = 1; DoubleRules double = 2; Int32Rules int32 = 3; Int64Rules int64 = 4; UInt32Rules uint32 = 5; UInt64Rules uint64 = 6; SInt32Rules sint32 = 7; SInt64Rules sint64 = 8; Fixed32Rules fixed32 = 9; Fixed64Rules fixed64 = 10; SFixed32Rules sfixed32 = 11; SFixed64Rules sfixed64 = 12; BoolRules bool = 13; StringRules string = 14; BytesRules bytes = 15; // Complex Field Types EnumRules enum = 16; RepeatedRules repeated = 18; MapRules map = 19; // Well-Known Field Types AnyRules any = 20; DurationRules duration = 21; TimestampRules timestamp = 22; } } // FloatRules describes the constraints applied to `float` values message FloatRules { // Const specifies that this field must be exactly the specified value optional float const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional float lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional float lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional float gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional float gte = 5; // In specifies that this field must be equal to one of the specified // values repeated float in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated float not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // DoubleRules describes the constraints applied to `double` values message DoubleRules { // Const specifies that this field must be exactly the specified value optional double const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional double lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional double lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional double gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional double gte = 5; // In specifies that this field must be equal to one of the specified // values repeated double in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated double not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int32Rules describes the constraints applied to `int32` values message Int32Rules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int64Rules describes the constraints applied to `int64` values message Int64Rules { // Const specifies that this field must be exactly the specified value optional int64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt32Rules describes the constraints applied to `uint32` values message UInt32Rules { // Const specifies that this field must be exactly the specified value optional uint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt64Rules describes the constraints applied to `uint64` values message UInt64Rules { // Const specifies that this field must be exactly the specified value optional uint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt32Rules describes the constraints applied to `sint32` values message SInt32Rules { // Const specifies that this field must be exactly the specified value optional sint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt64Rules describes the constraints applied to `sint64` values message SInt64Rules { // Const specifies that this field must be exactly the specified value optional sint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed32Rules describes the constraints applied to `fixed32` values message Fixed32Rules { // Const specifies that this field must be exactly the specified value optional fixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed64Rules describes the constraints applied to `fixed64` values message Fixed64Rules { // Const specifies that this field must be exactly the specified value optional fixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed32Rules describes the constraints applied to `sfixed32` values message SFixed32Rules { // Const specifies that this field must be exactly the specified value optional sfixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed64Rules describes the constraints applied to `sfixed64` values message SFixed64Rules { // Const specifies that this field must be exactly the specified value optional sfixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // BoolRules describes the constraints applied to `bool` values message BoolRules { // Const specifies that this field must be exactly the specified value optional bool const = 1; } // StringRules describe the constraints applied to `string` values message StringRules { // Const specifies that this field must be exactly the specified value optional string const = 1; // Len specifies that this field must be the specified number of // characters (Unicode code points). Note that the number of // characters may differ from the number of bytes in the string. optional uint64 len = 19; // MinLen specifies that this field must be the specified number of // characters (Unicode code points) at a minimum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of // characters (Unicode code points) at a maximum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 max_len = 3; // LenBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 len_bytes = 20; // MinBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_bytes = 4; // MaxBytes specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_bytes = 5; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 6; // Prefix specifies that this field must have the specified substring at // the beginning of the string. optional string prefix = 7; // Suffix specifies that this field must have the specified substring at // the end of the string. optional string suffix = 8; // Contains specifies that this field must have the specified substring // anywhere in the string. optional string contains = 9; // NotContains specifies that this field cannot have the specified substring // anywhere in the string. optional string not_contains = 23; // In specifies that this field must be equal to one of the specified // values repeated string in = 10; // NotIn specifies that this field cannot be equal to one of the specified // values repeated string not_in = 11; // WellKnown rules provide advanced constraints against common string // patterns oneof well_known { // Email specifies that the field must be a valid email address as // defined by RFC 5322 bool email = 12; // Hostname specifies that the field must be a valid hostname as // defined by RFC 1034. This constraint does not support // internationalized domain names (IDNs). bool hostname = 13; // Ip specifies that the field must be a valid IP (v4 or v6) address. // Valid IPv6 addresses should not include surrounding square brackets. bool ip = 14; // Ipv4 specifies that the field must be a valid IPv4 address. bool ipv4 = 15; // Ipv6 specifies that the field must be a valid IPv6 address. Valid // IPv6 addresses should not include surrounding square brackets. bool ipv6 = 16; // Uri specifies that the field must be a valid, absolute URI as defined // by RFC 3986 bool uri = 17; // UriRef specifies that the field must be a valid URI as defined by RFC // 3986 and may be relative or absolute. bool uri_ref = 18; // Address specifies that the field must be either a valid hostname as // defined by RFC 1034 (which does not support internationalized domain // names or IDNs), or it can be a valid IP (v4 or v6). bool address = 21; // Uuid specifies that the field must be a valid UUID as defined by // RFC 4122 bool uuid = 22; // WellKnownRegex specifies a common well known pattern defined as a regex. KnownRegex well_known_regex = 24; } // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable // strict header validation. // By default, this is true, and HTTP header validations are RFC-compliant. // Setting to false will enable a looser validations that only disallows // \r\n\0 characters, which can be used to bypass header matching rules. optional bool strict = 25 [default = true]; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 26; } // WellKnownRegex contain some well-known patterns. enum KnownRegex { UNKNOWN = 0; // HTTP header name as defined by RFC 7230. HTTP_HEADER_NAME = 1; // HTTP header value as defined by RFC 7230. HTTP_HEADER_VALUE = 2; } // BytesRules describe the constraints applied to `bytes` values message BytesRules { // Const specifies that this field must be exactly the specified value optional bytes const = 1; // Len specifies that this field must be the specified number of bytes optional uint64 len = 13; // MinLen specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_len = 3; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 4; // Prefix specifies that this field must have the specified bytes at the // beginning of the string. optional bytes prefix = 5; // Suffix specifies that this field must have the specified bytes at the // end of the string. optional bytes suffix = 6; // Contains specifies that this field must have the specified bytes // anywhere in the string. optional bytes contains = 7; // In specifies that this field must be equal to one of the specified // values repeated bytes in = 8; // NotIn specifies that this field cannot be equal to one of the specified // values repeated bytes not_in = 9; // WellKnown rules provide advanced constraints against common byte // patterns oneof well_known { // Ip specifies that the field must be a valid IP (v4 or v6) address in // byte format bool ip = 10; // Ipv4 specifies that the field must be a valid IPv4 address in byte // format bool ipv4 = 11; // Ipv6 specifies that the field must be a valid IPv6 address in byte // format bool ipv6 = 12; } // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 14; } // EnumRules describe the constraints applied to enum values message EnumRules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // DefinedOnly specifies that this field must be only one of the defined // values for this enum, failing on any undefined value. optional bool defined_only = 2; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 3; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 4; } // MessageRules describe the constraints applied to embedded message values. // For message-type fields, validation is performed recursively. message MessageRules { // Skip specifies that the validation rules of this field should not be // evaluated optional bool skip = 1; // Required specifies that this field must be set optional bool required = 2; } // RepeatedRules describe the constraints applied to `repeated` values message RepeatedRules { // MinItems specifies that this field must have the specified number of // items at a minimum optional uint64 min_items = 1; // MaxItems specifies that this field must have the specified number of // items at a maximum optional uint64 max_items = 2; // Unique specifies that all elements in this field must be unique. This // contraint is only applicable to scalar and enum types (messages are not // supported). optional bool unique = 3; // Items specifies the contraints to be applied to each item in the field. // Repeated message fields will still execute validation against each item // unless skip is specified here. optional FieldRules items = 4; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 5; } // MapRules describe the constraints applied to `map` values message MapRules { // MinPairs specifies that this field must have the specified number of // KVs at a minimum optional uint64 min_pairs = 1; // MaxPairs specifies that this field must have the specified number of // KVs at a maximum optional uint64 max_pairs = 2; // NoSparse specifies values in this field cannot be unset. This only // applies to map's with message value types. optional bool no_sparse = 3; // Keys specifies the constraints to be applied to each key in the field. optional FieldRules keys = 4; // Values specifies the constraints to be applied to the value of each key // in the field. Message values will still have their validations evaluated // unless skip is specified here. optional FieldRules values = 5; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 6; } // AnyRules describe constraints applied exclusively to the // `google.protobuf.Any` well-known type message AnyRules { // Required specifies that this field must be set optional bool required = 1; // In specifies that this field's `type_url` must be equal to one of the // specified values. repeated string in = 2; // NotIn specifies that this field's `type_url` must not be equal to any of // the specified values. repeated string not_in = 3; } // DurationRules describe the constraints applied exclusively to the // `google.protobuf.Duration` well-known type message DurationRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Duration const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Duration lt = 3; // Lt specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Duration lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Duration gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Duration gte = 6; // In specifies that this field must be equal to one of the specified // values repeated google.protobuf.Duration in = 7; // NotIn specifies that this field cannot be equal to one of the specified // values repeated google.protobuf.Duration not_in = 8; } // TimestampRules describe the constraints applied exclusively to the // `google.protobuf.Timestamp` well-known type message TimestampRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Timestamp const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Timestamp lt = 3; // Lte specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Timestamp lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Timestamp gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Timestamp gte = 6; // LtNow specifies that this must be less than the current time. LtNow // can only be used with the Within rule. optional bool lt_now = 7; // GtNow specifies that this must be greater than the current time. GtNow // can only be used with the Within rule. optional bool gt_now = 8; // Within specifies that this field must be within this duration of the // current time. This constraint can be used alone or with the LtNow and // GtNow rules. optional google.protobuf.Duration within = 9; } ================================================ FILE: service/cart/.gitignore ================================================ # Reference https://github.com/github/gitignore/blob/master/Go.gitignore # Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Dependency directories (remove the comment below to include it) vendor/ # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # OS General Thumbs.db .DS_Store # project *.cert *.key *.log bin/ # Develop tools .vscode/ .idea/ *.swp ================================================ FILE: service/cart/Dockerfile ================================================ FROM golang:1.16 AS builder COPY . /src WORKDIR /src RUN GOPROXY=https://goproxy.cn make build FROM debian:stable-slim RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/ \ && apt-get autoremove -y && apt-get autoclean -y COPY --from=builder /src/bin /app WORKDIR /app EXPOSE 8000 EXPOSE 9000 VOLUME /data/conf CMD ["./server", "-conf", "/data/conf"] ================================================ FILE: service/cart/LICENSE ================================================ MIT License Copyright (c) 2020 go-kratos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: service/cart/Makefile ================================================ GOPATH:=$(shell go env GOPATH) VERSION=$(shell git describe --tags --always) INTERNAL_PROTO_FILES=$(shell find internal -name *.proto) API_PROTO_FILES=$(shell find api -name *.proto) .PHONY: init # init env init: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest go install github.com/go-kratos/kratos/cmd/kratos/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest go install github.com/google/gnostic/cmd/protoc-gen-openapi@v0.6.1 .PHONY: config # generate internal proto config: protoc --proto_path=./internal \ --proto_path=./third_party \ --go_out=paths=source_relative:./internal \ $(INTERNAL_PROTO_FILES) .PHONY: api # generate api proto api: protoc --proto_path=./api \ --proto_path=./third_party \ --go_out=paths=source_relative:./api \ --go-http_out=paths=source_relative:./api \ --go-grpc_out=paths=source_relative:./api \ --openapi_out==paths=source_relative:. \ --validate_out=paths=source_relative,lang=go:./api \ $(API_PROTO_FILES) .PHONY: build # build build: mkdir -p bin/ && go build -ldflags "-X main.Version=$(VERSION)" -o ./bin/ ./... .PHONY: generate # generate generate: go mod tidy go get github.com/google/wire/cmd/wire@latest go generate ./... .PHONY: wire # wire wire: cd cmd/cart && wire .PHONY: all # generate all all: make api; make config; make generate; # show help help: @echo '' @echo 'Usage:' @echo ' make [target]' @echo '' @echo 'Targets:' @awk '/^[a-zA-Z\-\_0-9]+:/ { \ helpMessage = match(lastLine, /^# (.*)/); \ if (helpMessage) { \ helpCommand = substr($$1, 0, index($$1, ":")-1); \ helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ } \ } \ { lastLine = $$0 }' $(MAKEFILE_LIST) .DEFAULT_GOAL := help ================================================ FILE: service/cart/README.md ================================================ # Kratos Project Template ## Install Kratos ``` go install github.com/go-kratos/kratos/cmd/kratos/v2@latest ``` ## Create a service ``` # Create a template project kratos new server cd server # Add a proto template kratos proto add api/server/server.proto # Generate the proto code kratos proto client api/server/server.proto # Generate the source code of service by proto file kratos proto server api/server/server.proto -t internal/service go generate ./... go build -o ./bin/ ./... ./bin/server -conf ./configs ``` ## Generate other auxiliary files by Makefile ``` # Download and update dependencies make init # Generate API files (include: pb.go, http, grpc, validate, swagger) by proto file make api # Generate all files make all ``` ## Automated Initialization (wire) ``` # install wire go get github.com/google/wire/cmd/wire # generate wire cd cmd/server wire ``` ## Docker ```bash # build docker build -t . # run docker run --rm -p 8000:8000 -p 9000:9000 -v :/data/conf ``` ================================================ FILE: service/cart/api/cart/v1/cart.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: cart/v1/cart.proto package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type CartInfoReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` GoodsId int64 `protobuf:"varint,3,opt,name=goodsId,proto3" json:"goodsId,omitempty"` GoodsSn string `protobuf:"bytes,4,opt,name=goodsSn,proto3" json:"goodsSn,omitempty"` GoodsName string `protobuf:"bytes,5,opt,name=goodsName,proto3" json:"goodsName,omitempty"` SkuId int64 `protobuf:"varint,6,opt,name=skuId,proto3" json:"skuId,omitempty"` GoodsPrice int64 `protobuf:"varint,7,opt,name=goodsPrice,proto3" json:"goodsPrice,omitempty"` GoodsNum int32 `protobuf:"varint,8,opt,name=goodsNum,proto3" json:"goodsNum,omitempty"` IsSelect bool `protobuf:"varint,9,opt,name=isSelect,proto3" json:"isSelect,omitempty"` } func (x *CartInfoReply) Reset() { *x = CartInfoReply{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CartInfoReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*CartInfoReply) ProtoMessage() {} func (x *CartInfoReply) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_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 CartInfoReply.ProtoReflect.Descriptor instead. func (*CartInfoReply) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{0} } func (x *CartInfoReply) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *CartInfoReply) GetUserId() int64 { if x != nil { return x.UserId } return 0 } func (x *CartInfoReply) GetGoodsId() int64 { if x != nil { return x.GoodsId } return 0 } func (x *CartInfoReply) GetGoodsSn() string { if x != nil { return x.GoodsSn } return "" } func (x *CartInfoReply) GetGoodsName() string { if x != nil { return x.GoodsName } return "" } func (x *CartInfoReply) GetSkuId() int64 { if x != nil { return x.SkuId } return 0 } func (x *CartInfoReply) GetGoodsPrice() int64 { if x != nil { return x.GoodsPrice } return 0 } func (x *CartInfoReply) GetGoodsNum() int32 { if x != nil { return x.GoodsNum } return 0 } func (x *CartInfoReply) GetIsSelect() bool { if x != nil { return x.IsSelect } return false } type CreateCartRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` GoodsId int64 `protobuf:"varint,3,opt,name=goodsId,proto3" json:"goodsId,omitempty"` GoodsSn string `protobuf:"bytes,4,opt,name=goodsSn,proto3" json:"goodsSn,omitempty"` GoodsName string `protobuf:"bytes,5,opt,name=goodsName,proto3" json:"goodsName,omitempty"` SkuId int64 `protobuf:"varint,6,opt,name=skuId,proto3" json:"skuId,omitempty"` GoodsPrice int64 `protobuf:"varint,7,opt,name=goodsPrice,proto3" json:"goodsPrice,omitempty"` GoodsNum int32 `protobuf:"varint,8,opt,name=goodsNum,proto3" json:"goodsNum,omitempty"` IsSelect bool `protobuf:"varint,9,opt,name=isSelect,proto3" json:"isSelect,omitempty"` } func (x *CreateCartRequest) Reset() { *x = CreateCartRequest{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateCartRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateCartRequest) ProtoMessage() {} func (x *CreateCartRequest) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_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 CreateCartRequest.ProtoReflect.Descriptor instead. func (*CreateCartRequest) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{1} } func (x *CreateCartRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *CreateCartRequest) GetUserId() int64 { if x != nil { return x.UserId } return 0 } func (x *CreateCartRequest) GetGoodsId() int64 { if x != nil { return x.GoodsId } return 0 } func (x *CreateCartRequest) GetGoodsSn() string { if x != nil { return x.GoodsSn } return "" } func (x *CreateCartRequest) GetGoodsName() string { if x != nil { return x.GoodsName } return "" } func (x *CreateCartRequest) GetSkuId() int64 { if x != nil { return x.SkuId } return 0 } func (x *CreateCartRequest) GetGoodsPrice() int64 { if x != nil { return x.GoodsPrice } return 0 } func (x *CreateCartRequest) GetGoodsNum() int32 { if x != nil { return x.GoodsNum } return 0 } func (x *CreateCartRequest) GetIsSelect() bool { if x != nil { return x.IsSelect } return false } type UpdateCartRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` GoodsNum int32 `protobuf:"varint,2,opt,name=goodsNum,proto3" json:"goodsNum,omitempty"` } func (x *UpdateCartRequest) Reset() { *x = UpdateCartRequest{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateCartRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateCartRequest) ProtoMessage() {} func (x *UpdateCartRequest) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_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 UpdateCartRequest.ProtoReflect.Descriptor instead. func (*UpdateCartRequest) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{2} } func (x *UpdateCartRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UpdateCartRequest) GetGoodsNum() int32 { if x != nil { return x.GoodsNum } return 0 } type UpdateCartReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *UpdateCartReply) Reset() { *x = UpdateCartReply{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateCartReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateCartReply) ProtoMessage() {} func (x *UpdateCartReply) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_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 UpdateCartReply.ProtoReflect.Descriptor instead. func (*UpdateCartReply) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{3} } type CheckResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } func (x *CheckResponse) Reset() { *x = CheckResponse{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CheckResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CheckResponse) ProtoMessage() {} func (x *CheckResponse) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead. func (*CheckResponse) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{4} } func (x *CheckResponse) GetSuccess() bool { if x != nil { return x.Success } return false } type DeleteCartRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *DeleteCartRequest) Reset() { *x = DeleteCartRequest{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *DeleteCartRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*DeleteCartRequest) ProtoMessage() {} func (x *DeleteCartRequest) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use DeleteCartRequest.ProtoReflect.Descriptor instead. func (*DeleteCartRequest) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{5} } type DeleteCartReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *DeleteCartReply) Reset() { *x = DeleteCartReply{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *DeleteCartReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*DeleteCartReply) ProtoMessage() {} func (x *DeleteCartReply) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[6] 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 DeleteCartReply.ProtoReflect.Descriptor instead. func (*DeleteCartReply) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{6} } type GetCartRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *GetCartRequest) Reset() { *x = GetCartRequest{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GetCartRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*GetCartRequest) ProtoMessage() {} func (x *GetCartRequest) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[7] 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 GetCartRequest.ProtoReflect.Descriptor instead. func (*GetCartRequest) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{7} } type GetCartReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *GetCartReply) Reset() { *x = GetCartReply{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GetCartReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*GetCartReply) ProtoMessage() {} func (x *GetCartReply) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[8] 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 GetCartReply.ProtoReflect.Descriptor instead. func (*GetCartReply) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{8} } type ListCartRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` } func (x *ListCartRequest) Reset() { *x = ListCartRequest{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListCartRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListCartRequest) ProtoMessage() {} func (x *ListCartRequest) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[9] 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 ListCartRequest.ProtoReflect.Descriptor instead. func (*ListCartRequest) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{9} } func (x *ListCartRequest) GetUserId() int64 { if x != nil { return x.UserId } return 0 } type CartListReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Results []*CartInfoReply `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } func (x *CartListReply) Reset() { *x = CartListReply{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CartListReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*CartListReply) ProtoMessage() {} func (x *CartListReply) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[10] 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 CartListReply.ProtoReflect.Descriptor instead. func (*CartListReply) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{10} } func (x *CartListReply) GetResults() []*CartInfoReply { if x != nil { return x.Results } return nil } var File_cart_v1_cart_proto protoreflect.FileDescriptor var file_cart_v1_cart_proto_rawDesc = []byte{ 0x0a, 0x12, 0x63, 0x61, 0x72, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 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, 0xf7, 0x01, 0x0a, 0x0d, 0x43, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x22, 0xc3, 0x02, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x12, 0x25, 0x0a, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x23, 0x0a, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x6a, 0x02, 0x08, 0x01, 0x52, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x22, 0x3f, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x29, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x13, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x11, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x29, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x0d, 0x43, 0x61, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x32, 0x8a, 0x02, 0x0a, 0x04, 0x43, 0x61, 0x72, 0x74, 0x12, 0x40, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x12, 0x1a, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x40, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x12, 0x1a, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x12, 0x1a, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x72, 0x74, 0x12, 0x18, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x15, 0x5a, 0x13, 0x63, 0x61, 0x72, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x61, 0x72, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_cart_v1_cart_proto_rawDescOnce sync.Once file_cart_v1_cart_proto_rawDescData = file_cart_v1_cart_proto_rawDesc ) func file_cart_v1_cart_proto_rawDescGZIP() []byte { file_cart_v1_cart_proto_rawDescOnce.Do(func() { file_cart_v1_cart_proto_rawDescData = protoimpl.X.CompressGZIP(file_cart_v1_cart_proto_rawDescData) }) return file_cart_v1_cart_proto_rawDescData } var file_cart_v1_cart_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_cart_v1_cart_proto_goTypes = []interface{}{ (*CartInfoReply)(nil), // 0: cart.v1.CartInfoReply (*CreateCartRequest)(nil), // 1: cart.v1.CreateCartRequest (*UpdateCartRequest)(nil), // 2: cart.v1.UpdateCartRequest (*UpdateCartReply)(nil), // 3: cart.v1.UpdateCartReply (*CheckResponse)(nil), // 4: cart.v1.CheckResponse (*DeleteCartRequest)(nil), // 5: cart.v1.DeleteCartRequest (*DeleteCartReply)(nil), // 6: cart.v1.DeleteCartReply (*GetCartRequest)(nil), // 7: cart.v1.GetCartRequest (*GetCartReply)(nil), // 8: cart.v1.GetCartReply (*ListCartRequest)(nil), // 9: cart.v1.ListCartRequest (*CartListReply)(nil), // 10: cart.v1.CartListReply } var file_cart_v1_cart_proto_depIdxs = []int32{ 0, // 0: cart.v1.CartListReply.results:type_name -> cart.v1.CartInfoReply 1, // 1: cart.v1.Cart.CreateCart:input_type -> cart.v1.CreateCartRequest 2, // 2: cart.v1.Cart.UpdateCart:input_type -> cart.v1.UpdateCartRequest 5, // 3: cart.v1.Cart.DeleteCart:input_type -> cart.v1.DeleteCartRequest 9, // 4: cart.v1.Cart.ListCart:input_type -> cart.v1.ListCartRequest 0, // 5: cart.v1.Cart.CreateCart:output_type -> cart.v1.CartInfoReply 4, // 6: cart.v1.Cart.UpdateCart:output_type -> cart.v1.CheckResponse 4, // 7: cart.v1.Cart.DeleteCart:output_type -> cart.v1.CheckResponse 10, // 8: cart.v1.Cart.ListCart:output_type -> cart.v1.CartListReply 5, // [5:9] is the sub-list for method output_type 1, // [1:5] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name } func init() { file_cart_v1_cart_proto_init() } func file_cart_v1_cart_proto_init() { if File_cart_v1_cart_proto != nil { return } if !protoimpl.UnsafeEnabled { file_cart_v1_cart_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CartInfoReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateCartRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateCartRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateCartReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteCartRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteCartReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCartRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCartReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListCartRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CartListReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cart_v1_cart_proto_rawDesc, NumEnums: 0, NumMessages: 11, NumExtensions: 0, NumServices: 1, }, GoTypes: file_cart_v1_cart_proto_goTypes, DependencyIndexes: file_cart_v1_cart_proto_depIdxs, MessageInfos: file_cart_v1_cart_proto_msgTypes, }.Build() File_cart_v1_cart_proto = out.File file_cart_v1_cart_proto_rawDesc = nil file_cart_v1_cart_proto_goTypes = nil file_cart_v1_cart_proto_depIdxs = nil } ================================================ FILE: service/cart/api/cart/v1/cart.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: cart/v1/cart.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on CartInfoReply 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 *CartInfoReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CartInfoReply 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 CartInfoReplyMultiError, or // nil if none found. func (m *CartInfoReply) ValidateAll() error { return m.validate(true) } func (m *CartInfoReply) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for UserId // no validation rules for GoodsId // no validation rules for GoodsSn // no validation rules for GoodsName // no validation rules for SkuId // no validation rules for GoodsPrice // no validation rules for GoodsNum // no validation rules for IsSelect if len(errors) > 0 { return CartInfoReplyMultiError(errors) } return nil } // CartInfoReplyMultiError is an error wrapping multiple validation errors // returned by CartInfoReply.ValidateAll() if the designated constraints // aren't met. type CartInfoReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CartInfoReplyMultiError) 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 CartInfoReplyMultiError) AllErrors() []error { return m } // CartInfoReplyValidationError is the validation error returned by // CartInfoReply.Validate if the designated constraints aren't met. type CartInfoReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CartInfoReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CartInfoReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CartInfoReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CartInfoReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CartInfoReplyValidationError) ErrorName() string { return "CartInfoReplyValidationError" } // Error satisfies the builtin error interface func (e CartInfoReplyValidationError) 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 %sCartInfoReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CartInfoReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CartInfoReplyValidationError{} // Validate checks the field values on CreateCartRequest 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 *CreateCartRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateCartRequest 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 // CreateCartRequestMultiError, or nil if none found. func (m *CreateCartRequest) ValidateAll() error { return m.validate(true) } func (m *CreateCartRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetUserId() <= 0 { err := CreateCartRequestValidationError{ field: "UserId", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if m.GetGoodsId() <= 0 { err := CreateCartRequestValidationError{ field: "GoodsId", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetGoodsSn()) < 1 { err := CreateCartRequestValidationError{ field: "GoodsSn", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetGoodsName()) < 1 { err := CreateCartRequestValidationError{ field: "GoodsName", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if m.GetSkuId() <= 0 { err := CreateCartRequestValidationError{ field: "SkuId", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if m.GetGoodsPrice() <= 0 { err := CreateCartRequestValidationError{ field: "GoodsPrice", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if m.GetGoodsNum() <= 0 { err := CreateCartRequestValidationError{ field: "GoodsNum", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if m.GetIsSelect() != true { err := CreateCartRequestValidationError{ field: "IsSelect", reason: "value must equal true", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return CreateCartRequestMultiError(errors) } return nil } // CreateCartRequestMultiError is an error wrapping multiple validation errors // returned by CreateCartRequest.ValidateAll() if the designated constraints // aren't met. type CreateCartRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateCartRequestMultiError) 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 CreateCartRequestMultiError) AllErrors() []error { return m } // CreateCartRequestValidationError is the validation error returned by // CreateCartRequest.Validate if the designated constraints aren't met. type CreateCartRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateCartRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateCartRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateCartRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateCartRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateCartRequestValidationError) ErrorName() string { return "CreateCartRequestValidationError" } // Error satisfies the builtin error interface func (e CreateCartRequestValidationError) 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 %sCreateCartRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateCartRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateCartRequestValidationError{} // Validate checks the field values on UpdateCartRequest 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 *UpdateCartRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateCartRequest 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 // UpdateCartRequestMultiError, or nil if none found. func (m *UpdateCartRequest) ValidateAll() error { return m.validate(true) } func (m *UpdateCartRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for GoodsNum if len(errors) > 0 { return UpdateCartRequestMultiError(errors) } return nil } // UpdateCartRequestMultiError is an error wrapping multiple validation errors // returned by UpdateCartRequest.ValidateAll() if the designated constraints // aren't met. type UpdateCartRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateCartRequestMultiError) 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 UpdateCartRequestMultiError) AllErrors() []error { return m } // UpdateCartRequestValidationError is the validation error returned by // UpdateCartRequest.Validate if the designated constraints aren't met. type UpdateCartRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateCartRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateCartRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateCartRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateCartRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateCartRequestValidationError) ErrorName() string { return "UpdateCartRequestValidationError" } // Error satisfies the builtin error interface func (e UpdateCartRequestValidationError) 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 %sUpdateCartRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateCartRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateCartRequestValidationError{} // Validate checks the field values on UpdateCartReply 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 *UpdateCartReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateCartReply 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 // UpdateCartReplyMultiError, or nil if none found. func (m *UpdateCartReply) ValidateAll() error { return m.validate(true) } func (m *UpdateCartReply) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return UpdateCartReplyMultiError(errors) } return nil } // UpdateCartReplyMultiError is an error wrapping multiple validation errors // returned by UpdateCartReply.ValidateAll() if the designated constraints // aren't met. type UpdateCartReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateCartReplyMultiError) 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 UpdateCartReplyMultiError) AllErrors() []error { return m } // UpdateCartReplyValidationError is the validation error returned by // UpdateCartReply.Validate if the designated constraints aren't met. type UpdateCartReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateCartReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateCartReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateCartReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateCartReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateCartReplyValidationError) ErrorName() string { return "UpdateCartReplyValidationError" } // Error satisfies the builtin error interface func (e UpdateCartReplyValidationError) 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 %sUpdateCartReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateCartReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateCartReplyValidationError{} // Validate checks the field values on CheckResponse 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 *CheckResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CheckResponse 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 CheckResponseMultiError, or // nil if none found. func (m *CheckResponse) ValidateAll() error { return m.validate(true) } func (m *CheckResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Success if len(errors) > 0 { return CheckResponseMultiError(errors) } return nil } // CheckResponseMultiError is an error wrapping multiple validation errors // returned by CheckResponse.ValidateAll() if the designated constraints // aren't met. type CheckResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CheckResponseMultiError) 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 CheckResponseMultiError) AllErrors() []error { return m } // CheckResponseValidationError is the validation error returned by // CheckResponse.Validate if the designated constraints aren't met. type CheckResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CheckResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CheckResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CheckResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CheckResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CheckResponseValidationError) ErrorName() string { return "CheckResponseValidationError" } // Error satisfies the builtin error interface func (e CheckResponseValidationError) 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 %sCheckResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CheckResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CheckResponseValidationError{} // Validate checks the field values on DeleteCartRequest 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 *DeleteCartRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on DeleteCartRequest 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 // DeleteCartRequestMultiError, or nil if none found. func (m *DeleteCartRequest) ValidateAll() error { return m.validate(true) } func (m *DeleteCartRequest) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return DeleteCartRequestMultiError(errors) } return nil } // DeleteCartRequestMultiError is an error wrapping multiple validation errors // returned by DeleteCartRequest.ValidateAll() if the designated constraints // aren't met. type DeleteCartRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m DeleteCartRequestMultiError) 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 DeleteCartRequestMultiError) AllErrors() []error { return m } // DeleteCartRequestValidationError is the validation error returned by // DeleteCartRequest.Validate if the designated constraints aren't met. type DeleteCartRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e DeleteCartRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e DeleteCartRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e DeleteCartRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e DeleteCartRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e DeleteCartRequestValidationError) ErrorName() string { return "DeleteCartRequestValidationError" } // Error satisfies the builtin error interface func (e DeleteCartRequestValidationError) 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 %sDeleteCartRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = DeleteCartRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = DeleteCartRequestValidationError{} // Validate checks the field values on DeleteCartReply 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 *DeleteCartReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on DeleteCartReply 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 // DeleteCartReplyMultiError, or nil if none found. func (m *DeleteCartReply) ValidateAll() error { return m.validate(true) } func (m *DeleteCartReply) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return DeleteCartReplyMultiError(errors) } return nil } // DeleteCartReplyMultiError is an error wrapping multiple validation errors // returned by DeleteCartReply.ValidateAll() if the designated constraints // aren't met. type DeleteCartReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m DeleteCartReplyMultiError) 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 DeleteCartReplyMultiError) AllErrors() []error { return m } // DeleteCartReplyValidationError is the validation error returned by // DeleteCartReply.Validate if the designated constraints aren't met. type DeleteCartReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e DeleteCartReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e DeleteCartReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e DeleteCartReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e DeleteCartReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e DeleteCartReplyValidationError) ErrorName() string { return "DeleteCartReplyValidationError" } // Error satisfies the builtin error interface func (e DeleteCartReplyValidationError) 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 %sDeleteCartReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = DeleteCartReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = DeleteCartReplyValidationError{} // Validate checks the field values on GetCartRequest 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 *GetCartRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GetCartRequest 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 GetCartRequestMultiError, // or nil if none found. func (m *GetCartRequest) ValidateAll() error { return m.validate(true) } func (m *GetCartRequest) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return GetCartRequestMultiError(errors) } return nil } // GetCartRequestMultiError is an error wrapping multiple validation errors // returned by GetCartRequest.ValidateAll() if the designated constraints // aren't met. type GetCartRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GetCartRequestMultiError) 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 GetCartRequestMultiError) AllErrors() []error { return m } // GetCartRequestValidationError is the validation error returned by // GetCartRequest.Validate if the designated constraints aren't met. type GetCartRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GetCartRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GetCartRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GetCartRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GetCartRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GetCartRequestValidationError) ErrorName() string { return "GetCartRequestValidationError" } // Error satisfies the builtin error interface func (e GetCartRequestValidationError) 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 %sGetCartRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GetCartRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GetCartRequestValidationError{} // Validate checks the field values on GetCartReply 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 *GetCartReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GetCartReply 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 GetCartReplyMultiError, or // nil if none found. func (m *GetCartReply) ValidateAll() error { return m.validate(true) } func (m *GetCartReply) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return GetCartReplyMultiError(errors) } return nil } // GetCartReplyMultiError is an error wrapping multiple validation errors // returned by GetCartReply.ValidateAll() if the designated constraints aren't met. type GetCartReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GetCartReplyMultiError) 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 GetCartReplyMultiError) AllErrors() []error { return m } // GetCartReplyValidationError is the validation error returned by // GetCartReply.Validate if the designated constraints aren't met. type GetCartReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GetCartReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GetCartReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GetCartReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GetCartReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GetCartReplyValidationError) ErrorName() string { return "GetCartReplyValidationError" } // Error satisfies the builtin error interface func (e GetCartReplyValidationError) 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 %sGetCartReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GetCartReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GetCartReplyValidationError{} // Validate checks the field values on ListCartRequest 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 *ListCartRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListCartRequest 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 // ListCartRequestMultiError, or nil if none found. func (m *ListCartRequest) ValidateAll() error { return m.validate(true) } func (m *ListCartRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for UserId if len(errors) > 0 { return ListCartRequestMultiError(errors) } return nil } // ListCartRequestMultiError is an error wrapping multiple validation errors // returned by ListCartRequest.ValidateAll() if the designated constraints // aren't met. type ListCartRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListCartRequestMultiError) 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 ListCartRequestMultiError) AllErrors() []error { return m } // ListCartRequestValidationError is the validation error returned by // ListCartRequest.Validate if the designated constraints aren't met. type ListCartRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListCartRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListCartRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListCartRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListCartRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListCartRequestValidationError) ErrorName() string { return "ListCartRequestValidationError" } // Error satisfies the builtin error interface func (e ListCartRequestValidationError) 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 %sListCartRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListCartRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListCartRequestValidationError{} // Validate checks the field values on CartListReply 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 *CartListReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CartListReply 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 CartListReplyMultiError, or // nil if none found. func (m *CartListReply) ValidateAll() error { return m.validate(true) } func (m *CartListReply) validate(all bool) error { if m == nil { return nil } var errors []error for idx, item := range m.GetResults() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CartListReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CartListReplyValidationError{ field: fmt.Sprintf("Results[%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 CartListReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return CartListReplyMultiError(errors) } return nil } // CartListReplyMultiError is an error wrapping multiple validation errors // returned by CartListReply.ValidateAll() if the designated constraints // aren't met. type CartListReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CartListReplyMultiError) 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 CartListReplyMultiError) AllErrors() []error { return m } // CartListReplyValidationError is the validation error returned by // CartListReply.Validate if the designated constraints aren't met. type CartListReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CartListReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CartListReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CartListReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CartListReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CartListReplyValidationError) ErrorName() string { return "CartListReplyValidationError" } // Error satisfies the builtin error interface func (e CartListReplyValidationError) 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 %sCartListReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CartListReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CartListReplyValidationError{} ================================================ FILE: service/cart/api/cart/v1/cart.proto ================================================ syntax = "proto3"; package cart.v1; import "validate/validate.proto"; option go_package = "cart/api/cart/v1;v1"; // 购物车 service Cart { rpc CreateCart (CreateCartRequest) returns (CartInfoReply); // 添加商品进购物车 rpc UpdateCart (UpdateCartRequest) returns (CheckResponse); // 修改购物车商品数量 rpc DeleteCart (DeleteCartRequest) returns (CheckResponse); // 删除购物车商品 rpc ListCart (ListCartRequest) returns (CartListReply); // 购物车商品列表 } message CartInfoReply { int64 id = 1; int64 userId = 2; int64 goodsId = 3; string goodsSn = 4; string goodsName = 5; int64 skuId = 6; int64 goodsPrice = 7; int32 goodsNum = 8; bool isSelect = 9; } message CreateCartRequest { int64 id = 1; int64 userId = 2 [(validate.rules).int64 = {gt:0}]; int64 goodsId = 3 [(validate.rules).int64 = {gt:0}]; string goodsSn = 4 [(validate.rules).string.min_len = 1]; string goodsName = 5 [(validate.rules).string.min_len = 1]; int64 skuId = 6 [(validate.rules).int64 = {gt:0}]; int64 goodsPrice = 7 [(validate.rules).int64 = {gt:0}]; int32 goodsNum = 8 [(validate.rules).int32 = {gt:0}]; bool isSelect = 9 [(validate.rules).bool.const = true]; } message UpdateCartRequest { int64 id = 1; int32 goodsNum = 2; } message UpdateCartReply {} message CheckResponse{ bool success = 1; } message DeleteCartRequest {} message DeleteCartReply {} message GetCartRequest {} message GetCartReply {} message ListCartRequest { int64 userId = 1; } message CartListReply { repeated CartInfoReply results = 1; } ================================================ FILE: service/cart/api/cart/v1/cart_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 // source: cart/v1/cart.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // CartClient is the client API for Cart service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type CartClient interface { CreateCart(ctx context.Context, in *CreateCartRequest, opts ...grpc.CallOption) (*CartInfoReply, error) UpdateCart(ctx context.Context, in *UpdateCartRequest, opts ...grpc.CallOption) (*CheckResponse, error) DeleteCart(ctx context.Context, in *DeleteCartRequest, opts ...grpc.CallOption) (*CheckResponse, error) ListCart(ctx context.Context, in *ListCartRequest, opts ...grpc.CallOption) (*CartListReply, error) } type cartClient struct { cc grpc.ClientConnInterface } func NewCartClient(cc grpc.ClientConnInterface) CartClient { return &cartClient{cc} } func (c *cartClient) CreateCart(ctx context.Context, in *CreateCartRequest, opts ...grpc.CallOption) (*CartInfoReply, error) { out := new(CartInfoReply) err := c.cc.Invoke(ctx, "/cart.v1.Cart/CreateCart", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *cartClient) UpdateCart(ctx context.Context, in *UpdateCartRequest, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/cart.v1.Cart/UpdateCart", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *cartClient) DeleteCart(ctx context.Context, in *DeleteCartRequest, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/cart.v1.Cart/DeleteCart", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *cartClient) ListCart(ctx context.Context, in *ListCartRequest, opts ...grpc.CallOption) (*CartListReply, error) { out := new(CartListReply) err := c.cc.Invoke(ctx, "/cart.v1.Cart/ListCart", in, out, opts...) if err != nil { return nil, err } return out, nil } // CartServer is the server API for Cart service. // All implementations must embed UnimplementedCartServer // for forward compatibility type CartServer interface { CreateCart(context.Context, *CreateCartRequest) (*CartInfoReply, error) UpdateCart(context.Context, *UpdateCartRequest) (*CheckResponse, error) DeleteCart(context.Context, *DeleteCartRequest) (*CheckResponse, error) ListCart(context.Context, *ListCartRequest) (*CartListReply, error) mustEmbedUnimplementedCartServer() } // UnimplementedCartServer must be embedded to have forward compatible implementations. type UnimplementedCartServer struct { } func (UnimplementedCartServer) CreateCart(context.Context, *CreateCartRequest) (*CartInfoReply, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateCart not implemented") } func (UnimplementedCartServer) UpdateCart(context.Context, *UpdateCartRequest) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateCart not implemented") } func (UnimplementedCartServer) DeleteCart(context.Context, *DeleteCartRequest) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteCart not implemented") } func (UnimplementedCartServer) ListCart(context.Context, *ListCartRequest) (*CartListReply, error) { return nil, status.Errorf(codes.Unimplemented, "method ListCart not implemented") } func (UnimplementedCartServer) mustEmbedUnimplementedCartServer() {} // UnsafeCartServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to CartServer will // result in compilation errors. type UnsafeCartServer interface { mustEmbedUnimplementedCartServer() } func RegisterCartServer(s grpc.ServiceRegistrar, srv CartServer) { s.RegisterService(&Cart_ServiceDesc, srv) } func _Cart_CreateCart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateCartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(CartServer).CreateCart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/cart.v1.Cart/CreateCart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CartServer).CreateCart(ctx, req.(*CreateCartRequest)) } return interceptor(ctx, in, info, handler) } func _Cart_UpdateCart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateCartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(CartServer).UpdateCart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/cart.v1.Cart/UpdateCart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CartServer).UpdateCart(ctx, req.(*UpdateCartRequest)) } return interceptor(ctx, in, info, handler) } func _Cart_DeleteCart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteCartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(CartServer).DeleteCart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/cart.v1.Cart/DeleteCart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CartServer).DeleteCart(ctx, req.(*DeleteCartRequest)) } return interceptor(ctx, in, info, handler) } func _Cart_ListCart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListCartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(CartServer).ListCart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/cart.v1.Cart/ListCart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CartServer).ListCart(ctx, req.(*ListCartRequest)) } return interceptor(ctx, in, info, handler) } // Cart_ServiceDesc is the grpc.ServiceDesc for Cart service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Cart_ServiceDesc = grpc.ServiceDesc{ ServiceName: "cart.v1.Cart", HandlerType: (*CartServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateCart", Handler: _Cart_CreateCart_Handler, }, { MethodName: "UpdateCart", Handler: _Cart_UpdateCart_Handler, }, { MethodName: "DeleteCart", Handler: _Cart_DeleteCart_Handler, }, { MethodName: "ListCart", Handler: _Cart_ListCart_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cart/v1/cart.proto", } ================================================ FILE: service/cart/cmd/cart/main.go ================================================ package main import ( "flag" "github.com/go-kratos/kratos/v2/registry" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/exporters/jaeger" "go.opentelemetry.io/otel/sdk/resource" tracesdk "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" "os" "cart/internal/conf" "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/transport/grpc" ) // go build -ldflags "-X main.Version=x.y.z" var ( // Name is the name of the compiled software. Name = "shop.cart.service" // Version is the version of the compiled software. Version string // flagconf is the config flag. flagconf string id, _ = os.Hostname() ) func init() { flag.StringVar(&flagconf, "conf", "../../configs", "config path, eg: -conf config.yaml") } func newApp(logger log.Logger, gs *grpc.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.ID(id+"cart service"), kratos.Name(Name), kratos.Version(Version), kratos.Metadata(map[string]string{}), kratos.Logger(logger), kratos.Server( gs, ), kratos.Registrar(rr), ) } // Set global trace provider func setTracerProvider(url string) error { // Create the Jaeger exporter exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url))) if err != nil { return err } tp := tracesdk.NewTracerProvider( // Set the sampling rate based on the parent span to 100% tracesdk.WithSampler(tracesdk.ParentBased(tracesdk.TraceIDRatioBased(1.0))), // Always be sure to batch in production. tracesdk.WithBatcher(exp), // Record information about this application in an Resource. tracesdk.WithResource(resource.NewSchemaless( semconv.ServiceNameKey.String(Name), attribute.String("env", "dev"), )), ) otel.SetTracerProvider(tp) return nil } func main() { flag.Parse() logger := log.With(log.NewStdLogger(os.Stdout), "ts", log.DefaultTimestamp, "caller", log.DefaultCaller, "service.id", id, "service.name", Name, "service.version", Version, "trace_id", tracing.TraceID(), "span_id", tracing.SpanID(), ) c := config.New( config.WithSource( file.NewSource(flagconf), ), ) defer c.Close() if err := c.Load(); err != nil { panic(err) } var bc conf.Bootstrap if err := c.Scan(&bc); err != nil { panic(err) } if err := setTracerProvider(bc.Trace.Endpoint); err != nil { panic(err) } var rc conf.Registry if err := c.Scan(&rc); err != nil { panic(err) } app, cleanup, err := initApp(bc.Server, &rc, bc.Data, logger) if err != nil { panic(err) } defer cleanup() // start and wait for stop signal if err := app.Run(); err != nil { panic(err) } } ================================================ FILE: service/cart/cmd/cart/wire.go ================================================ // +build wireinject // The build tag makes sure the stub is not built in the final build. package main import ( "cart/internal/biz" "cart/internal/conf" "cart/internal/data" "cart/internal/server" "cart/internal/service" "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" "github.com/google/wire" ) // wireApp init kratos application. func initApp(*conf.Server,*conf.Registry, *conf.Data, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } ================================================ FILE: service/cart/cmd/cart/wire_gen.go ================================================ // Code generated by Wire. DO NOT EDIT. //go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject package main import ( "cart/internal/biz" "cart/internal/conf" "cart/internal/data" "cart/internal/server" "cart/internal/service" "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" ) // Injectors from wire.go: // wireApp init kratos application. func initApp(confServer *conf.Server, registry *conf.Registry, confData *conf.Data, logger log.Logger) (*kratos.App, func(), error) { db := data.NewDB(confData) client := data.NewRedis(confData) dataData, cleanup, err := data.NewData(confData, logger, db, client) if err != nil { return nil, nil, err } cartRepo := data.NewCartRepo(dataData, logger) cartUsecase := biz.NewCartUsecase(cartRepo, logger) cartService := service.NewCartService(cartUsecase) grpcServer := server.NewGRPCServer(confServer, cartService, logger) registrar := server.NewRegistrar(registry) app := newApp(logger, grpcServer, registrar) return app, func() { cleanup() }, nil } ================================================ FILE: service/cart/configs/config.yaml ================================================ server: http: addr: 0.0.0.0:8000 timeout: 1s grpc: addr: 0.0.0.0:50053 timeout: 1s data: database: driver: mysql source: root:root@tcp(127.0.0.1:3306)/shop_cart?charset=utf8mb4&parseTime=True&loc=Local redis: addr: 127.0.0.1:6379 dial_timeout: 1s read_timeout: 0.2s write_timeout: 0.2s trace: endpoint: http://127.0.0.1:14268/api/traces ================================================ FILE: service/cart/configs/registry.yaml ================================================ consul: address: 127.0.0.1:8500 scheme: http ================================================ FILE: service/cart/go.mod ================================================ module cart go 1.17 require ( github.com/envoyproxy/protoc-gen-validate v0.1.0 github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220414054820-d0b704b8f38d github.com/go-kratos/kratos/v2 v2.2.1 github.com/go-redis/redis/extra/redisotel v0.3.0 github.com/go-redis/redis/v8 v8.11.5 github.com/google/wire v0.5.0 github.com/hashicorp/consul/api v1.12.0 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.18.1 github.com/ory/dockertest/v3 v3.8.1 github.com/pkg/errors v0.9.1 go.opentelemetry.io/otel v1.6.3 go.opentelemetry.io/otel/exporters/jaeger v1.6.3 go.opentelemetry.io/otel/sdk v1.6.3 google.golang.org/grpc v1.44.0 google.golang.org/protobuf v1.27.1 gorm.io/driver/mysql v1.3.3 gorm.io/gorm v1.23.4 ) require ( github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect github.com/Microsoft/go-winio v0.5.1 // indirect github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect github.com/cenkalti/backoff/v4 v4.1.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/cli v20.10.11+incompatible // indirect github.com/docker/docker v20.10.7+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect github.com/fatih/color v1.9.0 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-playground/form/v4 v4.2.0 // indirect github.com/go-redis/redis/extra/rediscmd v0.2.0 // indirect github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.1 // indirect github.com/hashicorp/go-hclog v0.12.0 // indirect github.com/hashicorp/go-immutable-radix v1.0.0 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.0 // indirect github.com/hashicorp/serf v0.9.6 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.4 // indirect github.com/mattn/go-colorable v0.1.6 // indirect github.com/mattn/go-isatty v0.0.12 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.4.1 // indirect github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/opencontainers/go-digest v1.0.0-rc1 // indirect github.com/opencontainers/image-spec v1.0.2 // indirect github.com/opencontainers/runc v1.0.2 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect go.opentelemetry.io/otel/trace v1.6.3 // indirect golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.6 // indirect google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) ================================================ FILE: service/cart/go.sum ================================================ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/cli v20.10.11+incompatible h1:tXU1ezXcruZQRrMP8RN2z9N91h+6egZTS1gsPsKantc= github.com/docker/cli v20.10.11+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v20.10.7+incompatible h1:Z6O9Nhsjv+ayUEeI1IojKbYcsGdgYSNqxe1s2MYzUhQ= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kratos/aegis v0.1.1/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220414054820-d0b704b8f38d h1:fLF0ALNq0KKahsDIJM7OcMwI0h+t4s7ONg1OzxIQ+5A= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220414054820-d0b704b8f38d/go.mod h1:CFHMR6oi+wIEdqxjH4TwKvPlMWUfRY3SMke9++r/dB8= github.com/go-kratos/kratos/v2 v2.2.1 h1:sm29txvyqiQw4v+MftnYWTMgEBjjzWHjrim8kaTVQWE= github.com/go-kratos/kratos/v2 v2.2.1/go.mod h1:yebXu5KMayLjXZzMTY5HWIPRDwcBehHpiNF/Ot8A2pA= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= github.com/go-redis/redis/extra/rediscmd v0.2.0 h1:A3bhCsCKsedClEH9/jYlcKqOuBoeeV+H0yDie5t+a6w= github.com/go-redis/redis/extra/rediscmd v0.2.0/go.mod h1:Z5bP1EHl9PvWhx/DupfCdZwB0JgOO3aVxWc/PFux+BE= github.com/go-redis/redis/extra/redisotel v0.3.0 h1:8rrizwFAUUeMgmelyiQi9KeFwmpQhay9E+/rE6qHsBM= github.com/go-redis/redis/extra/redisotel v0.3.0/go.mod h1:sGV3dQnPMBUuqzowEP2nZPhLXCMeh83nY64yaju249c= github.com/go-redis/redis/v8 v8.3.2/go.mod h1:jszGxBCez8QA1HWSmQxJO9Y82kNibbUmeYhKWrBejTU= github.com/go-redis/redis/v8 v8.5.0/go.mod h1:YmEcgBDttjnkbMzDAhDtQxY9yVA7jMN6PCR5HeMvqFE= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.9.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= 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/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 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-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0 h1:8+567mCcFDnS5ADl7lrpxPMWiFCElyUEeW0gtj34fMA= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6 h1:uuEX1kLR6aoda1TBttmJQKDLZE1Ob7KN0NPdE7EtCDc= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2 h1:hRGSmZu7j271trc9sneMrpOW7GN5ngLm8YUZIPzf394= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/ory/dockertest/v3 v3.8.1 h1:vU/8d1We4qIad2YM0kOwRVtnyue7ExvacPiw1yDm17g= github.com/ory/dockertest/v3 v3.8.1/go.mod h1:wSRQ3wmkz+uSARYMk7kVJFDBGm8x5gSxIhI7NDc+BAQ= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.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 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA= go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel v1.6.3 h1:FLOfo8f9JzFVFVyU+MSRJc2HdEAXQgm7pIv2uFKRSZE= go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI= go.opentelemetry.io/otel/exporters/jaeger v1.6.3 h1:7tvBU1Ydbzq080efuepYYqC1Pv3/vOFBgCSrxLb24d0= go.opentelemetry.io/otel/exporters/jaeger v1.6.3/go.mod h1:YgX3eZWbJzgrNyNHCK0otGreAMBTIAcObtZS2VRi6sU= go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/sdk v1.6.3 h1:prSHYdwCQOX5DrsEzxowH3nLhoAzEBdZhvrR79scfLs= go.opentelemetry.io/otel/sdk v1.6.3/go.mod h1:A4iWF7HTXa+GWL/AaqESz28VuSBIcZ+0CV+IzJ5NMiQ= go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/otel/trace v1.6.3 h1:IqN4L+5b0mPNjdXIiZ90Ni4Bl5BRkDQywePLWemd9bc= go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf h1:SVYXkUz2yZS9FWb2Gm8ivSlbNQzL2Z/NpPKE3RG2jWk= google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.3.3 h1:jXG9ANrwBc4+bMvBcSl8zCfPBaVoPyBEBshA8dA93X8= gorm.io/driver/mysql v1.3.3/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U= gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.4 h1:1BKWM67O6CflSLcwGQR7ccfmC4ebOxQrTfOQGRE9wjg= gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= ================================================ FILE: service/cart/internal/biz/README.md ================================================ # Biz ================================================ FILE: service/cart/internal/biz/biz.go ================================================ package biz import "github.com/google/wire" // ProviderSet is biz providers. var ProviderSet = wire.NewSet(NewCartUsecase) ================================================ FILE: service/cart/internal/biz/cart.go ================================================ package biz import ( "cart/internal/domain" "context" "github.com/go-kratos/kratos/v2/log" ) type CartRepo interface { Create(ctx context.Context, c *domain.ShopCart) (*domain.ShopCart, error) List(ctx context.Context, userId int64) (domain.ShopCartList, error) } type CartUsecase struct { repo CartRepo log *log.Helper } func NewCartUsecase(repo CartRepo, logger log.Logger) *CartUsecase { return &CartUsecase{repo: repo, log: log.NewHelper(logger)} } func (uc *CartUsecase) CreateCart(ctx context.Context, c *domain.ShopCart) (*domain.ShopCart, error) { return uc.repo.Create(ctx, c) } func (uc *CartUsecase) List(ctx context.Context, userId int64) (domain.ShopCartList, error) { return uc.repo.List(ctx, userId) } func (uc *CartUsecase) ListSelected(ctx context.Context, userId int64) (domain.ShopCartList, error) { res, err := uc.repo.List(ctx, userId) if err != nil { return nil, err } res = res.ListSelected() return res, nil } ================================================ FILE: service/cart/internal/conf/conf.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: conf/conf.proto package conf import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Bootstrap struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Trace *Trace `protobuf:"bytes,3,opt,name=trace,proto3" json:"trace,omitempty"` } func (x *Bootstrap) Reset() { *x = Bootstrap{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Bootstrap) String() string { return protoimpl.X.MessageStringOf(x) } func (*Bootstrap) ProtoMessage() {} func (x *Bootstrap) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_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 Bootstrap.ProtoReflect.Descriptor instead. func (*Bootstrap) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{0} } func (x *Bootstrap) GetServer() *Server { if x != nil { return x.Server } return nil } func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data } return nil } func (x *Bootstrap) GetTrace() *Trace { if x != nil { return x.Trace } return nil } type Server struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Http *Server_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` Grpc *Server_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` } func (x *Server) Reset() { *x = Server{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server) ProtoMessage() {} func (x *Server) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_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 Server.ProtoReflect.Descriptor instead. func (*Server) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{1} } func (x *Server) GetHttp() *Server_HTTP { if x != nil { return x.Http } return nil } func (x *Server) GetGrpc() *Server_GRPC { if x != nil { return x.Grpc } return nil } type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` } func (x *Data) Reset() { *x = Data{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data) ProtoMessage() {} func (x *Data) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_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 Data.ProtoReflect.Descriptor instead. func (*Data) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{2} } func (x *Data) GetDatabase() *Data_Database { if x != nil { return x.Database } return nil } func (x *Data) GetRedis() *Data_Redis { if x != nil { return x.Redis } return nil } type Registry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` } func (x *Registry) Reset() { *x = Registry{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry) ProtoMessage() {} func (x *Registry) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_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 Registry.ProtoReflect.Descriptor instead. func (*Registry) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{3} } func (x *Registry) GetConsul() *Registry_Consul { if x != nil { return x.Consul } return nil } type Trace struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Trace) Reset() { *x = Trace{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Trace) String() string { return protoimpl.X.MessageStringOf(x) } func (*Trace) ProtoMessage() {} func (x *Trace) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Trace.ProtoReflect.Descriptor instead. func (*Trace) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{4} } func (x *Trace) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Server_HTTP struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_HTTP) Reset() { *x = Server_HTTP{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_HTTP) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_HTTP) ProtoMessage() {} func (x *Server_HTTP) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Server_HTTP.ProtoReflect.Descriptor instead. func (*Server_HTTP) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{1, 0} } func (x *Server_HTTP) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_HTTP) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_HTTP) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Server_GRPC struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_GRPC) Reset() { *x = Server_GRPC{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_GRPC) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_GRPC) ProtoMessage() {} func (x *Server_GRPC) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[6] 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 Server_GRPC.ProtoReflect.Descriptor instead. func (*Server_GRPC) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{1, 1} } func (x *Server_GRPC) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_GRPC) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_GRPC) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Data_Database struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` } func (x *Data_Database) Reset() { *x = Data_Database{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Database) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Database) ProtoMessage() {} func (x *Data_Database) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[7] 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 Data_Database.ProtoReflect.Descriptor instead. func (*Data_Database) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{2, 0} } func (x *Data_Database) GetDriver() string { if x != nil { return x.Driver } return "" } func (x *Data_Database) GetSource() string { if x != nil { return x.Source } return "" } type Data_Redis struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` Db int32 `protobuf:"varint,4,opt,name=db,proto3" json:"db,omitempty"` DialTimeout *durationpb.Duration `protobuf:"bytes,5,opt,name=dial_timeout,json=dialTimeout,proto3" json:"dial_timeout,omitempty"` ReadTimeout *durationpb.Duration `protobuf:"bytes,6,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"` WriteTimeout *durationpb.Duration `protobuf:"bytes,7,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"` } func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Redis) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[8] 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 Data_Redis.ProtoReflect.Descriptor instead. func (*Data_Redis) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{2, 1} } func (x *Data_Redis) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Data_Redis) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Data_Redis) GetPassword() string { if x != nil { return x.Password } return "" } func (x *Data_Redis) GetDb() int32 { if x != nil { return x.Db } return 0 } func (x *Data_Redis) GetDialTimeout() *durationpb.Duration { if x != nil { return x.DialTimeout } return nil } func (x *Data_Redis) GetReadTimeout() *durationpb.Duration { if x != nil { return x.ReadTimeout } return nil } func (x *Data_Redis) GetWriteTimeout() *durationpb.Duration { if x != nil { return x.WriteTimeout } return nil } type Registry_Consul struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` } func (x *Registry_Consul) Reset() { *x = Registry_Consul{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry_Consul) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry_Consul) ProtoMessage() {} func (x *Registry_Consul) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[9] 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 Registry_Consul.ProtoReflect.Descriptor instead. func (*Registry_Consul) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{3, 0} } func (x *Registry_Consul) GetAddress() string { if x != nil { return x.Address } return "" } func (x *Registry_Consul) GetScheme() string { if x != nil { return x.Scheme } return "" } var File_conf_conf_proto protoreflect.FileDescriptor var file_conf_conf_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x28, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x22, 0xb4, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x29, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x69, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xc3, 0x03, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x33, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x1a, 0x3a, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x9d, 0x02, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x79, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x23, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x63, 0x61, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_conf_conf_proto_rawDescOnce sync.Once file_conf_conf_proto_rawDescData = file_conf_conf_proto_rawDesc ) func file_conf_conf_proto_rawDescGZIP() []byte { file_conf_conf_proto_rawDescOnce.Do(func() { file_conf_conf_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_conf_proto_rawDescData) }) return file_conf_conf_proto_rawDescData } var file_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: cart.api.Bootstrap (*Server)(nil), // 1: cart.api.Server (*Data)(nil), // 2: cart.api.Data (*Registry)(nil), // 3: cart.api.Registry (*Trace)(nil), // 4: cart.api.Trace (*Server_HTTP)(nil), // 5: cart.api.Server.HTTP (*Server_GRPC)(nil), // 6: cart.api.Server.GRPC (*Data_Database)(nil), // 7: cart.api.Data.Database (*Data_Redis)(nil), // 8: cart.api.Data.Redis (*Registry_Consul)(nil), // 9: cart.api.Registry.Consul (*durationpb.Duration)(nil), // 10: google.protobuf.Duration } var file_conf_conf_proto_depIdxs = []int32{ 1, // 0: cart.api.Bootstrap.server:type_name -> cart.api.Server 2, // 1: cart.api.Bootstrap.data:type_name -> cart.api.Data 4, // 2: cart.api.Bootstrap.trace:type_name -> cart.api.Trace 5, // 3: cart.api.Server.http:type_name -> cart.api.Server.HTTP 6, // 4: cart.api.Server.grpc:type_name -> cart.api.Server.GRPC 7, // 5: cart.api.Data.database:type_name -> cart.api.Data.Database 8, // 6: cart.api.Data.redis:type_name -> cart.api.Data.Redis 9, // 7: cart.api.Registry.consul:type_name -> cart.api.Registry.Consul 10, // 8: cart.api.Server.HTTP.timeout:type_name -> google.protobuf.Duration 10, // 9: cart.api.Server.GRPC.timeout:type_name -> google.protobuf.Duration 10, // 10: cart.api.Data.Redis.dial_timeout:type_name -> google.protobuf.Duration 10, // 11: cart.api.Data.Redis.read_timeout:type_name -> google.protobuf.Duration 10, // 12: cart.api.Data.Redis.write_timeout:type_name -> google.protobuf.Duration 13, // [13:13] is the sub-list for method output_type 13, // [13:13] is the sub-list for method input_type 13, // [13:13] is the sub-list for extension type_name 13, // [13:13] is the sub-list for extension extendee 0, // [0:13] is the sub-list for field type_name } func init() { file_conf_conf_proto_init() } func file_conf_conf_proto_init() { if File_conf_conf_proto != nil { return } if !protoimpl.UnsafeEnabled { file_conf_conf_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Bootstrap); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Trace); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_HTTP); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_GRPC); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Database); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry_Consul); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_conf_conf_proto_rawDesc, NumEnums: 0, NumMessages: 10, NumExtensions: 0, NumServices: 0, }, GoTypes: file_conf_conf_proto_goTypes, DependencyIndexes: file_conf_conf_proto_depIdxs, MessageInfos: file_conf_conf_proto_msgTypes, }.Build() File_conf_conf_proto = out.File file_conf_conf_proto_rawDesc = nil file_conf_conf_proto_goTypes = nil file_conf_conf_proto_depIdxs = nil } ================================================ FILE: service/cart/internal/conf/conf.proto ================================================ syntax = "proto3"; package cart.api; option go_package = "cart/internal/conf;conf"; import "google/protobuf/duration.proto"; message Bootstrap { Server server = 1; Data data = 2; Trace trace = 3; } message Server { message HTTP { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } message GRPC { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } HTTP http = 1; GRPC grpc = 2; } message Data { message Database { string driver = 1; string source = 2; } message Redis { string network = 1; string addr = 2; string password = 3; int32 db = 4; google.protobuf.Duration dial_timeout = 5; google.protobuf.Duration read_timeout = 6; google.protobuf.Duration write_timeout = 7; } Database database = 1; Redis redis = 2; } message Registry { message Consul { string address = 1; string scheme = 2; } Consul consul = 1; } message Trace { string endpoint = 1; } ================================================ FILE: service/cart/internal/data/README.md ================================================ # Data ================================================ FILE: service/cart/internal/data/cart.go ================================================ package data import ( "cart/internal/domain" "context" "time" "github.com/go-kratos/kratos/v2/errors" "gorm.io/gorm" "cart/internal/biz" "github.com/go-kratos/kratos/v2/log" ) type ShopCart struct { ID int64 `gorm:"primarykey;type:int" json:"id"` UserId int64 `gorm:"type:int;not null;comment:用户id" json:"user_id"` GoodsId int64 `gorm:"type:int;not null;comment:商品id" json:"goods_id"` SkuId int64 `gorm:"type:int;not null;comment:sku_id" json:"sku_id"` GoodsPrice int64 `gorm:"type:int;not null;comment:商品价格" json:"goods_price"` GoodsNum int32 `gorm:"type:int;not null;comment:商品数量" json:"goods_num"` GoodsSn string `gorm:"type:varchar(500);default:;comment:商品编号"` GoodsName string `gorm:"type:varchar(500);default:;comment:商品名称"` IsSelect bool `gorm:"type:tinyint;comment:是否选中;default:false" json:"is_select"` CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } type cartRepo struct { data *Data log *log.Helper } func NewCartRepo(data *Data, logger log.Logger) biz.CartRepo { return &cartRepo{ data: data, log: log.NewHelper(logger), } } func (p *ShopCart) ToDomain() *domain.ShopCart { return &domain.ShopCart{ ID: p.ID, UserId: p.UserId, GoodsId: p.GoodsId, SkuId: p.SkuId, GoodsPrice: p.GoodsPrice, GoodsNum: p.GoodsNum, GoodsSn: p.GoodsSn, GoodsName: p.GoodsName, IsSelect: p.IsSelect, } } func (r *cartRepo) Create(ctx context.Context, c *domain.ShopCart) (*domain.ShopCart, error) { var shopCart ShopCart if result := r.data.db.Where(&ShopCart{UserId: c.UserId, SkuId: c.SkuId}).First(&shopCart); result.RowsAffected == 1 { shopCart.GoodsNum += c.GoodsNum } else { shopCart.UserId = c.UserId shopCart.GoodsId = c.GoodsId shopCart.SkuId = c.SkuId shopCart.GoodsPrice = c.GoodsPrice shopCart.GoodsNum = c.GoodsNum shopCart.GoodsSn = c.GoodsSn shopCart.GoodsName = c.GoodsName shopCart.IsSelect = c.IsSelect } if result := r.data.db.Save(&shopCart); result.Error != nil { return nil, errors.InternalServer("CREATE_CART_NOT_FOUND", "创建购物车失败") } return shopCart.ToDomain(), nil } func (r *cartRepo) List(ctx context.Context, userId int64) (domain.ShopCartList, error) { var shopCarts []ShopCart if result := r.data.db.Where(&ShopCart{UserId: userId}).Find(&shopCarts); result.Error != nil { return nil, errors.InternalServer("SELECT_CART_ERROR", "用户购物车列表查询失败") } else { var rsp domain.ShopCartList for _, cart := range shopCarts { rsp = append(rsp, cart.ToDomain()) } return rsp, nil } } ================================================ FILE: service/cart/internal/data/cart_test.go ================================================ package data_test import ( "cart/internal/biz" "cart/internal/data" "cart/internal/domain" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Cart", func() { var ro biz.CartRepo BeforeEach(func() { ro = data.NewCartRepo(Db, nil) }) // 设置 It 块来添加单个规格 It("CreateCart", func() { cartData := domain.ShopCart{ UserId: 1, GoodsId: 1, SkuId: 1, GoodsPrice: 1000, GoodsNum: 10, GoodsSn: "20232232231", GoodsName: "Mate 40 Pro", IsSelect: true, } c, err := ro.Create(ctx, &cartData) Ω(err).ShouldNot(HaveOccurred()) Ω(c.UserId).Should(Equal(int64(1))) Ω(c.GoodsNum).Should(Equal(int32(10))) // 二次验证创建相同商品的数据,只增加商品数量 cartData2 := domain.ShopCart{ UserId: 1, GoodsId: 1, SkuId: 1, GoodsPrice: 1000, GoodsNum: 10, GoodsSn: "20232232231", GoodsName: "Mate 40 Pro", IsSelect: true, } c2, err := ro.Create(ctx, &cartData2) Ω(err).ShouldNot(HaveOccurred()) Ω(c2.UserId).Should(Equal(int64(1))) Ω(c2.GoodsNum).Should(Equal(int32(20))) }) }) ================================================ FILE: service/cart/internal/data/data.go ================================================ package data import ( "cart/internal/conf" slog "log" "os" "time" "github.com/go-redis/redis/v8" "github.com/go-kratos/kratos/v2/log" "github.com/go-redis/redis/extra/redisotel" "github.com/google/wire" "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger" "gorm.io/gorm/schema" ) // ProviderSet is data providers. var ProviderSet = wire.NewSet( NewData, NewDB, NewRedis, NewCartRepo, ) type Data struct { db *gorm.DB rdb *redis.Client } // NewData . func NewData(c *conf.Data, logger log.Logger, db *gorm.DB, rdb *redis.Client) (*Data, func(), error) { cleanup := func() { log.NewHelper(logger).Info("closing the data resources") } return &Data{ db: db, rdb: rdb, }, cleanup, nil } // NewDB . func NewDB(c *conf.Data) *gorm.DB { // 终端打印输入 sql 执行记录 newLogger := logger.New( slog.New(os.Stdout, "\r\n", slog.LstdFlags), // io writer logger.Config{ SlowThreshold: time.Second, // 慢查询 SQL 阈值 Colorful: true, // 禁用彩色打印 //IgnoreRecordNotFoundError: false, LogLevel: logger.Info, // Log lever }, ) db, err := gorm.Open(mysql.Open(c.Database.Source), &gorm.Config{ Logger: newLogger, DisableForeignKeyConstraintWhenMigrating: true, NamingStrategy: schema.NamingStrategy{ //SingularTable: true, // 表名是否加 s }, }) if err != nil { log.Errorf("failed opening connection to sqlite: %v", err) panic("failed to connect database") } _ = db.AutoMigrate(&ShopCart{}) return db } func NewRedis(c *conf.Data) *redis.Client { rdb := redis.NewClient(&redis.Options{ Addr: c.Redis.Addr, Password: c.Redis.Password, DB: int(c.Redis.Db), DialTimeout: c.Redis.DialTimeout.AsDuration(), WriteTimeout: c.Redis.WriteTimeout.AsDuration(), ReadTimeout: c.Redis.ReadTimeout.AsDuration(), }) rdb.AddHook(redisotel.TracingHook{}) if err := rdb.Close(); err != nil { log.Error(err) } return rdb } ================================================ FILE: service/cart/internal/data/data_suite_test.go ================================================ package data_test import ( "cart/internal/conf" "cart/internal/data" "context" "github.com/pkg/errors" "gorm.io/gorm" "testing" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) // 测试 data 方法 func TestData(t *testing.T) { // Ginkgo 测试通过调用 Fail(description string) 功能来表示失败 // 使用 RegisterFailHandler 将此函数传递给 Gomega 。这是 Ginkgo 和 Gomega 之间的唯一连接点 RegisterFailHandler(Fail) // 通知 Ginkgo 启动测试套件。如果您的任何 specs 失败,Ginkgo 将自动使 testing.T 失败。 RunSpecs(t, "biz data test user") } var cleaner func() // 定义删除 mysql 容器的回调函数 var Db *data.Data // 用于测试的 data var ctx context.Context // 上下文 // initialize AutoMigrate gorm自动建表 func initialize(db *gorm.DB) error { err := db.AutoMigrate( &data.ShopCart{}, ) return errors.WithStack(err) } // ginkgo 使用 BeforeEach 为您的 Specs 设置状态 var _ = BeforeSuite(func() { // 执行测试数据库操作之前,链接之前 docker 容器创建的 mysql //con, f := data.DockerMysql("mysql", "latest") con, f := data.DockerMysql("mariadb", "latest") cleaner = f // 测试完成,关闭容器的回调方法 config := &conf.Data{Database: &conf.Data_Database{Driver: "mysql", Source: con}} db := data.NewDB(config) mySQLDb, _, err := data.NewData(config, nil, db, nil) if err != nil { return } if err != nil { return } Db = mySQLDb err = initialize(db) if err != nil { return } Expect(err).NotTo(HaveOccurred()) }) // 测试结束后 通过回调函数,关闭并删除 docker 创建的容器 var _ = AfterSuite(func() { cleaner() }) ================================================ FILE: service/cart/internal/data/docker_mysql.go ================================================ package data import ( "database/sql" "fmt" "github.com/ory/dockertest/v3" "log" "time" ) func DockerMysql(img, version string) (string, func()) { return innerDockerMysql(img, version) } func innerDockerMysql(img, version string) (string, func()) { // uses a sensible default on windows (tcp/http) and linux/osx (socket) pool, err := dockertest.NewPool("") pool.MaxWait = time.Minute * 2 if err != nil { log.Fatalf("Could not connect to docker: %s", err) } //time.Sleep(time.Second * 20) // pulls an image, creates a container based on it and runs it resource, err := pool.Run(img, version, []string{"MYSQL_ROOT_PASSWORD=secret", "MYSQL_ROOT_HOST=%"}) if err != nil { log.Fatalf("Could not start resource: %s", err) } conStr := fmt.Sprintf("root:secret@(localhost:%s)/mysql?parseTime=true", resource.GetPort("3306/tcp")) // exponential backoff-retry, because the application in the container might not be ready to accept connections yet if err := pool.Retry(func() error { var err error db, err := sql.Open("mysql", conStr) if err != nil { return err } return db.Ping() }); err != nil { log.Fatalf("Could not connect to docker: %s", err) } // 关闭容器 return conStr, func() { if err = pool.Purge(resource); err != nil { log.Fatalf("Could not purge resource: %s", err) } } } ================================================ FILE: service/cart/internal/domain/cart.go ================================================ package domain type ShopCart struct { ID int64 UserId int64 GoodsId int64 SkuId int64 GoodsPrice int64 GoodsNum int32 GoodsSn string GoodsName string IsSelect bool } type ShopCartList []*ShopCart func (p ShopCartList) ListSelected() ShopCartList { var list ShopCartList for _, cart := range p { if cart.IsSelect == true { list = append(list, cart) } } return list } ================================================ FILE: service/cart/internal/server/grpc.go ================================================ package server import ( v1 "cart/api/cart/v1" "cart/internal/conf" "cart/internal/service" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/validate" "github.com/go-kratos/kratos/v2/transport/grpc" ) // NewGRPCServer new a gRPC s. func NewGRPCServer(c *conf.Server, greeter *service.CartService, logger log.Logger) *grpc.Server { var opts = []grpc.ServerOption{ grpc.Middleware( recovery.Recovery(), validate.Validator(), ), } if c.Grpc.Network != "" { opts = append(opts, grpc.Network(c.Grpc.Network)) } if c.Grpc.Addr != "" { opts = append(opts, grpc.Address(c.Grpc.Addr)) } if c.Grpc.Timeout != nil { opts = append(opts, grpc.Timeout(c.Grpc.Timeout.AsDuration())) } srv := grpc.NewServer(opts...) v1.RegisterCartServer(srv, greeter) return srv } ================================================ FILE: service/cart/internal/server/server.go ================================================ package server import ( "cart/internal/conf" "github.com/go-kratos/kratos/v2/registry" "github.com/google/wire" consul "github.com/go-kratos/kratos/contrib/registry/consul/v2" consulAPI "github.com/hashicorp/consul/api" ) // ProviderSet is s providers. var ProviderSet = wire.NewSet(NewGRPCServer, NewRegistrar) // NewRegistrar 引入 consul func NewRegistrar(conf *conf.Registry) registry.Registrar { c := consulAPI.DefaultConfig() c.Address = conf.Consul.Address c.Scheme = conf.Consul.Scheme cli, err := consulAPI.NewClient(c) if err != nil { panic(err) } r := consul.New(cli, consul.WithHealthCheck(false)) return r } ================================================ FILE: service/cart/internal/service/README.md ================================================ # Service ================================================ FILE: service/cart/internal/service/cart.go ================================================ package service import ( "cart/internal/biz" "cart/internal/domain" "context" v1 "cart/api/cart/v1" ) type CartService struct { v1.UnimplementedCartServer cart *biz.CartUsecase } func NewCartService(cart *biz.CartUsecase) *CartService { return &CartService{cart: cart} } func (s *CartService) CreateCart(ctx context.Context, req *v1.CreateCartRequest) (*v1.CartInfoReply, error) { rv, err := s.cart.CreateCart(ctx, &domain.ShopCart{ UserId: req.UserId, GoodsId: req.GoodsId, SkuId: req.SkuId, GoodsPrice: req.GoodsPrice, GoodsNum: req.GoodsNum, GoodsSn: req.GoodsSn, GoodsName: req.GoodsName, IsSelect: req.IsSelect, }) if err != nil { return nil, err } return &v1.CartInfoReply{ Id: rv.ID, UserId: rv.UserId, GoodsId: rv.GoodsId, GoodsSn: rv.GoodsSn, GoodsName: rv.GoodsName, SkuId: rv.SkuId, GoodsPrice: rv.GoodsPrice, GoodsNum: rv.GoodsNum, IsSelect: rv.IsSelect, }, nil } func (s *CartService) ListCart(ctx context.Context, req *v1.ListCartRequest) (*v1.CartListReply, error) { res, err := s.cart.List(ctx, req.UserId) if err != nil { return nil, err } var rsp v1.CartListReply for _, cart := range res { rsp.Results = append(rsp.Results, &v1.CartInfoReply{ Id: cart.ID, UserId: cart.UserId, GoodsId: cart.GoodsId, GoodsSn: cart.GoodsSn, GoodsName: cart.GoodsName, SkuId: cart.SkuId, GoodsPrice: cart.GoodsPrice, GoodsNum: cart.GoodsNum, IsSelect: cart.IsSelect, }) } return &rsp, nil } //func (s *CartService) UpdateCart(ctx context.Context, req *pb.UpdateCartRequest) (*pb.UpdateCartReply, error) { // return &pb.UpdateCartReply{}, nil //} //func (s *CartService) DeleteCart(ctx context.Context, req *pb.DeleteCartRequest) (*pb.DeleteCartReply, error) { // return &pb.DeleteCartReply{}, nil //} //func (s *CartService) GetCart(ctx context.Context, req *pb.GetCartRequest) (*pb.GetCartReply, error) { // return &pb.GetCartReply{}, nil //} ================================================ FILE: service/cart/internal/service/service.go ================================================ package service import "github.com/google/wire" // ProviderSet is service providers. var ProviderSet = wire.NewSet(NewCartService) ================================================ FILE: service/cart/openapi.yaml ================================================ # Generated with protoc-gen-openapi # https://github.com/google/gnostic/tree/master/apps/protoc-gen-openapi openapi: 3.0.3 info: title: "" version: 0.0.1 paths: {} components: schemas: {} ================================================ FILE: service/cart/third_party/README.md ================================================ # third_party ================================================ FILE: service/cart/third_party/errors/errors.proto ================================================ syntax = "proto3"; package errors; option go_package = "github.com/go-kratos/kratos/v2/errors;errors"; option java_multiple_files = true; option java_package = "com.github.kratos.errors"; option objc_class_prefix = "KratosErrors"; import "google/protobuf/descriptor.proto"; extend google.protobuf.EnumOptions { int32 default_code = 1108; } extend google.protobuf.EnumValueOptions { int32 code = 1109; } ================================================ FILE: service/cart/third_party/google/api/annotations.proto ================================================ // Copyright (c) 2015, Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/api/http.proto"; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "AnnotationsProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.MethodOptions { // See `HttpRule`. HttpRule http = 72295728; } ================================================ FILE: service/cart/third_party/google/api/client.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "ClientProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.ServiceOptions { // The hostname for this service. // This should be specified with no prefix or protocol. // // Example: // // service Foo { // option (google.api.default_host) = "foo.googleapi.com"; // ... // } string default_host = 1049; // OAuth scopes needed for the client. // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform"; // ... // } // // If there is more than one scope, use a comma-separated string: // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform," // "https://www.googleapis.com/auth/monitoring"; // ... // } string oauth_scopes = 1050; } extend google.protobuf.MethodOptions { // A definition of a client library method signature. // // In client libraries, each proto RPC corresponds to one or more methods // which the end user is able to call, and calls the underlying RPC. // Normally, this method receives a single argument (a struct or instance // corresponding to the RPC request object). Defining this field will // add one or more overloads providing flattened or simpler method signatures // in some languages. // // The fields on the method signature are provided as a comma-separated // string. // // For example, the proto RPC and annotation: // // rpc CreateSubscription(CreateSubscriptionRequest) // returns (Subscription) { // option (google.api.method_signature) = "name,topic"; // } // // Would add the following Java overload (in addition to the method accepting // the request object): // // public final Subscription createSubscription(String name, String topic) // // The following backwards-compatibility guidelines apply: // // * Adding this annotation to an unannotated method is backwards // compatible. // * Adding this annotation to a method which already has existing // method signature annotations is backwards compatible if and only if // the new method signature annotation is last in the sequence. // * Modifying or removing an existing method signature annotation is // a breaking change. // * Re-ordering existing method signature annotations is a breaking // change. repeated string method_signature = 1051; } ================================================ FILE: service/cart/third_party/google/api/field_behavior.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "FieldBehaviorProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // An indicator of the behavior of a given field (for example, that a field // is required in requests, or given as output but ignored as input). // This **does not** change the behavior in protocol buffers itself; it only // denotes the behavior and may affect how API tooling handles the field. // // Note: This enum **may** receive new values in the future. enum FieldBehavior { // Conventional default for enums. Do not use this. FIELD_BEHAVIOR_UNSPECIFIED = 0; // Specifically denotes a field as optional. // While all fields in protocol buffers are optional, this may be specified // for emphasis if appropriate. OPTIONAL = 1; // Denotes a field as required. // This indicates that the field **must** be provided as part of the request, // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). REQUIRED = 2; // Denotes a field as output only. // This indicates that the field is provided in responses, but including the // field in a request does nothing (the server *must* ignore it and // *must not* throw an error as a result of the field's presence). OUTPUT_ONLY = 3; // Denotes a field as input only. // This indicates that the field is provided in requests, and the // corresponding field is not included in output. INPUT_ONLY = 4; // Denotes a field as immutable. // This indicates that the field may be set once in a request to create a // resource, but may not be changed thereafter. IMMUTABLE = 5; } extend google.protobuf.FieldOptions { // A designation of a specific field behavior (required, output only, etc.) // in protobuf messages. // // Examples: // // string name = 1 [(google.api.field_behavior) = REQUIRED]; // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // google.protobuf.Duration ttl = 1 // [(google.api.field_behavior) = INPUT_ONLY]; // google.protobuf.Timestamp expire_time = 1 // [(google.api.field_behavior) = OUTPUT_ONLY, // (google.api.field_behavior) = IMMUTABLE]; repeated FieldBehavior field_behavior = 1052; } ================================================ FILE: service/cart/third_party/google/api/http.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "HttpProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Defines the HTTP configuration for an API service. It contains a list of // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method // to one or more HTTP REST API methods. message Http { // A list of HTTP configuration rules that apply to individual API methods. // // **NOTE:** All service configuration rules follow "last one wins" order. repeated HttpRule rules = 1; // When set to true, URL path parameters will be fully URI-decoded except in // cases of single segment matches in reserved expansion, where "%2F" will be // left encoded. // // The default behavior is to not decode RFC 6570 reserved characters in multi // segment matches. bool fully_decode_reserved_expansion = 2; } // # gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service // that supports both gRPC APIs and REST APIs. Many systems, including [Google // APIs](https://github.com/googleapis/googleapis), // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC // Gateway](https://github.com/grpc-ecosystem/grpc-gateway), // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature // and use it for large scale production services. // // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies // how different portions of the gRPC request message are mapped to the URL // path, URL query parameters, and HTTP request body. It also controls how the // gRPC response message is mapped to the HTTP response body. `HttpRule` is // typically specified as an `google.api.http` annotation on the gRPC method. // // Each mapping specifies a URL path template and an HTTP method. The path // template may refer to one or more fields in the gRPC request message, as long // as each field is a non-repeated field with a primitive (non-message) type. // The path template controls how fields of the request message are mapped to // the URL path. // // Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/{name=messages/*}" // }; // } // } // message GetMessageRequest { // string name = 1; // Mapped to URL path. // } // message Message { // string text = 1; // The resource content. // } // // This enables an HTTP REST to gRPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. // For example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get:"/v1/messages/{message_id}" // }; // } // } // message GetMessageRequest { // message SubMessage { // string subfield = 1; // } // string message_id = 1; // Mapped to URL path. // int64 revision = 2; // Mapped to URL query parameter `revision`. // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. // } // // This enables a HTTP JSON to RPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: // "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. // In the case of a repeated type, the parameter can be repeated in the URL // as `...?param=A¶m=B`. In the case of a message type, each field of the // message is mapped to a separate parameter, such as // `...?foo.a=A&foo.b=B&foo.c=C`. // // For HTTP methods that allow a request body, the `body` field // specifies the mapping. Consider a REST update method on the // message resource collection: // // service Messaging { // rpc UpdateMessage(UpdateMessageRequest) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "message" // }; // } // } // message UpdateMessageRequest { // string message_id = 1; // mapped to the URL // Message message = 2; // mapped to the body // } // // The following HTTP JSON to RPC mapping is enabled, where the // representation of the JSON in the request body is determined by // protos JSON encoding: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the // request body. This enables the following alternative definition of // the update method: // // service Messaging { // rpc UpdateMessage(Message) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "*" // }; // } // } // message Message { // string message_id = 1; // string text = 2; // } // // // The following HTTP JSON to RPC mapping is enabled: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in // the body. This makes this option more rarely used in practice when // defining REST APIs. The common usage of `*` is in custom methods // which don't use the URL at all for transferring data. // // It is possible to define multiple HTTP methods for one RPC by using // the `additional_bindings` option. Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/messages/{message_id}" // additional_bindings { // get: "/v1/users/{user_id}/messages/{message_id}" // } // }; // } // } // message GetMessageRequest { // string message_id = 1; // string user_id = 2; // } // // This enables the following two alternative HTTP JSON to RPC mappings: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: // "123456")` // // ## Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: // - Fields referred by the path template. They are passed via the URL path. // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP // request body. // - All other fields are passed via the URL query parameters, and the // parameter name is the field path in the request message. A repeated // field can be represented as multiple query parameters under the same // name. // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields // are passed via URL path and HTTP request body. // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all // fields are passed via URL path and URL query parameters. // // ### Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; // Segment = "*" | "**" | LITERAL | Variable ; // Variable = "{" FieldPath [ "=" Segments ] "}" ; // FieldPath = IDENT { "." IDENT } ; // Verb = ":" LITERAL ; // // The syntax `*` matches a single URL path segment. The syntax `**` matches // zero or more URL path segments, which must be the last part of the URL path // except the `Verb`. // // The syntax `Variable` matches part of the URL path as specified by its // template. A variable template must not contain other variables. If a variable // matches a single path segment, its template may be omitted, e.g. `{var}` // is equivalent to `{var=*}`. // // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` // contains any reserved character, such characters should be percent-encoded // before the matching. // // If a variable contains exactly one path segment, such as `"{var}"` or // `"{var=*}"`, when such a variable is expanded into a URL path on the client // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The // server side does the reverse decoding. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{var}`. // // If a variable contains multiple path segments, such as `"{var=foo/*}"` // or `"{var=**}"`, when such a variable is expanded into a URL path on the // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. // The server side does the reverse decoding, except "%2F" and "%2f" are left // unchanged. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // // ## Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The // service config is simply the YAML representation of the `google.api.Service` // proto message. // // As an alternative to annotating your proto file, you can configure gRPC // transcoding in your service config YAML files. You do this by specifying a // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same // effect as the proto annotation. This can be particularly useful if you // have a proto that is reused in multiple services. Note that any transcoding // specified in the service config will override any matching transcoding // configuration in the proto. // // Example: // // http: // rules: // # Selects a gRPC method and applies HttpRule to it. // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // // ## Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 // specification](https://developers.google.com/protocol-buffers/docs/proto3#json). // // While the single segment variable follows the semantics of // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String // Expansion, the multi segment variable **does not** follow RFC 6570 Section // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion // does not expand special characters like `?` and `#`, which would lead // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding // for multi segment variables. // // The path variables **must not** refer to any repeated or mapped field, // because client libraries are not capable of handling such variable expansion. // // The path variables **must not** capture the leading "/" character. The reason // is that the most common use case "{var}" does not capture the leading "/" // character. For consistency, all path variables must share the same behavior. // // Repeated message fields must not be mapped to URL query parameters, because // no client library can support such complicated mapping. // // If an API needs to use a JSON array for request or response body, it can map // the request or response body to a repeated field. However, some gRPC // Transcoding implementations may not support this feature. message HttpRule { // Selects a method to which this rule applies. // // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. string selector = 1; // Determines the URL pattern is matched by this rules. This pattern can be // used with any of the {get|put|post|delete|patch} methods. A custom method // can be defined using the 'custom' field. oneof pattern { // Maps to HTTP GET. Used for listing and getting information about // resources. string get = 2; // Maps to HTTP PUT. Used for replacing a resource. string put = 3; // Maps to HTTP POST. Used for creating a resource or performing an action. string post = 4; // Maps to HTTP DELETE. Used for deleting a resource. string delete = 5; // Maps to HTTP PATCH. Used for updating a resource. string patch = 6; // The custom pattern is used for specifying an HTTP method that is not // included in the `pattern` field, such as HEAD, or "*" to leave the // HTTP method unspecified for this rule. The wild-card rule is useful // for services that provide content to Web (HTML) clients. CustomHttpPattern custom = 8; } // The name of the request field whose value is mapped to the HTTP request // body, or `*` for mapping all request fields not captured by the path // pattern to the HTTP body, or omitted for not having any HTTP request body. // // NOTE: the referred field must be present at the top-level of the request // message type. string body = 7; // Optional. The name of the response field whose value is mapped to the HTTP // response body. When omitted, the entire response message will be used // as the HTTP response body. // // NOTE: The referred field must be present at the top-level of the response // message type. string response_body = 12; // Additional HTTP bindings for the selector. Nested bindings must // not contain an `additional_bindings` field themselves (that is, // the nesting may only be one level deep). repeated HttpRule additional_bindings = 11; } // A custom pattern is used for defining custom HTTP verb. message CustomHttpPattern { // The name of this custom HTTP verb. string kind = 1; // The path matched by this custom verb. string path = 2; } ================================================ FILE: service/cart/third_party/google/api/httpbody.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/any.proto"; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; option java_multiple_files = true; option java_outer_classname = "HttpBodyProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Message that represents an arbitrary HTTP body. It should only be used for // payload formats that can't be represented as JSON, such as raw binary or // an HTML page. // // // This message can be used both in streaming and non-streaming API methods in // the request as well as the response. // // It can be used as a top-level request field, which is convenient if one // wants to extract parameters from either the URL or HTTP template into the // request fields and also want access to the raw HTTP body. // // Example: // // message GetResourceRequest { // // A unique request id. // string request_id = 1; // // // The raw HTTP body is bound to this field. // google.api.HttpBody http_body = 2; // } // // service ResourceService { // rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); // rpc UpdateResource(google.api.HttpBody) returns // (google.protobuf.Empty); // } // // Example with streaming methods: // // service CaldavService { // rpc GetCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // rpc UpdateCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // } // // Use of this type only changes how the request and response bodies are // handled, all other features will continue to work unchanged. message HttpBody { // The HTTP Content-Type header value specifying the content type of the body. string content_type = 1; // The HTTP request/response body as raw binary. bytes data = 2; // Application specific response metadata. Must be set in the first response // for streaming APIs. repeated google.protobuf.Any extensions = 3; } ================================================ FILE: service/cart/third_party/google/protobuf/any.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "google.golang.org/protobuf/types/known/anypb"; option java_package = "com.google.protobuf"; option java_outer_classname = "AnyProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // // Protobuf library provides support to pack/unpack Any values in the form // of utility functions or additional generated methods of the Any type. // // Example 1: Pack and unpack a message in C++. // // Foo foo = ...; // Any any; // any.PackFrom(foo); // ... // if (any.UnpackTo(&foo)) { // ... // } // // Example 2: Pack and unpack a message in Java. // // Foo foo = ...; // Any any = Any.pack(foo); // ... // if (any.is(Foo.class)) { // foo = any.unpack(Foo.class); // } // // Example 3: Pack and unpack a message in Python. // // foo = Foo(...) // any = Any() // any.Pack(foo) // ... // if any.Is(Foo.DESCRIPTOR): // any.Unpack(foo) // ... // // Example 4: Pack and unpack a message in Go // // foo := &pb.Foo{...} // any, err := anypb.New(foo) // if err != nil { // ... // } // ... // foo := &pb.Foo{} // if err := any.UnmarshalTo(foo); err != nil { // ... // } // // The pack methods provided by protobuf library will by default use // 'type.googleapis.com/full.type.name' as the type URL and the unpack // methods only use the fully qualified type name after the last '/' // in the type URL, for example "foo.bar.com/x/y.z" will yield type // name "y.z". // // // JSON // // The JSON representation of an `Any` value uses the regular // representation of the deserialized, embedded message, with an // additional field `@type` which contains the type URL. Example: // // package google.profile; // message Person { // string first_name = 1; // string last_name = 2; // } // // { // "@type": "type.googleapis.com/google.profile.Person", // "firstName": , // "lastName": // } // // If the embedded message type is well-known and has a custom JSON // representation, that representation will be embedded adding a field // `value` which holds the custom JSON in addition to the `@type` // field. Example (for message [google.protobuf.Duration][]): // // { // "@type": "type.googleapis.com/google.protobuf.Duration", // "value": "1.212s" // } // message Any { // A URL/resource name that uniquely identifies the type of the serialized // protocol buffer message. This string must contain at least // one "/" character. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). // // In practice, teams usually precompile into the binary all types that they // expect it to use in the context of Any. However, for URLs which use the // scheme `http`, `https`, or no scheme, one can optionally set up a type // server that maps type URLs to message definitions as follows: // // * If no scheme is provided, `https` is assumed. // * An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // * Applications are allowed to cache lookup results based on the // URL, or have them precompiled into a binary to avoid any // lookup. Therefore, binary compatibility needs to be preserved // on changes to types. (Use versioned type names to manage // breaking changes.) // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with // type.googleapis.com. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. // string type_url = 1; // Must be a valid serialized protocol buffer of the above specified type. bytes value = 2; } ================================================ FILE: service/cart/third_party/google/protobuf/api.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; import "google/protobuf/source_context.proto"; import "google/protobuf/type.proto"; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "ApiProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/apipb"; // Api is a light-weight descriptor for an API Interface. // // Interfaces are also described as "protocol buffer services" in some contexts, // such as by the "service" keyword in a .proto file, but they are different // from API Services, which represent a concrete implementation of an interface // as opposed to simply a description of methods and bindings. They are also // sometimes simply referred to as "APIs" in other contexts, such as the name of // this message itself. See https://cloud.google.com/apis/design/glossary for // detailed terminology. message Api { // The fully qualified name of this interface, including package name // followed by the interface's simple name. string name = 1; // The methods of this interface, in unspecified order. repeated Method methods = 2; // Any metadata attached to the interface. repeated Option options = 3; // A version string for this interface. If specified, must have the form // `major-version.minor-version`, as in `1.10`. If the minor version is // omitted, it defaults to zero. If the entire version field is empty, the // major version is derived from the package name, as outlined below. If the // field is not empty, the version in the package name will be verified to be // consistent with what is provided here. // // The versioning schema uses [semantic // versioning](http://semver.org) where the major version number // indicates a breaking change and the minor version an additive, // non-breaking change. Both version numbers are signals to users // what to expect from different versions, and should be carefully // chosen based on the product plan. // // The major version is also reflected in the package name of the // interface, which must end in `v`, as in // `google.feature.v1`. For major versions 0 and 1, the suffix can // be omitted. Zero major versions must only be used for // experimental, non-GA interfaces. // // string version = 4; // Source context for the protocol buffer service represented by this // message. SourceContext source_context = 5; // Included interfaces. See [Mixin][]. repeated Mixin mixins = 6; // The source syntax of the service. Syntax syntax = 7; } // Method represents a method of an API interface. message Method { // The simple name of this method. string name = 1; // A URL of the input message type. string request_type_url = 2; // If true, the request is streamed. bool request_streaming = 3; // The URL of the output message type. string response_type_url = 4; // If true, the response is streamed. bool response_streaming = 5; // Any metadata attached to the method. repeated Option options = 6; // The source syntax of this method. Syntax syntax = 7; } // Declares an API Interface to be included in this interface. The including // interface must redeclare all the methods from the included interface, but // documentation and options are inherited as follows: // // - If after comment and whitespace stripping, the documentation // string of the redeclared method is empty, it will be inherited // from the original method. // // - Each annotation belonging to the service config (http, // visibility) which is not set in the redeclared method will be // inherited. // // - If an http annotation is inherited, the path pattern will be // modified as follows. Any version prefix will be replaced by the // version of the including interface plus the [root][] path if // specified. // // Example of a simple mixin: // // package google.acl.v1; // service AccessControl { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v1/{resource=**}:getAcl"; // } // } // // package google.storage.v2; // service Storage { // rpc GetAcl(GetAclRequest) returns (Acl); // // // Get a data record. // rpc GetData(GetDataRequest) returns (Data) { // option (google.api.http).get = "/v2/{resource=**}"; // } // } // // Example of a mixin configuration: // // apis: // - name: google.storage.v2.Storage // mixins: // - name: google.acl.v1.AccessControl // // The mixin construct implies that all methods in `AccessControl` are // also declared with same name and request/response types in // `Storage`. A documentation generator or annotation processor will // see the effective `Storage.GetAcl` method after inheriting // documentation and annotations as follows: // // service Storage { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v2/{resource=**}:getAcl"; // } // ... // } // // Note how the version in the path pattern changed from `v1` to `v2`. // // If the `root` field in the mixin is specified, it should be a // relative path under which inherited HTTP paths are placed. Example: // // apis: // - name: google.storage.v2.Storage // mixins: // - name: google.acl.v1.AccessControl // root: acls // // This implies the following inherited HTTP annotation: // // service Storage { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; // } // ... // } message Mixin { // The fully qualified name of the interface which is included. string name = 1; // If non-empty specifies a path under which inherited HTTP paths // are rooted. string root = 2; } ================================================ FILE: service/cart/third_party/google/protobuf/compiler/plugin.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // // WARNING: The plugin interface is currently EXPERIMENTAL and is subject to // change. // // protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is // just a program that reads a CodeGeneratorRequest from stdin and writes a // CodeGeneratorResponse to stdout. // // Plugins written using C++ can use google/protobuf/compiler/plugin.h instead // of dealing with the raw protocol defined here. // // A plugin executable needs only to be placed somewhere in the path. The // plugin should be named "protoc-gen-$NAME", and will then be used when the // flag "--${NAME}_out" is passed to protoc. syntax = "proto2"; package google.protobuf.compiler; option java_package = "com.google.protobuf.compiler"; option java_outer_classname = "PluginProtos"; option go_package = "google.golang.org/protobuf/types/pluginpb"; import "google/protobuf/descriptor.proto"; // The version number of protocol compiler. message Version { optional int32 major = 1; optional int32 minor = 2; optional int32 patch = 3; // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should // be empty for mainline stable releases. optional string suffix = 4; } // An encoded CodeGeneratorRequest is written to the plugin's stdin. message CodeGeneratorRequest { // The .proto files that were explicitly listed on the command-line. The // code generator should generate code only for these files. Each file's // descriptor will be included in proto_file, below. repeated string file_to_generate = 1; // The generator parameter passed on the command-line. optional string parameter = 2; // FileDescriptorProtos for all files in files_to_generate and everything // they import. The files will appear in topological order, so each file // appears before any file that imports it. // // protoc guarantees that all proto_files will be written after // the fields above, even though this is not technically guaranteed by the // protobuf wire format. This theoretically could allow a plugin to stream // in the FileDescriptorProtos and handle them one by one rather than read // the entire set into memory at once. However, as of this writing, this // is not similarly optimized on protoc's end -- it will store all fields in // memory at once before sending them to the plugin. // // Type names of fields and extensions in the FileDescriptorProto are always // fully qualified. repeated FileDescriptorProto proto_file = 15; // The version number of protocol compiler. optional Version compiler_version = 3; } // The plugin writes an encoded CodeGeneratorResponse to stdout. message CodeGeneratorResponse { // Error message. If non-empty, code generation failed. The plugin process // should exit with status code zero even if it reports an error in this way. // // This should be used to indicate errors in .proto files which prevent the // code generator from generating correct code. Errors which indicate a // problem in protoc itself -- such as the input CodeGeneratorRequest being // unparseable -- should be reported by writing a message to stderr and // exiting with a non-zero status code. optional string error = 1; // A bitmask of supported features that the code generator supports. // This is a bitwise "or" of values from the Feature enum. optional uint64 supported_features = 2; // Sync with code_generator.h. enum Feature { FEATURE_NONE = 0; FEATURE_PROTO3_OPTIONAL = 1; } // Represents a single generated file. message File { // The file name, relative to the output directory. The name must not // contain "." or ".." components and must be relative, not be absolute (so, // the file cannot lie outside the output directory). "/" must be used as // the path separator, not "\". // // If the name is omitted, the content will be appended to the previous // file. This allows the generator to break large files into small chunks, // and allows the generated text to be streamed back to protoc so that large // files need not reside completely in memory at one time. Note that as of // this writing protoc does not optimize for this -- it will read the entire // CodeGeneratorResponse before writing files to disk. optional string name = 1; // If non-empty, indicates that the named file should already exist, and the // content here is to be inserted into that file at a defined insertion // point. This feature allows a code generator to extend the output // produced by another code generator. The original generator may provide // insertion points by placing special annotations in the file that look // like: // @@protoc_insertion_point(NAME) // The annotation can have arbitrary text before and after it on the line, // which allows it to be placed in a comment. NAME should be replaced with // an identifier naming the point -- this is what other generators will use // as the insertion_point. Code inserted at this point will be placed // immediately above the line containing the insertion point (thus multiple // insertions to the same point will come out in the order they were added). // The double-@ is intended to make it unlikely that the generated code // could contain things that look like insertion points by accident. // // For example, the C++ code generator places the following line in the // .pb.h files that it generates: // // @@protoc_insertion_point(namespace_scope) // This line appears within the scope of the file's package namespace, but // outside of any particular class. Another plugin can then specify the // insertion_point "namespace_scope" to generate additional classes or // other declarations that should be placed in this scope. // // Note that if the line containing the insertion point begins with // whitespace, the same whitespace will be added to every line of the // inserted text. This is useful for languages like Python, where // indentation matters. In these languages, the insertion point comment // should be indented the same amount as any inserted code will need to be // in order to work correctly in that context. // // The code generator that generates the initial file and the one which // inserts into it must both run as part of a single invocation of protoc. // Code generators are executed in the order in which they appear on the // command line. // // If |insertion_point| is present, |name| must also be present. optional string insertion_point = 2; // The file contents. optional string content = 15; // Information describing the file content being inserted. If an insertion // point is used, this information will be appropriately offset and inserted // into the code generation metadata for the generated files. optional GeneratedCodeInfo generated_code_info = 16; } repeated File file = 15; } ================================================ FILE: service/cart/third_party/google/protobuf/descriptor.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. // // The messages in this file describe the definitions found in .proto files. // A valid .proto file can be translated directly to a FileDescriptorProto // without any other information (e.g. without reading its imports). syntax = "proto2"; package google.protobuf; option go_package = "google.golang.org/protobuf/types/descriptorpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; option csharp_namespace = "Google.Protobuf.Reflection"; option objc_class_prefix = "GPB"; option cc_enable_arenas = true; // descriptor.proto must be optimized for speed because reflection-based // algorithms don't work during bootstrapping. option optimize_for = SPEED; // The protocol compiler can output a FileDescriptorSet containing the .proto // files it parses. message FileDescriptorSet { repeated FileDescriptorProto file = 1; } // Describes a complete .proto file. message FileDescriptorProto { optional string name = 1; // file name, relative to root of source tree optional string package = 2; // e.g. "foo", "foo.bar", etc. // Names of files imported by this file. repeated string dependency = 3; // Indexes of the public imported files in the dependency list above. repeated int32 public_dependency = 10; // Indexes of the weak imported files in the dependency list. // For Google-internal migration only. Do not use. repeated int32 weak_dependency = 11; // All top-level definitions in this file. repeated DescriptorProto message_type = 4; repeated EnumDescriptorProto enum_type = 5; repeated ServiceDescriptorProto service = 6; repeated FieldDescriptorProto extension = 7; optional FileOptions options = 8; // This field contains optional information about the original source code. // You may safely remove this entire field without harming runtime // functionality of the descriptors -- the information is needed only by // development tools. optional SourceCodeInfo source_code_info = 9; // The syntax of the proto file. // The supported values are "proto2" and "proto3". optional string syntax = 12; } // Describes a message type. message DescriptorProto { optional string name = 1; repeated FieldDescriptorProto field = 2; repeated FieldDescriptorProto extension = 6; repeated DescriptorProto nested_type = 3; repeated EnumDescriptorProto enum_type = 4; message ExtensionRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. optional ExtensionRangeOptions options = 3; } repeated ExtensionRange extension_range = 5; repeated OneofDescriptorProto oneof_decl = 8; optional MessageOptions options = 7; // Range of reserved tag numbers. Reserved tag numbers may not be used by // fields or extension ranges in the same message. Reserved ranges may // not overlap. message ReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. } repeated ReservedRange reserved_range = 9; // Reserved field names, which may not be used by fields in the same message. // A given name may only be reserved once. repeated string reserved_name = 10; } message ExtensionRangeOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // Describes a field within a message. message FieldDescriptorProto { enum Type { // 0 is reserved for errors. // Order is weird for historical reasons. TYPE_DOUBLE = 1; TYPE_FLOAT = 2; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. TYPE_INT64 = 3; TYPE_UINT64 = 4; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. TYPE_INT32 = 5; TYPE_FIXED64 = 6; TYPE_FIXED32 = 7; TYPE_BOOL = 8; TYPE_STRING = 9; // Tag-delimited aggregate. // Group type is deprecated and not supported in proto3. However, Proto3 // implementations should still be able to parse the group wire format and // treat group fields as unknown fields. TYPE_GROUP = 10; TYPE_MESSAGE = 11; // Length-delimited aggregate. // New in version 2. TYPE_BYTES = 12; TYPE_UINT32 = 13; TYPE_ENUM = 14; TYPE_SFIXED32 = 15; TYPE_SFIXED64 = 16; TYPE_SINT32 = 17; // Uses ZigZag encoding. TYPE_SINT64 = 18; // Uses ZigZag encoding. } enum Label { // 0 is reserved for errors LABEL_OPTIONAL = 1; LABEL_REQUIRED = 2; LABEL_REPEATED = 3; } optional string name = 1; optional int32 number = 3; optional Label label = 4; // If type_name is set, this need not be set. If both this and type_name // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. optional Type type = 5; // For message and enum types, this is the name of the type. If the name // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping // rules are used to find the type (i.e. first the nested types within this // message are searched, then within the parent, on up to the root // namespace). optional string type_name = 6; // For extensions, this is the name of the type being extended. It is // resolved in the same manner as type_name. optional string extendee = 2; // For numeric types, contains the original text representation of the value. // For booleans, "true" or "false". // For strings, contains the default text contents (not escaped in any way). // For bytes, contains the C escaped value. All bytes >= 128 are escaped. optional string default_value = 7; // If set, gives the index of a oneof in the containing type's oneof_decl // list. This field is a member of that oneof. optional int32 oneof_index = 9; // JSON name of this field. The value is set by protocol compiler. If the // user has set a "json_name" option on this field, that option's value // will be used. Otherwise, it's deduced from the field's name by converting // it to camelCase. optional string json_name = 10; optional FieldOptions options = 8; // If true, this is a proto3 "optional". When a proto3 field is optional, it // tracks presence regardless of field type. // // When proto3_optional is true, this field must be belong to a oneof to // signal to old proto3 clients that presence is tracked for this field. This // oneof is known as a "synthetic" oneof, and this field must be its sole // member (each proto3 optional field gets its own synthetic oneof). Synthetic // oneofs exist in the descriptor only, and do not generate any API. Synthetic // oneofs must be ordered after all "real" oneofs. // // For message fields, proto3_optional doesn't create any semantic change, // since non-repeated message fields always track presence. However it still // indicates the semantic detail of whether the user wrote "optional" or not. // This can be useful for round-tripping the .proto file. For consistency we // give message fields a synthetic oneof also, even though it is not required // to track presence. This is especially important because the parser can't // tell if a field is a message or an enum, so it must always create a // synthetic oneof. // // Proto2 optional fields do not set this flag, because they already indicate // optional with `LABEL_OPTIONAL`. optional bool proto3_optional = 17; } // Describes a oneof. message OneofDescriptorProto { optional string name = 1; optional OneofOptions options = 2; } // Describes an enum type. message EnumDescriptorProto { optional string name = 1; repeated EnumValueDescriptorProto value = 2; optional EnumOptions options = 3; // Range of reserved numeric values. Reserved values may not be used by // entries in the same enum. Reserved ranges may not overlap. // // Note that this is distinct from DescriptorProto.ReservedRange in that it // is inclusive such that it can appropriately represent the entire int32 // domain. message EnumReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Inclusive. } // Range of reserved numeric values. Reserved numeric values may not be used // by enum values in the same enum declaration. Reserved ranges may not // overlap. repeated EnumReservedRange reserved_range = 4; // Reserved enum value names, which may not be reused. A given name may only // be reserved once. repeated string reserved_name = 5; } // Describes a value within an enum. message EnumValueDescriptorProto { optional string name = 1; optional int32 number = 2; optional EnumValueOptions options = 3; } // Describes a service. message ServiceDescriptorProto { optional string name = 1; repeated MethodDescriptorProto method = 2; optional ServiceOptions options = 3; } // Describes a method of a service. message MethodDescriptorProto { optional string name = 1; // Input and output type names. These are resolved in the same way as // FieldDescriptorProto.type_name, but must refer to a message type. optional string input_type = 2; optional string output_type = 3; optional MethodOptions options = 4; // Identifies if client streams multiple client messages optional bool client_streaming = 5 [default = false]; // Identifies if server streams multiple server messages optional bool server_streaming = 6 [default = false]; } // =================================================================== // Options // Each of the definitions above may have "options" attached. These are // just annotations which may cause code to be generated slightly differently // or may contain hints for code that manipulates protocol messages. // // Clients may define custom options as extensions of the *Options messages. // These extensions may not yet be known at parsing time, so the parser cannot // store the values in them. Instead it stores them in a field in the *Options // message called uninterpreted_option. This field must have the same name // across all *Options messages. We then use this field to populate the // extensions when we build a descriptor, at which point all protos have been // parsed and so all extensions are known. // // Extension numbers for custom options may be chosen as follows: // * For options which will only be used within a single application or // organization, or for experimental options, use field numbers 50000 // through 99999. It is up to you to ensure that you do not use the // same number for multiple options. // * For options which will be published and used publicly by multiple // independent entities, e-mail protobuf-global-extension-registry@google.com // to reserve extension numbers. Simply provide your project name (e.g. // Objective-C plugin) and your project website (if available) -- there's no // need to explain how you intend to use them. Usually you only need one // extension number. You can declare multiple options with only one extension // number by putting them in a sub-message. See the Custom Options section of // the docs for examples: // https://developers.google.com/protocol-buffers/docs/proto#options // If this turns out to be popular, a web service will be set up // to automatically assign option numbers. message FileOptions { // Sets the Java package where classes generated from this .proto will be // placed. By default, the proto package is used, but this is often // inappropriate because proto packages do not normally start with backwards // domain names. optional string java_package = 1; // Controls the name of the wrapper Java class generated for the .proto file. // That class will always contain the .proto file's getDescriptor() method as // well as any top-level extensions defined in the .proto file. // If java_multiple_files is disabled, then all the other classes from the // .proto file will be nested inside the single wrapper outer class. optional string java_outer_classname = 8; // If enabled, then the Java code generator will generate a separate .java // file for each top-level message, enum, and service defined in the .proto // file. Thus, these types will *not* be nested inside the wrapper class // named by java_outer_classname. However, the wrapper class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. optional bool java_multiple_files = 10 [default = false]; // This option does nothing. optional bool java_generate_equals_and_hash = 20 [deprecated=true]; // If set true, then the Java2 code generator will generate code that // throws an exception whenever an attempt is made to assign a non-UTF-8 // byte sequence to a string field. // Message reflection will do the same. // However, an extension field still accepts non-UTF-8 byte sequences. // This option has no effect on when used with the lite runtime. optional bool java_string_check_utf8 = 27 [default = false]; // Generated classes can be optimized for speed or code size. enum OptimizeMode { SPEED = 1; // Generate complete code for parsing, serialization, // etc. CODE_SIZE = 2; // Use ReflectionOps to implement these methods. LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. } optional OptimizeMode optimize_for = 9 [default = SPEED]; // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: // - The basename of the package import path, if provided. // - Otherwise, the package statement in the .proto file, if present. // - Otherwise, the basename of the .proto file, without extension. optional string go_package = 11; // Should generic services be generated in each language? "Generic" services // are not specific to any particular RPC system. They are generated by the // main code generators in each language (without additional plugins). // Generic services were the only kind of service generation supported by // early versions of google.protobuf. // // Generic services are now considered deprecated in favor of using plugins // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. optional bool cc_generic_services = 16 [default = false]; optional bool java_generic_services = 17 [default = false]; optional bool py_generic_services = 18 [default = false]; optional bool php_generic_services = 42 [default = false]; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. optional bool deprecated = 23 [default = false]; // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. optional bool cc_enable_arenas = 31 [default = true]; // Sets the objective c class prefix which is prepended to all objective c // generated classes from this .proto. There is no default. optional string objc_class_prefix = 36; // Namespace for generated classes; defaults to the package. optional string csharp_namespace = 37; // By default Swift generators will take the proto package and CamelCase it // replacing '.' with underscore and use that to prefix the types/symbols // defined. When this options is provided, they will use this value instead // to prefix the types/symbols defined. optional string swift_prefix = 39; // Sets the php class prefix which is prepended to all php generated classes // from this .proto. Default is empty. optional string php_class_prefix = 40; // Use this option to change the namespace of php generated classes. Default // is empty. When this option is empty, the package name will be used for // determining the namespace. optional string php_namespace = 41; // Use this option to change the namespace of php generated metadata classes. // Default is empty. When this option is empty, the proto file name will be // used for determining the namespace. optional string php_metadata_namespace = 44; // Use this option to change the package of ruby generated classes. Default // is empty. When this option is not set, the package name will be used for // determining the ruby package. optional string ruby_package = 45; // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. // See the documentation for the "Options" section above. extensions 1000 to max; reserved 38; } message MessageOptions { // Set true to use the old proto1 MessageSet wire format for extensions. // This is provided for backwards-compatibility with the MessageSet wire // format. You should not use this for any other reason: It's less // efficient, has fewer features, and is more complicated. // // The message must be defined exactly as follows: // message Foo { // option message_set_wire_format = true; // extensions 4 to max; // } // Note that the message cannot have any defined fields; MessageSets only // have extensions. // // All extensions of your type must be singular messages; e.g. they cannot // be int32s, enums, or repeated messages. // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. optional bool message_set_wire_format = 1 [default = false]; // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". optional bool no_standard_descriptor_accessor = 2 [default = false]; // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. optional bool deprecated = 3 [default = false]; reserved 4, 5, 6; // Whether the message is an automatically generated map entry type for the // maps field. // // For maps fields: // map map_field = 1; // The parsed descriptor looks like: // message MapFieldEntry { // option map_entry = true; // optional KeyType key = 1; // optional ValueType value = 2; // } // repeated MapFieldEntry map_field = 1; // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax // instead. The option should only be implicitly set by the proto compiler // parser. optional bool map_entry = 7; reserved 8; // javalite_serializable reserved 9; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message FieldOptions { // The ctype option instructs the C++ code generator to use a different // representation of the field than it normally would. See the specific // options below. This option is not yet implemented in the open source // release -- sorry, we'll try to include it in a future version! optional CType ctype = 1 [default = STRING]; enum CType { // Default mode. STRING = 0; CORD = 1; STRING_PIECE = 2; } // The packed option can be enabled for repeated primitive fields to enable // a more efficient representation on the wire. Rather than repeatedly // writing the tag and type for each element, the entire array is encoded as // a single length-delimited blob. In proto3, only explicit setting it to // false will avoid using packed encoding. optional bool packed = 2; // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING // is represented as JavaScript string, which avoids loss of precision that // can happen when a large value is converted to a floating point JavaScript. // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to // use the JavaScript "number" type. The behavior of the default option // JS_NORMAL is implementation dependent. // // This option is an enum to permit additional types to be added, e.g. // goog.math.Integer. optional JSType jstype = 6 [default = JS_NORMAL]; enum JSType { // Use the default type. JS_NORMAL = 0; // Use JavaScript strings. JS_STRING = 1; // Use JavaScript numbers. JS_NUMBER = 2; } // Should this field be parsed lazily? Lazy applies only to message-type // fields. It means that when the outer message is initially parsed, the // inner message's contents will not be parsed but instead stored in encoded // form. The inner message will actually be parsed when it is first accessed. // // This is only a hint. Implementations are free to choose whether to use // eager or lazy parsing regardless of the value of this option. However, // setting this option true suggests that the protocol author believes that // using lazy parsing on this field is worth the additional bookkeeping // overhead typically needed to implement it. // // This option does not affect the public interface of any generated code; // all method signatures remain the same. Furthermore, thread-safety of the // interface is not affected by this option; const methods remain safe to // call from multiple threads concurrently, while non-const methods continue // to require exclusive access. // // // Note that implementations may choose not to check required fields within // a lazy sub-message. That is, calling IsInitialized() on the outer message // may return true even if the inner message has missing required fields. // This is necessary because otherwise the inner message would have to be // parsed in order to perform the check, defeating the purpose of lazy // parsing. An implementation which chooses not to check required fields // must be consistent about it. That is, for any particular sub-message, the // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. // // As of 2021, lazy does no correctness checks on the byte stream during // parsing. This may lead to crashes if and when an invalid byte stream is // finally parsed upon access. // // TODO(b/211906113): Enable validation on lazy fields. optional bool lazy = 5 [default = false]; // unverified_lazy does no correctness checks on the byte stream. This should // only be used where lazy with verification is prohibitive for performance // reasons. optional bool unverified_lazy = 15 [default = false]; // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. optional bool deprecated = 3 [default = false]; // For Google-internal migration only. Do not use. optional bool weak = 10 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; reserved 4; // removed jtype } message OneofOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumOptions { // Set this option to true to allow mapping different tag names to the same // value. optional bool allow_alias = 2; // Is this enum deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. optional bool deprecated = 3 [default = false]; reserved 5; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumValueOptions { // Is this enum value deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. optional bool deprecated = 1 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message ServiceOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this service deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. optional bool deprecated = 33 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message MethodOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this method deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. optional bool deprecated = 33 [default = false]; // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, // or neither? HTTP based RPC implementation may choose GET verb for safe // methods, and PUT verb for idempotent methods instead of the default POST. enum IdempotencyLevel { IDEMPOTENCY_UNKNOWN = 0; NO_SIDE_EFFECTS = 1; // implies idempotent IDEMPOTENT = 2; // idempotent, but may have side effects } optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // A message representing a option the parser does not recognize. This only // appears in options protos created by the compiler::Parser class. // DescriptorPool resolves these when building Descriptor objects. Therefore, // options protos in descriptor objects (e.g. returned by Descriptor::options(), // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions // in them. message UninterpretedOption { // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents // "foo.(bar.baz).qux". message NamePart { required string name_part = 1; required bool is_extension = 2; } repeated NamePart name = 2; // The value of the uninterpreted option, in whatever type the tokenizer // identified it as during parsing. Exactly one of these should be set. optional string identifier_value = 3; optional uint64 positive_int_value = 4; optional int64 negative_int_value = 5; optional double double_value = 6; optional bytes string_value = 7; optional string aggregate_value = 8; } // =================================================================== // Optional source code info // Encapsulates information about the original source file from which a // FileDescriptorProto was generated. message SourceCodeInfo { // A Location identifies a piece of source code in a .proto file which // corresponds to a particular definition. This information is intended // to be useful to IDEs, code indexers, documentation generators, and similar // tools. // // For example, say we have a file like: // message Foo { // optional string foo = 1; // } // Let's look at just the field definition: // optional string foo = 1; // ^ ^^ ^^ ^ ^^^ // a bc de f ghi // We have the following locations: // span path represents // [a,i) [ 4, 0, 2, 0 ] The whole field definition. // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). // // Notes: // - A location may refer to a repeated field itself (i.e. not to any // particular index within it). This is used whenever a set of elements are // logically enclosed in a single code segment. For example, an entire // extend block (possibly containing multiple extension definitions) will // have an outer location whose path refers to the "extensions" repeated // field without an index. // - Multiple locations may have the same path. This happens when a single // logical declaration is spread out across multiple places. The most // obvious example is the "extend" block again -- there may be multiple // extend blocks in the same scope, each of which will have the same path. // - A location's span is not always a subset of its parent's span. For // example, the "extendee" of an extension declaration appears at the // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span // does not mean that it is a descendant. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to // ignore those that it doesn't understand, as more types of locations could // be recorded in the future. repeated Location location = 1; message Location { // Identifies which part of the FileDescriptorProto was defined at this // location. // // Each element is a field number or an index. They form a path from // the root FileDescriptorProto to the place where the definition occurs. // For example, this path: // [ 4, 3, 2, 7, 1 ] // refers to: // file.message_type(3) // 4, 3 // .field(7) // 2, 7 // .name() // 1 // This is because FileDescriptorProto.message_type has field number 4: // repeated DescriptorProto message_type = 4; // and DescriptorProto.field has field number 2: // repeated FieldDescriptorProto field = 2; // and FieldDescriptorProto.name has field number 1: // optional string name = 1; // // Thus, the above path gives the location of a field name. If we removed // the last element: // [ 4, 3, 2, 7 ] // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). repeated int32 path = 1 [packed = true]; // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. repeated int32 span = 2 [packed = true]; // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be // attached to the declaration. // // A series of line comments appearing on consecutive lines, with no other // tokens appearing on those lines, will be treated as a single comment. // // leading_detached_comments will keep paragraphs of comments that appear // before (but not connected to) the current element. Each paragraph, // separated by empty lines, will be one comment element in the repeated // field. // // Only the comment content is provided; comment markers (e.g. //) are // stripped out. For block comments, leading whitespace and an asterisk // will be stripped from the beginning of each line other than the first. // Newlines are included in the output. // // Examples: // // optional int32 foo = 1; // Comment attached to foo. // // Comment attached to bar. // optional int32 bar = 2; // // optional string baz = 3; // // Comment attached to baz. // // Another line attached to baz. // // // Comment attached to qux. // // // // Another line attached to qux. // optional double qux = 4; // // // Detached comment for corge. This is not leading or trailing comments // // to qux or corge because there are blank lines separating it from // // both. // // // Detached comment for corge paragraph 2. // // optional string corge = 5; // /* Block comment attached // * to corge. Leading asterisks // * will be removed. */ // /* Block comment attached to // * grault. */ // optional int32 grault = 6; // // // ignored detached comments. optional string leading_comments = 3; optional string trailing_comments = 4; repeated string leading_detached_comments = 6; } } // Describes the relationship between generated code and its original source // file. A GeneratedCodeInfo message is associated with only one generated // source file, but may contain references to different source .proto files. message GeneratedCodeInfo { // An Annotation connects some span of text in generated code to an element // of its generating .proto file. repeated Annotation annotation = 1; message Annotation { // Identifies the element in the original source .proto file. This field // is formatted the same as SourceCodeInfo.Location.path. repeated int32 path = 1 [packed = true]; // Identifies the filesystem path to the original source .proto. optional string source_file = 2; // Identifies the starting offset in bytes in the generated code // that relates to the identified object. optional int32 begin = 3; // Identifies the ending offset in bytes in the generated code that // relates to the identified offset. The end offset should be one past // the last relevant byte (so the length of the text = end - begin). optional int32 end = 4; } } ================================================ FILE: service/cart/third_party/google/protobuf/duration.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/durationpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DurationProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Duration represents a signed, fixed-length span of time represented // as a count of seconds and fractions of seconds at nanosecond // resolution. It is independent of any calendar and concepts like "day" // or "month". It is related to Timestamp in that the difference between // two Timestamp values is a Duration and it can be added or subtracted // from a Timestamp. Range is approximately +-10,000 years. // // # Examples // // Example 1: Compute Duration from two Timestamps in pseudo code. // // Timestamp start = ...; // Timestamp end = ...; // Duration duration = ...; // // duration.seconds = end.seconds - start.seconds; // duration.nanos = end.nanos - start.nanos; // // if (duration.seconds < 0 && duration.nanos > 0) { // duration.seconds += 1; // duration.nanos -= 1000000000; // } else if (duration.seconds > 0 && duration.nanos < 0) { // duration.seconds -= 1; // duration.nanos += 1000000000; // } // // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. // // Timestamp start = ...; // Duration duration = ...; // Timestamp end = ...; // // end.seconds = start.seconds + duration.seconds; // end.nanos = start.nanos + duration.nanos; // // if (end.nanos < 0) { // end.seconds -= 1; // end.nanos += 1000000000; // } else if (end.nanos >= 1000000000) { // end.seconds += 1; // end.nanos -= 1000000000; // } // // Example 3: Compute Duration from datetime.timedelta in Python. // // td = datetime.timedelta(days=3, minutes=10) // duration = Duration() // duration.FromTimedelta(td) // // # JSON Mapping // // In JSON format, the Duration type is encoded as a string rather than an // object, where the string ends in the suffix "s" (indicating seconds) and // is preceded by the number of seconds, with nanoseconds expressed as // fractional seconds. For example, 3 seconds with 0 nanoseconds should be // encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should // be expressed in JSON format as "3.000000001s", and 3 seconds and 1 // microsecond should be expressed in JSON format as "3.000001s". // // message Duration { // Signed seconds of the span of time. Must be from -315,576,000,000 // to +315,576,000,000 inclusive. Note: these bounds are computed from: // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years int64 seconds = 1; // Signed fractions of a second at nanosecond resolution of the span // of time. Durations less than one second are represented with a 0 // `seconds` field and a positive or negative `nanos` field. For durations // of one second or more, a non-zero value for the `nanos` field must be // of the same sign as the `seconds` field. Must be from -999,999,999 // to +999,999,999 inclusive. int32 nanos = 2; } ================================================ FILE: service/cart/third_party/google/protobuf/empty.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "google.golang.org/protobuf/types/known/emptypb"; option java_package = "com.google.protobuf"; option java_outer_classname = "EmptyProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option cc_enable_arenas = true; // A generic empty message that you can re-use to avoid defining duplicated // empty messages in your APIs. A typical example is to use it as the request // or the response type of an API method. For instance: // // service Foo { // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); // } // // The JSON representation for `Empty` is empty JSON object `{}`. message Empty {} ================================================ FILE: service/cart/third_party/google/protobuf/field_mask.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "FieldMaskProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; option cc_enable_arenas = true; // `FieldMask` represents a set of symbolic field paths, for example: // // paths: "f.a" // paths: "f.b.d" // // Here `f` represents a field in some root message, `a` and `b` // fields in the message found in `f`, and `d` a field found in the // message in `f.b`. // // Field masks are used to specify a subset of fields that should be // returned by a get operation or modified by an update operation. // Field masks also have a custom JSON encoding (see below). // // # Field Masks in Projections // // When used in the context of a projection, a response message or // sub-message is filtered by the API to only contain those fields as // specified in the mask. For example, if the mask in the previous // example is applied to a response message as follows: // // f { // a : 22 // b { // d : 1 // x : 2 // } // y : 13 // } // z: 8 // // The result will not contain specific values for fields x,y and z // (their value will be set to the default, and omitted in proto text // output): // // // f { // a : 22 // b { // d : 1 // } // } // // A repeated field is not allowed except at the last position of a // paths string. // // If a FieldMask object is not present in a get operation, the // operation applies to all fields (as if a FieldMask of all fields // had been specified). // // Note that a field mask does not necessarily apply to the // top-level response message. In case of a REST get operation, the // field mask applies directly to the response, but in case of a REST // list operation, the mask instead applies to each individual message // in the returned resource list. In case of a REST custom method, // other definitions may be used. Where the mask applies will be // clearly documented together with its declaration in the API. In // any case, the effect on the returned resource/resources is required // behavior for APIs. // // # Field Masks in Update Operations // // A field mask in update operations specifies which fields of the // targeted resource are going to be updated. The API is required // to only change the values of the fields as specified in the mask // and leave the others untouched. If a resource is passed in to // describe the updated values, the API ignores the values of all // fields not covered by the mask. // // If a repeated field is specified for an update operation, new values will // be appended to the existing repeated field in the target resource. Note that // a repeated field is only allowed in the last position of a `paths` string. // // If a sub-message is specified in the last position of the field mask for an // update operation, then new value will be merged into the existing sub-message // in the target resource. // // For example, given the target message: // // f { // b { // d: 1 // x: 2 // } // c: [1] // } // // And an update message: // // f { // b { // d: 10 // } // c: [2] // } // // then if the field mask is: // // paths: ["f.b", "f.c"] // // then the result will be: // // f { // b { // d: 10 // x: 2 // } // c: [1, 2] // } // // An implementation may provide options to override this default behavior for // repeated and message fields. // // In order to reset a field's value to the default, the field must // be in the mask and set to the default value in the provided resource. // Hence, in order to reset all fields of a resource, provide a default // instance of the resource and set all fields in the mask, or do // not provide a mask as described below. // // If a field mask is not present on update, the operation applies to // all fields (as if a field mask of all fields has been specified). // Note that in the presence of schema evolution, this may mean that // fields the client does not know and has therefore not filled into // the request will be reset to their default. If this is unwanted // behavior, a specific service may require a client to always specify // a field mask, producing an error if not. // // As with get operations, the location of the resource which // describes the updated values in the request message depends on the // operation kind. In any case, the effect of the field mask is // required to be honored by the API. // // ## Considerations for HTTP REST // // The HTTP kind of an update operation which uses a field mask must // be set to PATCH instead of PUT in order to satisfy HTTP semantics // (PUT must only be used for full updates). // // # JSON Encoding of Field Masks // // In JSON, a field mask is encoded as a single string where paths are // separated by a comma. Fields name in each path are converted // to/from lower-camel naming conventions. // // As an example, consider the following message declarations: // // message Profile { // User user = 1; // Photo photo = 2; // } // message User { // string display_name = 1; // string address = 2; // } // // In proto a field mask for `Profile` may look as such: // // mask { // paths: "user.display_name" // paths: "photo" // } // // In JSON, the same mask is represented as below: // // { // mask: "user.displayName,photo" // } // // # Field Masks and Oneof Fields // // Field masks treat fields in oneofs just as regular fields. Consider the // following message: // // message SampleMessage { // oneof test_oneof { // string name = 4; // SubMessage sub_message = 9; // } // } // // The field mask can be: // // mask { // paths: "name" // } // // Or: // // mask { // paths: "sub_message" // } // // Note that oneof type names ("test_oneof" in this case) cannot be used in // paths. // // ## Field Mask Verification // // The implementation of any API method which has a FieldMask type field in the // request should verify the included field paths, and return an // `INVALID_ARGUMENT` error if any path is unmappable. message FieldMask { // The set of field mask paths. repeated string paths = 1; } ================================================ FILE: service/cart/third_party/google/protobuf/source_context.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "SourceContextProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; // `SourceContext` represents information about the source of a // protobuf element, like the file in which it is defined. message SourceContext { // The path-qualified name of the .proto file that contained the associated // protobuf element. For example: `"google/protobuf/source_context.proto"`. string file_name = 1; } ================================================ FILE: service/cart/third_party/google/protobuf/struct.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/structpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "StructProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // `Struct` represents a structured data value, consisting of fields // which map to dynamically typed values. In some languages, `Struct` // might be supported by a native representation. For example, in // scripting languages like JS a struct is represented as an // object. The details of that representation are described together // with the proto support for the language. // // The JSON representation for `Struct` is JSON object. message Struct { // Unordered map of dynamically typed values. map fields = 1; } // `Value` represents a dynamically typed value which can be either // null, a number, a string, a boolean, a recursive struct value, or a // list of values. A producer of value is expected to set one of these // variants. Absence of any variant indicates an error. // // The JSON representation for `Value` is JSON value. message Value { // The kind of value. oneof kind { // Represents a null value. NullValue null_value = 1; // Represents a double value. double number_value = 2; // Represents a string value. string string_value = 3; // Represents a boolean value. bool bool_value = 4; // Represents a structured value. Struct struct_value = 5; // Represents a repeated `Value`. ListValue list_value = 6; } } // `NullValue` is a singleton enumeration to represent the null value for the // `Value` type union. // // The JSON representation for `NullValue` is JSON `null`. enum NullValue { // Null value. NULL_VALUE = 0; } // `ListValue` is a wrapper around a repeated field of values. // // The JSON representation for `ListValue` is JSON array. message ListValue { // Repeated field of dynamically typed values. repeated Value values = 1; } ================================================ FILE: service/cart/third_party/google/protobuf/timestamp.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/timestamppb"; option java_package = "com.google.protobuf"; option java_outer_classname = "TimestampProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Timestamp represents a point in time independent of any time zone or local // calendar, encoded as a count of seconds and fractions of seconds at // nanosecond resolution. The count is relative to an epoch at UTC midnight on // January 1, 1970, in the proleptic Gregorian calendar which extends the // Gregorian calendar backwards to year one. // // All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap // second table is needed for interpretation, using a [24-hour linear // smear](https://developers.google.com/time/smear). // // The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By // restricting to that range, we ensure that we can convert to and from [RFC // 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. // // # Examples // // Example 1: Compute Timestamp from POSIX `time()`. // // Timestamp timestamp; // timestamp.set_seconds(time(NULL)); // timestamp.set_nanos(0); // // Example 2: Compute Timestamp from POSIX `gettimeofday()`. // // struct timeval tv; // gettimeofday(&tv, NULL); // // Timestamp timestamp; // timestamp.set_seconds(tv.tv_sec); // timestamp.set_nanos(tv.tv_usec * 1000); // // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. // // FILETIME ft; // GetSystemTimeAsFileTime(&ft); // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. // Timestamp timestamp; // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); // // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. // // long millis = System.currentTimeMillis(); // // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) // .setNanos((int) ((millis % 1000) * 1000000)).build(); // // // Example 5: Compute Timestamp from Java `Instant.now()`. // // Instant now = Instant.now(); // // Timestamp timestamp = // Timestamp.newBuilder().setSeconds(now.getEpochSecond()) // .setNanos(now.getNano()).build(); // // // Example 6: Compute Timestamp from current time in Python. // // timestamp = Timestamp() // timestamp.GetCurrentTime() // // # JSON Mapping // // In JSON format, the Timestamp type is encoded as a string in the // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" // where {year} is always expressed using four digits while {month}, {day}, // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone // is required. A proto3 JSON serializer should always use UTC (as indicated by // "Z") when printing the Timestamp type and a proto3 JSON parser should be // able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. // // In JavaScript, one can convert a Date object to this format using the // standard // [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) // method. In Python, a standard `datetime.datetime` object can be converted // to this format using // [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with // the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use // the Joda Time's [`ISODateTimeFormat.dateTime()`]( // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D // ) to obtain a formatter capable of generating timestamps in this format. // // message Timestamp { // Represents seconds of UTC time since Unix epoch // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to // 9999-12-31T23:59:59Z inclusive. int64 seconds = 1; // Non-negative fractions of a second at nanosecond resolution. Negative // second values with fractions must still have non-negative nanos values // that count forward in time. Must be from 0 to 999,999,999 // inclusive. int32 nanos = 2; } ================================================ FILE: service/cart/third_party/google/protobuf/type.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; import "google/protobuf/any.proto"; import "google/protobuf/source_context.proto"; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option java_package = "com.google.protobuf"; option java_outer_classname = "TypeProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/typepb"; // A protocol buffer message type. message Type { // The fully qualified message name. string name = 1; // The list of fields. repeated Field fields = 2; // The list of types appearing in `oneof` definitions in this type. repeated string oneofs = 3; // The protocol buffer options. repeated Option options = 4; // The source context. SourceContext source_context = 5; // The source syntax. Syntax syntax = 6; } // A single field of a message type. message Field { // Basic field types. enum Kind { // Field type unknown. TYPE_UNKNOWN = 0; // Field type double. TYPE_DOUBLE = 1; // Field type float. TYPE_FLOAT = 2; // Field type int64. TYPE_INT64 = 3; // Field type uint64. TYPE_UINT64 = 4; // Field type int32. TYPE_INT32 = 5; // Field type fixed64. TYPE_FIXED64 = 6; // Field type fixed32. TYPE_FIXED32 = 7; // Field type bool. TYPE_BOOL = 8; // Field type string. TYPE_STRING = 9; // Field type group. Proto2 syntax only, and deprecated. TYPE_GROUP = 10; // Field type message. TYPE_MESSAGE = 11; // Field type bytes. TYPE_BYTES = 12; // Field type uint32. TYPE_UINT32 = 13; // Field type enum. TYPE_ENUM = 14; // Field type sfixed32. TYPE_SFIXED32 = 15; // Field type sfixed64. TYPE_SFIXED64 = 16; // Field type sint32. TYPE_SINT32 = 17; // Field type sint64. TYPE_SINT64 = 18; } // Whether a field is optional, required, or repeated. enum Cardinality { // For fields with unknown cardinality. CARDINALITY_UNKNOWN = 0; // For optional fields. CARDINALITY_OPTIONAL = 1; // For required fields. Proto2 syntax only. CARDINALITY_REQUIRED = 2; // For repeated fields. CARDINALITY_REPEATED = 3; } // The field type. Kind kind = 1; // The field cardinality. Cardinality cardinality = 2; // The field number. int32 number = 3; // The field name. string name = 4; // The field type URL, without the scheme, for message or enumeration // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. string type_url = 6; // The index of the field type in `Type.oneofs`, for message or enumeration // types. The first type has index 1; zero means the type is not in the list. int32 oneof_index = 7; // Whether to use alternative packed wire representation. bool packed = 8; // The protocol buffer options. repeated Option options = 9; // The field JSON name. string json_name = 10; // The string value of the default value of this field. Proto2 syntax only. string default_value = 11; } // Enum type definition. message Enum { // Enum type name. string name = 1; // Enum value definitions. repeated EnumValue enumvalue = 2; // Protocol buffer options. repeated Option options = 3; // The source context. SourceContext source_context = 4; // The source syntax. Syntax syntax = 5; } // Enum value definition. message EnumValue { // Enum value name. string name = 1; // Enum value number. int32 number = 2; // Protocol buffer options. repeated Option options = 3; } // A protocol buffer option, which can be attached to a message, field, // enumeration, etc. message Option { // The option's name. For protobuf built-in options (options defined in // descriptor.proto), this is the short name. For example, `"map_entry"`. // For custom options, it should be the fully-qualified name. For example, // `"google.api.http"`. string name = 1; // The option's value packed in an Any message. If the value is a primitive, // the corresponding wrapper type defined in google/protobuf/wrappers.proto // should be used. If the value is an enum, it should be stored as an int32 // value using the google.protobuf.Int32Value type. Any value = 2; } // The syntax in which a protocol buffer element is defined. enum Syntax { // Syntax `proto2`. SYNTAX_PROTO2 = 0; // Syntax `proto3`. SYNTAX_PROTO3 = 1; } ================================================ FILE: service/cart/third_party/google/protobuf/wrappers.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Wrappers for primitive (non-message) types. These types are useful // for embedding primitives in the `google.protobuf.Any` type and for places // where we need to distinguish between the absence of a primitive // typed field and its default value. // // These wrappers have no meaningful use within repeated fields as they lack // the ability to detect presence on individual elements. // These wrappers have no meaningful use within a map or a oneof since // individual entries of a map or fields of a oneof can already detect presence. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; option java_package = "com.google.protobuf"; option java_outer_classname = "WrappersProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // Wrapper message for `double`. // // The JSON representation for `DoubleValue` is JSON number. message DoubleValue { // The double value. double value = 1; } // Wrapper message for `float`. // // The JSON representation for `FloatValue` is JSON number. message FloatValue { // The float value. float value = 1; } // Wrapper message for `int64`. // // The JSON representation for `Int64Value` is JSON string. message Int64Value { // The int64 value. int64 value = 1; } // Wrapper message for `uint64`. // // The JSON representation for `UInt64Value` is JSON string. message UInt64Value { // The uint64 value. uint64 value = 1; } // Wrapper message for `int32`. // // The JSON representation for `Int32Value` is JSON number. message Int32Value { // The int32 value. int32 value = 1; } // Wrapper message for `uint32`. // // The JSON representation for `UInt32Value` is JSON number. message UInt32Value { // The uint32 value. uint32 value = 1; } // Wrapper message for `bool`. // // The JSON representation for `BoolValue` is JSON `true` and `false`. message BoolValue { // The bool value. bool value = 1; } // Wrapper message for `string`. // // The JSON representation for `StringValue` is JSON string. message StringValue { // The string value. string value = 1; } // Wrapper message for `bytes`. // // The JSON representation for `BytesValue` is JSON string. message BytesValue { // The bytes value. bytes value = 1; } ================================================ FILE: service/cart/third_party/openapi/v3/annotations.proto ================================================ // Copyright 2022 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package openapi.v3; import "openapiv3/OpenAPIv3.proto"; import "google/protobuf/descriptor.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "AnnotationsProto"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapi_v3"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; // The Go package name. option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; extend google.protobuf.FileOptions { Document document = 1143; } extend google.protobuf.MethodOptions { Operation operation = 1143; } extend google.protobuf.MessageOptions { Schema schema = 1143; } extend google.protobuf.FieldOptions { Schema property = 1143; } ================================================ FILE: service/cart/third_party/openapi/v3/openapi.proto ================================================ // Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // THIS FILE IS AUTOMATICALLY GENERATED. syntax = "proto3"; package openapi.v3; import "google/protobuf/any.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "OpenAPIProto"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapi_v3"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; // The Go package name. option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; message AdditionalPropertiesItem { oneof oneof { SchemaOrReference schema_or_reference = 1; bool boolean = 2; } } message Any { google.protobuf.Any value = 1; string yaml = 2; } message AnyOrExpression { oneof oneof { Any any = 1; Expression expression = 2; } } // A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation. message Callback { repeated NamedPathItem path = 1; repeated NamedAny specification_extension = 2; } message CallbackOrReference { oneof oneof { Callback callback = 1; Reference reference = 2; } } message CallbacksOrReferences { repeated NamedCallbackOrReference additional_properties = 1; } // Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. message Components { SchemasOrReferences schemas = 1; ResponsesOrReferences responses = 2; ParametersOrReferences parameters = 3; ExamplesOrReferences examples = 4; RequestBodiesOrReferences request_bodies = 5; HeadersOrReferences headers = 6; SecuritySchemesOrReferences security_schemes = 7; LinksOrReferences links = 8; CallbacksOrReferences callbacks = 9; repeated NamedAny specification_extension = 10; } // Contact information for the exposed API. message Contact { string name = 1; string url = 2; string email = 3; repeated NamedAny specification_extension = 4; } message DefaultType { oneof oneof { double number = 1; bool boolean = 2; string string = 3; } } // When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it. When using the discriminator, _inline_ schemas will not be considered. message Discriminator { string property_name = 1; Strings mapping = 2; repeated NamedAny specification_extension = 3; } message Document { string openapi = 1; Info info = 2; repeated Server servers = 3; Paths paths = 4; Components components = 5; repeated SecurityRequirement security = 6; repeated Tag tags = 7; ExternalDocs external_docs = 8; repeated NamedAny specification_extension = 9; } // A single encoding definition applied to a single schema property. message Encoding { string content_type = 1; HeadersOrReferences headers = 2; string style = 3; bool explode = 4; bool allow_reserved = 5; repeated NamedAny specification_extension = 6; } message Encodings { repeated NamedEncoding additional_properties = 1; } message Example { string summary = 1; string description = 2; Any value = 3; string external_value = 4; repeated NamedAny specification_extension = 5; } message ExampleOrReference { oneof oneof { Example example = 1; Reference reference = 2; } } message ExamplesOrReferences { repeated NamedExampleOrReference additional_properties = 1; } message Expression { repeated NamedAny additional_properties = 1; } // Allows referencing an external resource for extended documentation. message ExternalDocs { string description = 1; string url = 2; repeated NamedAny specification_extension = 3; } // The Header Object follows the structure of the Parameter Object with the following changes: 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map. 1. `in` MUST NOT be specified, it is implicitly in `header`. 1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, `style`). message Header { string description = 1; bool required = 2; bool deprecated = 3; bool allow_empty_value = 4; string style = 5; bool explode = 6; bool allow_reserved = 7; SchemaOrReference schema = 8; Any example = 9; ExamplesOrReferences examples = 10; MediaTypes content = 11; repeated NamedAny specification_extension = 12; } message HeaderOrReference { oneof oneof { Header header = 1; Reference reference = 2; } } message HeadersOrReferences { repeated NamedHeaderOrReference additional_properties = 1; } // The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. message Info { string title = 1; string description = 2; string terms_of_service = 3; Contact contact = 4; License license = 5; string version = 6; repeated NamedAny specification_extension = 7; string summary = 8; } message ItemsItem { repeated SchemaOrReference schema_or_reference = 1; } // License information for the exposed API. message License { string name = 1; string url = 2; repeated NamedAny specification_extension = 3; } // The `Link object` represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations. Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response. For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation. message Link { string operation_ref = 1; string operation_id = 2; AnyOrExpression parameters = 3; AnyOrExpression request_body = 4; string description = 5; Server server = 6; repeated NamedAny specification_extension = 7; } message LinkOrReference { oneof oneof { Link link = 1; Reference reference = 2; } } message LinksOrReferences { repeated NamedLinkOrReference additional_properties = 1; } // Each Media Type Object provides schema and examples for the media type identified by its key. message MediaType { SchemaOrReference schema = 1; Any example = 2; ExamplesOrReferences examples = 3; Encodings encoding = 4; repeated NamedAny specification_extension = 5; } message MediaTypes { repeated NamedMediaType additional_properties = 1; } // Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. message NamedAny { // Map key string name = 1; // Mapped value Any value = 2; } // Automatically-generated message used to represent maps of CallbackOrReference as ordered (name,value) pairs. message NamedCallbackOrReference { // Map key string name = 1; // Mapped value CallbackOrReference value = 2; } // Automatically-generated message used to represent maps of Encoding as ordered (name,value) pairs. message NamedEncoding { // Map key string name = 1; // Mapped value Encoding value = 2; } // Automatically-generated message used to represent maps of ExampleOrReference as ordered (name,value) pairs. message NamedExampleOrReference { // Map key string name = 1; // Mapped value ExampleOrReference value = 2; } // Automatically-generated message used to represent maps of HeaderOrReference as ordered (name,value) pairs. message NamedHeaderOrReference { // Map key string name = 1; // Mapped value HeaderOrReference value = 2; } // Automatically-generated message used to represent maps of LinkOrReference as ordered (name,value) pairs. message NamedLinkOrReference { // Map key string name = 1; // Mapped value LinkOrReference value = 2; } // Automatically-generated message used to represent maps of MediaType as ordered (name,value) pairs. message NamedMediaType { // Map key string name = 1; // Mapped value MediaType value = 2; } // Automatically-generated message used to represent maps of ParameterOrReference as ordered (name,value) pairs. message NamedParameterOrReference { // Map key string name = 1; // Mapped value ParameterOrReference value = 2; } // Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. message NamedPathItem { // Map key string name = 1; // Mapped value PathItem value = 2; } // Automatically-generated message used to represent maps of RequestBodyOrReference as ordered (name,value) pairs. message NamedRequestBodyOrReference { // Map key string name = 1; // Mapped value RequestBodyOrReference value = 2; } // Automatically-generated message used to represent maps of ResponseOrReference as ordered (name,value) pairs. message NamedResponseOrReference { // Map key string name = 1; // Mapped value ResponseOrReference value = 2; } // Automatically-generated message used to represent maps of SchemaOrReference as ordered (name,value) pairs. message NamedSchemaOrReference { // Map key string name = 1; // Mapped value SchemaOrReference value = 2; } // Automatically-generated message used to represent maps of SecuritySchemeOrReference as ordered (name,value) pairs. message NamedSecuritySchemeOrReference { // Map key string name = 1; // Mapped value SecuritySchemeOrReference value = 2; } // Automatically-generated message used to represent maps of ServerVariable as ordered (name,value) pairs. message NamedServerVariable { // Map key string name = 1; // Mapped value ServerVariable value = 2; } // Automatically-generated message used to represent maps of string as ordered (name,value) pairs. message NamedString { // Map key string name = 1; // Mapped value string value = 2; } // Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. message NamedStringArray { // Map key string name = 1; // Mapped value StringArray value = 2; } // Configuration details for a supported OAuth Flow message OauthFlow { string authorization_url = 1; string token_url = 2; string refresh_url = 3; Strings scopes = 4; repeated NamedAny specification_extension = 5; } // Allows configuration of the supported OAuth Flows. message OauthFlows { OauthFlow implicit = 1; OauthFlow password = 2; OauthFlow client_credentials = 3; OauthFlow authorization_code = 4; repeated NamedAny specification_extension = 5; } message Object { repeated NamedAny additional_properties = 1; } // Describes a single API operation on a path. message Operation { repeated string tags = 1; string summary = 2; string description = 3; ExternalDocs external_docs = 4; string operation_id = 5; repeated ParameterOrReference parameters = 6; RequestBodyOrReference request_body = 7; Responses responses = 8; CallbacksOrReferences callbacks = 9; bool deprecated = 10; repeated SecurityRequirement security = 11; repeated Server servers = 12; repeated NamedAny specification_extension = 13; } // Describes a single operation parameter. A unique parameter is defined by a combination of a name and location. message Parameter { string name = 1; string in = 2; string description = 3; bool required = 4; bool deprecated = 5; bool allow_empty_value = 6; string style = 7; bool explode = 8; bool allow_reserved = 9; SchemaOrReference schema = 10; Any example = 11; ExamplesOrReferences examples = 12; MediaTypes content = 13; repeated NamedAny specification_extension = 14; } message ParameterOrReference { oneof oneof { Parameter parameter = 1; Reference reference = 2; } } message ParametersOrReferences { repeated NamedParameterOrReference additional_properties = 1; } // Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available. message PathItem { string _ref = 1; string summary = 2; string description = 3; Operation get = 4; Operation put = 5; Operation post = 6; Operation delete = 7; Operation options = 8; Operation head = 9; Operation patch = 10; Operation trace = 11; repeated Server servers = 12; repeated ParameterOrReference parameters = 13; repeated NamedAny specification_extension = 14; } // Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the `Server Object` in order to construct the full URL. The Paths MAY be empty, due to ACL constraints. message Paths { repeated NamedPathItem path = 1; repeated NamedAny specification_extension = 2; } message Properties { repeated NamedSchemaOrReference additional_properties = 1; } // A simple object to allow referencing other components in the specification, internally and externally. The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification. message Reference { string _ref = 1; string summary = 2; string description = 3; } message RequestBodiesOrReferences { repeated NamedRequestBodyOrReference additional_properties = 1; } // Describes a single request body. message RequestBody { string description = 1; MediaTypes content = 2; bool required = 3; repeated NamedAny specification_extension = 4; } message RequestBodyOrReference { oneof oneof { RequestBody request_body = 1; Reference reference = 2; } } // Describes a single response from an API Operation, including design-time, static `links` to operations based on the response. message Response { string description = 1; HeadersOrReferences headers = 2; MediaTypes content = 3; LinksOrReferences links = 4; repeated NamedAny specification_extension = 5; } message ResponseOrReference { oneof oneof { Response response = 1; Reference reference = 2; } } // A container for the expected responses of an operation. The container maps a HTTP response code to the expected response. The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors. The `default` MAY be used as a default response object for all HTTP codes that are not covered individually by the specification. The `Responses Object` MUST contain at least one response code, and it SHOULD be the response for a successful operation call. message Responses { ResponseOrReference default = 1; repeated NamedResponseOrReference response_or_reference = 2; repeated NamedAny specification_extension = 3; } message ResponsesOrReferences { repeated NamedResponseOrReference additional_properties = 1; } // The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the JSON Schema Specification Wright Draft 00. For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema. message Schema { bool nullable = 1; Discriminator discriminator = 2; bool read_only = 3; bool write_only = 4; Xml xml = 5; ExternalDocs external_docs = 6; Any example = 7; bool deprecated = 8; string title = 9; double multiple_of = 10; double maximum = 11; bool exclusive_maximum = 12; double minimum = 13; bool exclusive_minimum = 14; int64 max_length = 15; int64 min_length = 16; string pattern = 17; int64 max_items = 18; int64 min_items = 19; bool unique_items = 20; int64 max_properties = 21; int64 min_properties = 22; repeated string required = 23; repeated Any enum = 24; string type = 25; repeated SchemaOrReference all_of = 26; repeated SchemaOrReference one_of = 27; repeated SchemaOrReference any_of = 28; Schema not = 29; ItemsItem items = 30; Properties properties = 31; AdditionalPropertiesItem additional_properties = 32; DefaultType default = 33; string description = 34; string format = 35; repeated NamedAny specification_extension = 36; } message SchemaOrReference { oneof oneof { Schema schema = 1; Reference reference = 2; } } message SchemasOrReferences { repeated NamedSchemaOrReference additional_properties = 1; } // Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object. Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information. When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object, only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request. message SecurityRequirement { repeated NamedStringArray additional_properties = 1; } // Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect. Please note that currently (2019) the implicit flow is about to be deprecated OAuth 2.0 Security Best Current Practice. Recommended for most use case is Authorization Code Grant flow with PKCE. message SecurityScheme { string type = 1; string description = 2; string name = 3; string in = 4; string scheme = 5; string bearer_format = 6; OauthFlows flows = 7; string open_id_connect_url = 8; repeated NamedAny specification_extension = 9; } message SecuritySchemeOrReference { oneof oneof { SecurityScheme security_scheme = 1; Reference reference = 2; } } message SecuritySchemesOrReferences { repeated NamedSecuritySchemeOrReference additional_properties = 1; } // An object representing a Server. message Server { string url = 1; string description = 2; ServerVariables variables = 3; repeated NamedAny specification_extension = 4; } // An object representing a Server Variable for server URL template substitution. message ServerVariable { repeated string enum = 1; string default = 2; string description = 3; repeated NamedAny specification_extension = 4; } message ServerVariables { repeated NamedServerVariable additional_properties = 1; } // Any property starting with x- is valid. message SpecificationExtension { oneof oneof { double number = 1; bool boolean = 2; string string = 3; } } message StringArray { repeated string value = 1; } message Strings { repeated NamedString additional_properties = 1; } // Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. message Tag { string name = 1; string description = 2; ExternalDocs external_docs = 3; repeated NamedAny specification_extension = 4; } // A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior. message Xml { string name = 1; string namespace = 2; string prefix = 3; bool attribute = 4; bool wrapped = 5; repeated NamedAny specification_extension = 6; } ================================================ FILE: service/cart/third_party/validate/README.md ================================================ # protoc-gen-validate (PGV) * https://github.com/envoyproxy/protoc-gen-validate ================================================ FILE: service/cart/third_party/validate/validate.proto ================================================ syntax = "proto2"; package validate; option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; option java_package = "io.envoyproxy.pgv.validate"; import "google/protobuf/descriptor.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; // Validation rules applied at the message level extend google.protobuf.MessageOptions { // Disabled nullifies any validation rules for this message, including any // message fields associated with it that do support validation. optional bool disabled = 1071; // Ignore skips generation of validation methods for this message. optional bool ignored = 1072; } // Validation rules applied at the oneof level extend google.protobuf.OneofOptions { // Required ensures that exactly one the field options in a oneof is set; // validation fails if no fields in the oneof are set. optional bool required = 1071; } // Validation rules applied at the field level extend google.protobuf.FieldOptions { // Rules specify the validations to be performed on this field. By default, // no validation is performed against a field. optional FieldRules rules = 1071; } // FieldRules encapsulates the rules for each type of field. Depending on the // field, the correct set should be used to ensure proper validations. message FieldRules { optional MessageRules message = 17; oneof type { // Scalar Field Types FloatRules float = 1; DoubleRules double = 2; Int32Rules int32 = 3; Int64Rules int64 = 4; UInt32Rules uint32 = 5; UInt64Rules uint64 = 6; SInt32Rules sint32 = 7; SInt64Rules sint64 = 8; Fixed32Rules fixed32 = 9; Fixed64Rules fixed64 = 10; SFixed32Rules sfixed32 = 11; SFixed64Rules sfixed64 = 12; BoolRules bool = 13; StringRules string = 14; BytesRules bytes = 15; // Complex Field Types EnumRules enum = 16; RepeatedRules repeated = 18; MapRules map = 19; // Well-Known Field Types AnyRules any = 20; DurationRules duration = 21; TimestampRules timestamp = 22; } } // FloatRules describes the constraints applied to `float` values message FloatRules { // Const specifies that this field must be exactly the specified value optional float const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional float lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional float lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional float gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional float gte = 5; // In specifies that this field must be equal to one of the specified // values repeated float in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated float not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // DoubleRules describes the constraints applied to `double` values message DoubleRules { // Const specifies that this field must be exactly the specified value optional double const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional double lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional double lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional double gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional double gte = 5; // In specifies that this field must be equal to one of the specified // values repeated double in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated double not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int32Rules describes the constraints applied to `int32` values message Int32Rules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int64Rules describes the constraints applied to `int64` values message Int64Rules { // Const specifies that this field must be exactly the specified value optional int64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt32Rules describes the constraints applied to `uint32` values message UInt32Rules { // Const specifies that this field must be exactly the specified value optional uint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt64Rules describes the constraints applied to `uint64` values message UInt64Rules { // Const specifies that this field must be exactly the specified value optional uint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt32Rules describes the constraints applied to `sint32` values message SInt32Rules { // Const specifies that this field must be exactly the specified value optional sint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt64Rules describes the constraints applied to `sint64` values message SInt64Rules { // Const specifies that this field must be exactly the specified value optional sint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed32Rules describes the constraints applied to `fixed32` values message Fixed32Rules { // Const specifies that this field must be exactly the specified value optional fixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed64Rules describes the constraints applied to `fixed64` values message Fixed64Rules { // Const specifies that this field must be exactly the specified value optional fixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed32Rules describes the constraints applied to `sfixed32` values message SFixed32Rules { // Const specifies that this field must be exactly the specified value optional sfixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed64Rules describes the constraints applied to `sfixed64` values message SFixed64Rules { // Const specifies that this field must be exactly the specified value optional sfixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // BoolRules describes the constraints applied to `bool` values message BoolRules { // Const specifies that this field must be exactly the specified value optional bool const = 1; } // StringRules describe the constraints applied to `string` values message StringRules { // Const specifies that this field must be exactly the specified value optional string const = 1; // Len specifies that this field must be the specified number of // characters (Unicode code points). Note that the number of // characters may differ from the number of bytes in the string. optional uint64 len = 19; // MinLen specifies that this field must be the specified number of // characters (Unicode code points) at a minimum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of // characters (Unicode code points) at a maximum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 max_len = 3; // LenBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 len_bytes = 20; // MinBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_bytes = 4; // MaxBytes specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_bytes = 5; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 6; // Prefix specifies that this field must have the specified substring at // the beginning of the string. optional string prefix = 7; // Suffix specifies that this field must have the specified substring at // the end of the string. optional string suffix = 8; // Contains specifies that this field must have the specified substring // anywhere in the string. optional string contains = 9; // NotContains specifies that this field cannot have the specified substring // anywhere in the string. optional string not_contains = 23; // In specifies that this field must be equal to one of the specified // values repeated string in = 10; // NotIn specifies that this field cannot be equal to one of the specified // values repeated string not_in = 11; // WellKnown rules provide advanced constraints against common string // patterns oneof well_known { // Email specifies that the field must be a valid email address as // defined by RFC 5322 bool email = 12; // Hostname specifies that the field must be a valid hostname as // defined by RFC 1034. This constraint does not support // internationalized domain names (IDNs). bool hostname = 13; // Ip specifies that the field must be a valid IP (v4 or v6) address. // Valid IPv6 addresses should not include surrounding square brackets. bool ip = 14; // Ipv4 specifies that the field must be a valid IPv4 address. bool ipv4 = 15; // Ipv6 specifies that the field must be a valid IPv6 address. Valid // IPv6 addresses should not include surrounding square brackets. bool ipv6 = 16; // Uri specifies that the field must be a valid, absolute URI as defined // by RFC 3986 bool uri = 17; // UriRef specifies that the field must be a valid URI as defined by RFC // 3986 and may be relative or absolute. bool uri_ref = 18; // Address specifies that the field must be either a valid hostname as // defined by RFC 1034 (which does not support internationalized domain // names or IDNs), or it can be a valid IP (v4 or v6). bool address = 21; // Uuid specifies that the field must be a valid UUID as defined by // RFC 4122 bool uuid = 22; // WellKnownRegex specifies a common well known pattern defined as a regex. KnownRegex well_known_regex = 24; } // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable // strict header validation. // By default, this is true, and HTTP header validations are RFC-compliant. // Setting to false will enable a looser validations that only disallows // \r\n\0 characters, which can be used to bypass header matching rules. optional bool strict = 25 [default = true]; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 26; } // WellKnownRegex contain some well-known patterns. enum KnownRegex { UNKNOWN = 0; // HTTP header name as defined by RFC 7230. HTTP_HEADER_NAME = 1; // HTTP header value as defined by RFC 7230. HTTP_HEADER_VALUE = 2; } // BytesRules describe the constraints applied to `bytes` values message BytesRules { // Const specifies that this field must be exactly the specified value optional bytes const = 1; // Len specifies that this field must be the specified number of bytes optional uint64 len = 13; // MinLen specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_len = 3; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 4; // Prefix specifies that this field must have the specified bytes at the // beginning of the string. optional bytes prefix = 5; // Suffix specifies that this field must have the specified bytes at the // end of the string. optional bytes suffix = 6; // Contains specifies that this field must have the specified bytes // anywhere in the string. optional bytes contains = 7; // In specifies that this field must be equal to one of the specified // values repeated bytes in = 8; // NotIn specifies that this field cannot be equal to one of the specified // values repeated bytes not_in = 9; // WellKnown rules provide advanced constraints against common byte // patterns oneof well_known { // Ip specifies that the field must be a valid IP (v4 or v6) address in // byte format bool ip = 10; // Ipv4 specifies that the field must be a valid IPv4 address in byte // format bool ipv4 = 11; // Ipv6 specifies that the field must be a valid IPv6 address in byte // format bool ipv6 = 12; } // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 14; } // EnumRules describe the constraints applied to enum values message EnumRules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // DefinedOnly specifies that this field must be only one of the defined // values for this enum, failing on any undefined value. optional bool defined_only = 2; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 3; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 4; } // MessageRules describe the constraints applied to embedded message values. // For message-type fields, validation is performed recursively. message MessageRules { // Skip specifies that the validation rules of this field should not be // evaluated optional bool skip = 1; // Required specifies that this field must be set optional bool required = 2; } // RepeatedRules describe the constraints applied to `repeated` values message RepeatedRules { // MinItems specifies that this field must have the specified number of // items at a minimum optional uint64 min_items = 1; // MaxItems specifies that this field must have the specified number of // items at a maximum optional uint64 max_items = 2; // Unique specifies that all elements in this field must be unique. This // contraint is only applicable to scalar and enum types (messages are not // supported). optional bool unique = 3; // Items specifies the contraints to be applied to each item in the field. // Repeated message fields will still execute validation against each item // unless skip is specified here. optional FieldRules items = 4; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 5; } // MapRules describe the constraints applied to `map` values message MapRules { // MinPairs specifies that this field must have the specified number of // KVs at a minimum optional uint64 min_pairs = 1; // MaxPairs specifies that this field must have the specified number of // KVs at a maximum optional uint64 max_pairs = 2; // NoSparse specifies values in this field cannot be unset. This only // applies to map's with message value types. optional bool no_sparse = 3; // Keys specifies the constraints to be applied to each key in the field. optional FieldRules keys = 4; // Values specifies the constraints to be applied to the value of each key // in the field. Message values will still have their validations evaluated // unless skip is specified here. optional FieldRules values = 5; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 6; } // AnyRules describe constraints applied exclusively to the // `google.protobuf.Any` well-known type message AnyRules { // Required specifies that this field must be set optional bool required = 1; // In specifies that this field's `type_url` must be equal to one of the // specified values. repeated string in = 2; // NotIn specifies that this field's `type_url` must not be equal to any of // the specified values. repeated string not_in = 3; } // DurationRules describe the constraints applied exclusively to the // `google.protobuf.Duration` well-known type message DurationRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Duration const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Duration lt = 3; // Lt specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Duration lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Duration gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Duration gte = 6; // In specifies that this field must be equal to one of the specified // values repeated google.protobuf.Duration in = 7; // NotIn specifies that this field cannot be equal to one of the specified // values repeated google.protobuf.Duration not_in = 8; } // TimestampRules describe the constraints applied exclusively to the // `google.protobuf.Timestamp` well-known type message TimestampRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Timestamp const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Timestamp lt = 3; // Lte specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Timestamp lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Timestamp gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Timestamp gte = 6; // LtNow specifies that this must be less than the current time. LtNow // can only be used with the Within rule. optional bool lt_now = 7; // GtNow specifies that this must be greater than the current time. GtNow // can only be used with the Within rule. optional bool gt_now = 8; // Within specifies that this field must be within this duration of the // current time. This constraint can be used alone or with the LtNow and // GtNow rules. optional google.protobuf.Duration within = 9; } ================================================ FILE: service/goods/Dockerfile ================================================ FROM golang:1.16 AS builder COPY . /src WORKDIR /src RUN GOPROXY=https://goproxy.cn make build FROM debian:stable-slim RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/ \ && apt-get autoremove -y && apt-get autoclean -y COPY --from=builder /src/bin /app WORKDIR /app EXPOSE 8000 EXPOSE 9000 VOLUME /data/conf CMD ["./server", "-conf", "/data/conf"] ================================================ FILE: service/goods/LICENSE ================================================ MIT License Copyright (c) 2020 go-kratos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: service/goods/Makefile ================================================ GOPATH:=$(shell go env GOPATH) VERSION=$(shell git describe --tags --always) INTERNAL_PROTO_FILES=$(shell find internal -name *.proto) API_PROTO_FILES=$(shell find api -name *.proto) .PHONY: init # init env init: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest go install github.com/go-kratos/kratos/cmd/kratos/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest go install github.com/google/gnostic/cmd/protoc-gen-openapi@v0.6.1 .PHONY: errors # generate errors code errors: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ --go-errors_out=paths=source_relative:. \ $(API_PROTO_FILES) .PHONY: config # generate internal proto config: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ $(INTERNAL_PROTO_FILES) .PHONY: api # generate api proto api: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ --go-http_out=paths=source_relative:. \ --go-grpc_out=paths=source_relative:. \ --openapi_out==paths=source_relative:. \ --validate_out=paths=source_relative,lang=go:. \ $(API_PROTO_FILES) .PHONY: build # build build: mkdir -p bin/ && go build -ldflags "-X main.Version=$(VERSION)" -o ./bin/ ./... .PHONY: generate # generate generate: go generate ./... # wire # wire wire: cd cmd/goods/ && wire .PHONY: all # generate all all: make api; make errors; make config; make generate; # show help help: @echo '' @echo 'Usage:' @echo ' make [target]' @echo '' @echo 'Targets:' @awk '/^[a-zA-Z\-\_0-9]+:/ { \ helpMessage = match(lastLine, /^# (.*)/); \ if (helpMessage) { \ helpCommand = substr($$1, 0, index($$1, ":")-1); \ helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ } \ } \ { lastLine = $$0 }' $(MAKEFILE_LIST) .DEFAULT_GOAL := help ================================================ FILE: service/goods/README.md ================================================ goods service ================================================ FILE: service/goods/api/goods/v1/error_reason.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: api/goods/v1/error_reason.proto package v1 import ( _ "github.com/go-kratos/kratos/v2/errors" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ErrorReason int32 const ( ErrorReason_USER_NOT_FOUND ErrorReason = 0 ErrorReason_CONTENT_MISSING ErrorReason = 1 ) // Enum value maps for ErrorReason. var ( ErrorReason_name = map[int32]string{ 0: "USER_NOT_FOUND", 1: "CONTENT_MISSING", } ErrorReason_value = map[string]int32{ "USER_NOT_FOUND": 0, "CONTENT_MISSING": 1, } ) func (x ErrorReason) Enum() *ErrorReason { p := new(ErrorReason) *p = x return p } func (x ErrorReason) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ErrorReason) Descriptor() protoreflect.EnumDescriptor { return file_api_goods_v1_error_reason_proto_enumTypes[0].Descriptor() } func (ErrorReason) Type() protoreflect.EnumType { return &file_api_goods_v1_error_reason_proto_enumTypes[0] } func (x ErrorReason) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ErrorReason.Descriptor instead. func (ErrorReason) EnumDescriptor() ([]byte, []int) { return file_api_goods_v1_error_reason_proto_rawDescGZIP(), []int{0} } var File_api_goods_v1_error_reason_proto protoreflect.FileDescriptor var file_api_goods_v1_error_reason_proto_rawDesc = []byte{ 0x0a, 0x1f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0x48, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x1a, 0x04, 0xa8, 0x45, 0x94, 0x03, 0x12, 0x19, 0x0a, 0x0f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x42, 0x28, 0x5a, 0x15, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0xa2, 0x02, 0x0e, 0x41, 0x50, 0x49, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_api_goods_v1_error_reason_proto_rawDescOnce sync.Once file_api_goods_v1_error_reason_proto_rawDescData = file_api_goods_v1_error_reason_proto_rawDesc ) func file_api_goods_v1_error_reason_proto_rawDescGZIP() []byte { file_api_goods_v1_error_reason_proto_rawDescOnce.Do(func() { file_api_goods_v1_error_reason_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_goods_v1_error_reason_proto_rawDescData) }) return file_api_goods_v1_error_reason_proto_rawDescData } var file_api_goods_v1_error_reason_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_api_goods_v1_error_reason_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: goods.v1.ErrorReason } var file_api_goods_v1_error_reason_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_api_goods_v1_error_reason_proto_init() } func file_api_goods_v1_error_reason_proto_init() { if File_api_goods_v1_error_reason_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_goods_v1_error_reason_proto_rawDesc, NumEnums: 1, NumMessages: 0, NumExtensions: 0, NumServices: 0, }, GoTypes: file_api_goods_v1_error_reason_proto_goTypes, DependencyIndexes: file_api_goods_v1_error_reason_proto_depIdxs, EnumInfos: file_api_goods_v1_error_reason_proto_enumTypes, }.Build() File_api_goods_v1_error_reason_proto = out.File file_api_goods_v1_error_reason_proto_rawDesc = nil file_api_goods_v1_error_reason_proto_goTypes = nil file_api_goods_v1_error_reason_proto_depIdxs = nil } ================================================ FILE: service/goods/api/goods/v1/error_reason.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: api/goods/v1/error_reason.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) ================================================ FILE: service/goods/api/goods/v1/error_reason.proto ================================================ syntax = "proto3"; package goods.v1; import "errors/errors.proto"; option go_package = "goods/api/goods/v1;v1"; option objc_class_prefix = "APIGoodsErrors"; enum ErrorReason { option (errors.default_code) = 500; USER_NOT_FOUND = 0 [(errors.code) = 404]; CONTENT_MISSING = 1 [(errors.code) = 400]; } ================================================ FILE: service/goods/api/goods/v1/goods.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: api/goods/v1/goods.proto package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type AttrValueRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AttrId int64 `protobuf:"varint,2,opt,name=attrId,proto3" json:"attrId,omitempty"` GroupId int64 `protobuf:"varint,3,opt,name=groupId,proto3" json:"groupId,omitempty"` Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` } func (x *AttrValueRequest) Reset() { *x = AttrValueRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrValueRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrValueRequest) ProtoMessage() {} func (x *AttrValueRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_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 AttrValueRequest.ProtoReflect.Descriptor instead. func (*AttrValueRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{0} } func (x *AttrValueRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrValueRequest) GetAttrId() int64 { if x != nil { return x.AttrId } return 0 } func (x *AttrValueRequest) GetGroupId() int64 { if x != nil { return x.GroupId } return 0 } func (x *AttrValueRequest) GetValue() string { if x != nil { return x.Value } return "" } type AttrRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` TypeId int64 `protobuf:"varint,2,opt,name=typeId,proto3" json:"typeId,omitempty"` GroupId int64 `protobuf:"varint,3,opt,name=groupId,proto3" json:"groupId,omitempty"` Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` Desc string `protobuf:"bytes,5,opt,name=desc,proto3" json:"desc,omitempty"` Status bool `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` Sort int32 `protobuf:"varint,7,opt,name=sort,proto3" json:"sort,omitempty"` AttrValue []*AttrValueRequest `protobuf:"bytes,8,rep,name=attrValue,proto3" json:"attrValue,omitempty"` } func (x *AttrRequest) Reset() { *x = AttrRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrRequest) ProtoMessage() {} func (x *AttrRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_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 AttrRequest.ProtoReflect.Descriptor instead. func (*AttrRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{1} } func (x *AttrRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrRequest) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *AttrRequest) GetGroupId() int64 { if x != nil { return x.GroupId } return 0 } func (x *AttrRequest) GetTitle() string { if x != nil { return x.Title } return "" } func (x *AttrRequest) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *AttrRequest) GetStatus() bool { if x != nil { return x.Status } return false } func (x *AttrRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } func (x *AttrRequest) GetAttrValue() []*AttrValueRequest { if x != nil { return x.AttrValue } return nil } type AttrValueResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AttrId int64 `protobuf:"varint,2,opt,name=attrId,proto3" json:"attrId,omitempty"` GroupId int64 `protobuf:"varint,3,opt,name=groupId,proto3" json:"groupId,omitempty"` Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` } func (x *AttrValueResponse) Reset() { *x = AttrValueResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrValueResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrValueResponse) ProtoMessage() {} func (x *AttrValueResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_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 AttrValueResponse.ProtoReflect.Descriptor instead. func (*AttrValueResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{2} } func (x *AttrValueResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrValueResponse) GetAttrId() int64 { if x != nil { return x.AttrId } return 0 } func (x *AttrValueResponse) GetGroupId() int64 { if x != nil { return x.GroupId } return 0 } func (x *AttrValueResponse) GetValue() string { if x != nil { return x.Value } return "" } type AttrResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` TypeId int64 `protobuf:"varint,2,opt,name=typeId,proto3" json:"typeId,omitempty"` GroupId int64 `protobuf:"varint,3,opt,name=groupId,proto3" json:"groupId,omitempty"` Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` Desc string `protobuf:"bytes,5,opt,name=desc,proto3" json:"desc,omitempty"` Status bool `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` Sort int32 `protobuf:"varint,7,opt,name=sort,proto3" json:"sort,omitempty"` AttrValue []*AttrValueResponse `protobuf:"bytes,8,rep,name=attrValue,proto3" json:"attrValue,omitempty"` } func (x *AttrResponse) Reset() { *x = AttrResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrResponse) ProtoMessage() {} func (x *AttrResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_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 AttrResponse.ProtoReflect.Descriptor instead. func (*AttrResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{3} } func (x *AttrResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrResponse) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *AttrResponse) GetGroupId() int64 { if x != nil { return x.GroupId } return 0 } func (x *AttrResponse) GetTitle() string { if x != nil { return x.Title } return "" } func (x *AttrResponse) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *AttrResponse) GetStatus() bool { if x != nil { return x.Status } return false } func (x *AttrResponse) GetSort() int32 { if x != nil { return x.Sort } return 0 } func (x *AttrResponse) GetAttrValue() []*AttrValueResponse { if x != nil { return x.AttrValue } return nil } type AttrGroupRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` TypeId int64 `protobuf:"varint,2,opt,name=typeId,proto3" json:"typeId,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` Status bool `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *AttrGroupRequest) Reset() { *x = AttrGroupRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrGroupRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrGroupRequest) ProtoMessage() {} func (x *AttrGroupRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AttrGroupRequest.ProtoReflect.Descriptor instead. func (*AttrGroupRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{4} } func (x *AttrGroupRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrGroupRequest) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *AttrGroupRequest) GetTitle() string { if x != nil { return x.Title } return "" } func (x *AttrGroupRequest) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *AttrGroupRequest) GetStatus() bool { if x != nil { return x.Status } return false } func (x *AttrGroupRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } type AttrGroupResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` TypeId int64 `protobuf:"varint,2,opt,name=typeId,proto3" json:"typeId,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` Status bool `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *AttrGroupResponse) Reset() { *x = AttrGroupResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrGroupResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrGroupResponse) ProtoMessage() {} func (x *AttrGroupResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AttrGroupResponse.ProtoReflect.Descriptor instead. func (*AttrGroupResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{5} } func (x *AttrGroupResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrGroupResponse) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *AttrGroupResponse) GetTitle() string { if x != nil { return x.Title } return "" } func (x *AttrGroupResponse) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *AttrGroupResponse) GetStatus() bool { if x != nil { return x.Status } return false } func (x *AttrGroupResponse) GetSort() int32 { if x != nil { return x.Sort } return 0 } type SpecificationValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AttrId int64 `protobuf:"varint,2,opt,name=attrId,proto3" json:"attrId,omitempty"` Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *SpecificationValue) Reset() { *x = SpecificationValue{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SpecificationValue) String() string { return protoimpl.X.MessageStringOf(x) } func (*SpecificationValue) ProtoMessage() {} func (x *SpecificationValue) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[6] 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 SpecificationValue.ProtoReflect.Descriptor instead. func (*SpecificationValue) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{6} } func (x *SpecificationValue) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *SpecificationValue) GetAttrId() int64 { if x != nil { return x.AttrId } return 0 } func (x *SpecificationValue) GetValue() string { if x != nil { return x.Value } return "" } func (x *SpecificationValue) GetSort() int32 { if x != nil { return x.Sort } return 0 } type SpecificationValueResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AttrId int64 `protobuf:"varint,2,opt,name=attrId,proto3" json:"attrId,omitempty"` Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *SpecificationValueResponse) Reset() { *x = SpecificationValueResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SpecificationValueResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*SpecificationValueResponse) ProtoMessage() {} func (x *SpecificationValueResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[7] 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 SpecificationValueResponse.ProtoReflect.Descriptor instead. func (*SpecificationValueResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{7} } func (x *SpecificationValueResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *SpecificationValueResponse) GetAttrId() int64 { if x != nil { return x.AttrId } return 0 } func (x *SpecificationValueResponse) GetValue() string { if x != nil { return x.Value } return "" } func (x *SpecificationValueResponse) GetSort() int32 { if x != nil { return x.Sort } return 0 } type SpecificationRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` TypeId int64 `protobuf:"varint,2,opt,name=typeId,proto3" json:"typeId,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` Status bool `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` IsSku bool `protobuf:"varint,6,opt,name=isSku,proto3" json:"isSku,omitempty"` IsSelect bool `protobuf:"varint,7,opt,name=isSelect,proto3" json:"isSelect,omitempty"` SpecificationValue []*SpecificationValue `protobuf:"bytes,8,rep,name=specificationValue,proto3" json:"specificationValue,omitempty"` } func (x *SpecificationRequest) Reset() { *x = SpecificationRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SpecificationRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*SpecificationRequest) ProtoMessage() {} func (x *SpecificationRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[8] 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 SpecificationRequest.ProtoReflect.Descriptor instead. func (*SpecificationRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{8} } func (x *SpecificationRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *SpecificationRequest) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *SpecificationRequest) GetName() string { if x != nil { return x.Name } return "" } func (x *SpecificationRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } func (x *SpecificationRequest) GetStatus() bool { if x != nil { return x.Status } return false } func (x *SpecificationRequest) GetIsSku() bool { if x != nil { return x.IsSku } return false } func (x *SpecificationRequest) GetIsSelect() bool { if x != nil { return x.IsSelect } return false } func (x *SpecificationRequest) GetSpecificationValue() []*SpecificationValue { if x != nil { return x.SpecificationValue } return nil } type SpecificationResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *SpecificationResponse) Reset() { *x = SpecificationResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SpecificationResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*SpecificationResponse) ProtoMessage() {} func (x *SpecificationResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[9] 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 SpecificationResponse.ProtoReflect.Descriptor instead. func (*SpecificationResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{9} } func (x *SpecificationResponse) GetId() int64 { if x != nil { return x.Id } return 0 } type GoodsTypeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` TypeCode string `protobuf:"bytes,3,opt,name=typeCode,proto3" json:"typeCode,omitempty"` NameAlias string `protobuf:"bytes,4,opt,name=nameAlias,proto3" json:"nameAlias,omitempty"` IsVirtual bool `protobuf:"varint,5,opt,name=isVirtual,proto3" json:"isVirtual,omitempty"` Desc string `protobuf:"bytes,6,opt,name=desc,proto3" json:"desc,omitempty"` Sort int32 `protobuf:"varint,7,opt,name=sort,proto3" json:"sort,omitempty"` BrandIds string `protobuf:"bytes,8,opt,name=brandIds,proto3" json:"brandIds,omitempty"` } func (x *GoodsTypeRequest) Reset() { *x = GoodsTypeRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoodsTypeRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoodsTypeRequest) ProtoMessage() {} func (x *GoodsTypeRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[10] 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 GoodsTypeRequest.ProtoReflect.Descriptor instead. func (*GoodsTypeRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{10} } func (x *GoodsTypeRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *GoodsTypeRequest) GetName() string { if x != nil { return x.Name } return "" } func (x *GoodsTypeRequest) GetTypeCode() string { if x != nil { return x.TypeCode } return "" } func (x *GoodsTypeRequest) GetNameAlias() string { if x != nil { return x.NameAlias } return "" } func (x *GoodsTypeRequest) GetIsVirtual() bool { if x != nil { return x.IsVirtual } return false } func (x *GoodsTypeRequest) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *GoodsTypeRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } func (x *GoodsTypeRequest) GetBrandIds() string { if x != nil { return x.BrandIds } return "" } type GoodsTypeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *GoodsTypeResponse) Reset() { *x = GoodsTypeResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoodsTypeResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoodsTypeResponse) ProtoMessage() {} func (x *GoodsTypeResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[11] 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 GoodsTypeResponse.ProtoReflect.Descriptor instead. func (*GoodsTypeResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{11} } func (x *GoodsTypeResponse) GetId() int64 { if x != nil { return x.Id } return 0 } type CreateGoodsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` CategoryId int32 `protobuf:"varint,2,opt,name=categoryId,proto3" json:"categoryId,omitempty"` BrandId int32 `protobuf:"varint,3,opt,name=brandId,proto3" json:"brandId,omitempty"` TypeId int64 `protobuf:"varint,4,opt,name=typeId,proto3" json:"typeId,omitempty"` Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` NameAlias string `protobuf:"bytes,6,opt,name=nameAlias,proto3" json:"nameAlias,omitempty"` GoodsTags string `protobuf:"bytes,7,opt,name=goodsTags,proto3" json:"goodsTags,omitempty"` GoodsSn string `protobuf:"bytes,8,opt,name=goodsSn,proto3" json:"goodsSn,omitempty"` ShopPrice int64 `protobuf:"varint,9,opt,name=shopPrice,proto3" json:"shopPrice,omitempty"` MarketPrice int64 `protobuf:"varint,10,opt,name=marketPrice,proto3" json:"marketPrice,omitempty"` Inventory int64 `protobuf:"varint,11,opt,name=inventory,proto3" json:"inventory,omitempty"` GoodsBrief string `protobuf:"bytes,12,opt,name=goodsBrief,proto3" json:"goodsBrief,omitempty"` GoodsFrontImage string `protobuf:"bytes,13,opt,name=goodsFrontImage,proto3" json:"goodsFrontImage,omitempty"` GoodsImages []string `protobuf:"bytes,14,rep,name=goodsImages,proto3" json:"goodsImages,omitempty"` ShipFree bool `protobuf:"varint,15,opt,name=shipFree,proto3" json:"shipFree,omitempty"` ShipId int32 `protobuf:"varint,16,opt,name=shipId,proto3" json:"shipId,omitempty"` IsNew bool `protobuf:"varint,17,opt,name=isNew,proto3" json:"isNew,omitempty"` IsHot bool `protobuf:"varint,18,opt,name=isHot,proto3" json:"isHot,omitempty"` OnSale bool `protobuf:"varint,19,opt,name=onSale,proto3" json:"onSale,omitempty"` Sku []*CreateGoodsRequestGoodsSku `protobuf:"bytes,20,rep,name=sku,proto3" json:"sku,omitempty"` } func (x *CreateGoodsRequest) Reset() { *x = CreateGoodsRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsRequest) ProtoMessage() {} func (x *CreateGoodsRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[12] 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 CreateGoodsRequest.ProtoReflect.Descriptor instead. func (*CreateGoodsRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{12} } func (x *CreateGoodsRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *CreateGoodsRequest) GetCategoryId() int32 { if x != nil { return x.CategoryId } return 0 } func (x *CreateGoodsRequest) GetBrandId() int32 { if x != nil { return x.BrandId } return 0 } func (x *CreateGoodsRequest) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *CreateGoodsRequest) GetName() string { if x != nil { return x.Name } return "" } func (x *CreateGoodsRequest) GetNameAlias() string { if x != nil { return x.NameAlias } return "" } func (x *CreateGoodsRequest) GetGoodsTags() string { if x != nil { return x.GoodsTags } return "" } func (x *CreateGoodsRequest) GetGoodsSn() string { if x != nil { return x.GoodsSn } return "" } func (x *CreateGoodsRequest) GetShopPrice() int64 { if x != nil { return x.ShopPrice } return 0 } func (x *CreateGoodsRequest) GetMarketPrice() int64 { if x != nil { return x.MarketPrice } return 0 } func (x *CreateGoodsRequest) GetInventory() int64 { if x != nil { return x.Inventory } return 0 } func (x *CreateGoodsRequest) GetGoodsBrief() string { if x != nil { return x.GoodsBrief } return "" } func (x *CreateGoodsRequest) GetGoodsFrontImage() string { if x != nil { return x.GoodsFrontImage } return "" } func (x *CreateGoodsRequest) GetGoodsImages() []string { if x != nil { return x.GoodsImages } return nil } func (x *CreateGoodsRequest) GetShipFree() bool { if x != nil { return x.ShipFree } return false } func (x *CreateGoodsRequest) GetShipId() int32 { if x != nil { return x.ShipId } return 0 } func (x *CreateGoodsRequest) GetIsNew() bool { if x != nil { return x.IsNew } return false } func (x *CreateGoodsRequest) GetIsHot() bool { if x != nil { return x.IsHot } return false } func (x *CreateGoodsRequest) GetOnSale() bool { if x != nil { return x.OnSale } return false } func (x *CreateGoodsRequest) GetSku() []*CreateGoodsRequestGoodsSku { if x != nil { return x.Sku } return nil } type CreateGoodsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` } func (x *CreateGoodsResponse) Reset() { *x = CreateGoodsResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsResponse) ProtoMessage() {} func (x *CreateGoodsResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[13] 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 CreateGoodsResponse.ProtoReflect.Descriptor instead. func (*CreateGoodsResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{13} } func (x *CreateGoodsResponse) GetID() int64 { if x != nil { return x.ID } return 0 } type GoodsInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` CategoryId int32 `protobuf:"varint,2,opt,name=categoryId,proto3" json:"categoryId,omitempty"` BrandId int32 `protobuf:"varint,3,opt,name=brandId,proto3" json:"brandId,omitempty"` Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` GoodsSn string `protobuf:"bytes,5,opt,name=goodsSn,proto3" json:"goodsSn,omitempty"` ClickNum int64 `protobuf:"varint,6,opt,name=clickNum,proto3" json:"clickNum,omitempty"` SoldNum int64 `protobuf:"varint,7,opt,name=soldNum,proto3" json:"soldNum,omitempty"` FavNum int64 `protobuf:"varint,8,opt,name=favNum,proto3" json:"favNum,omitempty"` MarketPrice int64 `protobuf:"varint,9,opt,name=marketPrice,proto3" json:"marketPrice,omitempty"` GoodsBrief string `protobuf:"bytes,10,opt,name=goodsBrief,proto3" json:"goodsBrief,omitempty"` GoodsDesc string `protobuf:"bytes,11,opt,name=goodsDesc,proto3" json:"goodsDesc,omitempty"` ShipFree bool `protobuf:"varint,12,opt,name=shipFree,proto3" json:"shipFree,omitempty"` Images string `protobuf:"bytes,13,opt,name=images,proto3" json:"images,omitempty"` GoodsImages []string `protobuf:"bytes,14,rep,name=goodsImages,proto3" json:"goodsImages,omitempty"` IsNew bool `protobuf:"varint,15,opt,name=isNew,proto3" json:"isNew,omitempty"` IsHot bool `protobuf:"varint,16,opt,name=isHot,proto3" json:"isHot,omitempty"` OnSale bool `protobuf:"varint,17,opt,name=onSale,proto3" json:"onSale,omitempty"` } func (x *GoodsInfoResponse) Reset() { *x = GoodsInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoodsInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoodsInfoResponse) ProtoMessage() {} func (x *GoodsInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[14] 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 GoodsInfoResponse.ProtoReflect.Descriptor instead. func (*GoodsInfoResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{14} } func (x *GoodsInfoResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *GoodsInfoResponse) GetCategoryId() int32 { if x != nil { return x.CategoryId } return 0 } func (x *GoodsInfoResponse) GetBrandId() int32 { if x != nil { return x.BrandId } return 0 } func (x *GoodsInfoResponse) GetName() string { if x != nil { return x.Name } return "" } func (x *GoodsInfoResponse) GetGoodsSn() string { if x != nil { return x.GoodsSn } return "" } func (x *GoodsInfoResponse) GetClickNum() int64 { if x != nil { return x.ClickNum } return 0 } func (x *GoodsInfoResponse) GetSoldNum() int64 { if x != nil { return x.SoldNum } return 0 } func (x *GoodsInfoResponse) GetFavNum() int64 { if x != nil { return x.FavNum } return 0 } func (x *GoodsInfoResponse) GetMarketPrice() int64 { if x != nil { return x.MarketPrice } return 0 } func (x *GoodsInfoResponse) GetGoodsBrief() string { if x != nil { return x.GoodsBrief } return "" } func (x *GoodsInfoResponse) GetGoodsDesc() string { if x != nil { return x.GoodsDesc } return "" } func (x *GoodsInfoResponse) GetShipFree() bool { if x != nil { return x.ShipFree } return false } func (x *GoodsInfoResponse) GetImages() string { if x != nil { return x.Images } return "" } func (x *GoodsInfoResponse) GetGoodsImages() []string { if x != nil { return x.GoodsImages } return nil } func (x *GoodsInfoResponse) GetIsNew() bool { if x != nil { return x.IsNew } return false } func (x *GoodsInfoResponse) GetIsHot() bool { if x != nil { return x.IsHot } return false } func (x *GoodsInfoResponse) GetOnSale() bool { if x != nil { return x.OnSale } return false } type GoodsListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` List []*GoodsInfoResponse `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` } func (x *GoodsListResponse) Reset() { *x = GoodsListResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoodsListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoodsListResponse) ProtoMessage() {} func (x *GoodsListResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[15] 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 GoodsListResponse.ProtoReflect.Descriptor instead. func (*GoodsListResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{15} } func (x *GoodsListResponse) GetTotal() int64 { if x != nil { return x.Total } return 0 } func (x *GoodsListResponse) GetList() []*GoodsInfoResponse { if x != nil { return x.List } return nil } type GoodsFilterRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Keywords string `protobuf:"bytes,1,opt,name=keywords,proto3" json:"keywords,omitempty"` CategoryId int32 `protobuf:"varint,2,opt,name=categoryId,proto3" json:"categoryId,omitempty"` BrandId int32 `protobuf:"varint,3,opt,name=brandId,proto3" json:"brandId,omitempty"` MinPrice int64 `protobuf:"varint,4,opt,name=minPrice,proto3" json:"minPrice,omitempty"` MaxPrice int64 `protobuf:"varint,5,opt,name=maxPrice,proto3" json:"maxPrice,omitempty"` IsHot bool `protobuf:"varint,6,opt,name=isHot,proto3" json:"isHot,omitempty"` IsNew bool `protobuf:"varint,7,opt,name=isNew,proto3" json:"isNew,omitempty"` IsTab bool `protobuf:"varint,8,opt,name=isTab,proto3" json:"isTab,omitempty"` ClickNum int64 `protobuf:"varint,9,opt,name=clickNum,proto3" json:"clickNum,omitempty"` SoldNum int64 `protobuf:"varint,10,opt,name=soldNum,proto3" json:"soldNum,omitempty"` FavNum int64 `protobuf:"varint,11,opt,name=favNum,proto3" json:"favNum,omitempty"` Pages int64 `protobuf:"varint,12,opt,name=pages,proto3" json:"pages,omitempty"` PagePerNums int64 `protobuf:"varint,13,opt,name=pagePerNums,proto3" json:"pagePerNums,omitempty"` Id int64 `protobuf:"varint,14,opt,name=id,proto3" json:"id,omitempty"` } func (x *GoodsFilterRequest) Reset() { *x = GoodsFilterRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoodsFilterRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoodsFilterRequest) ProtoMessage() {} func (x *GoodsFilterRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[16] 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 GoodsFilterRequest.ProtoReflect.Descriptor instead. func (*GoodsFilterRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{16} } func (x *GoodsFilterRequest) GetKeywords() string { if x != nil { return x.Keywords } return "" } func (x *GoodsFilterRequest) GetCategoryId() int32 { if x != nil { return x.CategoryId } return 0 } func (x *GoodsFilterRequest) GetBrandId() int32 { if x != nil { return x.BrandId } return 0 } func (x *GoodsFilterRequest) GetMinPrice() int64 { if x != nil { return x.MinPrice } return 0 } func (x *GoodsFilterRequest) GetMaxPrice() int64 { if x != nil { return x.MaxPrice } return 0 } func (x *GoodsFilterRequest) GetIsHot() bool { if x != nil { return x.IsHot } return false } func (x *GoodsFilterRequest) GetIsNew() bool { if x != nil { return x.IsNew } return false } func (x *GoodsFilterRequest) GetIsTab() bool { if x != nil { return x.IsTab } return false } func (x *GoodsFilterRequest) GetClickNum() int64 { if x != nil { return x.ClickNum } return 0 } func (x *GoodsFilterRequest) GetSoldNum() int64 { if x != nil { return x.SoldNum } return 0 } func (x *GoodsFilterRequest) GetFavNum() int64 { if x != nil { return x.FavNum } return 0 } func (x *GoodsFilterRequest) GetPages() int64 { if x != nil { return x.Pages } return 0 } func (x *GoodsFilterRequest) GetPagePerNums() int64 { if x != nil { return x.PagePerNums } return 0 } func (x *GoodsFilterRequest) GetId() int64 { if x != nil { return x.Id } return 0 } // 商品分类 type CategoryInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` ParentCategory int32 `protobuf:"varint,3,opt,name=parentCategory,proto3" json:"parentCategory,omitempty"` Level int32 `protobuf:"varint,4,opt,name=level,proto3" json:"level,omitempty"` IsTab bool `protobuf:"varint,5,opt,name=isTab,proto3" json:"isTab,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *CategoryInfoResponse) Reset() { *x = CategoryInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CategoryInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CategoryInfoResponse) ProtoMessage() {} func (x *CategoryInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[17] 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 CategoryInfoResponse.ProtoReflect.Descriptor instead. func (*CategoryInfoResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{17} } func (x *CategoryInfoResponse) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *CategoryInfoResponse) GetName() string { if x != nil { return x.Name } return "" } func (x *CategoryInfoResponse) GetParentCategory() int32 { if x != nil { return x.ParentCategory } return 0 } func (x *CategoryInfoResponse) GetLevel() int32 { if x != nil { return x.Level } return 0 } func (x *CategoryInfoResponse) GetIsTab() bool { if x != nil { return x.IsTab } return false } func (x *CategoryInfoResponse) GetSort() int32 { if x != nil { return x.Sort } return 0 } type CategoryListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields JsonData string `protobuf:"bytes,1,opt,name=jsonData,proto3" json:"jsonData,omitempty"` } func (x *CategoryListResponse) Reset() { *x = CategoryListResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CategoryListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CategoryListResponse) ProtoMessage() {} func (x *CategoryListResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[18] 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 CategoryListResponse.ProtoReflect.Descriptor instead. func (*CategoryListResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{18} } func (x *CategoryListResponse) GetJsonData() string { if x != nil { return x.JsonData } return "" } type CategoryListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` } func (x *CategoryListRequest) Reset() { *x = CategoryListRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CategoryListRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*CategoryListRequest) ProtoMessage() {} func (x *CategoryListRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[19] 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 CategoryListRequest.ProtoReflect.Descriptor instead. func (*CategoryListRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{19} } func (x *CategoryListRequest) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *CategoryListRequest) GetLevel() int32 { if x != nil { return x.Level } return 0 } type SubCategoryListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Info *CategoryInfoResponse `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` SubCategory []*CategoryInfoResponse `protobuf:"bytes,2,rep,name=subCategory,proto3" json:"subCategory,omitempty"` } func (x *SubCategoryListResponse) Reset() { *x = SubCategoryListResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SubCategoryListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*SubCategoryListResponse) ProtoMessage() {} func (x *SubCategoryListResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[20] 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 SubCategoryListResponse.ProtoReflect.Descriptor instead. func (*SubCategoryListResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{20} } func (x *SubCategoryListResponse) GetInfo() *CategoryInfoResponse { if x != nil { return x.Info } return nil } func (x *SubCategoryListResponse) GetSubCategory() []*CategoryInfoResponse { if x != nil { return x.SubCategory } return nil } type CategoryInfoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` ParentCategory int32 `protobuf:"varint,3,opt,name=parentCategory,proto3" json:"parentCategory,omitempty"` Level int32 `protobuf:"varint,4,opt,name=level,proto3" json:"level,omitempty"` IsTab bool `protobuf:"varint,5,opt,name=isTab,proto3" json:"isTab,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *CategoryInfoRequest) Reset() { *x = CategoryInfoRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CategoryInfoRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*CategoryInfoRequest) ProtoMessage() {} func (x *CategoryInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[21] 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 CategoryInfoRequest.ProtoReflect.Descriptor instead. func (*CategoryInfoRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{21} } func (x *CategoryInfoRequest) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *CategoryInfoRequest) GetName() string { if x != nil { return x.Name } return "" } func (x *CategoryInfoRequest) GetParentCategory() int32 { if x != nil { return x.ParentCategory } return 0 } func (x *CategoryInfoRequest) GetLevel() int32 { if x != nil { return x.Level } return 0 } func (x *CategoryInfoRequest) GetIsTab() bool { if x != nil { return x.IsTab } return false } func (x *CategoryInfoRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } type BatchCategoryInfoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id []int32 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` GoodsNums int32 `protobuf:"varint,2,opt,name=goodsNums,proto3" json:"goodsNums,omitempty"` BrandNums int32 `protobuf:"varint,3,opt,name=brandNums,proto3" json:"brandNums,omitempty"` } func (x *BatchCategoryInfoRequest) Reset() { *x = BatchCategoryInfoRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BatchCategoryInfoRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*BatchCategoryInfoRequest) ProtoMessage() {} func (x *BatchCategoryInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[22] 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 BatchCategoryInfoRequest.ProtoReflect.Descriptor instead. func (*BatchCategoryInfoRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{22} } func (x *BatchCategoryInfoRequest) GetId() []int32 { if x != nil { return x.Id } return nil } func (x *BatchCategoryInfoRequest) GetGoodsNums() int32 { if x != nil { return x.GoodsNums } return 0 } func (x *BatchCategoryInfoRequest) GetBrandNums() int32 { if x != nil { return x.BrandNums } return 0 } type DeleteCategoryRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *DeleteCategoryRequest) Reset() { *x = DeleteCategoryRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *DeleteCategoryRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*DeleteCategoryRequest) ProtoMessage() {} func (x *DeleteCategoryRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[23] 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 DeleteCategoryRequest.ProtoReflect.Descriptor instead. func (*DeleteCategoryRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{23} } func (x *DeleteCategoryRequest) GetId() int32 { if x != nil { return x.Id } return 0 } type BrandListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Pages int32 `protobuf:"varint,1,opt,name=pages,proto3" json:"pages,omitempty"` PagePerNums int32 `protobuf:"varint,2,opt,name=pagePerNums,proto3" json:"pagePerNums,omitempty"` } func (x *BrandListRequest) Reset() { *x = BrandListRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BrandListRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*BrandListRequest) ProtoMessage() {} func (x *BrandListRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[24] 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 BrandListRequest.ProtoReflect.Descriptor instead. func (*BrandListRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{24} } func (x *BrandListRequest) GetPages() int32 { if x != nil { return x.Pages } return 0 } func (x *BrandListRequest) GetPagePerNums() int32 { if x != nil { return x.PagePerNums } return 0 } type BrandRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Logo string `protobuf:"bytes,3,opt,name=logo,proto3" json:"logo,omitempty"` Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` IsTab bool `protobuf:"varint,5,opt,name=isTab,proto3" json:"isTab,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *BrandRequest) Reset() { *x = BrandRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BrandRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*BrandRequest) ProtoMessage() {} func (x *BrandRequest) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[25] 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 BrandRequest.ProtoReflect.Descriptor instead. func (*BrandRequest) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{25} } func (x *BrandRequest) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *BrandRequest) GetName() string { if x != nil { return x.Name } return "" } func (x *BrandRequest) GetLogo() string { if x != nil { return x.Logo } return "" } func (x *BrandRequest) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *BrandRequest) GetIsTab() bool { if x != nil { return x.IsTab } return false } func (x *BrandRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } type BrandInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Logo string `protobuf:"bytes,3,opt,name=logo,proto3" json:"logo,omitempty"` Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` IsTab bool `protobuf:"varint,5,opt,name=isTab,proto3" json:"isTab,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *BrandInfoResponse) Reset() { *x = BrandInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BrandInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*BrandInfoResponse) ProtoMessage() {} func (x *BrandInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[26] 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 BrandInfoResponse.ProtoReflect.Descriptor instead. func (*BrandInfoResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{26} } func (x *BrandInfoResponse) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *BrandInfoResponse) GetName() string { if x != nil { return x.Name } return "" } func (x *BrandInfoResponse) GetLogo() string { if x != nil { return x.Logo } return "" } func (x *BrandInfoResponse) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *BrandInfoResponse) GetIsTab() bool { if x != nil { return x.IsTab } return false } func (x *BrandInfoResponse) GetSort() int32 { if x != nil { return x.Sort } return 0 } type BrandListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Data []*BrandInfoResponse `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` } func (x *BrandListResponse) Reset() { *x = BrandListResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BrandListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*BrandListResponse) ProtoMessage() {} func (x *BrandListResponse) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[27] 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 BrandListResponse.ProtoReflect.Descriptor instead. func (*BrandListResponse) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{27} } func (x *BrandListResponse) GetTotal() int32 { if x != nil { return x.Total } return 0 } func (x *BrandListResponse) GetData() []*BrandInfoResponse { if x != nil { return x.Data } return nil } // 根据商品类型 选择商品规格信息并选择 // 商品 sku 属性值 里面有规格的ID和属性的ID,分别是几组信息 type CreateGoodsRequestGoodsSku struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` GoodsId int64 `protobuf:"varint,2,opt,name=goodsId,proto3" json:"goodsId,omitempty"` SkuName string `protobuf:"bytes,3,opt,name=skuName,proto3" json:"skuName,omitempty"` Code string `protobuf:"bytes,4,opt,name=code,proto3" json:"code,omitempty"` BarCode string `protobuf:"bytes,5,opt,name=barCode,proto3" json:"barCode,omitempty"` Price int64 `protobuf:"varint,6,opt,name=price,proto3" json:"price,omitempty"` PromotionPrice int64 `protobuf:"varint,7,opt,name=promotionPrice,proto3" json:"promotionPrice,omitempty"` Points int64 `protobuf:"varint,8,opt,name=points,proto3" json:"points,omitempty"` Image string `protobuf:"bytes,9,opt,name=image,proto3" json:"image,omitempty"` Sort int32 `protobuf:"varint,10,opt,name=sort,proto3" json:"sort,omitempty"` Inventory int64 `protobuf:"varint,11,opt,name=inventory,proto3" json:"inventory,omitempty"` // sku 库存 SpecificationInfo []*CreateGoodsRequestGoodsSkuSpecification `protobuf:"bytes,12,rep,name=specificationInfo,proto3" json:"specificationInfo,omitempty"` GroupAttrInfo []*CreateGoodsRequestGoodsSkuGroupAttr `protobuf:"bytes,13,rep,name=groupAttrInfo,proto3" json:"groupAttrInfo,omitempty"` } func (x *CreateGoodsRequestGoodsSku) Reset() { *x = CreateGoodsRequestGoodsSku{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsRequestGoodsSku) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsRequestGoodsSku) ProtoMessage() {} func (x *CreateGoodsRequestGoodsSku) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[28] 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 CreateGoodsRequestGoodsSku.ProtoReflect.Descriptor instead. func (*CreateGoodsRequestGoodsSku) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{12, 0} } func (x *CreateGoodsRequestGoodsSku) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *CreateGoodsRequestGoodsSku) GetGoodsId() int64 { if x != nil { return x.GoodsId } return 0 } func (x *CreateGoodsRequestGoodsSku) GetSkuName() string { if x != nil { return x.SkuName } return "" } func (x *CreateGoodsRequestGoodsSku) GetCode() string { if x != nil { return x.Code } return "" } func (x *CreateGoodsRequestGoodsSku) GetBarCode() string { if x != nil { return x.BarCode } return "" } func (x *CreateGoodsRequestGoodsSku) GetPrice() int64 { if x != nil { return x.Price } return 0 } func (x *CreateGoodsRequestGoodsSku) GetPromotionPrice() int64 { if x != nil { return x.PromotionPrice } return 0 } func (x *CreateGoodsRequestGoodsSku) GetPoints() int64 { if x != nil { return x.Points } return 0 } func (x *CreateGoodsRequestGoodsSku) GetImage() string { if x != nil { return x.Image } return "" } func (x *CreateGoodsRequestGoodsSku) GetSort() int32 { if x != nil { return x.Sort } return 0 } func (x *CreateGoodsRequestGoodsSku) GetInventory() int64 { if x != nil { return x.Inventory } return 0 } func (x *CreateGoodsRequestGoodsSku) GetSpecificationInfo() []*CreateGoodsRequestGoodsSkuSpecification { if x != nil { return x.SpecificationInfo } return nil } func (x *CreateGoodsRequestGoodsSku) GetGroupAttrInfo() []*CreateGoodsRequestGoodsSkuGroupAttr { if x != nil { return x.GroupAttrInfo } return nil } // 规格 type CreateGoodsRequestGoodsSkuSpecification struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields SId int64 `protobuf:"varint,1,opt,name=sId,proto3" json:"sId,omitempty"` VId int64 `protobuf:"varint,2,opt,name=vId,proto3" json:"vId,omitempty"` } func (x *CreateGoodsRequestGoodsSkuSpecification) Reset() { *x = CreateGoodsRequestGoodsSkuSpecification{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsRequestGoodsSkuSpecification) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsRequestGoodsSkuSpecification) ProtoMessage() {} func (x *CreateGoodsRequestGoodsSkuSpecification) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[29] 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 CreateGoodsRequestGoodsSkuSpecification.ProtoReflect.Descriptor instead. func (*CreateGoodsRequestGoodsSkuSpecification) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{12, 0, 0} } func (x *CreateGoodsRequestGoodsSkuSpecification) GetSId() int64 { if x != nil { return x.SId } return 0 } func (x *CreateGoodsRequestGoodsSkuSpecification) GetVId() int64 { if x != nil { return x.VId } return 0 } // 属性组 type CreateGoodsRequestGoodsSkuGroupAttr struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields GroupId int64 `protobuf:"varint,1,opt,name=groupId,proto3" json:"groupId,omitempty"` GroupName string `protobuf:"bytes,2,opt,name=groupName,proto3" json:"groupName,omitempty"` AttrInfo []*CreateGoodsRequestGoodsSkuGroupAttrAttr `protobuf:"bytes,3,rep,name=attrInfo,proto3" json:"attrInfo,omitempty"` } func (x *CreateGoodsRequestGoodsSkuGroupAttr) Reset() { *x = CreateGoodsRequestGoodsSkuGroupAttr{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsRequestGoodsSkuGroupAttr) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsRequestGoodsSkuGroupAttr) ProtoMessage() {} func (x *CreateGoodsRequestGoodsSkuGroupAttr) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[30] 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 CreateGoodsRequestGoodsSkuGroupAttr.ProtoReflect.Descriptor instead. func (*CreateGoodsRequestGoodsSkuGroupAttr) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{12, 0, 1} } func (x *CreateGoodsRequestGoodsSkuGroupAttr) GetGroupId() int64 { if x != nil { return x.GroupId } return 0 } func (x *CreateGoodsRequestGoodsSkuGroupAttr) GetGroupName() string { if x != nil { return x.GroupName } return "" } func (x *CreateGoodsRequestGoodsSkuGroupAttr) GetAttrInfo() []*CreateGoodsRequestGoodsSkuGroupAttrAttr { if x != nil { return x.AttrInfo } return nil } type CreateGoodsRequestGoodsSkuGroupAttrAttr struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AttrId int64 `protobuf:"varint,1,opt,name=attrId,proto3" json:"attrId,omitempty"` AttrName string `protobuf:"bytes,2,opt,name=attrName,proto3" json:"attrName,omitempty"` AttrValueId int64 `protobuf:"varint,3,opt,name=attrValueId,proto3" json:"attrValueId,omitempty"` AttrValueName string `protobuf:"bytes,4,opt,name=attrValueName,proto3" json:"attrValueName,omitempty"` } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) Reset() { *x = CreateGoodsRequestGoodsSkuGroupAttrAttr{} if protoimpl.UnsafeEnabled { mi := &file_api_goods_v1_goods_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsRequestGoodsSkuGroupAttrAttr) ProtoMessage() {} func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) ProtoReflect() protoreflect.Message { mi := &file_api_goods_v1_goods_proto_msgTypes[31] 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 CreateGoodsRequestGoodsSkuGroupAttrAttr.ProtoReflect.Descriptor instead. func (*CreateGoodsRequestGoodsSkuGroupAttrAttr) Descriptor() ([]byte, []int) { return file_api_goods_v1_goods_proto_rawDescGZIP(), []int{12, 0, 1, 0} } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) GetAttrId() int64 { if x != nil { return x.AttrId } return 0 } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) GetAttrName() string { if x != nil { return x.AttrName } return "" } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) GetAttrValueId() int64 { if x != nil { return x.AttrValueId } return 0 } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) GetAttrValueName() string { if x != nil { return x.AttrValueName } return "" } var File_api_goods_v1_goods_proto protoreflect.FileDescriptor var file_api_goods_v1_goods_proto_rawDesc = []byte{ 0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 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, 0x7c, 0x0a, 0x10, 0x41, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x83, 0x02, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x6b, 0x0a, 0x11, 0x41, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xe1, 0x01, 0x0a, 0x0c, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x39, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x10, 0x41, 0x74, 0x74, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x03, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x91, 0x01, 0x0a, 0x11, 0x41, 0x74, 0x74, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x78, 0x0a, 0x12, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x6e, 0x0a, 0x1a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x99, 0x02, 0x0a, 0x14, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x53, 0x6b, 0x75, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x53, 0x6b, 0x75, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x4c, 0x0a, 0x12, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x27, 0x0a, 0x15, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xed, 0x01, 0x0a, 0x10, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 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, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x03, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x23, 0x0a, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x73, 0x22, 0x23, 0x0a, 0x11, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xf0, 0x0b, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x61, 0x67, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x61, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x70, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x70, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x42, 0x72, 0x69, 0x65, 0x66, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x42, 0x72, 0x69, 0x65, 0x66, 0x12, 0x28, 0x0a, 0x0f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x68, 0x69, 0x70, 0x46, 0x72, 0x65, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x68, 0x69, 0x70, 0x46, 0x72, 0x65, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x68, 0x69, 0x70, 0x49, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x68, 0x69, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x53, 0x61, 0x6c, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, 0x53, 0x61, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x6b, 0x75, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6b, 0x75, 0x52, 0x03, 0x73, 0x6b, 0x75, 0x1a, 0xf7, 0x06, 0x0a, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6b, 0x75, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x73, 0x6b, 0x75, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x73, 0x6b, 0x75, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x07, 0x62, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x62, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x61, 0x0a, 0x11, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6b, 0x75, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x55, 0x0a, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6b, 0x75, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x52, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x45, 0x0a, 0x0d, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x03, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x03, 0x73, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x03, 0x76, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x03, 0x76, 0x49, 0x64, 0x1a, 0xbe, 0x02, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x08, 0x61, 0x74, 0x74, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6b, 0x75, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x52, 0x08, 0x61, 0x74, 0x74, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0xa6, 0x01, 0x0a, 0x04, 0x61, 0x74, 0x74, 0x72, 0x12, 0x1f, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x08, 0x61, 0x74, 0x74, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x61, 0x74, 0x74, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x0b, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0d, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x25, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x44, 0x22, 0xd3, 0x03, 0x0a, 0x11, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x76, 0x4e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x61, 0x76, 0x4e, 0x75, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x42, 0x72, 0x69, 0x65, 0x66, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x42, 0x72, 0x69, 0x65, 0x66, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x65, 0x73, 0x63, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x65, 0x73, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x68, 0x69, 0x70, 0x46, 0x72, 0x65, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x68, 0x69, 0x70, 0x46, 0x72, 0x65, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x53, 0x61, 0x6c, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, 0x53, 0x61, 0x6c, 0x65, 0x22, 0x5a, 0x0a, 0x11, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2f, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xfa, 0x02, 0x0a, 0x12, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x76, 0x4e, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x61, 0x76, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xa2, 0x01, 0x0a, 0x14, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x32, 0x0a, 0x14, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3b, 0x0a, 0x13, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x8f, 0x01, 0x0a, 0x17, 0x53, 0x75, 0x62, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x40, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0xa1, 0x01, 0x0a, 0x13, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x66, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x73, 0x22, 0x27, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4a, 0x0a, 0x10, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x0c, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x11, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x5a, 0x0a, 0x11, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xa6, 0x09, 0x0a, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x4c, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x09, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4a, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x17, 0x5a, 0x15, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_api_goods_v1_goods_proto_rawDescOnce sync.Once file_api_goods_v1_goods_proto_rawDescData = file_api_goods_v1_goods_proto_rawDesc ) func file_api_goods_v1_goods_proto_rawDescGZIP() []byte { file_api_goods_v1_goods_proto_rawDescOnce.Do(func() { file_api_goods_v1_goods_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_goods_v1_goods_proto_rawDescData) }) return file_api_goods_v1_goods_proto_rawDescData } var file_api_goods_v1_goods_proto_msgTypes = make([]protoimpl.MessageInfo, 32) var file_api_goods_v1_goods_proto_goTypes = []interface{}{ (*AttrValueRequest)(nil), // 0: goods.v1.AttrValueRequest (*AttrRequest)(nil), // 1: goods.v1.AttrRequest (*AttrValueResponse)(nil), // 2: goods.v1.AttrValueResponse (*AttrResponse)(nil), // 3: goods.v1.AttrResponse (*AttrGroupRequest)(nil), // 4: goods.v1.AttrGroupRequest (*AttrGroupResponse)(nil), // 5: goods.v1.AttrGroupResponse (*SpecificationValue)(nil), // 6: goods.v1.SpecificationValue (*SpecificationValueResponse)(nil), // 7: goods.v1.SpecificationValueResponse (*SpecificationRequest)(nil), // 8: goods.v1.SpecificationRequest (*SpecificationResponse)(nil), // 9: goods.v1.SpecificationResponse (*GoodsTypeRequest)(nil), // 10: goods.v1.GoodsTypeRequest (*GoodsTypeResponse)(nil), // 11: goods.v1.GoodsTypeResponse (*CreateGoodsRequest)(nil), // 12: goods.v1.CreateGoodsRequest (*CreateGoodsResponse)(nil), // 13: goods.v1.CreateGoodsResponse (*GoodsInfoResponse)(nil), // 14: goods.v1.GoodsInfoResponse (*GoodsListResponse)(nil), // 15: goods.v1.GoodsListResponse (*GoodsFilterRequest)(nil), // 16: goods.v1.GoodsFilterRequest (*CategoryInfoResponse)(nil), // 17: goods.v1.CategoryInfoResponse (*CategoryListResponse)(nil), // 18: goods.v1.CategoryListResponse (*CategoryListRequest)(nil), // 19: goods.v1.CategoryListRequest (*SubCategoryListResponse)(nil), // 20: goods.v1.SubCategoryListResponse (*CategoryInfoRequest)(nil), // 21: goods.v1.CategoryInfoRequest (*BatchCategoryInfoRequest)(nil), // 22: goods.v1.BatchCategoryInfoRequest (*DeleteCategoryRequest)(nil), // 23: goods.v1.DeleteCategoryRequest (*BrandListRequest)(nil), // 24: goods.v1.BrandListRequest (*BrandRequest)(nil), // 25: goods.v1.BrandRequest (*BrandInfoResponse)(nil), // 26: goods.v1.BrandInfoResponse (*BrandListResponse)(nil), // 27: goods.v1.BrandListResponse (*CreateGoodsRequestGoodsSku)(nil), // 28: goods.v1.CreateGoodsRequest.goodsSku (*CreateGoodsRequestGoodsSkuSpecification)(nil), // 29: goods.v1.CreateGoodsRequest.goodsSku.specification (*CreateGoodsRequestGoodsSkuGroupAttr)(nil), // 30: goods.v1.CreateGoodsRequest.goodsSku.groupAttr (*CreateGoodsRequestGoodsSkuGroupAttrAttr)(nil), // 31: goods.v1.CreateGoodsRequest.goodsSku.groupAttr.attr (*emptypb.Empty)(nil), // 32: google.protobuf.Empty } var file_api_goods_v1_goods_proto_depIdxs = []int32{ 0, // 0: goods.v1.AttrRequest.attrValue:type_name -> goods.v1.AttrValueRequest 2, // 1: goods.v1.AttrResponse.attrValue:type_name -> goods.v1.AttrValueResponse 6, // 2: goods.v1.SpecificationRequest.specificationValue:type_name -> goods.v1.SpecificationValue 28, // 3: goods.v1.CreateGoodsRequest.sku:type_name -> goods.v1.CreateGoodsRequest.goodsSku 14, // 4: goods.v1.GoodsListResponse.list:type_name -> goods.v1.GoodsInfoResponse 17, // 5: goods.v1.SubCategoryListResponse.info:type_name -> goods.v1.CategoryInfoResponse 17, // 6: goods.v1.SubCategoryListResponse.subCategory:type_name -> goods.v1.CategoryInfoResponse 26, // 7: goods.v1.BrandListResponse.data:type_name -> goods.v1.BrandInfoResponse 29, // 8: goods.v1.CreateGoodsRequest.goodsSku.specificationInfo:type_name -> goods.v1.CreateGoodsRequest.goodsSku.specification 30, // 9: goods.v1.CreateGoodsRequest.goodsSku.groupAttrInfo:type_name -> goods.v1.CreateGoodsRequest.goodsSku.groupAttr 31, // 10: goods.v1.CreateGoodsRequest.goodsSku.groupAttr.attrInfo:type_name -> goods.v1.CreateGoodsRequest.goodsSku.groupAttr.attr 32, // 11: goods.v1.Goods.GetAllCategoryList:input_type -> google.protobuf.Empty 19, // 12: goods.v1.Goods.GetSubCategory:input_type -> goods.v1.CategoryListRequest 21, // 13: goods.v1.Goods.CreateCategory:input_type -> goods.v1.CategoryInfoRequest 23, // 14: goods.v1.Goods.DeleteCategory:input_type -> goods.v1.DeleteCategoryRequest 21, // 15: goods.v1.Goods.UpdateCategory:input_type -> goods.v1.CategoryInfoRequest 24, // 16: goods.v1.Goods.BrandList:input_type -> goods.v1.BrandListRequest 25, // 17: goods.v1.Goods.CreateBrand:input_type -> goods.v1.BrandRequest 25, // 18: goods.v1.Goods.DeleteBrand:input_type -> goods.v1.BrandRequest 25, // 19: goods.v1.Goods.UpdateBrand:input_type -> goods.v1.BrandRequest 10, // 20: goods.v1.Goods.CreateGoodsType:input_type -> goods.v1.GoodsTypeRequest 8, // 21: goods.v1.Goods.CreateGoodsSpecification:input_type -> goods.v1.SpecificationRequest 4, // 22: goods.v1.Goods.CreateAttrGroup:input_type -> goods.v1.AttrGroupRequest 1, // 23: goods.v1.Goods.CreateAttrValue:input_type -> goods.v1.AttrRequest 12, // 24: goods.v1.Goods.CreateGoods:input_type -> goods.v1.CreateGoodsRequest 12, // 25: goods.v1.Goods.UpdateGoods:input_type -> goods.v1.CreateGoodsRequest 16, // 26: goods.v1.Goods.GoodsList:input_type -> goods.v1.GoodsFilterRequest 18, // 27: goods.v1.Goods.GetAllCategoryList:output_type -> goods.v1.CategoryListResponse 20, // 28: goods.v1.Goods.GetSubCategory:output_type -> goods.v1.SubCategoryListResponse 17, // 29: goods.v1.Goods.CreateCategory:output_type -> goods.v1.CategoryInfoResponse 32, // 30: goods.v1.Goods.DeleteCategory:output_type -> google.protobuf.Empty 32, // 31: goods.v1.Goods.UpdateCategory:output_type -> google.protobuf.Empty 27, // 32: goods.v1.Goods.BrandList:output_type -> goods.v1.BrandListResponse 26, // 33: goods.v1.Goods.CreateBrand:output_type -> goods.v1.BrandInfoResponse 32, // 34: goods.v1.Goods.DeleteBrand:output_type -> google.protobuf.Empty 32, // 35: goods.v1.Goods.UpdateBrand:output_type -> google.protobuf.Empty 11, // 36: goods.v1.Goods.CreateGoodsType:output_type -> goods.v1.GoodsTypeResponse 9, // 37: goods.v1.Goods.CreateGoodsSpecification:output_type -> goods.v1.SpecificationResponse 5, // 38: goods.v1.Goods.CreateAttrGroup:output_type -> goods.v1.AttrGroupResponse 3, // 39: goods.v1.Goods.CreateAttrValue:output_type -> goods.v1.AttrResponse 13, // 40: goods.v1.Goods.CreateGoods:output_type -> goods.v1.CreateGoodsResponse 32, // 41: goods.v1.Goods.UpdateGoods:output_type -> google.protobuf.Empty 15, // 42: goods.v1.Goods.GoodsList:output_type -> goods.v1.GoodsListResponse 27, // [27:43] is the sub-list for method output_type 11, // [11:27] is the sub-list for method input_type 11, // [11:11] is the sub-list for extension type_name 11, // [11:11] is the sub-list for extension extendee 0, // [0:11] is the sub-list for field type_name } func init() { file_api_goods_v1_goods_proto_init() } func file_api_goods_v1_goods_proto_init() { if File_api_goods_v1_goods_proto != nil { return } if !protoimpl.UnsafeEnabled { file_api_goods_v1_goods_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrValueRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrValueResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrGroupRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrGroupResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SpecificationValue); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SpecificationValueResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SpecificationRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SpecificationResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoodsTypeRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoodsTypeResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoodsInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoodsListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoodsFilterRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CategoryInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CategoryListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CategoryListRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubCategoryListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CategoryInfoRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchCategoryInfoRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteCategoryRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BrandListRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BrandRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BrandInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BrandListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsRequestGoodsSku); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsRequestGoodsSkuSpecification); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsRequestGoodsSkuGroupAttr); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_goods_v1_goods_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsRequestGoodsSkuGroupAttrAttr); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_goods_v1_goods_proto_rawDesc, NumEnums: 0, NumMessages: 32, NumExtensions: 0, NumServices: 1, }, GoTypes: file_api_goods_v1_goods_proto_goTypes, DependencyIndexes: file_api_goods_v1_goods_proto_depIdxs, MessageInfos: file_api_goods_v1_goods_proto_msgTypes, }.Build() File_api_goods_v1_goods_proto = out.File file_api_goods_v1_goods_proto_rawDesc = nil file_api_goods_v1_goods_proto_goTypes = nil file_api_goods_v1_goods_proto_depIdxs = nil } ================================================ FILE: service/goods/api/goods/v1/goods.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: api/goods/v1/goods.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on AttrValueRequest 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 *AttrValueRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrValueRequest 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 // AttrValueRequestMultiError, or nil if none found. func (m *AttrValueRequest) ValidateAll() error { return m.validate(true) } func (m *AttrValueRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for AttrId if m.GetGroupId() < 1 { err := AttrValueRequestValidationError{ field: "GroupId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetValue()) < 3 { err := AttrValueRequestValidationError{ field: "Value", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return AttrValueRequestMultiError(errors) } return nil } // AttrValueRequestMultiError is an error wrapping multiple validation errors // returned by AttrValueRequest.ValidateAll() if the designated constraints // aren't met. type AttrValueRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrValueRequestMultiError) 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 AttrValueRequestMultiError) AllErrors() []error { return m } // AttrValueRequestValidationError is the validation error returned by // AttrValueRequest.Validate if the designated constraints aren't met. type AttrValueRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrValueRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrValueRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrValueRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrValueRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrValueRequestValidationError) ErrorName() string { return "AttrValueRequestValidationError" } // Error satisfies the builtin error interface func (e AttrValueRequestValidationError) 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 %sAttrValueRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrValueRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrValueRequestValidationError{} // Validate checks the field values on AttrRequest 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 *AttrRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrRequest 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 AttrRequestMultiError, or // nil if none found. func (m *AttrRequest) ValidateAll() error { return m.validate(true) } func (m *AttrRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetTypeId() < 1 { err := AttrRequestValidationError{ field: "TypeId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if m.GetGroupId() < 1 { err := AttrRequestValidationError{ field: "GroupId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetTitle()) < 1 { err := AttrRequestValidationError{ field: "Title", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Desc // no validation rules for Status if m.GetSort() < 1 { err := AttrRequestValidationError{ field: "Sort", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } for idx, item := range m.GetAttrValue() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, AttrRequestValidationError{ field: fmt.Sprintf("AttrValue[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, AttrRequestValidationError{ field: fmt.Sprintf("AttrValue[%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 AttrRequestValidationError{ field: fmt.Sprintf("AttrValue[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return AttrRequestMultiError(errors) } return nil } // AttrRequestMultiError is an error wrapping multiple validation errors // returned by AttrRequest.ValidateAll() if the designated constraints aren't met. type AttrRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrRequestMultiError) 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 AttrRequestMultiError) AllErrors() []error { return m } // AttrRequestValidationError is the validation error returned by // AttrRequest.Validate if the designated constraints aren't met. type AttrRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrRequestValidationError) ErrorName() string { return "AttrRequestValidationError" } // Error satisfies the builtin error interface func (e AttrRequestValidationError) 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 %sAttrRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrRequestValidationError{} // Validate checks the field values on AttrValueResponse 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 *AttrValueResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrValueResponse 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 // AttrValueResponseMultiError, or nil if none found. func (m *AttrValueResponse) ValidateAll() error { return m.validate(true) } func (m *AttrValueResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for AttrId // no validation rules for GroupId // no validation rules for Value if len(errors) > 0 { return AttrValueResponseMultiError(errors) } return nil } // AttrValueResponseMultiError is an error wrapping multiple validation errors // returned by AttrValueResponse.ValidateAll() if the designated constraints // aren't met. type AttrValueResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrValueResponseMultiError) 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 AttrValueResponseMultiError) AllErrors() []error { return m } // AttrValueResponseValidationError is the validation error returned by // AttrValueResponse.Validate if the designated constraints aren't met. type AttrValueResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrValueResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrValueResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrValueResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrValueResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrValueResponseValidationError) ErrorName() string { return "AttrValueResponseValidationError" } // Error satisfies the builtin error interface func (e AttrValueResponseValidationError) 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 %sAttrValueResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrValueResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrValueResponseValidationError{} // Validate checks the field values on AttrResponse 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 *AttrResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrResponse 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 AttrResponseMultiError, or // nil if none found. func (m *AttrResponse) ValidateAll() error { return m.validate(true) } func (m *AttrResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for TypeId // no validation rules for GroupId // no validation rules for Title // no validation rules for Desc // no validation rules for Status // no validation rules for Sort for idx, item := range m.GetAttrValue() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, AttrResponseValidationError{ field: fmt.Sprintf("AttrValue[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, AttrResponseValidationError{ field: fmt.Sprintf("AttrValue[%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 AttrResponseValidationError{ field: fmt.Sprintf("AttrValue[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return AttrResponseMultiError(errors) } return nil } // AttrResponseMultiError is an error wrapping multiple validation errors // returned by AttrResponse.ValidateAll() if the designated constraints aren't met. type AttrResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrResponseMultiError) 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 AttrResponseMultiError) AllErrors() []error { return m } // AttrResponseValidationError is the validation error returned by // AttrResponse.Validate if the designated constraints aren't met. type AttrResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrResponseValidationError) ErrorName() string { return "AttrResponseValidationError" } // Error satisfies the builtin error interface func (e AttrResponseValidationError) 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 %sAttrResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrResponseValidationError{} // Validate checks the field values on AttrGroupRequest 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 *AttrGroupRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrGroupRequest 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 // AttrGroupRequestMultiError, or nil if none found. func (m *AttrGroupRequest) ValidateAll() error { return m.validate(true) } func (m *AttrGroupRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetTypeId() < 1 { err := AttrGroupRequestValidationError{ field: "TypeId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetTitle()) < 3 { err := AttrGroupRequestValidationError{ field: "Title", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Desc // no validation rules for Status if m.GetSort() < 1 { err := AttrGroupRequestValidationError{ field: "Sort", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return AttrGroupRequestMultiError(errors) } return nil } // AttrGroupRequestMultiError is an error wrapping multiple validation errors // returned by AttrGroupRequest.ValidateAll() if the designated constraints // aren't met. type AttrGroupRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrGroupRequestMultiError) 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 AttrGroupRequestMultiError) AllErrors() []error { return m } // AttrGroupRequestValidationError is the validation error returned by // AttrGroupRequest.Validate if the designated constraints aren't met. type AttrGroupRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrGroupRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrGroupRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrGroupRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrGroupRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrGroupRequestValidationError) ErrorName() string { return "AttrGroupRequestValidationError" } // Error satisfies the builtin error interface func (e AttrGroupRequestValidationError) 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 %sAttrGroupRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrGroupRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrGroupRequestValidationError{} // Validate checks the field values on AttrGroupResponse 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 *AttrGroupResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrGroupResponse 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 // AttrGroupResponseMultiError, or nil if none found. func (m *AttrGroupResponse) ValidateAll() error { return m.validate(true) } func (m *AttrGroupResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for TypeId // no validation rules for Title // no validation rules for Desc // no validation rules for Status // no validation rules for Sort if len(errors) > 0 { return AttrGroupResponseMultiError(errors) } return nil } // AttrGroupResponseMultiError is an error wrapping multiple validation errors // returned by AttrGroupResponse.ValidateAll() if the designated constraints // aren't met. type AttrGroupResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrGroupResponseMultiError) 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 AttrGroupResponseMultiError) AllErrors() []error { return m } // AttrGroupResponseValidationError is the validation error returned by // AttrGroupResponse.Validate if the designated constraints aren't met. type AttrGroupResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrGroupResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrGroupResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrGroupResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrGroupResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrGroupResponseValidationError) ErrorName() string { return "AttrGroupResponseValidationError" } // Error satisfies the builtin error interface func (e AttrGroupResponseValidationError) 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 %sAttrGroupResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrGroupResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrGroupResponseValidationError{} // Validate checks the field values on SpecificationValue 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 *SpecificationValue) Validate() error { return m.validate(false) } // ValidateAll checks the field values on SpecificationValue 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 // SpecificationValueMultiError, or nil if none found. func (m *SpecificationValue) ValidateAll() error { return m.validate(true) } func (m *SpecificationValue) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for AttrId if utf8.RuneCountInString(m.GetValue()) < 3 { err := SpecificationValueValidationError{ field: "Value", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } if m.GetSort() < 1 { err := SpecificationValueValidationError{ field: "Sort", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return SpecificationValueMultiError(errors) } return nil } // SpecificationValueMultiError is an error wrapping multiple validation errors // returned by SpecificationValue.ValidateAll() if the designated constraints // aren't met. type SpecificationValueMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m SpecificationValueMultiError) 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 SpecificationValueMultiError) AllErrors() []error { return m } // SpecificationValueValidationError is the validation error returned by // SpecificationValue.Validate if the designated constraints aren't met. type SpecificationValueValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e SpecificationValueValidationError) Field() string { return e.field } // Reason function returns reason value. func (e SpecificationValueValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e SpecificationValueValidationError) Cause() error { return e.cause } // Key function returns key value. func (e SpecificationValueValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e SpecificationValueValidationError) ErrorName() string { return "SpecificationValueValidationError" } // Error satisfies the builtin error interface func (e SpecificationValueValidationError) 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 %sSpecificationValue.%s: %s%s", key, e.field, e.reason, cause) } var _ error = SpecificationValueValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = SpecificationValueValidationError{} // Validate checks the field values on SpecificationValueResponse 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 *SpecificationValueResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on SpecificationValueResponse 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 // SpecificationValueResponseMultiError, or nil if none found. func (m *SpecificationValueResponse) ValidateAll() error { return m.validate(true) } func (m *SpecificationValueResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for AttrId // no validation rules for Value // no validation rules for Sort if len(errors) > 0 { return SpecificationValueResponseMultiError(errors) } return nil } // SpecificationValueResponseMultiError is an error wrapping multiple // validation errors returned by SpecificationValueResponse.ValidateAll() if // the designated constraints aren't met. type SpecificationValueResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m SpecificationValueResponseMultiError) 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 SpecificationValueResponseMultiError) AllErrors() []error { return m } // SpecificationValueResponseValidationError is the validation error returned // by SpecificationValueResponse.Validate if the designated constraints aren't met. type SpecificationValueResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e SpecificationValueResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e SpecificationValueResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e SpecificationValueResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e SpecificationValueResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e SpecificationValueResponseValidationError) ErrorName() string { return "SpecificationValueResponseValidationError" } // Error satisfies the builtin error interface func (e SpecificationValueResponseValidationError) 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 %sSpecificationValueResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = SpecificationValueResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = SpecificationValueResponseValidationError{} // Validate checks the field values on SpecificationRequest 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 *SpecificationRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on SpecificationRequest 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 // SpecificationRequestMultiError, or nil if none found. func (m *SpecificationRequest) ValidateAll() error { return m.validate(true) } func (m *SpecificationRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetTypeId() < 1 { err := SpecificationRequestValidationError{ field: "TypeId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetName()) < 2 { err := SpecificationRequestValidationError{ field: "Name", reason: "value length must be at least 2 runes", } if !all { return err } errors = append(errors, err) } if m.GetSort() < 1 { err := SpecificationRequestValidationError{ field: "Sort", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } // no validation rules for Status // no validation rules for IsSku // no validation rules for IsSelect for idx, item := range m.GetSpecificationValue() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SpecificationRequestValidationError{ field: fmt.Sprintf("SpecificationValue[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, SpecificationRequestValidationError{ field: fmt.Sprintf("SpecificationValue[%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 SpecificationRequestValidationError{ field: fmt.Sprintf("SpecificationValue[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return SpecificationRequestMultiError(errors) } return nil } // SpecificationRequestMultiError is an error wrapping multiple validation // errors returned by SpecificationRequest.ValidateAll() if the designated // constraints aren't met. type SpecificationRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m SpecificationRequestMultiError) 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 SpecificationRequestMultiError) AllErrors() []error { return m } // SpecificationRequestValidationError is the validation error returned by // SpecificationRequest.Validate if the designated constraints aren't met. type SpecificationRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e SpecificationRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e SpecificationRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e SpecificationRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e SpecificationRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e SpecificationRequestValidationError) ErrorName() string { return "SpecificationRequestValidationError" } // Error satisfies the builtin error interface func (e SpecificationRequestValidationError) 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 %sSpecificationRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = SpecificationRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = SpecificationRequestValidationError{} // Validate checks the field values on SpecificationResponse 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 *SpecificationResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on SpecificationResponse 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 // SpecificationResponseMultiError, or nil if none found. func (m *SpecificationResponse) ValidateAll() error { return m.validate(true) } func (m *SpecificationResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return SpecificationResponseMultiError(errors) } return nil } // SpecificationResponseMultiError is an error wrapping multiple validation // errors returned by SpecificationResponse.ValidateAll() if the designated // constraints aren't met. type SpecificationResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m SpecificationResponseMultiError) 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 SpecificationResponseMultiError) AllErrors() []error { return m } // SpecificationResponseValidationError is the validation error returned by // SpecificationResponse.Validate if the designated constraints aren't met. type SpecificationResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e SpecificationResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e SpecificationResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e SpecificationResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e SpecificationResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e SpecificationResponseValidationError) ErrorName() string { return "SpecificationResponseValidationError" } // Error satisfies the builtin error interface func (e SpecificationResponseValidationError) 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 %sSpecificationResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = SpecificationResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = SpecificationResponseValidationError{} // Validate checks the field values on GoodsTypeRequest 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 *GoodsTypeRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GoodsTypeRequest 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 // GoodsTypeRequestMultiError, or nil if none found. func (m *GoodsTypeRequest) ValidateAll() error { return m.validate(true) } func (m *GoodsTypeRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if utf8.RuneCountInString(m.GetName()) < 3 { err := GoodsTypeRequestValidationError{ field: "Name", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetTypeCode()) < 3 { err := GoodsTypeRequestValidationError{ field: "TypeCode", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for NameAlias // no validation rules for IsVirtual // no validation rules for Desc // no validation rules for Sort if utf8.RuneCountInString(m.GetBrandIds()) < 1 { err := GoodsTypeRequestValidationError{ field: "BrandIds", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return GoodsTypeRequestMultiError(errors) } return nil } // GoodsTypeRequestMultiError is an error wrapping multiple validation errors // returned by GoodsTypeRequest.ValidateAll() if the designated constraints // aren't met. type GoodsTypeRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GoodsTypeRequestMultiError) 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 GoodsTypeRequestMultiError) AllErrors() []error { return m } // GoodsTypeRequestValidationError is the validation error returned by // GoodsTypeRequest.Validate if the designated constraints aren't met. type GoodsTypeRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GoodsTypeRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GoodsTypeRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GoodsTypeRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GoodsTypeRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GoodsTypeRequestValidationError) ErrorName() string { return "GoodsTypeRequestValidationError" } // Error satisfies the builtin error interface func (e GoodsTypeRequestValidationError) 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 %sGoodsTypeRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GoodsTypeRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GoodsTypeRequestValidationError{} // Validate checks the field values on GoodsTypeResponse 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 *GoodsTypeResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GoodsTypeResponse 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 // GoodsTypeResponseMultiError, or nil if none found. func (m *GoodsTypeResponse) ValidateAll() error { return m.validate(true) } func (m *GoodsTypeResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return GoodsTypeResponseMultiError(errors) } return nil } // GoodsTypeResponseMultiError is an error wrapping multiple validation errors // returned by GoodsTypeResponse.ValidateAll() if the designated constraints // aren't met. type GoodsTypeResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GoodsTypeResponseMultiError) 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 GoodsTypeResponseMultiError) AllErrors() []error { return m } // GoodsTypeResponseValidationError is the validation error returned by // GoodsTypeResponse.Validate if the designated constraints aren't met. type GoodsTypeResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GoodsTypeResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GoodsTypeResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GoodsTypeResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GoodsTypeResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GoodsTypeResponseValidationError) ErrorName() string { return "GoodsTypeResponseValidationError" } // Error satisfies the builtin error interface func (e GoodsTypeResponseValidationError) 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 %sGoodsTypeResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GoodsTypeResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GoodsTypeResponseValidationError{} // Validate checks the field values on CreateGoodsRequest 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 *CreateGoodsRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateGoodsRequest 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 // CreateGoodsRequestMultiError, or nil if none found. func (m *CreateGoodsRequest) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetCategoryId() < 1 { err := CreateGoodsRequestValidationError{ field: "CategoryId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if m.GetBrandId() < 1 { err := CreateGoodsRequestValidationError{ field: "BrandId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if m.GetTypeId() < 1 { err := CreateGoodsRequestValidationError{ field: "TypeId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } // no validation rules for Name // no validation rules for NameAlias // no validation rules for GoodsTags // no validation rules for GoodsSn // no validation rules for ShopPrice // no validation rules for MarketPrice // no validation rules for Inventory // no validation rules for GoodsBrief // no validation rules for GoodsFrontImage // no validation rules for ShipFree // no validation rules for ShipId // no validation rules for IsNew // no validation rules for IsHot // no validation rules for OnSale for idx, item := range m.GetSku() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CreateGoodsRequestValidationError{ field: fmt.Sprintf("Sku[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CreateGoodsRequestValidationError{ field: fmt.Sprintf("Sku[%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 CreateGoodsRequestValidationError{ field: fmt.Sprintf("Sku[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return CreateGoodsRequestMultiError(errors) } return nil } // CreateGoodsRequestMultiError is an error wrapping multiple validation errors // returned by CreateGoodsRequest.ValidateAll() if the designated constraints // aren't met. type CreateGoodsRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsRequestMultiError) 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 CreateGoodsRequestMultiError) AllErrors() []error { return m } // CreateGoodsRequestValidationError is the validation error returned by // CreateGoodsRequest.Validate if the designated constraints aren't met. type CreateGoodsRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsRequestValidationError) ErrorName() string { return "CreateGoodsRequestValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsRequestValidationError) 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 %sCreateGoodsRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsRequestValidationError{} // Validate checks the field values on CreateGoodsResponse 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 *CreateGoodsResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateGoodsResponse 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 // CreateGoodsResponseMultiError, or nil if none found. func (m *CreateGoodsResponse) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for ID if len(errors) > 0 { return CreateGoodsResponseMultiError(errors) } return nil } // CreateGoodsResponseMultiError is an error wrapping multiple validation // errors returned by CreateGoodsResponse.ValidateAll() if the designated // constraints aren't met. type CreateGoodsResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsResponseMultiError) 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 CreateGoodsResponseMultiError) AllErrors() []error { return m } // CreateGoodsResponseValidationError is the validation error returned by // CreateGoodsResponse.Validate if the designated constraints aren't met. type CreateGoodsResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsResponseValidationError) ErrorName() string { return "CreateGoodsResponseValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsResponseValidationError) 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 %sCreateGoodsResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsResponseValidationError{} // Validate checks the field values on GoodsInfoResponse 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 *GoodsInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GoodsInfoResponse 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 // GoodsInfoResponseMultiError, or nil if none found. func (m *GoodsInfoResponse) ValidateAll() error { return m.validate(true) } func (m *GoodsInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for CategoryId // no validation rules for BrandId // no validation rules for Name // no validation rules for GoodsSn // no validation rules for ClickNum // no validation rules for SoldNum // no validation rules for FavNum // no validation rules for MarketPrice // no validation rules for GoodsBrief // no validation rules for GoodsDesc // no validation rules for ShipFree // no validation rules for Images // no validation rules for IsNew // no validation rules for IsHot // no validation rules for OnSale if len(errors) > 0 { return GoodsInfoResponseMultiError(errors) } return nil } // GoodsInfoResponseMultiError is an error wrapping multiple validation errors // returned by GoodsInfoResponse.ValidateAll() if the designated constraints // aren't met. type GoodsInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GoodsInfoResponseMultiError) 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 GoodsInfoResponseMultiError) AllErrors() []error { return m } // GoodsInfoResponseValidationError is the validation error returned by // GoodsInfoResponse.Validate if the designated constraints aren't met. type GoodsInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GoodsInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GoodsInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GoodsInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GoodsInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GoodsInfoResponseValidationError) ErrorName() string { return "GoodsInfoResponseValidationError" } // Error satisfies the builtin error interface func (e GoodsInfoResponseValidationError) 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 %sGoodsInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GoodsInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GoodsInfoResponseValidationError{} // Validate checks the field values on GoodsListResponse 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 *GoodsListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GoodsListResponse 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 // GoodsListResponseMultiError, or nil if none found. func (m *GoodsListResponse) ValidateAll() error { return m.validate(true) } func (m *GoodsListResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Total for idx, item := range m.GetList() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, GoodsListResponseValidationError{ field: fmt.Sprintf("List[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, GoodsListResponseValidationError{ field: fmt.Sprintf("List[%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 GoodsListResponseValidationError{ field: fmt.Sprintf("List[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return GoodsListResponseMultiError(errors) } return nil } // GoodsListResponseMultiError is an error wrapping multiple validation errors // returned by GoodsListResponse.ValidateAll() if the designated constraints // aren't met. type GoodsListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GoodsListResponseMultiError) 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 GoodsListResponseMultiError) AllErrors() []error { return m } // GoodsListResponseValidationError is the validation error returned by // GoodsListResponse.Validate if the designated constraints aren't met. type GoodsListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GoodsListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GoodsListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GoodsListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GoodsListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GoodsListResponseValidationError) ErrorName() string { return "GoodsListResponseValidationError" } // Error satisfies the builtin error interface func (e GoodsListResponseValidationError) 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 %sGoodsListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GoodsListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GoodsListResponseValidationError{} // Validate checks the field values on GoodsFilterRequest 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 *GoodsFilterRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GoodsFilterRequest 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 // GoodsFilterRequestMultiError, or nil if none found. func (m *GoodsFilterRequest) ValidateAll() error { return m.validate(true) } func (m *GoodsFilterRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Keywords // no validation rules for CategoryId // no validation rules for BrandId // no validation rules for MinPrice // no validation rules for MaxPrice // no validation rules for IsHot // no validation rules for IsNew // no validation rules for IsTab // no validation rules for ClickNum // no validation rules for SoldNum // no validation rules for FavNum // no validation rules for Pages // no validation rules for PagePerNums // no validation rules for Id if len(errors) > 0 { return GoodsFilterRequestMultiError(errors) } return nil } // GoodsFilterRequestMultiError is an error wrapping multiple validation errors // returned by GoodsFilterRequest.ValidateAll() if the designated constraints // aren't met. type GoodsFilterRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GoodsFilterRequestMultiError) 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 GoodsFilterRequestMultiError) AllErrors() []error { return m } // GoodsFilterRequestValidationError is the validation error returned by // GoodsFilterRequest.Validate if the designated constraints aren't met. type GoodsFilterRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GoodsFilterRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GoodsFilterRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GoodsFilterRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GoodsFilterRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GoodsFilterRequestValidationError) ErrorName() string { return "GoodsFilterRequestValidationError" } // Error satisfies the builtin error interface func (e GoodsFilterRequestValidationError) 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 %sGoodsFilterRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GoodsFilterRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GoodsFilterRequestValidationError{} // Validate checks the field values on CategoryInfoResponse 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 *CategoryInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CategoryInfoResponse 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 // CategoryInfoResponseMultiError, or nil if none found. func (m *CategoryInfoResponse) ValidateAll() error { return m.validate(true) } func (m *CategoryInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for ParentCategory // no validation rules for Level // no validation rules for IsTab // no validation rules for Sort if len(errors) > 0 { return CategoryInfoResponseMultiError(errors) } return nil } // CategoryInfoResponseMultiError is an error wrapping multiple validation // errors returned by CategoryInfoResponse.ValidateAll() if the designated // constraints aren't met. type CategoryInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CategoryInfoResponseMultiError) 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 CategoryInfoResponseMultiError) AllErrors() []error { return m } // CategoryInfoResponseValidationError is the validation error returned by // CategoryInfoResponse.Validate if the designated constraints aren't met. type CategoryInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CategoryInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CategoryInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CategoryInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CategoryInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CategoryInfoResponseValidationError) ErrorName() string { return "CategoryInfoResponseValidationError" } // Error satisfies the builtin error interface func (e CategoryInfoResponseValidationError) 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 %sCategoryInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CategoryInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CategoryInfoResponseValidationError{} // Validate checks the field values on CategoryListResponse 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 *CategoryListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CategoryListResponse 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 // CategoryListResponseMultiError, or nil if none found. func (m *CategoryListResponse) ValidateAll() error { return m.validate(true) } func (m *CategoryListResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for JsonData if len(errors) > 0 { return CategoryListResponseMultiError(errors) } return nil } // CategoryListResponseMultiError is an error wrapping multiple validation // errors returned by CategoryListResponse.ValidateAll() if the designated // constraints aren't met. type CategoryListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CategoryListResponseMultiError) 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 CategoryListResponseMultiError) AllErrors() []error { return m } // CategoryListResponseValidationError is the validation error returned by // CategoryListResponse.Validate if the designated constraints aren't met. type CategoryListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CategoryListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CategoryListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CategoryListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CategoryListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CategoryListResponseValidationError) ErrorName() string { return "CategoryListResponseValidationError" } // Error satisfies the builtin error interface func (e CategoryListResponseValidationError) 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 %sCategoryListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CategoryListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CategoryListResponseValidationError{} // Validate checks the field values on CategoryListRequest 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 *CategoryListRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CategoryListRequest 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 // CategoryListRequestMultiError, or nil if none found. func (m *CategoryListRequest) ValidateAll() error { return m.validate(true) } func (m *CategoryListRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Level if len(errors) > 0 { return CategoryListRequestMultiError(errors) } return nil } // CategoryListRequestMultiError is an error wrapping multiple validation // errors returned by CategoryListRequest.ValidateAll() if the designated // constraints aren't met. type CategoryListRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CategoryListRequestMultiError) 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 CategoryListRequestMultiError) AllErrors() []error { return m } // CategoryListRequestValidationError is the validation error returned by // CategoryListRequest.Validate if the designated constraints aren't met. type CategoryListRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CategoryListRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CategoryListRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CategoryListRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CategoryListRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CategoryListRequestValidationError) ErrorName() string { return "CategoryListRequestValidationError" } // Error satisfies the builtin error interface func (e CategoryListRequestValidationError) 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 %sCategoryListRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CategoryListRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CategoryListRequestValidationError{} // Validate checks the field values on SubCategoryListResponse 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 *SubCategoryListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on SubCategoryListResponse 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 // SubCategoryListResponseMultiError, or nil if none found. func (m *SubCategoryListResponse) ValidateAll() error { return m.validate(true) } func (m *SubCategoryListResponse) validate(all bool) error { if m == nil { return nil } var errors []error if all { switch v := interface{}(m.GetInfo()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SubCategoryListResponseValidationError{ field: "Info", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, SubCategoryListResponseValidationError{ field: "Info", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetInfo()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SubCategoryListResponseValidationError{ field: "Info", reason: "embedded message failed validation", cause: err, } } } for idx, item := range m.GetSubCategory() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SubCategoryListResponseValidationError{ field: fmt.Sprintf("SubCategory[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, SubCategoryListResponseValidationError{ field: fmt.Sprintf("SubCategory[%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 SubCategoryListResponseValidationError{ field: fmt.Sprintf("SubCategory[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return SubCategoryListResponseMultiError(errors) } return nil } // SubCategoryListResponseMultiError is an error wrapping multiple validation // errors returned by SubCategoryListResponse.ValidateAll() if the designated // constraints aren't met. type SubCategoryListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m SubCategoryListResponseMultiError) 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 SubCategoryListResponseMultiError) AllErrors() []error { return m } // SubCategoryListResponseValidationError is the validation error returned by // SubCategoryListResponse.Validate if the designated constraints aren't met. type SubCategoryListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e SubCategoryListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e SubCategoryListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e SubCategoryListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e SubCategoryListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e SubCategoryListResponseValidationError) ErrorName() string { return "SubCategoryListResponseValidationError" } // Error satisfies the builtin error interface func (e SubCategoryListResponseValidationError) 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 %sSubCategoryListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = SubCategoryListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = SubCategoryListResponseValidationError{} // Validate checks the field values on CategoryInfoRequest 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 *CategoryInfoRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CategoryInfoRequest 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 // CategoryInfoRequestMultiError, or nil if none found. func (m *CategoryInfoRequest) ValidateAll() error { return m.validate(true) } func (m *CategoryInfoRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for ParentCategory // no validation rules for Level // no validation rules for IsTab // no validation rules for Sort if len(errors) > 0 { return CategoryInfoRequestMultiError(errors) } return nil } // CategoryInfoRequestMultiError is an error wrapping multiple validation // errors returned by CategoryInfoRequest.ValidateAll() if the designated // constraints aren't met. type CategoryInfoRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CategoryInfoRequestMultiError) 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 CategoryInfoRequestMultiError) AllErrors() []error { return m } // CategoryInfoRequestValidationError is the validation error returned by // CategoryInfoRequest.Validate if the designated constraints aren't met. type CategoryInfoRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CategoryInfoRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CategoryInfoRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CategoryInfoRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CategoryInfoRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CategoryInfoRequestValidationError) ErrorName() string { return "CategoryInfoRequestValidationError" } // Error satisfies the builtin error interface func (e CategoryInfoRequestValidationError) 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 %sCategoryInfoRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CategoryInfoRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CategoryInfoRequestValidationError{} // Validate checks the field values on BatchCategoryInfoRequest 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 *BatchCategoryInfoRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on BatchCategoryInfoRequest 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 // BatchCategoryInfoRequestMultiError, or nil if none found. func (m *BatchCategoryInfoRequest) ValidateAll() error { return m.validate(true) } func (m *BatchCategoryInfoRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for GoodsNums // no validation rules for BrandNums if len(errors) > 0 { return BatchCategoryInfoRequestMultiError(errors) } return nil } // BatchCategoryInfoRequestMultiError is an error wrapping multiple validation // errors returned by BatchCategoryInfoRequest.ValidateAll() if the designated // constraints aren't met. type BatchCategoryInfoRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m BatchCategoryInfoRequestMultiError) 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 BatchCategoryInfoRequestMultiError) AllErrors() []error { return m } // BatchCategoryInfoRequestValidationError is the validation error returned by // BatchCategoryInfoRequest.Validate if the designated constraints aren't met. type BatchCategoryInfoRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e BatchCategoryInfoRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e BatchCategoryInfoRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e BatchCategoryInfoRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e BatchCategoryInfoRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e BatchCategoryInfoRequestValidationError) ErrorName() string { return "BatchCategoryInfoRequestValidationError" } // Error satisfies the builtin error interface func (e BatchCategoryInfoRequestValidationError) 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 %sBatchCategoryInfoRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = BatchCategoryInfoRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = BatchCategoryInfoRequestValidationError{} // Validate checks the field values on DeleteCategoryRequest 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 *DeleteCategoryRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on DeleteCategoryRequest 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 // DeleteCategoryRequestMultiError, or nil if none found. func (m *DeleteCategoryRequest) ValidateAll() error { return m.validate(true) } func (m *DeleteCategoryRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return DeleteCategoryRequestMultiError(errors) } return nil } // DeleteCategoryRequestMultiError is an error wrapping multiple validation // errors returned by DeleteCategoryRequest.ValidateAll() if the designated // constraints aren't met. type DeleteCategoryRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m DeleteCategoryRequestMultiError) 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 DeleteCategoryRequestMultiError) AllErrors() []error { return m } // DeleteCategoryRequestValidationError is the validation error returned by // DeleteCategoryRequest.Validate if the designated constraints aren't met. type DeleteCategoryRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e DeleteCategoryRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e DeleteCategoryRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e DeleteCategoryRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e DeleteCategoryRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e DeleteCategoryRequestValidationError) ErrorName() string { return "DeleteCategoryRequestValidationError" } // Error satisfies the builtin error interface func (e DeleteCategoryRequestValidationError) 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 %sDeleteCategoryRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = DeleteCategoryRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = DeleteCategoryRequestValidationError{} // Validate checks the field values on BrandListRequest 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 *BrandListRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on BrandListRequest 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 // BrandListRequestMultiError, or nil if none found. func (m *BrandListRequest) ValidateAll() error { return m.validate(true) } func (m *BrandListRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Pages // no validation rules for PagePerNums if len(errors) > 0 { return BrandListRequestMultiError(errors) } return nil } // BrandListRequestMultiError is an error wrapping multiple validation errors // returned by BrandListRequest.ValidateAll() if the designated constraints // aren't met. type BrandListRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m BrandListRequestMultiError) 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 BrandListRequestMultiError) AllErrors() []error { return m } // BrandListRequestValidationError is the validation error returned by // BrandListRequest.Validate if the designated constraints aren't met. type BrandListRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e BrandListRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e BrandListRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e BrandListRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e BrandListRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e BrandListRequestValidationError) ErrorName() string { return "BrandListRequestValidationError" } // Error satisfies the builtin error interface func (e BrandListRequestValidationError) 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 %sBrandListRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = BrandListRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = BrandListRequestValidationError{} // Validate checks the field values on BrandRequest 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 *BrandRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on BrandRequest 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 BrandRequestMultiError, or // nil if none found. func (m *BrandRequest) ValidateAll() error { return m.validate(true) } func (m *BrandRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for Logo // no validation rules for Desc // no validation rules for IsTab // no validation rules for Sort if len(errors) > 0 { return BrandRequestMultiError(errors) } return nil } // BrandRequestMultiError is an error wrapping multiple validation errors // returned by BrandRequest.ValidateAll() if the designated constraints aren't met. type BrandRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m BrandRequestMultiError) 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 BrandRequestMultiError) AllErrors() []error { return m } // BrandRequestValidationError is the validation error returned by // BrandRequest.Validate if the designated constraints aren't met. type BrandRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e BrandRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e BrandRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e BrandRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e BrandRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e BrandRequestValidationError) ErrorName() string { return "BrandRequestValidationError" } // Error satisfies the builtin error interface func (e BrandRequestValidationError) 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 %sBrandRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = BrandRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = BrandRequestValidationError{} // Validate checks the field values on BrandInfoResponse 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 *BrandInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on BrandInfoResponse 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 // BrandInfoResponseMultiError, or nil if none found. func (m *BrandInfoResponse) ValidateAll() error { return m.validate(true) } func (m *BrandInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for Logo // no validation rules for Desc // no validation rules for IsTab // no validation rules for Sort if len(errors) > 0 { return BrandInfoResponseMultiError(errors) } return nil } // BrandInfoResponseMultiError is an error wrapping multiple validation errors // returned by BrandInfoResponse.ValidateAll() if the designated constraints // aren't met. type BrandInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m BrandInfoResponseMultiError) 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 BrandInfoResponseMultiError) AllErrors() []error { return m } // BrandInfoResponseValidationError is the validation error returned by // BrandInfoResponse.Validate if the designated constraints aren't met. type BrandInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e BrandInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e BrandInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e BrandInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e BrandInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e BrandInfoResponseValidationError) ErrorName() string { return "BrandInfoResponseValidationError" } // Error satisfies the builtin error interface func (e BrandInfoResponseValidationError) 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 %sBrandInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = BrandInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = BrandInfoResponseValidationError{} // Validate checks the field values on BrandListResponse 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 *BrandListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on BrandListResponse 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 // BrandListResponseMultiError, or nil if none found. func (m *BrandListResponse) ValidateAll() error { return m.validate(true) } func (m *BrandListResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Total for idx, item := range m.GetData() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, BrandListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, BrandListResponseValidationError{ field: fmt.Sprintf("Data[%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 BrandListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return BrandListResponseMultiError(errors) } return nil } // BrandListResponseMultiError is an error wrapping multiple validation errors // returned by BrandListResponse.ValidateAll() if the designated constraints // aren't met. type BrandListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m BrandListResponseMultiError) 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 BrandListResponseMultiError) AllErrors() []error { return m } // BrandListResponseValidationError is the validation error returned by // BrandListResponse.Validate if the designated constraints aren't met. type BrandListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e BrandListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e BrandListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e BrandListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e BrandListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e BrandListResponseValidationError) ErrorName() string { return "BrandListResponseValidationError" } // Error satisfies the builtin error interface func (e BrandListResponseValidationError) 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 %sBrandListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = BrandListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = BrandListResponseValidationError{} // Validate checks the field values on CreateGoodsRequestGoodsSku 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 *CreateGoodsRequestGoodsSku) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateGoodsRequestGoodsSku 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 // CreateGoodsRequestGoodsSkuMultiError, or nil if none found. func (m *CreateGoodsRequestGoodsSku) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsRequestGoodsSku) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for GoodsId if utf8.RuneCountInString(m.GetSkuName()) < 1 { err := CreateGoodsRequestGoodsSkuValidationError{ field: "SkuName", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetCode()) < 1 { err := CreateGoodsRequestGoodsSkuValidationError{ field: "Code", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetBarCode()) < 1 { err := CreateGoodsRequestGoodsSkuValidationError{ field: "BarCode", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Price // no validation rules for PromotionPrice // no validation rules for Points // no validation rules for Image // no validation rules for Sort // no validation rules for Inventory for idx, item := range m.GetSpecificationInfo() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("SpecificationInfo[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("SpecificationInfo[%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 CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("SpecificationInfo[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetGroupAttrInfo() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("GroupAttrInfo[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("GroupAttrInfo[%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 CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("GroupAttrInfo[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return CreateGoodsRequestGoodsSkuMultiError(errors) } return nil } // CreateGoodsRequestGoodsSkuMultiError is an error wrapping multiple // validation errors returned by CreateGoodsRequestGoodsSku.ValidateAll() if // the designated constraints aren't met. type CreateGoodsRequestGoodsSkuMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsRequestGoodsSkuMultiError) 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 CreateGoodsRequestGoodsSkuMultiError) AllErrors() []error { return m } // CreateGoodsRequestGoodsSkuValidationError is the validation error returned // by CreateGoodsRequestGoodsSku.Validate if the designated constraints aren't met. type CreateGoodsRequestGoodsSkuValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsRequestGoodsSkuValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsRequestGoodsSkuValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsRequestGoodsSkuValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsRequestGoodsSkuValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsRequestGoodsSkuValidationError) ErrorName() string { return "CreateGoodsRequestGoodsSkuValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsRequestGoodsSkuValidationError) 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 %sCreateGoodsRequestGoodsSku.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsRequestGoodsSkuValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsRequestGoodsSkuValidationError{} // Validate checks the field values on CreateGoodsRequestGoodsSkuSpecification // 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 *CreateGoodsRequestGoodsSkuSpecification) Validate() error { return m.validate(false) } // ValidateAll checks the field values on // CreateGoodsRequestGoodsSkuSpecification 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 // CreateGoodsRequestGoodsSkuSpecificationMultiError, or nil if none found. func (m *CreateGoodsRequestGoodsSkuSpecification) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsRequestGoodsSkuSpecification) validate(all bool) error { if m == nil { return nil } var errors []error if m.GetSId() < 1 { err := CreateGoodsRequestGoodsSkuSpecificationValidationError{ field: "SId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if m.GetVId() < 1 { err := CreateGoodsRequestGoodsSkuSpecificationValidationError{ field: "VId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return CreateGoodsRequestGoodsSkuSpecificationMultiError(errors) } return nil } // CreateGoodsRequestGoodsSkuSpecificationMultiError is an error wrapping // multiple validation errors returned by // CreateGoodsRequestGoodsSkuSpecification.ValidateAll() if the designated // constraints aren't met. type CreateGoodsRequestGoodsSkuSpecificationMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsRequestGoodsSkuSpecificationMultiError) 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 CreateGoodsRequestGoodsSkuSpecificationMultiError) AllErrors() []error { return m } // CreateGoodsRequestGoodsSkuSpecificationValidationError is the validation // error returned by CreateGoodsRequestGoodsSkuSpecification.Validate if the // designated constraints aren't met. type CreateGoodsRequestGoodsSkuSpecificationValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) ErrorName() string { return "CreateGoodsRequestGoodsSkuSpecificationValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) 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 %sCreateGoodsRequestGoodsSkuSpecification.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsRequestGoodsSkuSpecificationValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsRequestGoodsSkuSpecificationValidationError{} // Validate checks the field values on CreateGoodsRequestGoodsSkuGroupAttr 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 *CreateGoodsRequestGoodsSkuGroupAttr) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateGoodsRequestGoodsSkuGroupAttr // 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 // CreateGoodsRequestGoodsSkuGroupAttrMultiError, or nil if none found. func (m *CreateGoodsRequestGoodsSkuGroupAttr) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsRequestGoodsSkuGroupAttr) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for GroupId // no validation rules for GroupName for idx, item := range m.GetAttrInfo() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuGroupAttrValidationError{ field: fmt.Sprintf("AttrInfo[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuGroupAttrValidationError{ field: fmt.Sprintf("AttrInfo[%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 CreateGoodsRequestGoodsSkuGroupAttrValidationError{ field: fmt.Sprintf("AttrInfo[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return CreateGoodsRequestGoodsSkuGroupAttrMultiError(errors) } return nil } // CreateGoodsRequestGoodsSkuGroupAttrMultiError is an error wrapping multiple // validation errors returned by // CreateGoodsRequestGoodsSkuGroupAttr.ValidateAll() if the designated // constraints aren't met. type CreateGoodsRequestGoodsSkuGroupAttrMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsRequestGoodsSkuGroupAttrMultiError) 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 CreateGoodsRequestGoodsSkuGroupAttrMultiError) AllErrors() []error { return m } // CreateGoodsRequestGoodsSkuGroupAttrValidationError is the validation error // returned by CreateGoodsRequestGoodsSkuGroupAttr.Validate if the designated // constraints aren't met. type CreateGoodsRequestGoodsSkuGroupAttrValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) ErrorName() string { return "CreateGoodsRequestGoodsSkuGroupAttrValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) 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 %sCreateGoodsRequestGoodsSkuGroupAttr.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsRequestGoodsSkuGroupAttrValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsRequestGoodsSkuGroupAttrValidationError{} // Validate checks the field values on CreateGoodsRequestGoodsSkuGroupAttrAttr // 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 *CreateGoodsRequestGoodsSkuGroupAttrAttr) Validate() error { return m.validate(false) } // ValidateAll checks the field values on // CreateGoodsRequestGoodsSkuGroupAttrAttr 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 // CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError, or nil if none found. func (m *CreateGoodsRequestGoodsSkuGroupAttrAttr) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsRequestGoodsSkuGroupAttrAttr) validate(all bool) error { if m == nil { return nil } var errors []error if m.GetAttrId() < 1 { err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{ field: "AttrId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetAttrName()) < 1 { err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{ field: "AttrName", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if m.GetAttrValueId() < 1 { err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{ field: "AttrValueId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetAttrValueName()) < 1 { err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{ field: "AttrValueName", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError(errors) } return nil } // CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError is an error wrapping // multiple validation errors returned by // CreateGoodsRequestGoodsSkuGroupAttrAttr.ValidateAll() if the designated // constraints aren't met. type CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError) 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 CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError) AllErrors() []error { return m } // CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError is the validation // error returned by CreateGoodsRequestGoodsSkuGroupAttrAttr.Validate if the // designated constraints aren't met. type CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) ErrorName() string { return "CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) 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 %sCreateGoodsRequestGoodsSkuGroupAttrAttr.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{} ================================================ FILE: service/goods/api/goods/v1/goods.proto ================================================ syntax = "proto3"; package goods.v1; import "google/protobuf/empty.proto"; import "validate/validate.proto"; option go_package = "goods/api/goods/v1;v1"; service Goods { // 商品分类 rpc GetAllCategoryList(google.protobuf.Empty) returns(CategoryListResponse); // 获取所有的分类 rpc GetSubCategory(CategoryListRequest) returns(SubCategoryListResponse);// 获取子分类 rpc CreateCategory(CategoryInfoRequest) returns(CategoryInfoResponse); // 新建分类信息 rpc DeleteCategory(DeleteCategoryRequest) returns(google.protobuf.Empty); // 删除分类 rpc UpdateCategory(CategoryInfoRequest) returns(google.protobuf.Empty); // 修改分类信息 // 商品品牌 rpc BrandList(BrandListRequest) returns(BrandListResponse); rpc CreateBrand(BrandRequest) returns(BrandInfoResponse); rpc DeleteBrand(BrandRequest) returns(google.protobuf.Empty); rpc UpdateBrand(BrandRequest) returns(google.protobuf.Empty); // 商品类型 goods_property_names // 商品类型不同于商品分类,指的是依据某一类商品的相同属性归纳成的属性集合 // 手机类型都有屏幕尺寸、网络制式等共同的属性 rpc CreateGoodsType(GoodsTypeRequest) returns(GoodsTypeResponse); // 商品类型基本信息创建 // 创建商品规格 也就是 手机的颜色、内存版本、购买方式之类的 // 商品规格的值,比如手机颜色对应的有 红、白、黑,内存,128g、256g, 也一起创建了 rpc CreateGoodsSpecification(SpecificationRequest) returns(SpecificationResponse); // 商品规格或属性的信息 // 商品参数属性 ,手机:主体,屏幕, 操作系统,网络支持之类的 rpc CreateAttrGroup(AttrGroupRequest) returns(AttrGroupResponse); // 商品参数属性组下的一些信息 ,主体:上市年份 产品名称 ,网络支持 5G网络,双卡双待类型, rpc CreateAttrValue(AttrRequest) returns(AttrResponse); // 商品接口 rpc CreateGoods(CreateGoodsRequest) returns (CreateGoodsResponse); rpc UpdateGoods(CreateGoodsRequest) returns (google.protobuf.Empty); rpc GoodsList(GoodsFilterRequest) returns(GoodsListResponse); // rpc GetGoodsDetail(GoodInfoRequest) returns(GoodsInfoResponse); // rpc BatchGetGoods(BatchGoodsIdInfo) returns(GoodsListResponse); // 现在用户提交订单有多个商品,你得批量查询商品的信息吧 // rpc DeleteGoods(DeleteGoodsInfo) returns (google.protobuf.Empty); // Sku rpc SkuList(SkuListRequest) returns(SkuListResponse); } message AttrValueRequest { int64 id = 1; int64 attrId = 2; int64 groupId = 3 [(validate.rules).int64.gte = 1]; string value = 4 [(validate.rules).string.min_len = 3]; } message AttrRequest { int64 id = 1; int64 typeId = 2 [(validate.rules).int64.gte = 1]; int64 groupId = 3 [(validate.rules).int64.gte = 1]; string title = 4 [(validate.rules).string = {min_len: 1}]; string desc = 5; bool status = 6; int32 sort = 7 [(validate.rules).int32.gte = 1]; repeated AttrValueRequest attrValue = 8; } message AttrValueResponse { int64 id = 1; int64 attrId = 2; int64 groupId = 3; string value = 4; } message AttrResponse { int64 id = 1; int64 typeId = 2; int64 groupId = 3; string title = 4; string desc = 5; bool status = 6; int32 sort = 7; repeated AttrValueResponse attrValue = 8; } message AttrGroupRequest { int64 id = 1; int64 typeId = 2 [(validate.rules).int64.gte = 1]; string title = 3 [(validate.rules).string.min_len = 3]; string desc = 4; bool status = 5; int32 sort = 6 [(validate.rules).int32.gte = 1]; } message AttrGroupResponse { int64 id = 1; int64 typeId = 2; string title = 3; string desc = 4; bool status = 5; int32 sort = 6; } message SpecificationValue { int64 id = 1; int64 attrId = 2; string value = 3 [(validate.rules).string.min_len = 3]; int32 sort = 4 [(validate.rules).int32.gte = 1]; } message SpecificationValueResponse { int64 id = 1; int64 attrId = 2; string value = 3 ; int32 sort = 4; } message SpecificationRequest { int64 id = 1; int64 typeId = 2 [(validate.rules).int64.gte = 1]; string name = 3 [(validate.rules).string.min_len = 2]; int32 sort = 4 [(validate.rules).int32.gte = 1]; bool status = 5; bool isSku = 6; bool isSelect = 7; repeated SpecificationValue specificationValue = 8; } message SpecificationResponse { int64 id = 1; } message GoodsTypeRequest { int64 id = 1; string name = 2 [(validate.rules).string.min_len = 3]; string typeCode = 3 [(validate.rules).string.min_len = 3]; string nameAlias = 4; bool isVirtual = 5; string desc = 6; int32 sort = 7; string brandIds = 8 [(validate.rules).string.min_len = 1]; } message GoodsTypeResponse { int64 id = 1; } message CreateGoodsRequest { int64 id = 1; int32 categoryId = 2 [(validate.rules).int32.gte = 1]; int32 brandId = 3 [(validate.rules).int32.gte = 1]; int64 typeId = 4 [(validate.rules).int64.gte = 1]; string name = 5; string nameAlias = 6; string goodsTags = 7; string goodsSn = 8; int64 shopPrice = 9; int64 marketPrice = 10; int64 inventory = 11; string goodsBrief = 12; string goodsFrontImage = 13; repeated string goodsImages = 14; bool shipFree = 15; int32 shipId = 16; bool isNew = 17; bool isHot = 18; bool onSale = 19; // 根据商品类型 选择商品规格信息并选择 // 商品 sku 属性值 里面有规格的ID和属性的ID,分别是几组信息 message goodsSku { int64 id = 1; int64 goodsId = 2; string skuName = 3 [(validate.rules).string.min_len = 1]; string code = 4 [(validate.rules).string.min_len = 1]; string barCode = 5 [(validate.rules).string.min_len = 1]; int64 price = 6; int64 promotionPrice = 7; int64 points = 8; string image = 9; int32 sort = 10; int64 inventory = 11; // sku 库存 // 规格 message specification { int64 sId = 1 [(validate.rules).int64.gte = 1]; int64 vId = 2 [(validate.rules).int64.gte = 1]; } repeated specification specificationInfo = 12; // 属性组 message groupAttr { int64 groupId = 1; string groupName = 2; message attr { int64 attrId = 1 [(validate.rules).int64.gte = 1]; string attrName = 2 [(validate.rules).string.min_len = 1]; int64 attrValueId = 3 [(validate.rules).int64.gte = 1]; string attrValueName = 4 [(validate.rules).string.min_len = 1]; } repeated attr attrInfo = 3; } repeated groupAttr groupAttrInfo = 13; } repeated goodsSku sku = 20; } message CreateGoodsResponse { int64 ID = 1; } message GoodsInfoResponse { int64 id = 1; int32 categoryId = 2; int32 brandId = 3; string name = 4; string goodsSn = 5; int64 clickNum = 6; int64 soldNum = 7; int64 favNum = 8; int64 marketPrice = 9; string goodsBrief = 10; string goodsDesc = 11; bool shipFree = 12; string images = 13; repeated string goodsImages = 14; bool isNew = 15; bool isHot = 16; bool onSale = 17; } message GoodsListResponse { int64 total = 1; repeated GoodsInfoResponse list = 2; } message GoodsFilterRequest { string keywords = 1; int32 categoryId = 2; int32 brandId = 3; int64 minPrice = 4; int64 maxPrice = 5; bool isHot = 6; bool isNew = 7; bool isTab = 8; int64 clickNum = 9; int64 soldNum = 10; int64 favNum = 11; int64 pages = 12; int64 pagePerNums = 13; int64 id = 14; } // 商品分类 message CategoryInfoResponse { int32 id = 1; string name = 2; int32 parentCategory = 3; int32 level = 4; bool isTab = 5; int32 sort = 6; } message CategoryListResponse { string jsonData = 1; } message CategoryListRequest { int32 id = 1; int32 level = 2; } message SubCategoryListResponse { CategoryInfoResponse info = 1; repeated CategoryInfoResponse subCategory = 2; } message CategoryInfoRequest { int32 id = 1; string name = 2; int32 parentCategory = 3; int32 level = 4; bool isTab = 5; int32 sort = 6; } message BatchCategoryInfoRequest { repeated int32 id = 1; int32 goodsNums = 2; int32 brandNums = 3; } message DeleteCategoryRequest { int32 id = 1; } message BrandListRequest { int32 pages = 1; int32 pagePerNums = 2; } message BrandRequest { int32 id = 1; string name = 2; string logo = 3; string desc = 4; bool isTab = 5; int32 sort = 6; } message BrandInfoResponse { int32 id = 1; string name = 2; string logo = 3; string desc = 4; bool isTab = 5; int32 sort = 6; } message BrandListResponse { int32 total = 1; repeated BrandInfoResponse data = 2; } message SkuListRequest{ repeated int64 id = 1; } message SkuListResponse { } ================================================ FILE: service/goods/api/goods/v1/goods_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 // source: api/goods/v1/goods.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // GoodsClient is the client API for Goods service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type GoodsClient interface { // 商品分类 GetAllCategoryList(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CategoryListResponse, error) GetSubCategory(ctx context.Context, in *CategoryListRequest, opts ...grpc.CallOption) (*SubCategoryListResponse, error) CreateCategory(ctx context.Context, in *CategoryInfoRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error) DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) UpdateCategory(ctx context.Context, in *CategoryInfoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // 商品品牌 BrandList(ctx context.Context, in *BrandListRequest, opts ...grpc.CallOption) (*BrandListResponse, error) CreateBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*BrandInfoResponse, error) DeleteBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) UpdateBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // 商品类型 goods_property_names // 商品类型不同于商品分类,指的是依据某一类商品的相同属性归纳成的属性集合 // 手机类型都有屏幕尺寸、网络制式等共同的属性 CreateGoodsType(ctx context.Context, in *GoodsTypeRequest, opts ...grpc.CallOption) (*GoodsTypeResponse, error) // 创建商品规格 也就是 手机的颜色、内存版本、购买方式之类的 // 商品规格的值,比如手机颜色对应的有 红、白、黑,内存,128g、256g, 也一起创建了 CreateGoodsSpecification(ctx context.Context, in *SpecificationRequest, opts ...grpc.CallOption) (*SpecificationResponse, error) // 商品参数属性 ,手机:主体,屏幕, 操作系统,网络支持之类的 CreateAttrGroup(ctx context.Context, in *AttrGroupRequest, opts ...grpc.CallOption) (*AttrGroupResponse, error) // 商品参数属性组下的一些信息 ,主体:上市年份 产品名称 ,网络支持 5G网络,双卡双待类型, CreateAttrValue(ctx context.Context, in *AttrRequest, opts ...grpc.CallOption) (*AttrResponse, error) // 商品接口 CreateGoods(ctx context.Context, in *CreateGoodsRequest, opts ...grpc.CallOption) (*CreateGoodsResponse, error) UpdateGoods(ctx context.Context, in *CreateGoodsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) GoodsList(ctx context.Context, in *GoodsFilterRequest, opts ...grpc.CallOption) (*GoodsListResponse, error) } type goodsClient struct { cc grpc.ClientConnInterface } func NewGoodsClient(cc grpc.ClientConnInterface) GoodsClient { return &goodsClient{cc} } func (c *goodsClient) GetAllCategoryList(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CategoryListResponse, error) { out := new(CategoryListResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/GetAllCategoryList", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) GetSubCategory(ctx context.Context, in *CategoryListRequest, opts ...grpc.CallOption) (*SubCategoryListResponse, error) { out := new(SubCategoryListResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/GetSubCategory", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateCategory(ctx context.Context, in *CategoryInfoRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error) { out := new(CategoryInfoResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateCategory", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/goods.v1.Goods/DeleteCategory", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) UpdateCategory(ctx context.Context, in *CategoryInfoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/goods.v1.Goods/UpdateCategory", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) BrandList(ctx context.Context, in *BrandListRequest, opts ...grpc.CallOption) (*BrandListResponse, error) { out := new(BrandListResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/BrandList", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*BrandInfoResponse, error) { out := new(BrandInfoResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateBrand", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) DeleteBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/goods.v1.Goods/DeleteBrand", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) UpdateBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/goods.v1.Goods/UpdateBrand", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateGoodsType(ctx context.Context, in *GoodsTypeRequest, opts ...grpc.CallOption) (*GoodsTypeResponse, error) { out := new(GoodsTypeResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateGoodsType", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateGoodsSpecification(ctx context.Context, in *SpecificationRequest, opts ...grpc.CallOption) (*SpecificationResponse, error) { out := new(SpecificationResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateGoodsSpecification", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateAttrGroup(ctx context.Context, in *AttrGroupRequest, opts ...grpc.CallOption) (*AttrGroupResponse, error) { out := new(AttrGroupResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateAttrGroup", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateAttrValue(ctx context.Context, in *AttrRequest, opts ...grpc.CallOption) (*AttrResponse, error) { out := new(AttrResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateAttrValue", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateGoods(ctx context.Context, in *CreateGoodsRequest, opts ...grpc.CallOption) (*CreateGoodsResponse, error) { out := new(CreateGoodsResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateGoods", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) UpdateGoods(ctx context.Context, in *CreateGoodsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/goods.v1.Goods/UpdateGoods", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) GoodsList(ctx context.Context, in *GoodsFilterRequest, opts ...grpc.CallOption) (*GoodsListResponse, error) { out := new(GoodsListResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/GoodsList", in, out, opts...) if err != nil { return nil, err } return out, nil } // GoodsServer is the server API for Goods service. // All implementations must embed UnimplementedGoodsServer // for forward compatibility type GoodsServer interface { // 商品分类 GetAllCategoryList(context.Context, *emptypb.Empty) (*CategoryListResponse, error) GetSubCategory(context.Context, *CategoryListRequest) (*SubCategoryListResponse, error) CreateCategory(context.Context, *CategoryInfoRequest) (*CategoryInfoResponse, error) DeleteCategory(context.Context, *DeleteCategoryRequest) (*emptypb.Empty, error) UpdateCategory(context.Context, *CategoryInfoRequest) (*emptypb.Empty, error) // 商品品牌 BrandList(context.Context, *BrandListRequest) (*BrandListResponse, error) CreateBrand(context.Context, *BrandRequest) (*BrandInfoResponse, error) DeleteBrand(context.Context, *BrandRequest) (*emptypb.Empty, error) UpdateBrand(context.Context, *BrandRequest) (*emptypb.Empty, error) // 商品类型 goods_property_names // 商品类型不同于商品分类,指的是依据某一类商品的相同属性归纳成的属性集合 // 手机类型都有屏幕尺寸、网络制式等共同的属性 CreateGoodsType(context.Context, *GoodsTypeRequest) (*GoodsTypeResponse, error) // 创建商品规格 也就是 手机的颜色、内存版本、购买方式之类的 // 商品规格的值,比如手机颜色对应的有 红、白、黑,内存,128g、256g, 也一起创建了 CreateGoodsSpecification(context.Context, *SpecificationRequest) (*SpecificationResponse, error) // 商品参数属性 ,手机:主体,屏幕, 操作系统,网络支持之类的 CreateAttrGroup(context.Context, *AttrGroupRequest) (*AttrGroupResponse, error) // 商品参数属性组下的一些信息 ,主体:上市年份 产品名称 ,网络支持 5G网络,双卡双待类型, CreateAttrValue(context.Context, *AttrRequest) (*AttrResponse, error) // 商品接口 CreateGoods(context.Context, *CreateGoodsRequest) (*CreateGoodsResponse, error) UpdateGoods(context.Context, *CreateGoodsRequest) (*emptypb.Empty, error) GoodsList(context.Context, *GoodsFilterRequest) (*GoodsListResponse, error) mustEmbedUnimplementedGoodsServer() } // UnimplementedGoodsServer must be embedded to have forward compatible implementations. type UnimplementedGoodsServer struct { } func (UnimplementedGoodsServer) GetAllCategoryList(context.Context, *emptypb.Empty) (*CategoryListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAllCategoryList not implemented") } func (UnimplementedGoodsServer) GetSubCategory(context.Context, *CategoryListRequest) (*SubCategoryListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetSubCategory not implemented") } func (UnimplementedGoodsServer) CreateCategory(context.Context, *CategoryInfoRequest) (*CategoryInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateCategory not implemented") } func (UnimplementedGoodsServer) DeleteCategory(context.Context, *DeleteCategoryRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteCategory not implemented") } func (UnimplementedGoodsServer) UpdateCategory(context.Context, *CategoryInfoRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateCategory not implemented") } func (UnimplementedGoodsServer) BrandList(context.Context, *BrandListRequest) (*BrandListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BrandList not implemented") } func (UnimplementedGoodsServer) CreateBrand(context.Context, *BrandRequest) (*BrandInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateBrand not implemented") } func (UnimplementedGoodsServer) DeleteBrand(context.Context, *BrandRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteBrand not implemented") } func (UnimplementedGoodsServer) UpdateBrand(context.Context, *BrandRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateBrand not implemented") } func (UnimplementedGoodsServer) CreateGoodsType(context.Context, *GoodsTypeRequest) (*GoodsTypeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateGoodsType not implemented") } func (UnimplementedGoodsServer) CreateGoodsSpecification(context.Context, *SpecificationRequest) (*SpecificationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateGoodsSpecification not implemented") } func (UnimplementedGoodsServer) CreateAttrGroup(context.Context, *AttrGroupRequest) (*AttrGroupResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAttrGroup not implemented") } func (UnimplementedGoodsServer) CreateAttrValue(context.Context, *AttrRequest) (*AttrResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAttrValue not implemented") } func (UnimplementedGoodsServer) CreateGoods(context.Context, *CreateGoodsRequest) (*CreateGoodsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateGoods not implemented") } func (UnimplementedGoodsServer) UpdateGoods(context.Context, *CreateGoodsRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateGoods not implemented") } func (UnimplementedGoodsServer) GoodsList(context.Context, *GoodsFilterRequest) (*GoodsListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GoodsList not implemented") } func (UnimplementedGoodsServer) mustEmbedUnimplementedGoodsServer() {} // UnsafeGoodsServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to GoodsServer will // result in compilation errors. type UnsafeGoodsServer interface { mustEmbedUnimplementedGoodsServer() } func RegisterGoodsServer(s grpc.ServiceRegistrar, srv GoodsServer) { s.RegisterService(&Goods_ServiceDesc, srv) } func _Goods_GetAllCategoryList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).GetAllCategoryList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/GetAllCategoryList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).GetAllCategoryList(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _Goods_GetSubCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CategoryListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).GetSubCategory(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/GetSubCategory", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).GetSubCategory(ctx, req.(*CategoryListRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CategoryInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateCategory(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateCategory", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateCategory(ctx, req.(*CategoryInfoRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_DeleteCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteCategoryRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).DeleteCategory(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/DeleteCategory", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).DeleteCategory(ctx, req.(*DeleteCategoryRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_UpdateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CategoryInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).UpdateCategory(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/UpdateCategory", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).UpdateCategory(ctx, req.(*CategoryInfoRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_BrandList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BrandListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).BrandList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/BrandList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).BrandList(ctx, req.(*BrandListRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateBrand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BrandRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateBrand(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateBrand", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateBrand(ctx, req.(*BrandRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_DeleteBrand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BrandRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).DeleteBrand(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/DeleteBrand", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).DeleteBrand(ctx, req.(*BrandRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_UpdateBrand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BrandRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).UpdateBrand(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/UpdateBrand", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).UpdateBrand(ctx, req.(*BrandRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateGoodsType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GoodsTypeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateGoodsType(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateGoodsType", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateGoodsType(ctx, req.(*GoodsTypeRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateGoodsSpecification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SpecificationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateGoodsSpecification(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateGoodsSpecification", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateGoodsSpecification(ctx, req.(*SpecificationRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateAttrGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AttrGroupRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateAttrGroup(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateAttrGroup", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateAttrGroup(ctx, req.(*AttrGroupRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateAttrValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AttrRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateAttrValue(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateAttrValue", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateAttrValue(ctx, req.(*AttrRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateGoods_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateGoodsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateGoods(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateGoods", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateGoods(ctx, req.(*CreateGoodsRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_UpdateGoods_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateGoodsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).UpdateGoods(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/UpdateGoods", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).UpdateGoods(ctx, req.(*CreateGoodsRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_GoodsList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GoodsFilterRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).GoodsList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/GoodsList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).GoodsList(ctx, req.(*GoodsFilterRequest)) } return interceptor(ctx, in, info, handler) } // Goods_ServiceDesc is the grpc.ServiceDesc for Goods service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Goods_ServiceDesc = grpc.ServiceDesc{ ServiceName: "goods.v1.Goods", HandlerType: (*GoodsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetAllCategoryList", Handler: _Goods_GetAllCategoryList_Handler, }, { MethodName: "GetSubCategory", Handler: _Goods_GetSubCategory_Handler, }, { MethodName: "CreateCategory", Handler: _Goods_CreateCategory_Handler, }, { MethodName: "DeleteCategory", Handler: _Goods_DeleteCategory_Handler, }, { MethodName: "UpdateCategory", Handler: _Goods_UpdateCategory_Handler, }, { MethodName: "BrandList", Handler: _Goods_BrandList_Handler, }, { MethodName: "CreateBrand", Handler: _Goods_CreateBrand_Handler, }, { MethodName: "DeleteBrand", Handler: _Goods_DeleteBrand_Handler, }, { MethodName: "UpdateBrand", Handler: _Goods_UpdateBrand_Handler, }, { MethodName: "CreateGoodsType", Handler: _Goods_CreateGoodsType_Handler, }, { MethodName: "CreateGoodsSpecification", Handler: _Goods_CreateGoodsSpecification_Handler, }, { MethodName: "CreateAttrGroup", Handler: _Goods_CreateAttrGroup_Handler, }, { MethodName: "CreateAttrValue", Handler: _Goods_CreateAttrValue_Handler, }, { MethodName: "CreateGoods", Handler: _Goods_CreateGoods_Handler, }, { MethodName: "UpdateGoods", Handler: _Goods_UpdateGoods_Handler, }, { MethodName: "GoodsList", Handler: _Goods_GoodsList_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/goods/v1/goods.proto", } ================================================ FILE: service/goods/cmd/goods/main.go ================================================ package main import ( "flag" "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/registry" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" "os" "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/transport/grpc" "go.opentelemetry.io/otel/exporters/jaeger" tracesdk "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" "goods/internal/conf" ) // go build -ldflags "-X main.Version=x.y.z" var ( // Name is the name of the compiled software. Name = "shop.goods.service" // Version is the version of the compiled software. Version string // flagconf is the config flag. flagconf string id, _ = os.Hostname() ) func init() { flag.StringVar(&flagconf, "conf", "../../configs", "config path, eg: -conf config.yaml") } func newApp(logger log.Logger, gs *grpc.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.ID(id), kratos.Name(Name), kratos.Version(Version), kratos.Metadata(map[string]string{}), kratos.Logger(logger), kratos.Server( gs, ), kratos.Registrar(rr), ) } func setTracerProvider(url string) error { // Create the Jaeger exporter exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url))) if err != nil { return err } tp := tracesdk.NewTracerProvider( // Set the sampling rate based on the parent span to 100% tracesdk.WithSampler(tracesdk.ParentBased(tracesdk.TraceIDRatioBased(1.0))), // Always be sure to batch in production. tracesdk.WithBatcher(exp), // Record information about this application in an Resource. tracesdk.WithResource(resource.NewSchemaless( semconv.ServiceNameKey.String(Name), attribute.String("env", "dev"), )), ) otel.SetTracerProvider(tp) return nil } func main() { flag.Parse() logger := log.With(log.NewStdLogger(os.Stdout), "ts", log.DefaultTimestamp, "caller", log.DefaultCaller, "service.id", id, "service.name", Name, "service.version", Version, "trace_id", tracing.TraceID(), "span_id", tracing.SpanID(), ) c := config.New( config.WithSource( file.NewSource(flagconf), ), ) defer c.Close() if err := c.Load(); err != nil { panic(err) } var bc conf.Bootstrap if err := c.Scan(&bc); err != nil { panic(err) } if err := setTracerProvider(bc.Trace.Endpoint); err != nil { panic(err) } var rc conf.Registry if err := c.Scan(&rc); err != nil { panic(err) } app, cleanup, err := initApp(bc.Server, &rc, bc.Data, logger) if err != nil { panic(err) } defer cleanup() // start and wait for stop signal if err := app.Run(); err != nil { panic(err) } } ================================================ FILE: service/goods/cmd/goods/wire.go ================================================ //go:build wireinject // +build wireinject // The build tag makes sure the stub is not built in the final build. package main import ( "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" "github.com/google/wire" "goods/internal/biz" "goods/internal/conf" "goods/internal/data" "goods/internal/server" "goods/internal/service" ) // initApp init kratos application. func initApp(*conf.Server, *conf.Registry, *conf.Data, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } ================================================ FILE: service/goods/cmd/goods/wire_gen.go ================================================ // Code generated by Wire. DO NOT EDIT. //go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject package main import ( "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" "goods/internal/biz" "goods/internal/conf" "goods/internal/data" "goods/internal/server" "goods/internal/service" ) // Injectors from wire.go: // initApp init kratos application. func initApp(confServer *conf.Server, registry *conf.Registry, confData *conf.Data, logger log.Logger) (*kratos.App, func(), error) { db := data.NewDB(confData) client := data.NewRedis(confData) elasticClient := data.NewElasticsearch(confData) dataData, cleanup, err := data.NewData(confData, logger, db, client, elasticClient) if err != nil { return nil, nil, err } brandRepo := data.NewBrandRepo(dataData, logger) brandUsecase := biz.NewBrandUsecase(brandRepo, logger) categoryRepo := data.NewCategoryRepo(dataData, logger) categoryUsecase := biz.NewCategoryUsecase(categoryRepo, logger) goodsTypeRepo := data.NewGoodsTypeRepo(dataData, logger) transaction := data.NewTransaction(dataData) goodsTypeUsecase := biz.NewGoodsTypeUsecase(goodsTypeRepo, transaction, brandRepo, logger) specificationRepo := data.NewSpecificationRepo(dataData, logger) specificationUsecase := biz.NewSpecificationUsecase(specificationRepo, goodsTypeRepo, transaction, logger) goodsAttrRepo := data.NewGoodsAttrRepo(dataData, logger) goodsAttrUsecase := biz.NewGoodsAttrUsecase(goodsAttrRepo, transaction, goodsTypeRepo, logger) goodsRepo := data.NewGoodsRepo(dataData, logger) goodsSkuRepo := data.NewGoodsSkuRepoRepo(dataData, logger) inventoryRepo := data.NewInventoryRepo(dataData, logger) esGoodsRepo := data.NewEsGoodsRepo(dataData, logger) goodsUsecase := biz.NewGoodsUsecase(goodsRepo, goodsSkuRepo, transaction, goodsTypeRepo, categoryRepo, brandRepo, specificationRepo, goodsAttrRepo, inventoryRepo, esGoodsRepo, logger) esGoodsUsecase := biz.NewEsGoodsUsecase(goodsRepo, esGoodsRepo, categoryRepo, logger) goodsService := service.NewGoodsService(brandUsecase, categoryUsecase, goodsTypeUsecase, specificationUsecase, goodsAttrUsecase, goodsUsecase, esGoodsUsecase, logger) grpcServer := server.NewGRPCServer(confServer, goodsService, logger) registrar := server.NewRegistrar(registry) app := newApp(logger, grpcServer, registrar) return app, func() { cleanup() }, nil } ================================================ FILE: service/goods/configs/config.yaml ================================================ server: http: addr: 0.0.0.0:8000 timeout: 1s grpc: addr: 0.0.0.0:50052 timeout: 1s data: database: driver: mysql source: root:root@tcp(127.0.0.1:3306)/shop_goods?charset=utf8mb4&parseTime=True&loc=Local redis: addr: 127.0.0.1:6379 dial_timeout: 1s read_timeout: 0.2s write_timeout: 0.2s elastic: addr: http://127.0.0.1:9200 trace: endpoint: http://127.0.0.1:14268/api/traces ================================================ FILE: service/goods/configs/registry.yaml ================================================ consul: address: 127.0.0.1:8500 scheme: http ================================================ FILE: service/goods/generate.go ================================================ package generate //go:generate kratos proto client api ================================================ FILE: service/goods/go.mod ================================================ module goods go 1.16 require ( github.com/envoyproxy/protoc-gen-validate v0.1.0 github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220310144244-ac99a5c877c4 github.com/go-kratos/kratos/v2 v2.2.0 github.com/go-redis/redis/extra/redisotel v0.3.0 github.com/go-redis/redis/v8 v8.11.4 github.com/google/wire v0.5.0 github.com/hashicorp/consul/api v1.12.0 github.com/jinzhu/copier v0.3.5 github.com/kr/pretty v0.3.0 // indirect github.com/olivere/elastic/v7 v7.0.31 github.com/rogpeppe/go-internal v1.8.0 // indirect go.opentelemetry.io/otel v1.4.1 go.opentelemetry.io/otel/exporters/jaeger v1.4.1 go.opentelemetry.io/otel/sdk v1.4.1 golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect google.golang.org/grpc v1.44.0 google.golang.org/protobuf v1.27.1 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gorm.io/driver/mysql v1.3.2 gorm.io/gorm v1.23.1 ) ================================================ FILE: service/goods/go.sum ================================================ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go v1.42.23/go.mod h1:gyRszuZ/icHmHAVE4gc/r+cfCmhA1AD+vqfWbgI+eHs= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kratos/aegis v0.1.1/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220310144244-ac99a5c877c4 h1:p6EeKSls7sO32i1JjrZ5cL0ecOAx4EaFufBdhA8ANmY= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220310144244-ac99a5c877c4/go.mod h1:UB1G3wVn0oR/viZXokBAopwHMDn3AuO11t2oRqa8zzY= github.com/go-kratos/kratos/v2 v2.2.0 h1:swSCoOdXD5F/L4eUfhapxSXe1I846hZz1wMLLixz9SA= github.com/go-kratos/kratos/v2 v2.2.0/go.mod h1:yebXu5KMayLjXZzMTY5HWIPRDwcBehHpiNF/Ot8A2pA= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= github.com/go-redis/redis/extra/rediscmd v0.2.0 h1:A3bhCsCKsedClEH9/jYlcKqOuBoeeV+H0yDie5t+a6w= github.com/go-redis/redis/extra/rediscmd v0.2.0/go.mod h1:Z5bP1EHl9PvWhx/DupfCdZwB0JgOO3aVxWc/PFux+BE= github.com/go-redis/redis/extra/redisotel v0.3.0 h1:8rrizwFAUUeMgmelyiQi9KeFwmpQhay9E+/rE6qHsBM= github.com/go-redis/redis/extra/redisotel v0.3.0/go.mod h1:sGV3dQnPMBUuqzowEP2nZPhLXCMeh83nY64yaju249c= github.com/go-redis/redis/v8 v8.3.2/go.mod h1:jszGxBCez8QA1HWSmQxJO9Y82kNibbUmeYhKWrBejTU= github.com/go-redis/redis/v8 v8.5.0/go.mod h1:YmEcgBDttjnkbMzDAhDtQxY9yVA7jMN6PCR5HeMvqFE= github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.9.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= 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/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 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-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0 h1:8+567mCcFDnS5ADl7lrpxPMWiFCElyUEeW0gtj34fMA= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6 h1:uuEX1kLR6aoda1TBttmJQKDLZE1Ob7KN0NPdE7EtCDc= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= 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/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/olivere/elastic/v7 v7.0.31 h1:VJu9/zIsbeiulwlRCfGQf6Tzsr++uo+FeUgj5oj+xKk= github.com/olivere/elastic/v7 v7.0.31/go.mod h1:idEQxe7Es+Wr4XAuNnJdKeMZufkA9vQprOIFck061vg= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= github.com/smartystreets/assertions v1.1.1/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= github.com/smartystreets/gunit v1.4.2/go.mod h1:ZjM1ozSIMJlAz/ay4SG8PeKF00ckUp+zMHZXV9/bvak= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.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 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA= go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel v1.4.1 h1:QbINgGDDcoQUoMJa2mMaWno49lja9sHwp6aoa2n3a4g= go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= go.opentelemetry.io/otel/exporters/jaeger v1.4.1 h1:VHCK+2yTZDqDaVXj7JH2Z/khptuydo6C0ttBh2bxAbc= go.opentelemetry.io/otel/exporters/jaeger v1.4.1/go.mod h1:ZW7vkOu9nC1CxsD8bHNHCia5JUbwP39vxgd1q4Z5rCI= go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/sdk v1.4.1 h1:J7EaW71E0v87qflB4cDolaqq3AcujGrtyIPGQoZOB0Y= go.opentelemetry.io/otel/sdk v1.4.1/go.mod h1:NBwHDgDIBYjwK2WNu1OPgsIc2IJzmBXNnvIJxJc8BpE= go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/otel/trace v1.4.1 h1:O+16qcdTrT7zxv2J6GejTPFinSwA++cYerC5iSiF8EQ= go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 h1:YxHp5zqIcAShDEvRr5/0rVESVS+njYF68PSdazrNLJo= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.3.2 h1:QJryWiqQ91EvZ0jZL48NOpdlPdMjdip1hQ8bTgo4H7I= gorm.io/driver/mysql v1.3.2/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U= gorm.io/gorm v1.23.1 h1:aj5IlhDzEPsoIyOPtTRVI+SyaN1u6k613sbt4pwbxG0= gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= ================================================ FILE: service/goods/internal/biz/README.md ================================================ # Biz ================================================ FILE: service/goods/internal/biz/biz.go ================================================ package biz import ( "context" "github.com/google/wire" ) // ProviderSet is biz providers. var ProviderSet = wire.NewSet( NewBrandUsecase, NewCategoryUsecase, NewGoodsTypeUsecase, NewSpecificationUsecase, NewGoodsAttrUsecase, NewGoodsUsecase, NewGoodsSkuUsecase, NewInventoryUsecase, NewEsGoodsUsecase, ) // Transaction 新增事务接口方法 type Transaction interface { ExecTx(context.Context, func(ctx context.Context) error) error } ================================================ FILE: service/goods/internal/biz/brand.go ================================================ package biz import ( "context" "errors" "github.com/go-kratos/kratos/v2/log" "goods/internal/domain" ) type Pagination struct { PageNum int PageSize int } type BrandRepo interface { Create(context.Context, *domain.Brand) (*domain.Brand, error) GetBradByName(context.Context, string) (*domain.Brand, error) Update(context.Context, *domain.Brand) error List(context.Context, *Pagination) ([]*domain.Brand, int64, error) IsBrandByID(context.Context, int32) (*domain.Brand, error) IsBrand(context.Context, []int32) error ListByIds(context.Context, ...int32) (domain.BrandList, error) } type BrandUsecase struct { repo BrandRepo log *log.Helper } func NewBrandUsecase(repo BrandRepo, logger log.Logger) *BrandUsecase { return &BrandUsecase{repo: repo, log: log.NewHelper(logger)} } func (uc *BrandUsecase) CreateBrand(ctx context.Context, b *domain.Brand) (*domain.Brand, error) { _, err := uc.repo.GetBradByName(ctx, b.Name) if err != nil { return uc.repo.Create(ctx, b) } else { return nil, errors.New("当前品牌已经存在") } } func (uc *BrandUsecase) UpdateBrand(ctx context.Context, b *domain.Brand) error { err := uc.repo.Update(ctx, b) if err != nil { return err } return nil } func (uc *BrandUsecase) BrandList(ctx context.Context, b *Pagination) ([]*domain.Brand, int64, error) { list, total, err := uc.repo.List(ctx, b) if err != nil { return nil, 0, err } return list, total, nil } ================================================ FILE: service/goods/internal/biz/category.go ================================================ package biz import ( "context" "github.com/go-kratos/kratos/v2/log" ) type Category struct { ID int32 Name string ParentCategoryID int32 SubCategory []*Category Level int32 IsTab bool Sort int32 } type CategoryList struct { Category *CategoryInfo SubCategory []*CategoryInfo } type CategoryInfo struct { ID int32 Name string ParentCategory int32 Level int32 IsTab bool Sort int32 } type CategoryRepo interface { AddCategory(context.Context, *CategoryInfo) (*CategoryInfo, error) UpdateCategory(context.Context, *CategoryInfo) error Category(context.Context) ([]*Category, error) GetCategoryByID(ctx context.Context, id int32) (*CategoryInfo, error) SubCategory(context.Context, CategoryInfo) ([]*CategoryInfo, error) DeleteCategory(context.Context, int32) error GetCategoryAll(context.Context, int32, int32) ([]interface{}, error) } type CategoryUsecase struct { repo CategoryRepo log *log.Helper } func NewCategoryUsecase(repo CategoryRepo, logger log.Logger) *CategoryUsecase { return &CategoryUsecase{repo: repo, log: log.NewHelper(logger)} } func (c *CategoryUsecase) DeleteCategory(ctx context.Context, r *CategoryInfo) error { // todo 需要验证是否是定级分类,定级分类下面还有没有二级分类 err := c.repo.DeleteCategory(ctx, r.ID) if err != nil { return err } return nil } func (c *CategoryUsecase) UpdateCategory(ctx context.Context, r *CategoryInfo) error { err := c.repo.UpdateCategory(ctx, r) return err } func (c *CategoryUsecase) CreateCategory(ctx context.Context, r *CategoryInfo) (*CategoryInfo, error) { cateInfo, err := c.repo.AddCategory(ctx, r) if err != nil { return nil, err } return cateInfo, nil } func (c *CategoryUsecase) CategoryList(ctx context.Context) ([]*Category, error) { return c.repo.Category(ctx) } func (c *CategoryUsecase) SubCategoryList(ctx context.Context, cid int32) (*CategoryList, error) { cateInfo, err := c.repo.GetCategoryByID(ctx, cid) if err != nil { return nil, err } category, err := c.repo.SubCategory(ctx, *cateInfo) if err != nil { return nil, err } return &CategoryList{ Category: cateInfo, SubCategory: category, }, nil } ================================================ FILE: service/goods/internal/biz/es_goods.go ================================================ package biz import ( "context" "goods/internal/domain" "github.com/go-kratos/kratos/v2/log" "github.com/olivere/elastic/v7" ) type EsGoodsRepo interface { GoodsList(ctx context.Context, es *domain.EsSearch) ([]int64, int64, error) InsertEsGoods(context.Context, domain.ESGoods) error } type EsGoodsUsecase struct { repo GoodsRepo esRepo EsGoodsRepo categoryRepo CategoryRepo log *log.Helper } func NewEsGoodsUsecase(repo GoodsRepo, es EsGoodsRepo, cRepo CategoryRepo, logger log.Logger) *EsGoodsUsecase { return &EsGoodsUsecase{ repo: repo, esRepo: es, categoryRepo: cRepo, log: log.NewHelper(logger), } } func (g EsGoodsUsecase) GoodsList(ctx context.Context, req *domain.ESGoodsFilter) (*domain.GoodsListResponse, error) { // 组织 es 查询条件 var es domain.EsSearch if req.Keywords != "" { es.ShouldQuery = append(es.ShouldQuery, elastic.NewMultiMatchQuery(req.Keywords, "name", "goods_brief", "sku.sku_name")) } if req.IsHot { es.ShouldQuery = append(es.ShouldQuery, elastic.NewTermQuery("is_hot", req.IsHot)) // 精确字段查询 } if req.ClickNum > 0 { es.ShouldQuery = append(es.ShouldQuery, elastic.NewFieldSort("click_num").Desc()) // 根据某个字段排序 } if req.MinPrice > 0 { es.ShouldQuery = append(es.ShouldQuery, elastic.NewRangeQuery("shop_price").Gte(req.MinPrice)) // 区间筛选 gte 大于= } if req.MaxPrice > 0 { es.ShouldQuery = append(es.ShouldQuery, elastic.NewRangeQuery("shop_price").Lte(req.MaxPrice)) // lte 小于= } if req.BrandsID > 0 { es.ShouldQuery = append(es.ShouldQuery, elastic.NewTermQuery("brands_id", req.BrandsID)) } // 通过 category 去查询商品 if req.CategoryID > 0 { // 查询分类是否存在 cate, err := g.categoryRepo.GetCategoryByID(ctx, req.CategoryID) if err != nil { return nil, err } categoryIds, err := g.categoryRepo.GetCategoryAll(ctx, cate.Level, req.CategoryID) if err != nil { return nil, err } es.ShouldQuery = append(es.ShouldQuery, elastic.NewTermsQuery("category_id", categoryIds...)) } // 分页处理 switch { case req.PagePerNums > 100: req.PagePerNums = 100 case req.PagePerNums <= 0: req.PagePerNums = 10 } if req.Pages == 0 { req.Pages = 1 } es.Form = (req.Pages - 1) * req.PagePerNums es.Size = req.PagePerNums res := &domain.GoodsListResponse{} goodsIds, total, err := g.esRepo.GoodsList(ctx, &es) if err != nil { return nil, err } res.Total = total if err != nil { return nil, err } goodsList, err := g.repo.GoodsListByIDs(ctx, goodsIds...) if err != nil { return nil, err } res.List = goodsList // TODO 根据返回的商品信息,查询所有分类、查询所有品牌、查询所有sku 的信息进行组合 return res, nil } ================================================ FILE: service/goods/internal/biz/goods.go ================================================ package biz import ( "context" "encoding/json" "fmt" "goods/internal/domain" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" ) type GoodsRepo interface { CreateGoods(ctx context.Context, goods *domain.Goods) (*domain.Goods, error) GoodsListByIDs(context.Context, ...int64) ([]*domain.Goods, error) } type GoodsUsecase struct { repo GoodsRepo tr Transaction skuRepo GoodsSkuRepo categoryRepo CategoryRepo brandRepo BrandRepo typeRepo GoodsTypeRepo specificationRepo SpecificationRepo goodsAttrRepo GoodsAttrRepo inventoryRepo InventoryRepo esGoodsRepo EsGoodsRepo log *log.Helper } func NewGoodsUsecase(repo GoodsRepo, skuRepo GoodsSkuRepo, tx Transaction, gRepo GoodsTypeRepo, cRepo CategoryRepo, bRepo BrandRepo, sRepo SpecificationRepo, aRepo GoodsAttrRepo, iRepo InventoryRepo, es EsGoodsRepo, logger log.Logger) *GoodsUsecase { return &GoodsUsecase{ repo: repo, skuRepo: skuRepo, tr: tx, typeRepo: gRepo, categoryRepo: cRepo, brandRepo: bRepo, specificationRepo: sRepo, goodsAttrRepo: aRepo, inventoryRepo: iRepo, esGoodsRepo: es, log: log.NewHelper(logger), } } func (g GoodsUsecase) CreateGoods(ctx context.Context, r *domain.Goods) (*domain.GoodsInfoResponse, error) { var ( err error goods *domain.Goods EsGoods domain.ESGoods ) // 判断品牌是否存在 brand, err := g.brandRepo.IsBrandByID(ctx, r.BrandsID) if err != nil { return nil, err } // 判断分类是否存在 cate, err := g.categoryRepo.GetCategoryByID(ctx, r.CategoryID) if err != nil { return nil, err } // 判断商品类型是否存在 goodsType, err := g.typeRepo.IsExistsByID(ctx, r.TypeID) if err != nil { return nil, err } // 判断商品规格和属性是否存在 for _, sku := range r.Sku { var sIDs []*int64 for _, info := range sku.Specification { sIDs = append(sIDs, &info.SpecificationID) } specList, err := g.specificationRepo.ListByIds(ctx, sIDs...) if err != nil { return nil, err } for _, sId := range sIDs { info := specList.FindById(*sId) if info == nil { return nil, errors.NotFound("SPECIFICATION_NOT_FOUND", "商品规格不存在") } } var attrIDs []int64 for _, attr := range sku.GroupAttr { for _, id := range attr.Attr { attrIDs = append(attrIDs, id.AttrID) } } attrList, err := g.goodsAttrRepo.ListByIds(ctx, attrIDs...) if err != nil { return nil, err } for _, attr := range sku.GroupAttr { for _, id := range attr.Attr { attrIDs = append(attrIDs, id.AttrID) true := attrList.IsNotExist(attr.GroupId, id.AttrID) if true { return nil, errors.NotFound("ATTR_NOT_FOUND", "商品属性不存在") } } } } err = g.tr.ExecTx(ctx, func(ctx context.Context) error { // 更新商品表 goods, err = g.repo.CreateGoods(ctx, &domain.Goods{ CategoryID: r.CategoryID, BrandsID: r.BrandsID, TypeID: r.TypeID, Name: r.Name, NameAlias: r.NameAlias, GoodsSn: r.GoodsSn, GoodsTags: r.GoodsTags, MarketPrice: r.MarketPrice, GoodsBrief: r.GoodsBrief, GoodsFrontImage: r.GoodsFrontImage, GoodsImages: r.GoodsImages, OnSale: r.OnSale, IsNew: r.IsNew, IsHot: r.IsHot, ShipFree: r.ShipFree, ShipID: r.ShipID, }) if err != nil { return err } // 更新商品 SKU 表 for _, v := range r.Sku { res := &domain.GoodsSku{ GoodsID: goods.ID, GoodsSn: goods.GoodsSn, GoodsName: goods.Name, SkuName: v.SkuName, SkuCode: v.SkuCode, BarCode: v.BarCode, Price: v.Price, PromotionPrice: v.PromotionPrice, Points: v.Points, RemarksInfo: v.RemarksInfo, Pic: v.Pic, Inventory: v.Inventory, OnSale: v.OnSale, } goodsAttr, err := json.Marshal(v.GroupAttr) if err != nil { return err } res.AttrInfo = string(goodsAttr) // 插入 sku 表 skuInfo, err := g.skuRepo.Create(ctx, res) if err != nil { return err } // 插入库存表 _, err = g.inventoryRepo.Create(ctx, &domain.Inventory{ SkuID: skuInfo.ID, Inventory: skuInfo.Inventory, }) if err != nil { return err } // 插入 sku 规格关联关系表 var skuRelation []*domain.GoodsSpecificationSku for _, spec := range v.Specification { skuRelation = append(skuRelation, &domain.GoodsSpecificationSku{ SkuID: skuInfo.ID, SkuCode: skuInfo.SkuCode, SpecificationId: spec.SpecificationID, ValueId: spec.SpecificationValueID, }) } // 插入商品规格关联关系表 err = g.skuRepo.CreateSkuRelation(ctx, skuRelation) if err != nil { return err } // esModel { EsGoods.Sku = append(EsGoods.Sku, domain.EsSku{ SkuID: skuInfo.ID, SkuName: skuInfo.SkuName, SkuPrice: skuInfo.Price, }) EsGoods.BrandsID = brand.ID EsGoods.BrandName = brand.Name EsGoods.CategoryID = cate.ID EsGoods.CategoryName = cate.Name EsGoods.TypeID = goodsType.ID EsGoods.TypeName = goodsType.Name EsGoods.Name = goodsType.Name EsGoods.ID = goods.ID EsGoods.OnSale = goods.OnSale EsGoods.ShipFree = goods.ShipFree EsGoods.IsNew = goods.IsNew EsGoods.IsHot = goods.IsHot EsGoods.Name = goods.Name EsGoods.GoodsTags = goods.GoodsTags EsGoods.ClickNum = goods.ClickNum EsGoods.SoldNum = goods.SoldNum EsGoods.FavNum = goods.FavNum EsGoods.MarketPrice = goods.MarketPrice EsGoods.GoodsBrief = goods.GoodsBrief } fmt.Println("EsGoods", EsGoods) // 插入 EsGoods err = g.esGoodsRepo.InsertEsGoods(ctx, EsGoods) if err != nil { return err } } return nil }) if err != nil { return nil, err } return &domain.GoodsInfoResponse{GoodsID: goods.ID}, nil } ================================================ FILE: service/goods/internal/biz/goods_attr.go ================================================ package biz import ( "context" "goods/internal/domain" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" ) type GoodsAttrRepo interface { CreateGoodsGroupAttr(context.Context, *domain.AttrGroup) (*domain.AttrGroup, error) IsExistsGroupByID(ctx context.Context, id int64) (*domain.AttrGroup, error) CreateGoodsAttr(context.Context, *domain.GoodsAttr) (*domain.GoodsAttr, error) CreateGoodsAttrValue(context.Context, []*domain.GoodsAttrValue) ([]*domain.GoodsAttrValue, error) GetAttrByIDs(ctx context.Context, id []*int64) error ListByIds(ctx context.Context, id ...int64) (domain.GoodsAttrList, error) } type GoodsAttrUsecase struct { repo GoodsAttrRepo typeRepo GoodsTypeRepo // 引入goods type 的 repo tx Transaction // 引入事务 log *log.Helper } func NewGoodsAttrUsecase(repo GoodsAttrRepo, tx Transaction, gRepo GoodsTypeRepo, logger log.Logger) *GoodsAttrUsecase { return &GoodsAttrUsecase{ repo: repo, tx: tx, typeRepo: gRepo, log: log.NewHelper(logger), } } func (ga *GoodsAttrUsecase) CreateAttrGroup(ctx context.Context, r *domain.AttrGroup) (*domain.AttrGroup, error) { if r.IsTypeIDEmpty() { return nil, errors.InternalServer("TYPE_IS_EMPTY", "请选择商品类型进行绑定") } _, err := ga.typeRepo.IsExistsByID(ctx, r.TypeID) if err != nil { return nil, err } attr, err := ga.repo.CreateGoodsGroupAttr(ctx, r) if err != nil { return nil, err } return attr, nil } // CreateAttrValue 创建商品属性和属性信息 func (ga *GoodsAttrUsecase) CreateAttrValue(ctx context.Context, r *domain.GoodsAttr) (*domain.GoodsAttr, error) { var ( attrInfo *domain.GoodsAttr attrValue []*domain.GoodsAttrValue err error ) if r.IsTypeIDEmpty() { return nil, errors.InternalServer("TYPE_IS_EMPTY", "请选择商品类型进行绑定") } _, err = ga.typeRepo.IsExistsByID(ctx, r.TypeID) if err != nil { return nil, err } _, err = ga.repo.IsExistsGroupByID(ctx, r.GroupID) if err != nil { return nil, err } err = ga.tx.ExecTx(ctx, func(ctx context.Context) error { attrInfo, err = ga.repo.CreateGoodsAttr(ctx, r) if err != nil { return err } var value []*domain.GoodsAttrValue for _, v := range r.GoodsAttrValue { if v.IsValueEmpty() { return errors.InternalServer("ATTR_IS_EMPTY", "商品属性不能为空") } res := &domain.GoodsAttrValue{ AttrId: attrInfo.ID, GroupID: v.GroupID, Value: v.Value, } value = append(value, res) } attrValue, err = ga.repo.CreateGoodsAttrValue(ctx, value) if err != nil { return err } return nil }) if err != nil { return nil, err } return &domain.GoodsAttr{ ID: attrInfo.ID, TypeID: attrInfo.TypeID, GroupID: attrInfo.GroupID, Title: attrInfo.Title, Sort: attrInfo.Sort, Status: attrInfo.Status, Desc: attrInfo.Desc, GoodsAttrValue: attrValue, }, nil } ================================================ FILE: service/goods/internal/biz/goods_image.go ================================================ package biz import ( "context" "github.com/go-kratos/kratos/v2/log" "goods/internal/domain" ) type GoodsImages struct { Hello string } type GoodsImagesRepo interface { CreateGreeter(context.Context, *domain.Goods) error UpdateGreeter(context.Context, *domain.Goods) error } type GoodsImageUsecase struct { repo GoodsImagesRepo log *log.Helper } func NewGoodsImagesUsecase(repo GoodsImagesRepo, logger log.Logger) *GoodsImageUsecase { return &GoodsImageUsecase{repo: repo, log: log.NewHelper(logger)} } ================================================ FILE: service/goods/internal/biz/goods_sku.go ================================================ package biz import ( "context" "github.com/go-kratos/kratos/v2/log" "goods/internal/domain" ) type Sku struct { ID int64 GoodsID int64 GoodsSn string GoodsName string SkuName string SkuCode string BarCode string Price int64 PromotionPrice int64 Points int64 RemarksInfo string Pic string Inventory int64 OnSale bool AttrInfo string } type GoodsSkuRepo interface { Create(context.Context, *domain.GoodsSku) (*domain.GoodsSku, error) CreateSkuRelation(context.Context, []*domain.GoodsSpecificationSku) error } type GoodsSkuUsecase struct { repo GoodsSkuRepo log *log.Helper } func NewGoodsSkuUsecase(repo GoodsSkuRepo, logger log.Logger) *GoodsSkuUsecase { return &GoodsSkuUsecase{repo: repo, log: log.NewHelper(logger)} } ================================================ FILE: service/goods/internal/biz/goods_type.go ================================================ package biz import ( "context" "goods/internal/domain" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" ) type GoodsTypeRepo interface { CreateGoodsType(context.Context, *domain.GoodsType) (int64, error) CreateGoodsBrandType(context.Context, int64, string) error GetGoodsTypeByID(context.Context, int64) (*domain.GoodsType, error) IsExistsByID(context.Context, int64) (*domain.GoodsType, error) } type GoodsTypeUsecase struct { repo GoodsTypeRepo bRepo BrandRepo tx Transaction log *log.Helper } func NewGoodsTypeUsecase(repo GoodsTypeRepo, tx Transaction, BrandUc BrandRepo, logger log.Logger) *GoodsTypeUsecase { return &GoodsTypeUsecase{ repo: repo, tx: tx, bRepo: BrandUc, log: log.NewHelper(logger), } } // GoosTypeCreate 创建商品类型 func (gt *GoodsTypeUsecase) GoosTypeCreate(ctx context.Context, r *domain.GoodsType) (int64, error) { var ( id int64 err error ) if r.IsEmpty() { return id, errors.InternalServer("TYPE_IS_EMPTY", "请选择品牌进行绑定") } i, err := r.FormatBrandIds() if err != nil { return 0, err } brand, err := gt.bRepo.ListByIds(ctx, i...) if err != nil { return 0, err } if !brand.CheckLength(len(i)) { return 0, errors.InternalServer("BRAND_IS_EMPTY", "品牌不存在") } // 使用事务 err = gt.tx.ExecTx(ctx, func(ctx context.Context) error { id, err = gt.repo.CreateGoodsType(ctx, r) if err != nil { return err } // 创建商品类型关联关系表 err = gt.repo.CreateGoodsBrandType(ctx, id, r.BrandIds) if err != nil { return err } return nil }) return id, err } ================================================ FILE: service/goods/internal/biz/inventory.go ================================================ package biz import ( "context" "github.com/go-kratos/kratos/v2/log" "goods/internal/domain" ) type InventoryRepo interface { Create(context.Context, *domain.Inventory) (*domain.Inventory, error) } type InventoryUsecase struct { repo InventoryRepo log *log.Helper } func NewInventoryUsecase(repo InventoryRepo, logger log.Logger) *InventoryUsecase { return &InventoryUsecase{repo: repo, log: log.NewHelper(logger)} } ================================================ FILE: service/goods/internal/biz/specifications.go ================================================ package biz import ( "context" "errors" "goods/internal/domain" "github.com/go-kratos/kratos/v2/log" ) type SpecificationRepo interface { CreateSpecification(context.Context, *domain.Specification) (int64, error) CreateSpecificationValue(context.Context, int64, []*domain.SpecificationValue) error ListByIds(ctx context.Context, id ...*int64) (domain.SpecificationList, error) } type SpecificationUsecase struct { repo SpecificationRepo gRepo GoodsTypeRepo tx Transaction log *log.Helper } func NewSpecificationUsecase(repo SpecificationRepo, TypeUc GoodsTypeRepo, tx Transaction, logger log.Logger) *SpecificationUsecase { return &SpecificationUsecase{ repo: repo, gRepo: TypeUc, tx: tx, log: log.NewHelper(logger), } } // CreateSpecification 创建商品规格 func (s *SpecificationUsecase) CreateSpecification(ctx context.Context, r *domain.Specification) (int64, error) { var ( id int64 err error ) if r.IsTypeIDEmpty() { return id, errors.New("请选择商品类型进行绑定") } if r.IsValueEmpty() { return id, errors.New("请填写商品规格下的参数") } // 去查询有没有这个类型 _, err = s.gRepo.IsExistsByID(ctx, r.TypeID) if err != nil { return id, err } // 使用事务 err = s.tx.ExecTx(ctx, func(ctx context.Context) error { id, err = s.repo.CreateSpecification(ctx, r) // 插入选项 if err != nil { return err } err = s.repo.CreateSpecificationValue(ctx, id, r.SpecificationValue) // 插入选项对应的值 if err != nil { return err } return nil }) return id, err } ================================================ FILE: service/goods/internal/conf/conf.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: internal/conf/conf.proto package conf import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Bootstrap struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Trace *Trace `protobuf:"bytes,3,opt,name=trace,proto3" json:"trace,omitempty"` } func (x *Bootstrap) Reset() { *x = Bootstrap{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Bootstrap) String() string { return protoimpl.X.MessageStringOf(x) } func (*Bootstrap) ProtoMessage() {} func (x *Bootstrap) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Bootstrap.ProtoReflect.Descriptor instead. func (*Bootstrap) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{0} } func (x *Bootstrap) GetServer() *Server { if x != nil { return x.Server } return nil } func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data } return nil } func (x *Bootstrap) GetTrace() *Trace { if x != nil { return x.Trace } return nil } type Server struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Http *Server_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` Grpc *Server_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` } func (x *Server) Reset() { *x = Server{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server) ProtoMessage() {} func (x *Server) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Server.ProtoReflect.Descriptor instead. func (*Server) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1} } func (x *Server) GetHttp() *Server_HTTP { if x != nil { return x.Http } return nil } func (x *Server) GetGrpc() *Server_GRPC { if x != nil { return x.Grpc } return nil } type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` Elastic *Data_Elastic `protobuf:"bytes,3,opt,name=elastic,proto3" json:"elastic,omitempty"` } func (x *Data) Reset() { *x = Data{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data) ProtoMessage() {} func (x *Data) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Data.ProtoReflect.Descriptor instead. func (*Data) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2} } func (x *Data) GetDatabase() *Data_Database { if x != nil { return x.Database } return nil } func (x *Data) GetRedis() *Data_Redis { if x != nil { return x.Redis } return nil } func (x *Data) GetElastic() *Data_Elastic { if x != nil { return x.Elastic } return nil } type Registry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` } func (x *Registry) Reset() { *x = Registry{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry) ProtoMessage() {} func (x *Registry) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Registry.ProtoReflect.Descriptor instead. func (*Registry) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{3} } func (x *Registry) GetConsul() *Registry_Consul { if x != nil { return x.Consul } return nil } type Trace struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Trace) Reset() { *x = Trace{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Trace) String() string { return protoimpl.X.MessageStringOf(x) } func (*Trace) ProtoMessage() {} func (x *Trace) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Trace.ProtoReflect.Descriptor instead. func (*Trace) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{4} } func (x *Trace) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Server_HTTP struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_HTTP) Reset() { *x = Server_HTTP{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_HTTP) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_HTTP) ProtoMessage() {} func (x *Server_HTTP) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Server_HTTP.ProtoReflect.Descriptor instead. func (*Server_HTTP) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1, 0} } func (x *Server_HTTP) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_HTTP) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_HTTP) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Server_GRPC struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_GRPC) Reset() { *x = Server_GRPC{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_GRPC) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_GRPC) ProtoMessage() {} func (x *Server_GRPC) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[6] 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 Server_GRPC.ProtoReflect.Descriptor instead. func (*Server_GRPC) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1, 1} } func (x *Server_GRPC) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_GRPC) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_GRPC) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Data_Database struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` } func (x *Data_Database) Reset() { *x = Data_Database{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Database) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Database) ProtoMessage() {} func (x *Data_Database) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[7] 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 Data_Database.ProtoReflect.Descriptor instead. func (*Data_Database) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} } func (x *Data_Database) GetDriver() string { if x != nil { return x.Driver } return "" } func (x *Data_Database) GetSource() string { if x != nil { return x.Source } return "" } type Data_Redis struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` Db int32 `protobuf:"varint,4,opt,name=db,proto3" json:"db,omitempty"` DialTimeout *durationpb.Duration `protobuf:"bytes,5,opt,name=dial_timeout,json=dialTimeout,proto3" json:"dial_timeout,omitempty"` ReadTimeout *durationpb.Duration `protobuf:"bytes,6,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"` WriteTimeout *durationpb.Duration `protobuf:"bytes,7,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"` } func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Redis) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[8] 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 Data_Redis.ProtoReflect.Descriptor instead. func (*Data_Redis) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2, 1} } func (x *Data_Redis) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Data_Redis) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Data_Redis) GetPassword() string { if x != nil { return x.Password } return "" } func (x *Data_Redis) GetDb() int32 { if x != nil { return x.Db } return 0 } func (x *Data_Redis) GetDialTimeout() *durationpb.Duration { if x != nil { return x.DialTimeout } return nil } func (x *Data_Redis) GetReadTimeout() *durationpb.Duration { if x != nil { return x.ReadTimeout } return nil } func (x *Data_Redis) GetWriteTimeout() *durationpb.Duration { if x != nil { return x.WriteTimeout } return nil } type Data_Elastic struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` } func (x *Data_Elastic) Reset() { *x = Data_Elastic{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Elastic) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Elastic) ProtoMessage() {} func (x *Data_Elastic) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[9] 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 Data_Elastic.ProtoReflect.Descriptor instead. func (*Data_Elastic) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2, 2} } func (x *Data_Elastic) GetAddr() string { if x != nil { return x.Addr } return "" } type Registry_Consul struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` } func (x *Registry_Consul) Reset() { *x = Registry_Consul{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry_Consul) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry_Consul) ProtoMessage() {} func (x *Registry_Consul) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[10] 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 Registry_Consul.ProtoReflect.Descriptor instead. func (*Registry_Consul) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} } func (x *Registry_Consul) GetAddress() string { if x != nil { return x.Address } return "" } func (x *Registry_Consul) GetScheme() string { if x != nil { return x.Scheme } return "" } var File_internal_conf_conf_proto protoreflect.FileDescriptor var file_internal_conf_conf_proto_rawDesc = []byte{ 0x0a, 0x18, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x22, 0xb6, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x2a, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x69, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x97, 0x04, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x34, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, 0x31, 0x0a, 0x07, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x52, 0x07, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x1a, 0x3a, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x9d, 0x02, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x1d, 0x0a, 0x07, 0x45, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x22, 0x7a, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x32, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x23, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x42, 0x1a, 0x5a, 0x18, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_internal_conf_conf_proto_rawDescOnce sync.Once file_internal_conf_conf_proto_rawDescData = file_internal_conf_conf_proto_rawDesc ) func file_internal_conf_conf_proto_rawDescGZIP() []byte { file_internal_conf_conf_proto_rawDescOnce.Do(func() { file_internal_conf_conf_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_conf_conf_proto_rawDescData) }) return file_internal_conf_conf_proto_rawDescData } var file_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_internal_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: goods.api.Bootstrap (*Server)(nil), // 1: goods.api.Server (*Data)(nil), // 2: goods.api.Data (*Registry)(nil), // 3: goods.api.Registry (*Trace)(nil), // 4: goods.api.Trace (*Server_HTTP)(nil), // 5: goods.api.Server.HTTP (*Server_GRPC)(nil), // 6: goods.api.Server.GRPC (*Data_Database)(nil), // 7: goods.api.Data.Database (*Data_Redis)(nil), // 8: goods.api.Data.Redis (*Data_Elastic)(nil), // 9: goods.api.Data.Elastic (*Registry_Consul)(nil), // 10: goods.api.Registry.Consul (*durationpb.Duration)(nil), // 11: google.protobuf.Duration } var file_internal_conf_conf_proto_depIdxs = []int32{ 1, // 0: goods.api.Bootstrap.server:type_name -> goods.api.Server 2, // 1: goods.api.Bootstrap.data:type_name -> goods.api.Data 4, // 2: goods.api.Bootstrap.trace:type_name -> goods.api.Trace 5, // 3: goods.api.Server.http:type_name -> goods.api.Server.HTTP 6, // 4: goods.api.Server.grpc:type_name -> goods.api.Server.GRPC 7, // 5: goods.api.Data.database:type_name -> goods.api.Data.Database 8, // 6: goods.api.Data.redis:type_name -> goods.api.Data.Redis 9, // 7: goods.api.Data.elastic:type_name -> goods.api.Data.Elastic 10, // 8: goods.api.Registry.consul:type_name -> goods.api.Registry.Consul 11, // 9: goods.api.Server.HTTP.timeout:type_name -> google.protobuf.Duration 11, // 10: goods.api.Server.GRPC.timeout:type_name -> google.protobuf.Duration 11, // 11: goods.api.Data.Redis.dial_timeout:type_name -> google.protobuf.Duration 11, // 12: goods.api.Data.Redis.read_timeout:type_name -> google.protobuf.Duration 11, // 13: goods.api.Data.Redis.write_timeout:type_name -> google.protobuf.Duration 14, // [14:14] is the sub-list for method output_type 14, // [14:14] is the sub-list for method input_type 14, // [14:14] is the sub-list for extension type_name 14, // [14:14] is the sub-list for extension extendee 0, // [0:14] is the sub-list for field type_name } func init() { file_internal_conf_conf_proto_init() } func file_internal_conf_conf_proto_init() { if File_internal_conf_conf_proto != nil { return } if !protoimpl.UnsafeEnabled { file_internal_conf_conf_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Bootstrap); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Trace); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_HTTP); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_GRPC); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Database); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Elastic); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry_Consul); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_internal_conf_conf_proto_rawDesc, NumEnums: 0, NumMessages: 11, NumExtensions: 0, NumServices: 0, }, GoTypes: file_internal_conf_conf_proto_goTypes, DependencyIndexes: file_internal_conf_conf_proto_depIdxs, MessageInfos: file_internal_conf_conf_proto_msgTypes, }.Build() File_internal_conf_conf_proto = out.File file_internal_conf_conf_proto_rawDesc = nil file_internal_conf_conf_proto_goTypes = nil file_internal_conf_conf_proto_depIdxs = nil } ================================================ FILE: service/goods/internal/conf/conf.proto ================================================ syntax = "proto3"; package goods.api; option go_package = "goods/internal/conf;conf"; import "google/protobuf/duration.proto"; message Bootstrap { Server server = 1; Data data = 2; Trace trace = 3; } message Server { message HTTP { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } message GRPC { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } HTTP http = 1; GRPC grpc = 2; } message Data { message Database { string driver = 1; string source = 2; } message Redis { string network = 1; string addr = 2; string password = 3; int32 db = 4; google.protobuf.Duration dial_timeout = 5; google.protobuf.Duration read_timeout = 6; google.protobuf.Duration write_timeout = 7; } message Elastic { string addr = 1; } Database database = 1; Redis redis = 2; Elastic elastic = 3; } message Registry { message Consul { string address = 1; string scheme = 2; } Consul consul = 1; } message Trace { string endpoint = 1; } ================================================ FILE: service/goods/internal/data/README.md ================================================ # Data ================================================ FILE: service/goods/internal/data/base.go ================================================ package data import ( "database/sql/driver" "encoding/json" "gorm.io/gorm" "time" ) type GormList []string func (g GormList) Value() (driver.Value, error) { return json.Marshal(g) } func (g *GormList) Scan(value interface{}) error { return json.Unmarshal(value.([]byte), &g) } type BaseFields struct { ID int64 `gorm:"primarykey;type:int" json:"id"` // bigint CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } // Paginate 分页 func Paginate(page, pageSize int) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { if page == 0 { page = 1 } switch { case pageSize > 100: pageSize = 100 case pageSize <= 0: pageSize = 10 } offset := (page - 1) * pageSize return db.Offset(offset).Limit(pageSize) } } ================================================ FILE: service/goods/internal/data/brand.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" "goods/internal/biz" "goods/internal/domain" "gorm.io/gorm" "time" ) // Brand 商品品牌表 type Brand struct { ID int32 `gorm:"primarykey;type:int" json:"id"` Name string `gorm:"type:varchar(50);not null;comment:品牌名称" json:"name"` Logo string `gorm:"type:varchar(200);default:;comment:品牌Logo图片"` Desc string `gorm:"type:varchar(500);default:;comment:品牌描述"` IsTab bool `gorm:"comment:是否显示;default:false" json:"is_tab"` Sort int32 `gorm:"comment:品牌排序;default:99;not null;type:int" json:"sort"` CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } func (p *Brand) ToDomain() *domain.Brand { return &domain.Brand{ ID: p.ID, Name: p.Name, Logo: p.Logo, Desc: p.Desc, IsTab: p.IsTab, Sort: p.Sort, } } type BrandRepo struct { data *Data log *log.Helper } // NewBrandRepo . func NewBrandRepo(data *Data, logger log.Logger) biz.BrandRepo { return &BrandRepo{ data: data, log: log.NewHelper(logger), } } func (r *BrandRepo) Create(ctx context.Context, b *domain.Brand) (*domain.Brand, error) { brand := &Brand{ Name: b.Name, Logo: b.Logo, Desc: b.Desc, IsTab: b.IsTab, Sort: b.Sort, } if err := r.data.db.Save(brand).Error; err != nil { return nil, errors.InternalServer("SAVE_BRAND_ERROR", err.Error()) } res := &domain.Brand{ ID: brand.ID, Name: brand.Name, Logo: brand.Logo, Desc: brand.Desc, IsTab: brand.IsTab, Sort: brand.Sort, } return res, nil } func (r *BrandRepo) GetBradByName(ctx context.Context, name string) (*domain.Brand, error) { var brand Brand result := r.data.db.Where("name=?", name).First(&brand) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return nil, errors.NotFound("BRAND_NOT_FOUND", "brand not found") } if result.RowsAffected == 1 { return &domain.Brand{ ID: brand.ID, Name: brand.Name, Logo: brand.Logo, Desc: brand.Desc, IsTab: brand.IsTab, Sort: brand.Sort, }, nil } else { return nil, errors.NotFound("BRAND_NOT_FOUND", "brand not found") } } func (r *BrandRepo) Update(ctx context.Context, b *domain.Brand) error { brands := Brand{} if result := r.data.db.Where("id=?", b.ID).First(&brands); result.RowsAffected == 0 { return errors.NotFound("BRAND_NOT_FOUND", "brand not found") } if b.Name != "" { brands.Name = b.Name } if b.Logo != "" { brands.Logo = b.Logo } if b.IsTab { brands.IsTab = b.IsTab } if b.Sort != 0 { brands.Sort = b.Sort } if b.Desc != "" { brands.Desc = b.Desc } if err := r.data.db.Save(&brands).Error; err != nil { return errors.InternalServer("UPDATE_BRAND_ERROR", err.Error()) } return nil } func (r *BrandRepo) List(ctx context.Context, b *biz.Pagination) ([]*domain.Brand, int64, error) { var brands []Brand result := r.data.db.Scopes(Paginate(b.PageNum, b.PageSize)).Find(&brands) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return nil, 0, errors.NotFound("BRAND_NOT_FOUND", "brand not found") } if result.Error != nil { return nil, 0, result.Error } var rsp []*domain.Brand var total int64 result = r.data.db.Table("brands").Model(&Brand{}).Count(&total) if result.Error != nil { return nil, 0, errors.NotFound("BRAND_NOT_FOUND", "brand not found") } for _, v := range brands { br := &domain.Brand{ ID: v.ID, Name: v.Name, Logo: v.Logo, IsTab: v.IsTab, Sort: v.Sort, } rsp = append(rsp, br) } return rsp, total, nil } func (r *BrandRepo) IsBrand(ctx context.Context, ids []int32) error { idCount := len(ids) if idCount == 0 { return errors.InternalServer("BRAND_NOT_FOUND", "brand not found") } var count int64 result := r.data.db.Table("brands").Where("id IN (?)", ids).Count(&count) if result.Error != nil { return errors.InternalServer("BRAND_NOT_FOUND", result.Error.Error()) } if int64(idCount) != count { return errors.InternalServer("BRAND_NOT_FOUND", "品牌不存在") } return nil } func (r *BrandRepo) ListByIds(ctx context.Context, ids ...int32) (domain.BrandList, error) { if len(ids) == 0 { return nil, errors.InternalServer("BRAND_NOT_FOUND", "请选择品牌") } var l []*Brand if err := r.data.DB(ctx).Where("id IN (?)", ids).Find(&l).Error; err != nil { return nil, errors.InternalServer("BRAND_NOT_FOUND", err.Error()) } var res domain.BrandList for _, item := range l { res = append(res, item.ToDomain()) } return res, nil } func (r *BrandRepo) IsBrandByID(ctx context.Context, id int32) (*domain.Brand, error) { var b Brand if err := r.data.db.Table("brands").Where("id = ?", id).First(&b).Error; err != nil { return nil, errors.InternalServer("BRAND_NOT_FOUND", err.Error()) } return b.ToDomain(), nil } ================================================ FILE: service/goods/internal/data/category.go ================================================ package data import ( "context" "fmt" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" "github.com/jinzhu/copier" "goods/internal/biz" "gorm.io/gorm" "time" ) // Category 商品分类表 type Category struct { ID int32 `gorm:"primarykey;type:int" json:"id"` Name string `gorm:"type:varchar(50);not null;comment:分类名称" json:"name"` ParentCategoryID int32 `json:"parent_id"` ParentCategory *Category `json:"-"` SubCategory []*Category `gorm:"foreignKey:ParentCategoryID;references:ID" json:"sub_category"` Level int32 `gorm:"column:level;default:1;not null;type:int;comment:分类的级别" json:"level"` IsTab bool `gorm:"comment:是否显示;default:false" json:"is_tab"` Sort int32 `gorm:"comment:分类排序;default:99;not null;type:int" json:"sort"` CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } // GoodsCategoryBrand 商品和分类多对对的表 type GoodsCategoryBrand struct { ID int32 `gorm:"primarykey;type:int" json:"id"` // bigint CategoryID int32 `gorm:"type:int;index:idx_category_brand,unique;comment:商品和分类联合索引唯一"` BrandsID int32 `gorm:"type:int;index:idx_category_brand,unique:comment:商品和分类联合索引唯一"` CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } type CategoryRepo struct { data *Data log *log.Helper } // NewCategoryRepo . func NewCategoryRepo(data *Data, logger log.Logger) biz.CategoryRepo { return &CategoryRepo{ data: data, log: log.NewHelper(logger), } } func (r *CategoryRepo) DeleteCategory(ctx context.Context, id int32) error { if res := r.data.db.Delete(&Category{}, id); res.RowsAffected == 0 { return errors.InternalServer("DELETE_CATGORY_ERROR", res.Error.Error()) } return nil } func (r *CategoryRepo) UpdateCategory(ctx context.Context, req *biz.CategoryInfo) error { var category Category if result := r.data.db.First(&category, req.ID); result.RowsAffected == 0 { return errors.NotFound("CATEGORY_NOT_FOUND", "商品分类不存在") } if req.Name != "" { category.Name = req.Name } if req.ParentCategory != 0 { category.ParentCategoryID = req.ParentCategory } if req.Level != 0 { category.Level = req.Level } if req.IsTab { category.IsTab = req.IsTab } result := r.data.db.Save(&category) if result.Error != nil { return errors.InternalServer("CATEGORY_UPDATE_ERROR", "商品分类创建失败") } return nil } func (r *CategoryRepo) AddCategory(ctx context.Context, req *biz.CategoryInfo) (*biz.CategoryInfo, error) { cMap := map[string]interface{}{} cMap["name"] = req.Name cMap["level"] = req.Level cMap["is_tab"] = req.IsTab cMap["sort"] = req.Sort cMap["add_time"] = time.Now() cMap["update_time"] = time.Now() // 去查询父类目是否存在 if req.Level != 1 { var categories Category if res := r.data.db.First(&categories, req.ParentCategory); res.RowsAffected == 0 { return nil, errors.NotFound("CATEGORY_NOT_FOUND", "商品分类不存在") } cMap["parent_category_id"] = req.ParentCategory } result := r.data.db.Model(&Category{}).Create(&cMap) if result.Error != nil { return nil, errors.InternalServer("CATEGORY_CREATE_ERROR", result.Error.Error()) } var value int32 value, ok := cMap["parent_category_id"].(int32) if !ok { value = 0 } res := &biz.CategoryInfo{ Name: cMap["name"].(string), ParentCategory: value, Level: cMap["level"].(int32), IsTab: cMap["is_tab"].(bool), Sort: cMap["sort"].(int32), } return res, nil } func (r *CategoryRepo) Category(ctx context.Context) ([]*biz.Category, error) { var cate []*Category result := r.data.db.Where(&Category{Level: 1}).Preload("SubCategory.SubCategory").Find(&cate) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return nil, errors.NotFound("CATEGORY_NOT_FOUND", "分类不存在") } if result.Error != nil { return nil, errors.InternalServer("CATEGORY_NOT_FOUND", result.Error.Error()) } var res []*biz.Category err := copier.Copy(&res, &cate) if err != nil { return nil, errors.InternalServer("CATEGORY_COPY_ERROR", err.Error()) } return res, nil } func (r *CategoryRepo) GetCategoryByID(ctx context.Context, id int32) (*biz.CategoryInfo, error) { var categories Category if res := r.data.db.First(&categories, id); res.RowsAffected == 0 { return nil, errors.NotFound("CATEGORY_NOT_FOUND", "分类不存在") } info := &biz.CategoryInfo{ ID: categories.ID, Name: categories.Name, ParentCategory: categories.ParentCategoryID, Level: categories.Level, IsTab: categories.IsTab, Sort: categories.Sort, } return info, nil } func (r *CategoryRepo) SubCategory(ctx context.Context, req biz.CategoryInfo) ([]*biz.CategoryInfo, error) { var subCategory []Category var subCategoryInfo []*biz.CategoryInfo preload := "SubCategory" if req.Level == 1 { preload = "SubCategory.SubCategory" } if err := r.data.db.Where(&Category{ParentCategoryID: req.ID}).Preload(preload).Find(&subCategory).Error; err != nil { return nil, errors.NotFound("CATEGORY_NOT_FOUND", "分类不存在") } for _, v := range subCategory { subCategoryInfo = append(subCategoryInfo, &biz.CategoryInfo{ ID: v.ID, Name: v.Name, ParentCategory: v.ParentCategoryID, Level: v.Level, IsTab: v.IsTab, Sort: v.Sort, }) } return subCategoryInfo, nil } func (r *CategoryRepo) GetCategoryAll(ctx context.Context, level, id int32) ([]interface{}, error) { categoryIds := make([]interface{}, 0) var subQuery string // 把一级级分类下的所有三级分类都拿到 if level == 1 { subQuery = fmt.Sprintf("SELECT id FROM categories WHERE parent_category_id IN (SELECT id FROM categories WHERE parent_category_id=%d)", id) } else if level == 2 { subQuery = fmt.Sprintf("SELECT id FROM categories WHERE parent_category_id=%d", id) } else if level == 3 { subQuery = fmt.Sprintf("SELECT id FROM categories WHERE id=%d", id) } type Result struct { ID int32 } var results []Result if err := r.data.db.Table("categories").Model(Category{}).Raw(subQuery).Scan(&results).Error; err != nil { return nil, errors.InternalServer("CATEGORY_ERROR", err.Error()) } for _, re := range results { categoryIds = append(categoryIds, re.ID) } return categoryIds, nil } ================================================ FILE: service/goods/internal/data/data.go ================================================ package data import ( "context" "goods/internal/biz" "goods/internal/conf" slog "log" "os" "time" "github.com/go-kratos/kratos/v2/log" "github.com/go-redis/redis/extra/redisotel" "github.com/go-redis/redis/v8" "github.com/google/wire" "github.com/olivere/elastic/v7" "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger" "gorm.io/gorm/schema" ) // ProviderSet is data providers. var ProviderSet = wire.NewSet( NewData, NewDB, NewTransaction, NewRedis, NewElasticsearch, NewBrandRepo, NewCategoryRepo, NewGoodsTypeRepo, NewSpecificationRepo, NewGoodsAttrRepo, NewGoodsRepo, NewGoodsSkuRepoRepo, NewInventoryRepo, NewEsGoodsRepo, ) type Data struct { db *gorm.DB rdb *redis.Client EsClient *elastic.Client } // 用来承载事务的上下文 type contextTxKey struct{} // NewData . func NewData(c *conf.Data, logger log.Logger, db *gorm.DB, rdb *redis.Client, es *elastic.Client) (*Data, func(), error) { cleanup := func() { log.NewHelper(logger).Info("closing the data resources") } return &Data{ db: db, rdb: rdb, EsClient: es, }, cleanup, nil } // NewTransaction . func NewTransaction(d *Data) biz.Transaction { return d } // ExecTx gorm Transaction func (d *Data) ExecTx(ctx context.Context, fn func(ctx context.Context) error) error { return d.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error { ctx = context.WithValue(ctx, contextTxKey{}, tx) return fn(ctx) }) } // DB 根据此方法来判断当前的 db 是不是使用 事务的 DB func (d *Data) DB(ctx context.Context) *gorm.DB { tx, ok := ctx.Value(contextTxKey{}).(*gorm.DB) if ok { return tx } return d.db } // NewDB . func NewDB(c *conf.Data) *gorm.DB { // 终端打印输入 sql 执行记录 newLogger := logger.New( slog.New(os.Stdout, "\r\n", slog.LstdFlags), // io writer logger.Config{ SlowThreshold: time.Second, // 慢查询 SQL 阈值 Colorful: true, // 禁用彩色打印 //IgnoreRecordNotFoundError: false, LogLevel: logger.Info, // Log lever }, ) db, err := gorm.Open(mysql.Open(c.Database.Source), &gorm.Config{ Logger: newLogger, DisableForeignKeyConstraintWhenMigrating: true, NamingStrategy: schema.NamingStrategy{ //SingularTable: true, // 表名是否加 s }, }) if err != nil { log.Errorf("failed opening connection to sqlite: %v", err) panic("failed to connect database") } return db } func NewRedis(c *conf.Data) *redis.Client { rdb := redis.NewClient(&redis.Options{ Addr: c.Redis.Addr, Password: c.Redis.Password, DB: int(c.Redis.Db), DialTimeout: c.Redis.DialTimeout.AsDuration(), WriteTimeout: c.Redis.WriteTimeout.AsDuration(), ReadTimeout: c.Redis.ReadTimeout.AsDuration(), }) rdb.AddHook(redisotel.TracingHook{}) if err := rdb.Close(); err != nil { log.Error(err) } return rdb } func NewElasticsearch(c *conf.Data) *elastic.Client { es, err := elastic.NewClient(elastic.SetURL(c.Elastic.Addr), elastic.SetSniff(false), elastic.SetTraceLog(slog.New(os.Stdout, "shop", slog.LstdFlags))) if err != nil { panic(err) } return es } ================================================ FILE: service/goods/internal/data/entity/goods.go ================================================ package main import ( "goods/internal/data" "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger" "gorm.io/gorm/schema" "log" "os" "time" ) // 链接数据库 func main() { dsn := "root:root@tcp(127.0.0.1:3306)/shop_goods?charset=utf8mb4&parseTime=True&loc=Local" newLogger := logger.New( log.New(os.Stdout, "\r\n", log.LstdFlags), // io writer logger.Config{ SlowThreshold: time.Second, // 慢 SQL 阈值 LogLevel: logger.Info, // Log level Colorful: true, // 禁用彩色打印 }, ) // 全局模式 db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{ NamingStrategy: schema.NamingStrategy{ //SingularTable: true, }, Logger: newLogger, }) if err != nil { panic(err) } _ = db.AutoMigrate( //&data.Brand{}, //&data.Category{}, //&data.GoodsCategoryBrand{}, //&data.GoodsType{}, //&data.GoodsTypeBrand{}, //&data.SpecificationsAttr{}, //&data.SpecificationsAttrValue{}, //&data.GoodsAttrGroup{}, //&data.GoodsAttr{}, //&data.GoodsAttrValue{}, //&data.Goods{}, //&data.GoodsSku{}, //&data.GoodsImages{}, &data.GoodsSpecificationSku{}, &data.GoodsInventory{}, ) } ================================================ FILE: service/goods/internal/data/es_goods.go ================================================ package data import ( "context" "encoding/json" "goods/internal/biz" "goods/internal/domain" "strconv" "github.com/go-kratos/kratos/v2/log" "github.com/olivere/elastic/v7" ) // GetIndexName 设计商品的索引 goods func (esGoodsRepo) GetIndexName() string { return "goods" } // GetMapping 设计商品的 mapping 结构 func (esGoodsRepo) GetMapping() string { goodsMapping := ` { "mappings": { "properties": { "id": { "type": "integer" }, "brands_id": { "type": "integer" }, "category_id": { "type": "integer" }, "type_id": { "type": "integer" }, "click_num": { "type": "integer" }, "fav_num": { "type": "integer" }, "is_hot": { "type": "boolean" }, "is_new": { "type": "boolean" }, "market_price": { "type": "integer" }, "name": { "type": "text", "analyzer": "ik_max_word" }, "brand_name": { "type": "keyword", "index": false, "dec_values": false, }, "category_name": { "type": "keyword", "index": false, "dec_values": false, }, "type_name": { "type": "keyword", "index": false, "dec_values": false, }, "goods_brief": { "type": "text", "analyzer": "ik_max_word" }, "on_sale": { "type": "boolean" }, "ship_free": { "type": "boolean" }, "shop_price": { "type": "integer" }, "sold_num": { "type": "integer" }, "sku": { "type": "nested", "sku_id": { "type": "integer", }, "sku_name": { "type": "text", "analyzer": "ik_max_word" }, "sku_price": { "type": "integer", }, } } } }` return goodsMapping } type esGoodsRepo struct { data *Data log *log.Helper } // NewEsGoodsRepo . func NewEsGoodsRepo(data *Data, logger log.Logger) biz.EsGoodsRepo { return &esGoodsRepo{ data: data, log: log.NewHelper(logger), } } func (p esGoodsRepo) GoodsList(ctx context.Context, filter *domain.EsSearch) ([]int64, int64, error) { boolQuery := elastic.NewBoolQuery() boolQuery.Must(filter.MustQuery...) boolQuery.MustNot(filter.MustNotQuery...) boolQuery.Should(filter.ShouldQuery...) boolQuery.Filter(filter.Filters...) result, err := p.data.EsClient.Search(). Index(p.GetIndexName()). Query(boolQuery). SortBy(filter.Sorters...). From(int(filter.Form)). Size(int(filter.Size)). Do(ctx) if err != nil { return nil, 0, err } // 取出来商品ID goodsIds := make([]int64, 0) for _, value := range result.Hits.Hits { goods := domain.ESGoods{} _ = json.Unmarshal(value.Source, &goods) goodsIds = append(goodsIds, goods.ID) } return goodsIds, result.Hits.TotalHits.Value, nil } func (p esGoodsRepo) InsertEsGoods(ctx context.Context, esModel domain.ESGoods) error { // 新建 mapping 和 index exists, err := p.data.EsClient.IndexExists(p.GetIndexName()).Do(ctx) if err != nil { panic(err) } if !exists { _, err = p.data.EsClient.CreateIndex(p.GetIndexName()).BodyString(p.GetMapping()).Do(ctx) if err != nil { return err } } _, err = p.data.EsClient.Index().Index(p.GetIndexName()).BodyJson(esModel).Id(strconv.Itoa(int(esModel.ID))).Do(ctx) if err != nil { return err } _, err = p.data.EsClient.Index().Index(p.GetIndexName()).BodyJson(esModel).Id(strconv.Itoa(int(esModel.ID))).Do(ctx) _, err = p.data.EsClient.Update().Index(p.GetIndexName()). Doc(esModel).Id("自己的ID").Do(ctx) return nil } ================================================ FILE: service/goods/internal/data/good_type.go ================================================ package data import ( "context" "goods/internal/biz" "goods/internal/domain" "strconv" "strings" "time" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" "gorm.io/gorm" ) // GoodsType 商品类型表 type GoodsType struct { ID int64 `gorm:"primarykey;type:int" json:"id"` Name string `gorm:"type:varchar(50);not null;comment:商品类型名称" json:"name"` TypeCode string `gorm:"type:varchar(50);not null;comment:商品类型编码" json:"type_code"` NameAlias string `gorm:"type:varchar(50);not null;comment:商品类型别名" json:"name_alias"` IsVirtual bool `gorm:"comment:是否是虚拟商品显示;default:false" json:"is_virtual"` Desc string `gorm:"type:varchar(50);not null;comment:商品类型描述" json:"desc"` Sort int32 `gorm:"comment:类型排序;default:99;not null;type:int" json:"sort"` CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } // GoodsTypeBrand 商品类型表和商品品牌关联表 type GoodsTypeBrand struct { ID int32 `gorm:"primarykey;type:int" json:"id"` BrandID int32 `gorm:"index:brand_id;type:int;comment:商品品牌ID;not null"` TypeID int64 `gorm:"index:type_id;type:int;comment:商品类型ID;not null"` } type goodsTypeRepo struct { data *Data log *log.Helper } // NewGoodsTypeRepo . func NewGoodsTypeRepo(data *Data, logger log.Logger) biz.GoodsTypeRepo { return &goodsTypeRepo{ data: data, log: log.NewHelper(logger), } } func (p *GoodsType) ToDomain() *domain.GoodsType { return &domain.GoodsType{ ID: p.ID, Name: p.Name, TypeCode: p.TypeCode, NameAlias: p.NameAlias, IsVirtual: p.IsVirtual, Desc: p.Desc, Sort: p.Sort, } } // CreateGoodsType 创建基本的商品类型 func (g *goodsTypeRepo) CreateGoodsType(ctx context.Context, req *domain.GoodsType) (int64, error) { goodsType := GoodsType{ Name: req.Name, TypeCode: req.TypeCode, NameAlias: req.NameAlias, IsVirtual: req.IsVirtual, Desc: req.Desc, Sort: req.Sort, CreatedAt: time.Time{}, UpdatedAt: time.Time{}, } result := g.data.DB(ctx).Save(&goodsType) if result.Error != nil { return 0, errors.InternalServer("GOODS_TYPE_SAVE_ERROR", result.Error.Error()) } return goodsType.ID, result.Error } func (g *goodsTypeRepo) CreateGoodsBrandType(ctx context.Context, typeID int64, brandIds string) error { var gtb []GoodsTypeBrand Ids := strings.Split(brandIds, ",") for _, id := range Ids { j, _ := strconv.ParseInt(id, 10, 32) v := GoodsTypeBrand{ BrandID: int32(j), TypeID: typeID, } gtb = append(gtb, v) } if err := g.data.DB(ctx).Create(>b).Error; err != nil { return errors.InternalServer("GOODS_TYPE_CREATE_ERROR", err.Error()) } return nil } func (g *goodsTypeRepo) GetGoodsTypeByID(ctx context.Context, typeID int64) (*domain.GoodsType, error) { var goodsType GoodsType if res := g.data.db.First(&goodsType, typeID); res.RowsAffected == 0 { return nil, errors.NotFound("GOODS_TYPE_NOT_FOUND", "商品类型不存在") } return goodsType.ToDomain(), nil } func (g *goodsTypeRepo) IsExistsByID(ctx context.Context, typeID int64) (*domain.GoodsType, error) { var goodsType GoodsType if res := g.data.db.First(&goodsType, typeID); res.RowsAffected == 0 { return nil, errors.NotFound("GOODS_TYPE_NOT_FOUND", "商品类型不存在") } return goodsType.ToDomain(), nil } ================================================ FILE: service/goods/internal/data/goods.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" "goods/internal/biz" "goods/internal/domain" ) // Goods 商品表 type Goods struct { BaseFields CategoryID int32 `gorm:"index:category_id;type:int;comment:分类ID;not null"` BrandsID int32 `gorm:"index:brand_id;type:int;comment:品牌ID ;not null"` TypeID int64 `gorm:"index:type_id;type:int;comment:商品类型ID ;not null"` Name string `gorm:"type:varchar(100);not null;comment:商品名称"` NameAlias string `gorm:"type:varchar(100);not null;comment:商品别名"` GoodsSn string `gorm:"type:varchar(100);not null;comment:商品编号"` GoodsTags string `gorm:"type:varchar(100);not null;comment:商品标签"` MarketPrice int64 `gorm:"type:int;default:0;not null;comment:商品展示价格"` GoodsBrief string `gorm:"type:varchar(100);not null;comment:商品简介"` GoodsFrontImage string `gorm:"type:varchar(200);not null;comment:商品封面图"` GoodsImages GormList `gorm:"type:varchar(1000);not null;comment:商品的介绍图"` // 切片类型转为 json 到数据库,取出来是切片类型 OnSale bool `gorm:"default:false;comment:是否上架;not null "` ShipFree bool `gorm:"default:false;comment:是否免运费; not null"` ShipID int32 `gorm:"type:int;comment:运费模版ID;not null"` IsNew bool `gorm:"default:false;comment:是否新品;not null"` IsHot bool `gorm:"comment:是否热卖商品;default:false;not null"` ClickNum int64 `gorm:"default:0;type:int; comment 商品详情点击数"` SoldNum int64 `gorm:"default:0;type:int; comment 商品销售数"` FavNum int64 `gorm:"default:0;type:int; comment 商品收藏数"` // 售前服务信息、售后服务信息、商品促销活动信息 } type goodsRepo struct { data *Data log *log.Helper } // NewGoodsRepo . func NewGoodsRepo(data *Data, logger log.Logger) biz.GoodsRepo { return &goodsRepo{ data: data, log: log.NewHelper(logger), } } func (p *Goods) ToDomain() *domain.Goods { return &domain.Goods{ ID: p.ID, CategoryID: p.CategoryID, BrandsID: p.BrandsID, TypeID: p.TypeID, Name: p.Name, NameAlias: p.NameAlias, GoodsSn: p.GoodsSn, GoodsTags: p.GoodsTags, MarketPrice: p.MarketPrice, GoodsBrief: p.GoodsBrief, GoodsFrontImage: p.GoodsFrontImage, GoodsImages: p.GoodsImages, OnSale: p.OnSale, ShipFree: p.ShipFree, ShipID: p.ShipID, IsNew: p.IsNew, IsHot: p.IsHot, ClickNum: p.ClickNum, SoldNum: p.SoldNum, FavNum: p.FavNum, } } func (g goodsRepo) CreateGoods(c context.Context, goods *domain.Goods) (*domain.Goods, error) { product := &Goods{ CategoryID: goods.CategoryID, BrandsID: goods.BrandsID, TypeID: goods.TypeID, Name: goods.Name, NameAlias: goods.NameAlias, GoodsSn: goods.GoodsSn, GoodsTags: goods.GoodsTags, MarketPrice: goods.MarketPrice, GoodsBrief: goods.GoodsBrief, GoodsFrontImage: goods.GoodsFrontImage, GoodsImages: goods.GoodsImages, OnSale: goods.OnSale, ShipFree: goods.ShipFree, ShipID: goods.ShipID, IsNew: goods.IsNew, IsHot: goods.IsHot, } result := g.data.DB(c).Save(product) if result.Error != nil { return nil, errors.InternalServer("GOODS_CREATE_ERROR", "商品创建失败") } return product.ToDomain(), nil } func (g goodsRepo) GoodsListByIDs(c context.Context, ids ...int64) ([]*domain.Goods, error) { var l []*Goods if err := g.data.DB(c).Where("id IN (?)", ids).Find(&l).Error; err != nil { return nil, errors.NotFound("GOODS_NOT_FOUND", "商品不存在") } var res []*domain.Goods for _, item := range l { res = append(res, item.ToDomain()) } return res, nil } ================================================ FILE: service/goods/internal/data/goods_attr.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" "goods/internal/biz" "goods/internal/domain" "gorm.io/gorm" "time" ) // GoodsAttrGroup 商品属性分组表 手机 -> 主体->屏幕,操作系统,网络支持,基本信息 type GoodsAttrGroup struct { ID int64 `gorm:"primarykey;type:int" json:"id"` GoodsTypeID int64 `gorm:"index:goods_type_id;type:int;comment:商品类型ID;not null"` Title string `gorm:"type:varchar(100);comment:属性名;not null"` Desc string `gorm:"type:varchar(200);comment:属性描述;default:false;not null"` Status bool `gorm:"comment:状态;default:false;not null"` Sort int32 `gorm:"type:int;comment:商品属性排序字段;not null"` CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } // GoodsAttr 商品属性表 主体->产品名称,上市月份,机身宽度 type GoodsAttr struct { ID int64 `gorm:"primarykey;type:int" json:"id"` GoodsTypeID int64 `gorm:"index:goods_type_id;type:int;comment:商品类型ID;not null"` GroupID int64 `gorm:"index:attr_group_id;type:int;comment:商品属性分组ID;not null"` Title string `gorm:"type:varchar(100);comment:属性名;not null"` Desc string `gorm:"type:varchar(200);comment:属性描述;default:false;not null"` Status bool `gorm:"comment:状态;default:false;not null"` Sort int32 `gorm:"type:int;comment:商品属性排序字段;not null"` CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } type GoodsAttrValue struct { ID int64 `gorm:"primarykey;type:int" json:"id"` AttrId int64 `gorm:"index:property_name_id;type:int;comment:属性表ID;not null"` GroupID int64 `gorm:"index:attr_group_id;type:int;comment:商品属性分组ID;not null"` Value string `gorm:"type:varchar(100);comment:属性值;not null"` CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } type goodsAttrRepo struct { data *Data log *log.Helper } // NewGoodsAttrRepo . func NewGoodsAttrRepo(data *Data, logger log.Logger) biz.GoodsAttrRepo { return &goodsAttrRepo{ data: data, log: log.NewHelper(logger), } } func (p *GoodsAttrGroup) ToDomain() *domain.AttrGroup { return &domain.AttrGroup{ ID: p.ID, TypeID: p.GoodsTypeID, Title: p.Title, Desc: p.Desc, Status: p.Status, Sort: p.Sort, } } func (p *GoodsAttr) ToDomain() *domain.GoodsAttr { return &domain.GoodsAttr{ ID: p.ID, TypeID: p.GoodsTypeID, GroupID: p.GroupID, Title: p.Title, Sort: p.Sort, Status: p.Status, Desc: p.Desc, } } func (p *GoodsAttrValue) ToDomain() *domain.GoodsAttrValue { return &domain.GoodsAttrValue{ ID: p.ID, AttrId: p.AttrId, GroupID: p.GroupID, Value: p.Value, } } func (g *goodsAttrRepo) CreateGoodsGroupAttr(ctx context.Context, a *domain.AttrGroup) (*domain.AttrGroup, error) { group := GoodsAttrGroup{ GoodsTypeID: a.TypeID, Title: a.Title, Desc: a.Desc, Status: a.Status, Sort: a.Sort, } result := g.data.db.Save(&group) if result.Error != nil { return nil, errors.InternalServer("ATTR_GROUP_SAVE_ERROR", result.Error.Error()) } return group.ToDomain(), nil } func (g *goodsAttrRepo) IsExistsGroupByID(ctx context.Context, groupId int64) (*domain.AttrGroup, error) { var group GoodsAttrGroup if res := g.data.db.First(&group, groupId); res.RowsAffected == 0 { return nil, errors.NotFound("ATTR_GROUP_NOT_FOUND", "商品属性组不存在") } return group.ToDomain(), nil } func (g *goodsAttrRepo) CreateGoodsAttr(ctx context.Context, a *domain.GoodsAttr) (*domain.GoodsAttr, error) { attr := GoodsAttr{ GoodsTypeID: a.TypeID, GroupID: a.GroupID, Title: a.Title, Desc: a.Desc, Status: a.Status, Sort: a.Sort, } if err := g.data.DB(ctx).Save(&attr).Error; err != nil { return nil, errors.InternalServer("ATTR_SAVE_ERROR", err.Error()) } return attr.ToDomain(), nil } func (g *goodsAttrRepo) CreateGoodsAttrValue(ctx context.Context, r []*domain.GoodsAttrValue) ([]*domain.GoodsAttrValue, error) { var attrValue []*GoodsAttrValue for _, v := range r { attr := GoodsAttrValue{ AttrId: v.AttrId, GroupID: v.GroupID, Value: v.Value, } attrValue = append(attrValue, &attr) } if err := g.data.DB(ctx).Create(&attrValue).Error; err != nil { return nil, errors.InternalServer("ATTR_CREATE_ERROR", err.Error()) } var res []*domain.GoodsAttrValue for _, v := range attrValue { value := v.ToDomain() res = append(res, value) } return res, nil } func (g *goodsAttrRepo) GetAttrByIDs(ctx context.Context, ids []*int64) error { var attrIDs []*int64 for _, id := range ids { attrIDs = append(attrIDs, id) } total := len(ids) var count int64 result := g.data.DB(ctx).Where("id IN (?)", attrIDs).Count(&count) if result.Error != nil { if errors.Is(result.Error, gorm.ErrRecordNotFound) { return errors.NotFound("ATTR_NOT_FOUND", "商品属性不存在") } return errors.InternalServer("ATTR_GET_ERROR", result.Error.Error()) } if int64(total) != count { return errors.NotFound("ATTR_NOT_FOUND", "部分属性不存在") } return nil } func (g *goodsAttrRepo) ListByIds(ctx context.Context, ids ...int64) (domain.GoodsAttrList, error) { var l []*GoodsAttr if err := g.data.DB(ctx).Where("id IN (?)", ids).Find(&l).Error; err != nil { return nil, errors.NotFound("ATTR_NOT_FOUND", "商品属性不存在") } var res domain.GoodsAttrList for _, item := range l { res = append(res, item.ToDomain()) } return res, nil } ================================================ FILE: service/goods/internal/data/goods_image.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/v2/log" "goods/internal/biz" "goods/internal/domain" ) // GoodsImages goods images type GoodsImages struct { BaseFields GoodsID int64 `gorm:"index:goods_id;type:int;comment:商品ID;not null"` Goods Goods Link string `gorm:"type:varchar(200);comment:商品图片URL地址;not null"` Position int32 `gorm:"type:smallint(5);comment:商品图片位置;not null"` IsMaster bool `gorm:"comment:是否主图: 1是,0否;default:false;not null"` } type goodsImagesRepo struct { data *Data log *log.Helper } // NewGoodsImagesRepo . func NewGoodsImagesRepo(data *Data, logger log.Logger) biz.GoodsImagesRepo { return &goodsImagesRepo{ data: data, log: log.NewHelper(logger), } } func (r *goodsImagesRepo) CreateGreeter(ctx context.Context, g *domain.Goods) error { return nil } func (r *goodsImagesRepo) UpdateGreeter(ctx context.Context, g *domain.Goods) error { return nil } ================================================ FILE: service/goods/internal/data/goods_sku.go ================================================ package data import ( "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" "golang.org/x/net/context" "goods/internal/biz" "goods/internal/domain" ) // GoodsSku 商品SKU 表 type GoodsSku struct { BaseFields GoodsID int64 `gorm:"index:goods_id;type:int;comment:商品ID;not null"` GoodsSn string `gorm:"type:varchar(100);not null;comment:商品编号"` GoodsName string `gorm:"type:varchar(100);not null;comment:商品名称"` SkuName string `gorm:"type:varchar(100);comment:SKU名称;not null"` SkuCode string `gorm:"type:varchar(100);comment:SKUCode;not null"` BarCode string `gorm:"type:varchar(100);comment:条码;not null"` Price int64 `gorm:"type:int;comment:商品售价;not null"` PromotionPrice int64 `gorm:"type:int;comment:商品促销售价;not null"` Points int64 `gorm:"type:int;comment:赠送积分;not null"` RemarksInfo string `gorm:"type:varchar(100);comment:备注信息;not null"` Pic string `gorm:"type:varchar(500);not null;comment:规格参数对应的图片" json:"pic"` OnSale bool `gorm:"comment:是否上架;default:false;not null"` AttrInfo string `gorm:"type:varchar(2000);comment:商品属性信息JSON;not null"` Inventory int64 `gorm:"type:int;comment:商品SKU库存冗余字段;not null"` } // GoodsSpecificationSku 商品规格和商品Sku关联表 type GoodsSpecificationSku struct { BaseFields SkuID int64 `gorm:"index:sku_id;type:int;comment:商品SKU_ID;not null"` SkuCode string `gorm:"type:varchar(100);comment:商品SKU_Code;not null"` SpecificationId int64 `gorm:"index:specification_id;type:int;comment:商品规格ID;not null"` ValueId int64 `gorm:"index:value_id;type:int;comment:商品规格值表ID;not null"` } type goodsSkuRepo struct { data *Data log *log.Helper } // NewGoodsSkuRepoRepo . func NewGoodsSkuRepoRepo(data *Data, logger log.Logger) biz.GoodsSkuRepo { return &goodsSkuRepo{ data: data, log: log.NewHelper(logger), } } func (p *GoodsSku) ToDomain() *domain.GoodsSku { return &domain.GoodsSku{ ID: p.ID, GoodsID: p.GoodsID, GoodsSn: p.GoodsSn, GoodsName: p.GoodsName, SkuName: p.SkuName, SkuCode: p.SkuCode, BarCode: p.BarCode, Price: p.Price, PromotionPrice: p.PromotionPrice, Points: p.Points, RemarksInfo: p.RemarksInfo, Pic: p.Pic, Inventory: p.Inventory, OnSale: p.OnSale, AttrInfo: p.AttrInfo, } } func (g *goodsSkuRepo) Create(ctx context.Context, req *domain.GoodsSku) (*domain.GoodsSku, error) { sku := &GoodsSku{ GoodsID: req.GoodsID, GoodsSn: req.GoodsSn, GoodsName: req.GoodsName, SkuName: req.SkuName, SkuCode: req.SkuCode, BarCode: req.BarCode, Price: req.Price, PromotionPrice: req.PromotionPrice, Points: req.Points, RemarksInfo: req.RemarksInfo, Pic: req.Pic, OnSale: req.OnSale, AttrInfo: req.AttrInfo, Inventory: req.Inventory, } if err := g.data.DB(ctx).Save(sku).Error; err != nil { return nil, errors.InternalServer("SKU_SAVE_ERROR", err.Error()) } return sku.ToDomain(), nil } func (g *goodsSkuRepo) CreateSkuRelation(ctx context.Context, req []*domain.GoodsSpecificationSku) error { var info []*GoodsSpecificationSku for _, sku := range req { i := GoodsSpecificationSku{ SkuID: sku.SkuID, SkuCode: sku.SkuCode, SpecificationId: sku.SpecificationId, ValueId: sku.ValueId, } info = append(info, &i) } if err := g.data.DB(ctx).Table("goods_specification_skus").Save(&info).Error; err != nil { return errors.InternalServer("SKU_RELATION_SAVE_ERROR", err.Error()) } return nil } ================================================ FILE: service/goods/internal/data/inventory.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" "goods/internal/biz" "goods/internal/domain" ) type GoodsInventory struct { BaseFields SkuID int64 `gorm:"index:sku_id;type:int;comment:商品SKU_ID;not null"` Inventory int64 `gorm:"type:int;comment:商品库存;not null"` } type inventoryRepo struct { data *Data log *log.Helper } // NewInventoryRepo . func NewInventoryRepo(data *Data, logger log.Logger) biz.InventoryRepo { return &inventoryRepo{ data: data, log: log.NewHelper(logger), } } func (p *GoodsInventory) ToDomain() *domain.Inventory { return &domain.Inventory{ ID: p.ID, SkuID: p.SkuID, Inventory: p.Inventory, } } func (i inventoryRepo) Create(ctx context.Context, inventory *domain.Inventory) (*domain.Inventory, error) { info := GoodsInventory{ SkuID: inventory.SkuID, Inventory: inventory.Inventory, } if err := i.data.DB(ctx).Save(&info).Error; err != nil { return nil, errors.InternalServer("INENNTORY_SAVE_ERROR", err.Error()) } return info.ToDomain(), nil } ================================================ FILE: service/goods/internal/data/specifications.go ================================================ package data import ( "context" "goods/internal/biz" "goods/internal/domain" "time" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" "gorm.io/gorm" ) // SpecificationsAttr 规格参数信息表 type SpecificationsAttr struct { ID int64 `gorm:"primarykey;type:int" json:"id"` TypeID int64 `gorm:"index:type_id;type:int;comment:商品类型ID;not null"` Name string `gorm:"type:varchar(250);not null;comment:规格参数名称" json:"name"` Sort int32 `gorm:"comment:规格排序;default:99;not null;type:int" json:"sort"` Status bool `gorm:"comment:参数状态;default:false" json:"status"` IsSKU bool `gorm:"comment:是否通用的SKU持有;default:false" json:"is_sku"` IsSelect bool `gorm:"comment:是否可查询;default:false" json:"is_select"` CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } // SpecificationsAttrValue 规格参数信息选项表 type SpecificationsAttrValue struct { ID int64 `gorm:"primarykey;type:int" json:"id"` AttrId int64 `gorm:"index:attr_id;type:int;comment:规格ID;not null"` Value string `gorm:"type:varchar(250);not null;comment:规格参数信息值" json:"value"` Sort int32 `gorm:"comment:规格参数值排序;default:99;not null;type:int" json:"sort"` CreatedAt time.Time `gorm:"column:add_time" json:"created_at"` UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at"` } type specificationRepo struct { data *Data log *log.Helper } // NewSpecificationRepo . func NewSpecificationRepo(data *Data, logger log.Logger) biz.SpecificationRepo { return &specificationRepo{ data: data, log: log.NewHelper(logger), } } func (p *SpecificationsAttr) ToDomain() *domain.Specification { return &domain.Specification{ ID: p.ID, TypeID: p.TypeID, Name: p.Name, Sort: p.Sort, Status: p.Status, IsSKU: p.IsSKU, IsSelect: p.IsSelect, } } func (g *specificationRepo) CreateSpecification(ctx context.Context, req *domain.Specification) (int64, error) { s := &SpecificationsAttr{ TypeID: req.TypeID, Name: req.Name, Sort: req.Sort, Status: req.Status, IsSKU: req.IsSKU, IsSelect: req.IsSelect, CreatedAt: time.Time{}, UpdatedAt: time.Time{}, } if err := g.data.DB(ctx).Save(s).Error; err != nil { return 0, errors.InternalServer("SPECIFICATION_SAVED_ERROR", err.Error()) } return s.ID, nil } func (g *specificationRepo) CreateSpecificationValue(ctx context.Context, AttrId int64, req []*domain.SpecificationValue) error { var value []*SpecificationsAttrValue for _, v := range req { res := &SpecificationsAttrValue{ AttrId: AttrId, Value: v.Value, Sort: v.Sort, CreatedAt: time.Time{}, UpdatedAt: time.Time{}, } value = append(value, res) } if err := g.data.DB(ctx).Create(&value).Error; err != nil { return errors.InternalServer("SPECIFICATION_VALUE_SAVED_ERROR", err.Error()) } return nil } func (g *specificationRepo) ListByIds(ctx context.Context, id ...*int64) (domain.SpecificationList, error) { var l []*SpecificationsAttr if err := g.data.DB(ctx).Where("id IN (?)", id).Find(&l).Error; err != nil { return nil, errors.NotFound("SPECIFICATION_NOT_FOUND", "规格不存在") } var res domain.SpecificationList for _, item := range l { res = append(res, item.ToDomain()) } return res, nil } ================================================ FILE: service/goods/internal/domain/brand.go ================================================ package domain type Brand struct { ID int32 Name string Logo string Desc string IsTab bool Sort int32 } func (b *Brand) IsNotExist(id int32) bool { return false } type BrandList []*Brand func (b BrandList) FindById(id int32) *Brand { for _, item := range b { if item.ID == id { return item } } return nil } func (b BrandList) CheckLength(length int) bool { return len(b) == length } ================================================ FILE: service/goods/internal/domain/es_goods.go ================================================ package domain import "github.com/olivere/elastic/v7" type ESGoodsFilter struct { ID int64 CategoryID int32 BrandsID int32 Keywords string OnSale bool ShipFree bool IsNew bool IsHot bool ClickNum int64 SoldNum int64 FavNum int64 MaxPrice int64 MinPrice int64 Pages int64 PagePerNums int64 } type ESGoods struct { ID int64 `json:"id"` CategoryID int32 `json:"category_id"` CategoryName string `json:"category_name"` BrandsID int32 `json:"brands_id"` BrandName string `json:"brand_name"` TypeID int64 `json:"type_id"` TypeName string `json:"type_name"` OnSale bool `json:"on_sale"` ShipFree bool `json:"ship_free"` IsNew bool `json:"is_new"` IsHot bool `json:"is_hot"` Name string `json:"name"` GoodsTags string `json:"goods_tags"` ClickNum int64 `json:"click_num"` SoldNum int64 `json:"sold_num"` FavNum int64 `json:"fav_num"` MarketPrice int64 `json:"market_price"` GoodsBrief string `json:"goods_brief"` Pages int64 `json:"pages"` PagePerNums int64 `json:"page_pre_num"` Sku []EsSku `json:"sku"` } type EsSku struct { SkuID int64 `json:"sku_id"` SkuName string `json:"sku_name"` SkuPrice int64 `json:"sku_price"` } type EsSearch struct { MustQuery []elastic.Query MustNotQuery []elastic.Query ShouldQuery []elastic.Query Filters []elastic.Query Sorters []elastic.Sorter Form int64 // 分页 Size int64 } ================================================ FILE: service/goods/internal/domain/goods.go ================================================ package domain type Goods struct { ID int64 CategoryID int32 BrandsID int32 TypeID int64 Name string NameAlias string GoodsSn string GoodsTags string MarketPrice int64 GoodsBrief string GoodsFrontImage string GoodsImages []string OnSale bool ShipFree bool ShipID int32 IsNew bool IsHot bool ClickNum int64 SoldNum int64 FavNum int64 Sku []*GoodsSku } type GoodsInfoResponse struct { GoodsID int64 } type GoodsListResponse struct { Total int64 List []*Goods } ================================================ FILE: service/goods/internal/domain/goods_attr.go ================================================ package domain type AttrGroup struct { ID int64 TypeID int64 Title string Desc string Status bool Sort int32 } func (p AttrGroup) IsTypeIDEmpty() bool { return p.TypeID == 0 } type GoodsAttr struct { ID int64 TypeID int64 GroupID int64 Title string Sort int32 Status bool Desc string GoodsAttrValue []*GoodsAttrValue } func (p GoodsAttr) IsTypeIDEmpty() bool { return p.TypeID == 0 } type GoodsAttrValue struct { ID int64 AttrId int64 GroupID int64 Value string } func (p GoodsAttrValue) IsValueEmpty() bool { return p.Value == "" } type GoodsAttrList []*GoodsAttr func (p GoodsAttrList) FindById(id int64) *GoodsAttr { for _, item := range p { if item.ID == id { return item } } return nil } func (p GoodsAttrList) IsNotExist(groupId, attrId int64) bool { for _, item := range p { if item.GroupID != groupId && item.ID != attrId { return true } } return false } ================================================ FILE: service/goods/internal/domain/goods_sku.go ================================================ package domain type GoodsSku struct { ID int64 GoodsID int64 GoodsSn string GoodsName string SkuName string SkuCode string BarCode string Price int64 PromotionPrice int64 Points int64 RemarksInfo string Pic string Inventory int64 OnSale bool AttrInfo string Specification []*SpecificationInfo GroupAttr []*GroupAttr } type SpecificationInfo struct { SpecificationID int64 SpecificationValueID int64 } type GroupAttr struct { GroupId int64 `json:"group_id"` GroupName string `json:"group_name"` Attr []*Attr `json:"attr"` } type Attr struct { AttrID int64 `json:"attr_id"` AttrName string `json:"attr_name"` AttrValueID int64 `json:"attr_value_id"` AttrValueName string `json:"attr_value_name"` } type GoodsSpecificationSku struct { ID int64 SkuID int64 SkuCode string SpecificationId int64 ValueId int64 } ================================================ FILE: service/goods/internal/domain/goods_type.go ================================================ package domain import ( "strconv" "strings" ) type GoodsType struct { ID int64 Name string TypeCode string NameAlias string IsVirtual bool Desc string Sort int32 BrandIds string } func (b *GoodsType) IsEmpty() bool { return b.BrandIds == "" } func (b *GoodsType) FormatBrandIds() ([]int32, error) { ids := strings.Replace(b.BrandIds, ",", ",", -1) Ids := strings.Split(ids, ",") var i []int32 for _, bid := range Ids { if bid == "" { continue } j, err := strconv.ParseInt(bid, 10, 32) if err != nil { return nil, err } i = append(i, int32(j)) } return i, nil } ================================================ FILE: service/goods/internal/domain/inventory.go ================================================ package domain type Inventory struct { ID int64 SkuID int64 Inventory int64 } ================================================ FILE: service/goods/internal/domain/specification.go ================================================ package domain type SpecificationValue struct { ID int64 AttrId int64 Value string Sort int32 } type Specification struct { ID int64 TypeID int64 Name string Sort int32 Status bool IsSKU bool IsSelect bool SpecificationValue []*SpecificationValue } func (b *Specification) IsTypeIDEmpty() bool { return b.TypeID == 0 } func (b *Specification) IsValueEmpty() bool { return b.SpecificationValue == nil } type SpecificationList []*Specification func (p SpecificationList) FindById(id int64) *Specification { for _, item := range p { if item.ID == id { return item } } return nil } ================================================ FILE: service/goods/internal/server/grpc.go ================================================ package server import ( "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/logging" "github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/validate" "github.com/go-kratos/kratos/v2/transport/grpc" v1 "goods/api/goods/v1" "goods/internal/conf" "goods/internal/service" ) // NewGRPCServer new a gRPC s. func NewGRPCServer(c *conf.Server, greeter *service.GoodsService, logger log.Logger) *grpc.Server { var opts = []grpc.ServerOption{ grpc.Middleware( recovery.Recovery(), validate.Validator(), logging.Server(logger), ), } if c.Grpc.Network != "" { opts = append(opts, grpc.Network(c.Grpc.Network)) } if c.Grpc.Addr != "" { opts = append(opts, grpc.Address(c.Grpc.Addr)) } if c.Grpc.Timeout != nil { opts = append(opts, grpc.Timeout(c.Grpc.Timeout.AsDuration())) } srv := grpc.NewServer(opts...) v1.RegisterGoodsServer(srv, greeter) return srv } ================================================ FILE: service/goods/internal/server/server.go ================================================ package server import ( "github.com/go-kratos/kratos/v2/registry" "github.com/google/wire" "goods/internal/conf" "github.com/go-kratos/kratos/contrib/registry/consul/v2" consulAPI "github.com/hashicorp/consul/api" ) // ProviderSet is s providers. var ProviderSet = wire.NewSet(NewGRPCServer, NewRegistrar) // NewRegistrar 引入 consul func NewRegistrar(conf *conf.Registry) registry.Registrar { c := consulAPI.DefaultConfig() c.Address = conf.Consul.Address c.Scheme = conf.Consul.Scheme cli, err := consulAPI.NewClient(c) if err != nil { panic(err) } r := consul.New(cli, consul.WithHealthCheck(false)) return r } ================================================ FILE: service/goods/internal/service/README.md ================================================ # Service ================================================ FILE: service/goods/internal/service/brand.go ================================================ package service import ( "context" v1 "goods/api/goods/v1" "goods/internal/biz" "goods/internal/domain" "google.golang.org/protobuf/types/known/emptypb" ) // CreateBrand 创建品牌 func (g *GoodsService) CreateBrand(ctx context.Context, r *v1.BrandRequest) (*v1.BrandInfoResponse, error) { brand, err := g.bc.CreateBrand(ctx, toBiz(r)) if err != nil { return nil, err } return &v1.BrandInfoResponse{ Id: brand.ID, Name: brand.Name, Logo: brand.Logo, Desc: brand.Desc, IsTab: brand.IsTab, Sort: brand.Sort, }, nil } func (g *GoodsService) UpdateBrand(ctx context.Context, r *v1.BrandRequest) (*emptypb.Empty, error) { err := g.bc.UpdateBrand(ctx, toBiz(r)) if err != nil { return nil, err } return &emptypb.Empty{}, nil } func (g *GoodsService) BrandList(ctx context.Context, r *v1.BrandListRequest) (*v1.BrandListResponse, error) { list, total, err := g.bc.BrandList(ctx, &biz.Pagination{ PageNum: int(r.PagePerNums), PageSize: int(r.Pages), }) if err != nil { return nil, err } var rs v1.BrandListResponse rs.Total = int32(total) for _, x := range list { info := toProto(x) rs.Data = append(rs.Data, info) } return &rs, nil } func toProto(r *domain.Brand) *v1.BrandInfoResponse { return &v1.BrandInfoResponse{ Id: r.ID, Name: r.Name, Logo: r.Logo, Desc: r.Desc, IsTab: r.IsTab, Sort: r.Sort, } } func toBiz(r *v1.BrandRequest) *domain.Brand { return &domain.Brand{ ID: r.Id, Name: r.Name, Logo: r.Logo, Desc: r.Desc, IsTab: r.IsTab, Sort: r.Sort, } } ================================================ FILE: service/goods/internal/service/category.go ================================================ package service import ( "context" "encoding/json" v1 "goods/api/goods/v1" "goods/internal/biz" "google.golang.org/protobuf/types/known/emptypb" ) func (g *GoodsService) DeleteCategory(ctx context.Context, r *v1.DeleteCategoryRequest) (*emptypb.Empty, error) { err := g.cac.DeleteCategory(ctx, &biz.CategoryInfo{ ID: r.Id, }) if err != nil { return nil, err } return &emptypb.Empty{}, nil } func (g *GoodsService) UpdateCategory(ctx context.Context, r *v1.CategoryInfoRequest) (*emptypb.Empty, error) { err := g.cac.UpdateCategory(ctx, &biz.CategoryInfo{ ID: r.Id, Name: r.Name, ParentCategory: r.ParentCategory, Level: r.Level, IsTab: r.IsTab, Sort: r.Sort, }) return &emptypb.Empty{}, err } // CreateCategory 创建分类 func (g *GoodsService) CreateCategory(ctx context.Context, r *v1.CategoryInfoRequest) (*v1.CategoryInfoResponse, error) { result, err := g.cac.CreateCategory(ctx, &biz.CategoryInfo{ Name: r.Name, ParentCategory: r.ParentCategory, Level: r.Level, IsTab: r.IsTab, Sort: r.Sort, }) if err != nil { return nil, err } return &v1.CategoryInfoResponse{ Id: result.ID, Name: result.Name, ParentCategory: result.ParentCategory, Level: result.Level, IsTab: result.IsTab, Sort: result.Sort, }, nil } func (g *GoodsService) GetAllCategoryList(ctx context.Context, r *emptypb.Empty) (*v1.CategoryListResponse, error) { cate, err := g.cac.CategoryList(ctx) if err != nil { return nil, err } jsonData, _ := json.Marshal(cate) res := &v1.CategoryListResponse{ JsonData: string(jsonData), } return res, nil } // GetSubCategory 获取子分类 func (g *GoodsService) GetSubCategory(ctx context.Context, r *v1.CategoryListRequest) (*v1.SubCategoryListResponse, error) { list, err := g.cac.SubCategoryList(ctx, r.Id) if err != nil { return nil, err } categoryListRes := v1.SubCategoryListResponse{} categoryListRes.Info = &v1.CategoryInfoResponse{ Id: list.Category.ID, Name: list.Category.Name, ParentCategory: list.Category.ParentCategory, Level: list.Category.Level, IsTab: list.Category.IsTab, } var subCategoryResponse []*v1.CategoryInfoResponse for _, subC := range list.SubCategory { subCategoryResponse = append(subCategoryResponse, &v1.CategoryInfoResponse{ Id: subC.ID, Name: subC.Name, ParentCategory: subC.ParentCategory, Level: subC.Level, IsTab: subC.IsTab, }) } categoryListRes.SubCategory = subCategoryResponse return &categoryListRes, nil } ================================================ FILE: service/goods/internal/service/goods.go ================================================ package service import ( "context" v1 "goods/api/goods/v1" "goods/internal/domain" ) // CreateGoods 创建商品 func (g *GoodsService) CreateGoods(ctx context.Context, r *v1.CreateGoodsRequest) (*v1.CreateGoodsResponse, error) { var goodsSku []*domain.GoodsSku for _, sku := range r.Sku { res := &domain.GoodsSku{ GoodsName: r.Name, GoodsSn: r.GoodsSn, SkuName: sku.SkuName, SkuCode: sku.Code, BarCode: sku.BarCode, Price: sku.Price, PromotionPrice: sku.PromotionPrice, Points: sku.Points, Pic: sku.Image, Inventory: sku.Inventory, OnSale: r.OnSale, } for _, specification := range sku.SpecificationInfo { s := &domain.SpecificationInfo{ SpecificationID: specification.SId, SpecificationValueID: specification.VId, } res.Specification = append(res.Specification, s) } for _, attrGroup := range sku.GroupAttrInfo { group := &domain.GroupAttr{ GroupId: attrGroup.GroupId, GroupName: attrGroup.GroupName, } for _, attr := range attrGroup.AttrInfo { s := &domain.Attr{ AttrID: attr.AttrId, AttrName: attr.AttrName, AttrValueID: attr.AttrValueId, AttrValueName: attr.AttrValueName, } group.Attr = append(group.Attr, s) } res.GroupAttr = append(res.GroupAttr, group) } goodsSku = append(goodsSku, res) } goodsInfo := domain.Goods{ ID: r.Id, CategoryID: r.CategoryId, BrandsID: r.BrandId, TypeID: r.TypeId, Name: r.Name, NameAlias: r.NameAlias, GoodsSn: r.GoodsSn, GoodsTags: r.GoodsTags, MarketPrice: r.MarketPrice, GoodsBrief: r.GoodsBrief, GoodsFrontImage: r.GoodsFrontImage, GoodsImages: r.GoodsImages, OnSale: r.OnSale, ShipFree: r.ShipFree, ShipID: r.ShipId, IsNew: r.IsNew, IsHot: r.IsHot, Sku: goodsSku, } result, err := g.g.CreateGoods(ctx, &goodsInfo) if err != nil { return nil, err } return &v1.CreateGoodsResponse{ID: result.GoodsID}, nil } func (g *GoodsService) GoodsList(ctx context.Context, r *v1.GoodsFilterRequest) (*v1.GoodsListResponse, error) { goodsFilter := &domain.ESGoodsFilter{ ID: r.Id, CategoryID: r.CategoryId, BrandsID: r.BrandId, Keywords: r.Keywords, IsNew: r.IsNew, IsHot: r.IsHot, ClickNum: r.ClickNum, SoldNum: r.SoldNum, FavNum: r.FavNum, MaxPrice: r.MaxPrice, MinPrice: r.MinPrice, Pages: r.Pages, PagePerNums: r.PagePerNums, } result, err := g.esGoods.GoodsList(ctx, goodsFilter) if err != nil { return nil, err } response := v1.GoodsListResponse{ Total: result.Total, } for _, goods := range result.List { res := v1.GoodsInfoResponse{ Id: goods.ID, CategoryId: goods.CategoryID, BrandId: goods.BrandsID, Name: goods.Name, GoodsSn: goods.GoodsSn, ClickNum: goods.ClickNum, SoldNum: goods.SoldNum, FavNum: goods.FavNum, MarketPrice: goods.MarketPrice, GoodsBrief: goods.GoodsBrief, GoodsDesc: goods.GoodsBrief, ShipFree: goods.ShipFree, Images: goods.GoodsFrontImage, GoodsImages: goods.GoodsImages, IsNew: goods.IsNew, IsHot: goods.IsHot, OnSale: goods.OnSale, } response.List = append(response.List, &res) } return &response, nil } ================================================ FILE: service/goods/internal/service/goods_attr.go ================================================ package service import ( "context" v1 "goods/api/goods/v1" "goods/internal/domain" ) // CreateAttrGroup 创建属性组 func (g *GoodsService) CreateAttrGroup(ctx context.Context, r *v1.AttrGroupRequest) (*v1.AttrGroupResponse, error) { result, err := g.ga.CreateAttrGroup(ctx, &domain.AttrGroup{ TypeID: r.TypeId, Title: r.Title, Desc: r.Desc, Status: r.Status, Sort: r.Sort, }) if err != nil { return nil, err } return &v1.AttrGroupResponse{ Id: result.ID, TypeId: result.TypeID, Title: result.Title, Desc: result.Desc, Status: result.Status, Sort: result.Sort, }, nil } // CreateAttrValue 创建属性名称和值 func (g *GoodsService) CreateAttrValue(ctx context.Context, r *v1.AttrRequest) (*v1.AttrResponse, error) { var value []*domain.GoodsAttrValue for _, v := range r.AttrValue { res := &domain.GoodsAttrValue{ GroupID: v.GroupId, Value: v.Value, } value = append(value, res) } info, err := g.ga.CreateAttrValue(ctx, &domain.GoodsAttr{ TypeID: r.TypeId, GroupID: r.GroupId, Title: r.Title, Sort: r.Sort, Status: r.Status, Desc: r.Desc, GoodsAttrValue: value, }) if err != nil { return nil, err } var AttrValue []*v1.AttrValueResponse for _, v := range info.GoodsAttrValue { result := &v1.AttrValueResponse{ Id: v.ID, AttrId: v.AttrId, GroupId: v.GroupID, Value: v.Value, } AttrValue = append(AttrValue, result) } return &v1.AttrResponse{ Id: info.ID, TypeId: info.TypeID, GroupId: info.GroupID, Title: info.Title, Desc: info.Desc, Status: info.Status, Sort: info.Sort, AttrValue: AttrValue, }, nil } ================================================ FILE: service/goods/internal/service/goods_type.go ================================================ package service import ( "context" v1 "goods/api/goods/v1" "goods/internal/domain" ) func (g *GoodsService) CreateGoodsType(ctx context.Context, r *v1.GoodsTypeRequest) (*v1.GoodsTypeResponse, error) { id, err := g.gt.GoosTypeCreate(ctx, &domain.GoodsType{ Name: r.Name, TypeCode: r.TypeCode, NameAlias: r.NameAlias, IsVirtual: r.IsVirtual, Desc: r.Desc, Sort: r.Sort, BrandIds: r.BrandIds, }) if err != nil { return nil, err } return &v1.GoodsTypeResponse{ Id: id, }, nil } ================================================ FILE: service/goods/internal/service/service.go ================================================ package service import ( "github.com/go-kratos/kratos/v2/log" "github.com/google/wire" v1 "goods/api/goods/v1" "goods/internal/biz" ) // ProviderSet is service providers. var ProviderSet = wire.NewSet(NewGoodsService) // GoodsService is a goods service. type GoodsService struct { v1.UnimplementedGoodsServer cac *biz.CategoryUsecase bc *biz.BrandUsecase gt *biz.GoodsTypeUsecase s *biz.SpecificationUsecase ga *biz.GoodsAttrUsecase g *biz.GoodsUsecase esGoods *biz.EsGoodsUsecase log *log.Helper } // NewGoodsService new a goods service. func NewGoodsService(bc *biz.BrandUsecase, cac *biz.CategoryUsecase, gt *biz.GoodsTypeUsecase, s *biz.SpecificationUsecase, ga *biz.GoodsAttrUsecase, gc *biz.GoodsUsecase, esGoods *biz.EsGoodsUsecase, logger log.Logger) *GoodsService { return &GoodsService{ bc: bc, cac: cac, gt: gt, s: s, ga: ga, g: gc, esGoods: esGoods, log: log.NewHelper(logger), } } ================================================ FILE: service/goods/internal/service/specifications.go ================================================ package service import ( "context" v1 "goods/api/goods/v1" "goods/internal/domain" ) // CreateGoodsSpecification 创建商品规格版本 func (g *GoodsService) CreateGoodsSpecification(ctx context.Context, r *v1.SpecificationRequest) (*v1.SpecificationResponse, error) { var value []*domain.SpecificationValue // 组织规格参数值 if r.SpecificationValue != nil { for _, v := range r.SpecificationValue { res := &domain.SpecificationValue{ Value: v.Value, Sort: v.Sort, } value = append(value, res) } } id, err := g.s.CreateSpecification(ctx, &domain.Specification{ TypeID: r.TypeId, Name: r.Name, Sort: r.Sort, Status: r.Status, IsSKU: r.IsSku, IsSelect: r.IsSelect, SpecificationValue: value, }) if err != nil { return nil, err } return &v1.SpecificationResponse{ Id: id, }, nil } ================================================ FILE: service/goods/openapi.yaml ================================================ # Generated with protoc-gen-openapi # https://github.com/google/gnostic/tree/master/apps/protoc-gen-openapi openapi: 3.0.3 info: title: "" version: 0.0.1 paths: {} components: schemas: {} ================================================ FILE: service/goods/third_party/README.md ================================================ # third_party ================================================ FILE: service/goods/third_party/errors/errors.proto ================================================ syntax = "proto3"; package errors; option go_package = "github.com/go-kratos/kratos/v2/errors;errors"; option java_multiple_files = true; option java_package = "com.github.kratos.errors"; option objc_class_prefix = "KratosErrors"; import "google/protobuf/descriptor.proto"; extend google.protobuf.EnumOptions { int32 default_code = 1108; } extend google.protobuf.EnumValueOptions { int32 code = 1109; } ================================================ FILE: service/goods/third_party/google/api/annotations.proto ================================================ // Copyright (c) 2015, Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/api/http.proto"; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "AnnotationsProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.MethodOptions { // See `HttpRule`. HttpRule http = 72295728; } ================================================ FILE: service/goods/third_party/google/api/client.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "ClientProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.ServiceOptions { // The hostname for this service. // This should be specified with no prefix or protocol. // // Example: // // service Foo { // option (google.api.default_host) = "foo.googleapi.com"; // ... // } string default_host = 1049; // OAuth scopes needed for the client. // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform"; // ... // } // // If there is more than one scope, use a comma-separated string: // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform," // "https://www.googleapis.com/auth/monitoring"; // ... // } string oauth_scopes = 1050; } extend google.protobuf.MethodOptions { // A definition of a client library method signature. // // In client libraries, each proto RPC corresponds to one or more methods // which the end user is able to call, and calls the underlying RPC. // Normally, this method receives a single argument (a struct or instance // corresponding to the RPC request object). Defining this field will // add one or more overloads providing flattened or simpler method signatures // in some languages. // // The fields on the method signature are provided as a comma-separated // string. // // For example, the proto RPC and annotation: // // rpc CreateSubscription(CreateSubscriptionRequest) // returns (Subscription) { // option (google.api.method_signature) = "name,topic"; // } // // Would add the following Java overload (in addition to the method accepting // the request object): // // public final Subscription createSubscription(String name, String topic) // // The following backwards-compatibility guidelines apply: // // * Adding this annotation to an unannotated method is backwards // compatible. // * Adding this annotation to a method which already has existing // method signature annotations is backwards compatible if and only if // the new method signature annotation is last in the sequence. // * Modifying or removing an existing method signature annotation is // a breaking change. // * Re-ordering existing method signature annotations is a breaking // change. repeated string method_signature = 1051; } ================================================ FILE: service/goods/third_party/google/api/field_behavior.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "FieldBehaviorProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // An indicator of the behavior of a given field (for example, that a field // is required in requests, or given as output but ignored as input). // This **does not** change the behavior in protocol buffers itself; it only // denotes the behavior and may affect how API tooling handles the field. // // Note: This enum **may** receive new values in the future. enum FieldBehavior { // Conventional default for enums. Do not use this. FIELD_BEHAVIOR_UNSPECIFIED = 0; // Specifically denotes a field as optional. // While all fields in protocol buffers are optional, this may be specified // for emphasis if appropriate. OPTIONAL = 1; // Denotes a field as required. // This indicates that the field **must** be provided as part of the request, // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). REQUIRED = 2; // Denotes a field as output only. // This indicates that the field is provided in responses, but including the // field in a request does nothing (the server *must* ignore it and // *must not* throw an error as a result of the field's presence). OUTPUT_ONLY = 3; // Denotes a field as input only. // This indicates that the field is provided in requests, and the // corresponding field is not included in output. INPUT_ONLY = 4; // Denotes a field as immutable. // This indicates that the field may be set once in a request to create a // resource, but may not be changed thereafter. IMMUTABLE = 5; } extend google.protobuf.FieldOptions { // A designation of a specific field behavior (required, output only, etc.) // in protobuf messages. // // Examples: // // string name = 1 [(google.api.field_behavior) = REQUIRED]; // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // google.protobuf.Duration ttl = 1 // [(google.api.field_behavior) = INPUT_ONLY]; // google.protobuf.Timestamp expire_time = 1 // [(google.api.field_behavior) = OUTPUT_ONLY, // (google.api.field_behavior) = IMMUTABLE]; repeated FieldBehavior field_behavior = 1052; } ================================================ FILE: service/goods/third_party/google/api/http.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "HttpProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Defines the HTTP configuration for an API service. It contains a list of // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method // to one or more HTTP REST API methods. message Http { // A list of HTTP configuration rules that apply to individual API methods. // // **NOTE:** All service configuration rules follow "last one wins" order. repeated HttpRule rules = 1; // When set to true, URL path parameters will be fully URI-decoded except in // cases of single segment matches in reserved expansion, where "%2F" will be // left encoded. // // The default behavior is to not decode RFC 6570 reserved characters in multi // segment matches. bool fully_decode_reserved_expansion = 2; } // # gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service // that supports both gRPC APIs and REST APIs. Many systems, including [Google // APIs](https://github.com/googleapis/googleapis), // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC // Gateway](https://github.com/grpc-ecosystem/grpc-gateway), // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature // and use it for large scale production services. // // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies // how different portions of the gRPC request message are mapped to the URL // path, URL query parameters, and HTTP request body. It also controls how the // gRPC response message is mapped to the HTTP response body. `HttpRule` is // typically specified as an `google.api.http` annotation on the gRPC method. // // Each mapping specifies a URL path template and an HTTP method. The path // template may refer to one or more fields in the gRPC request message, as long // as each field is a non-repeated field with a primitive (non-message) type. // The path template controls how fields of the request message are mapped to // the URL path. // // Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/{name=messages/*}" // }; // } // } // message GetMessageRequest { // string name = 1; // Mapped to URL path. // } // message Message { // string text = 1; // The resource content. // } // // This enables an HTTP REST to gRPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. // For example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get:"/v1/messages/{message_id}" // }; // } // } // message GetMessageRequest { // message SubMessage { // string subfield = 1; // } // string message_id = 1; // Mapped to URL path. // int64 revision = 2; // Mapped to URL query parameter `revision`. // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. // } // // This enables a HTTP JSON to RPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: // "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. // In the case of a repeated type, the parameter can be repeated in the URL // as `...?param=A¶m=B`. In the case of a message type, each field of the // message is mapped to a separate parameter, such as // `...?foo.a=A&foo.b=B&foo.c=C`. // // For HTTP methods that allow a request body, the `body` field // specifies the mapping. Consider a REST update method on the // message resource collection: // // service Messaging { // rpc UpdateMessage(UpdateMessageRequest) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "message" // }; // } // } // message UpdateMessageRequest { // string message_id = 1; // mapped to the URL // Message message = 2; // mapped to the body // } // // The following HTTP JSON to RPC mapping is enabled, where the // representation of the JSON in the request body is determined by // protos JSON encoding: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the // request body. This enables the following alternative definition of // the update method: // // service Messaging { // rpc UpdateMessage(Message) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "*" // }; // } // } // message Message { // string message_id = 1; // string text = 2; // } // // // The following HTTP JSON to RPC mapping is enabled: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in // the body. This makes this option more rarely used in practice when // defining REST APIs. The common usage of `*` is in custom methods // which don't use the URL at all for transferring data. // // It is possible to define multiple HTTP methods for one RPC by using // the `additional_bindings` option. Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/messages/{message_id}" // additional_bindings { // get: "/v1/users/{user_id}/messages/{message_id}" // } // }; // } // } // message GetMessageRequest { // string message_id = 1; // string user_id = 2; // } // // This enables the following two alternative HTTP JSON to RPC mappings: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: // "123456")` // // ## Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: // - Fields referred by the path template. They are passed via the URL path. // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP // request body. // - All other fields are passed via the URL query parameters, and the // parameter name is the field path in the request message. A repeated // field can be represented as multiple query parameters under the same // name. // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields // are passed via URL path and HTTP request body. // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all // fields are passed via URL path and URL query parameters. // // ### Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; // Segment = "*" | "**" | LITERAL | Variable ; // Variable = "{" FieldPath [ "=" Segments ] "}" ; // FieldPath = IDENT { "." IDENT } ; // Verb = ":" LITERAL ; // // The syntax `*` matches a single URL path segment. The syntax `**` matches // zero or more URL path segments, which must be the last part of the URL path // except the `Verb`. // // The syntax `Variable` matches part of the URL path as specified by its // template. A variable template must not contain other variables. If a variable // matches a single path segment, its template may be omitted, e.g. `{var}` // is equivalent to `{var=*}`. // // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` // contains any reserved character, such characters should be percent-encoded // before the matching. // // If a variable contains exactly one path segment, such as `"{var}"` or // `"{var=*}"`, when such a variable is expanded into a URL path on the client // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The // server side does the reverse decoding. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{var}`. // // If a variable contains multiple path segments, such as `"{var=foo/*}"` // or `"{var=**}"`, when such a variable is expanded into a URL path on the // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. // The server side does the reverse decoding, except "%2F" and "%2f" are left // unchanged. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // // ## Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The // service config is simply the YAML representation of the `google.api.Service` // proto message. // // As an alternative to annotating your proto file, you can configure gRPC // transcoding in your service config YAML files. You do this by specifying a // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same // effect as the proto annotation. This can be particularly useful if you // have a proto that is reused in multiple services. Note that any transcoding // specified in the service config will override any matching transcoding // configuration in the proto. // // Example: // // http: // rules: // # Selects a gRPC method and applies HttpRule to it. // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // // ## Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 // specification](https://developers.google.com/protocol-buffers/docs/proto3#json). // // While the single segment variable follows the semantics of // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String // Expansion, the multi segment variable **does not** follow RFC 6570 Section // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion // does not expand special characters like `?` and `#`, which would lead // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding // for multi segment variables. // // The path variables **must not** refer to any repeated or mapped field, // because client libraries are not capable of handling such variable expansion. // // The path variables **must not** capture the leading "/" character. The reason // is that the most common use case "{var}" does not capture the leading "/" // character. For consistency, all path variables must share the same behavior. // // Repeated message fields must not be mapped to URL query parameters, because // no client library can support such complicated mapping. // // If an API needs to use a JSON array for request or response body, it can map // the request or response body to a repeated field. However, some gRPC // Transcoding implementations may not support this feature. message HttpRule { // Selects a method to which this rule applies. // // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. string selector = 1; // Determines the URL pattern is matched by this rules. This pattern can be // used with any of the {get|put|post|delete|patch} methods. A custom method // can be defined using the 'custom' field. oneof pattern { // Maps to HTTP GET. Used for listing and getting information about // resources. string get = 2; // Maps to HTTP PUT. Used for replacing a resource. string put = 3; // Maps to HTTP POST. Used for creating a resource or performing an action. string post = 4; // Maps to HTTP DELETE. Used for deleting a resource. string delete = 5; // Maps to HTTP PATCH. Used for updating a resource. string patch = 6; // The custom pattern is used for specifying an HTTP method that is not // included in the `pattern` field, such as HEAD, or "*" to leave the // HTTP method unspecified for this rule. The wild-card rule is useful // for services that provide content to Web (HTML) clients. CustomHttpPattern custom = 8; } // The name of the request field whose value is mapped to the HTTP request // body, or `*` for mapping all request fields not captured by the path // pattern to the HTTP body, or omitted for not having any HTTP request body. // // NOTE: the referred field must be present at the top-level of the request // message type. string body = 7; // Optional. The name of the response field whose value is mapped to the HTTP // response body. When omitted, the entire response message will be used // as the HTTP response body. // // NOTE: The referred field must be present at the top-level of the response // message type. string response_body = 12; // Additional HTTP bindings for the selector. Nested bindings must // not contain an `additional_bindings` field themselves (that is, // the nesting may only be one level deep). repeated HttpRule additional_bindings = 11; } // A custom pattern is used for defining custom HTTP verb. message CustomHttpPattern { // The name of this custom HTTP verb. string kind = 1; // The path matched by this custom verb. string path = 2; } ================================================ FILE: service/goods/third_party/google/api/httpbody.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/any.proto"; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; option java_multiple_files = true; option java_outer_classname = "HttpBodyProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Message that represents an arbitrary HTTP body. It should only be used for // payload formats that can't be represented as JSON, such as raw binary or // an HTML page. // // // This message can be used both in streaming and non-streaming API methods in // the request as well as the response. // // It can be used as a top-level request field, which is convenient if one // wants to extract parameters from either the URL or HTTP template into the // request fields and also want access to the raw HTTP body. // // Example: // // message GetResourceRequest { // // A unique request id. // string request_id = 1; // // // The raw HTTP body is bound to this field. // google.api.HttpBody http_body = 2; // } // // service ResourceService { // rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); // rpc UpdateResource(google.api.HttpBody) returns // (google.protobuf.Empty); // } // // Example with streaming methods: // // service CaldavService { // rpc GetCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // rpc UpdateCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // } // // Use of this type only changes how the request and response bodies are // handled, all other features will continue to work unchanged. message HttpBody { // The HTTP Content-Type header value specifying the content type of the body. string content_type = 1; // The HTTP request/response body as raw binary. bytes data = 2; // Application specific response metadata. Must be set in the first response // for streaming APIs. repeated google.protobuf.Any extensions = 3; } ================================================ FILE: service/goods/third_party/google/protobuf/any.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "google.golang.org/protobuf/types/known/anypb"; option java_package = "com.google.protobuf"; option java_outer_classname = "AnyProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // // Protobuf library provides support to pack/unpack Any values in the form // of utility functions or additional generated methods of the Any type. // // Example 1: Pack and unpack a message in C++. // // Foo foo = ...; // Any any; // any.PackFrom(foo); // ... // if (any.UnpackTo(&foo)) { // ... // } // // Example 2: Pack and unpack a message in Java. // // Foo foo = ...; // Any any = Any.pack(foo); // ... // if (any.is(Foo.class)) { // foo = any.unpack(Foo.class); // } // // Example 3: Pack and unpack a message in Python. // // foo = Foo(...) // any = Any() // any.Pack(foo) // ... // if any.Is(Foo.DESCRIPTOR): // any.Unpack(foo) // ... // // Example 4: Pack and unpack a message in Go // // foo := &pb.Foo{...} // any, err := anypb.New(foo) // if err != nil { // ... // } // ... // foo := &pb.Foo{} // if err := any.UnmarshalTo(foo); err != nil { // ... // } // // The pack methods provided by protobuf library will by default use // 'type.googleapis.com/full.type.name' as the type URL and the unpack // methods only use the fully qualified type name after the last '/' // in the type URL, for example "foo.bar.com/x/y.z" will yield type // name "y.z". // // // JSON // // The JSON representation of an `Any` value uses the regular // representation of the deserialized, embedded message, with an // additional field `@type` which contains the type URL. Example: // // package google.profile; // message Person { // string first_name = 1; // string last_name = 2; // } // // { // "@type": "type.googleapis.com/google.profile.Person", // "firstName": , // "lastName": // } // // If the embedded message type is well-known and has a custom JSON // representation, that representation will be embedded adding a field // `value` which holds the custom JSON in addition to the `@type` // field. Example (for message [google.protobuf.Duration][]): // // { // "@type": "type.googleapis.com/google.protobuf.Duration", // "value": "1.212s" // } // message Any { // A URL/resource name that uniquely identifies the type of the serialized // protocol buffer message. This string must contain at least // one "/" character. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). // // In practice, teams usually precompile into the binary all types that they // expect it to use in the context of Any. However, for URLs which use the // scheme `http`, `https`, or no scheme, one can optionally set up a type // server that maps type URLs to message definitions as follows: // // * If no scheme is provided, `https` is assumed. // * An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // * Applications are allowed to cache lookup results based on the // URL, or have them precompiled into a binary to avoid any // lookup. Therefore, binary compatibility needs to be preserved // on changes to types. (Use versioned type names to manage // breaking changes.) // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with // type.googleapis.com. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. // string type_url = 1; // Must be a valid serialized protocol buffer of the above specified type. bytes value = 2; } ================================================ FILE: service/goods/third_party/google/protobuf/api.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; import "google/protobuf/source_context.proto"; import "google/protobuf/type.proto"; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "ApiProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/apipb"; // Api is a light-weight descriptor for an API Interface. // // Interfaces are also described as "protocol buffer services" in some contexts, // such as by the "service" keyword in a .proto file, but they are different // from API Services, which represent a concrete implementation of an interface // as opposed to simply a description of methods and bindings. They are also // sometimes simply referred to as "APIs" in other contexts, such as the name of // this message itself. See https://cloud.google.com/apis/design/glossary for // detailed terminology. message Api { // The fully qualified name of this interface, including package name // followed by the interface's simple name. string name = 1; // The methods of this interface, in unspecified order. repeated Method methods = 2; // Any metadata attached to the interface. repeated Option options = 3; // A version string for this interface. If specified, must have the form // `major-version.minor-version`, as in `1.10`. If the minor version is // omitted, it defaults to zero. If the entire version field is empty, the // major version is derived from the package name, as outlined below. If the // field is not empty, the version in the package name will be verified to be // consistent with what is provided here. // // The versioning schema uses [semantic // versioning](http://semver.org) where the major version number // indicates a breaking change and the minor version an additive, // non-breaking change. Both version numbers are signals to users // what to expect from different versions, and should be carefully // chosen based on the product plan. // // The major version is also reflected in the package name of the // interface, which must end in `v`, as in // `google.feature.v1`. For major versions 0 and 1, the suffix can // be omitted. Zero major versions must only be used for // experimental, non-GA interfaces. // // string version = 4; // Source context for the protocol buffer service represented by this // message. SourceContext source_context = 5; // Included interfaces. See [Mixin][]. repeated Mixin mixins = 6; // The source syntax of the service. Syntax syntax = 7; } // Method represents a method of an API interface. message Method { // The simple name of this method. string name = 1; // A URL of the input message type. string request_type_url = 2; // If true, the request is streamed. bool request_streaming = 3; // The URL of the output message type. string response_type_url = 4; // If true, the response is streamed. bool response_streaming = 5; // Any metadata attached to the method. repeated Option options = 6; // The source syntax of this method. Syntax syntax = 7; } // Declares an API Interface to be included in this interface. The including // interface must redeclare all the methods from the included interface, but // documentation and options are inherited as follows: // // - If after comment and whitespace stripping, the documentation // string of the redeclared method is empty, it will be inherited // from the original method. // // - Each annotation belonging to the service config (http, // visibility) which is not set in the redeclared method will be // inherited. // // - If an http annotation is inherited, the path pattern will be // modified as follows. Any version prefix will be replaced by the // version of the including interface plus the [root][] path if // specified. // // Example of a simple mixin: // // package google.acl.v1; // service AccessControl { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v1/{resource=**}:getAcl"; // } // } // // package google.storage.v2; // service Storage { // rpc GetAcl(GetAclRequest) returns (Acl); // // // Get a data record. // rpc GetData(GetDataRequest) returns (Data) { // option (google.api.http).get = "/v2/{resource=**}"; // } // } // // Example of a mixin configuration: // // apis: // - name: google.storage.v2.Storage // mixins: // - name: google.acl.v1.AccessControl // // The mixin construct implies that all methods in `AccessControl` are // also declared with same name and request/response types in // `Storage`. A documentation generator or annotation processor will // see the effective `Storage.GetAcl` method after inheriting // documentation and annotations as follows: // // service Storage { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v2/{resource=**}:getAcl"; // } // ... // } // // Note how the version in the path pattern changed from `v1` to `v2`. // // If the `root` field in the mixin is specified, it should be a // relative path under which inherited HTTP paths are placed. Example: // // apis: // - name: google.storage.v2.Storage // mixins: // - name: google.acl.v1.AccessControl // root: acls // // This implies the following inherited HTTP annotation: // // service Storage { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; // } // ... // } message Mixin { // The fully qualified name of the interface which is included. string name = 1; // If non-empty specifies a path under which inherited HTTP paths // are rooted. string root = 2; } ================================================ FILE: service/goods/third_party/google/protobuf/compiler/plugin.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // // WARNING: The plugin interface is currently EXPERIMENTAL and is subject to // change. // // protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is // just a program that reads a CodeGeneratorRequest from stdin and writes a // CodeGeneratorResponse to stdout. // // Plugins written using C++ can use google/protobuf/compiler/plugin.h instead // of dealing with the raw protocol defined here. // // A plugin executable needs only to be placed somewhere in the path. The // plugin should be named "protoc-gen-$NAME", and will then be used when the // flag "--${NAME}_out" is passed to protoc. syntax = "proto2"; package google.protobuf.compiler; option java_package = "com.google.protobuf.compiler"; option java_outer_classname = "PluginProtos"; option go_package = "google.golang.org/protobuf/types/pluginpb"; import "google/protobuf/descriptor.proto"; // The version number of protocol compiler. message Version { optional int32 major = 1; optional int32 minor = 2; optional int32 patch = 3; // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should // be empty for mainline stable releases. optional string suffix = 4; } // An encoded CodeGeneratorRequest is written to the plugin's stdin. message CodeGeneratorRequest { // The .proto files that were explicitly listed on the command-line. The // code generator should generate code only for these files. Each file's // descriptor will be included in proto_file, below. repeated string file_to_generate = 1; // The generator parameter passed on the command-line. optional string parameter = 2; // FileDescriptorProtos for all files in files_to_generate and everything // they import. The files will appear in topological order, so each file // appears before any file that imports it. // // protoc guarantees that all proto_files will be written after // the fields above, even though this is not technically guaranteed by the // protobuf wire format. This theoretically could allow a plugin to stream // in the FileDescriptorProtos and handle them one by one rather than read // the entire set into memory at once. However, as of this writing, this // is not similarly optimized on protoc's end -- it will store all fields in // memory at once before sending them to the plugin. // // Type names of fields and extensions in the FileDescriptorProto are always // fully qualified. repeated FileDescriptorProto proto_file = 15; // The version number of protocol compiler. optional Version compiler_version = 3; } // The plugin writes an encoded CodeGeneratorResponse to stdout. message CodeGeneratorResponse { // Error message. If non-empty, code generation failed. The plugin process // should exit with status code zero even if it reports an error in this way. // // This should be used to indicate errors in .proto files which prevent the // code generator from generating correct code. Errors which indicate a // problem in protoc itself -- such as the input CodeGeneratorRequest being // unparseable -- should be reported by writing a message to stderr and // exiting with a non-zero status code. optional string error = 1; // A bitmask of supported features that the code generator supports. // This is a bitwise "or" of values from the Feature enum. optional uint64 supported_features = 2; // Sync with code_generator.h. enum Feature { FEATURE_NONE = 0; FEATURE_PROTO3_OPTIONAL = 1; } // Represents a single generated file. message File { // The file name, relative to the output directory. The name must not // contain "." or ".." components and must be relative, not be absolute (so, // the file cannot lie outside the output directory). "/" must be used as // the path separator, not "\". // // If the name is omitted, the content will be appended to the previous // file. This allows the generator to break large files into small chunks, // and allows the generated text to be streamed back to protoc so that large // files need not reside completely in memory at one time. Note that as of // this writing protoc does not optimize for this -- it will read the entire // CodeGeneratorResponse before writing files to disk. optional string name = 1; // If non-empty, indicates that the named file should already exist, and the // content here is to be inserted into that file at a defined insertion // point. This feature allows a code generator to extend the output // produced by another code generator. The original generator may provide // insertion points by placing special annotations in the file that look // like: // @@protoc_insertion_point(NAME) // The annotation can have arbitrary text before and after it on the line, // which allows it to be placed in a comment. NAME should be replaced with // an identifier naming the point -- this is what other generators will use // as the insertion_point. Code inserted at this point will be placed // immediately above the line containing the insertion point (thus multiple // insertions to the same point will come out in the order they were added). // The double-@ is intended to make it unlikely that the generated code // could contain things that look like insertion points by accident. // // For example, the C++ code generator places the following line in the // .pb.h files that it generates: // // @@protoc_insertion_point(namespace_scope) // This line appears within the scope of the file's package namespace, but // outside of any particular class. Another plugin can then specify the // insertion_point "namespace_scope" to generate additional classes or // other declarations that should be placed in this scope. // // Note that if the line containing the insertion point begins with // whitespace, the same whitespace will be added to every line of the // inserted text. This is useful for languages like Python, where // indentation matters. In these languages, the insertion point comment // should be indented the same amount as any inserted code will need to be // in order to work correctly in that context. // // The code generator that generates the initial file and the one which // inserts into it must both run as part of a single invocation of protoc. // Code generators are executed in the order in which they appear on the // command line. // // If |insertion_point| is present, |name| must also be present. optional string insertion_point = 2; // The file contents. optional string content = 15; // Information describing the file content being inserted. If an insertion // point is used, this information will be appropriately offset and inserted // into the code generation metadata for the generated files. optional GeneratedCodeInfo generated_code_info = 16; } repeated File file = 15; } ================================================ FILE: service/goods/third_party/google/protobuf/descriptor.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. // // The messages in this file describe the definitions found in .proto files. // A valid .proto file can be translated directly to a FileDescriptorProto // without any other information (e.g. without reading its imports). syntax = "proto2"; package google.protobuf; option go_package = "google.golang.org/protobuf/types/descriptorpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; option csharp_namespace = "Google.Protobuf.Reflection"; option objc_class_prefix = "GPB"; option cc_enable_arenas = true; // descriptor.proto must be optimized for speed because reflection-based // algorithms don't work during bootstrapping. option optimize_for = SPEED; // The protocol compiler can output a FileDescriptorSet containing the .proto // files it parses. message FileDescriptorSet { repeated FileDescriptorProto file = 1; } // Describes a complete .proto file. message FileDescriptorProto { optional string name = 1; // file name, relative to root of source tree optional string package = 2; // e.g. "foo", "foo.bar", etc. // Names of files imported by this file. repeated string dependency = 3; // Indexes of the public imported files in the dependency list above. repeated int32 public_dependency = 10; // Indexes of the weak imported files in the dependency list. // For Google-internal migration only. Do not use. repeated int32 weak_dependency = 11; // All top-level definitions in this file. repeated DescriptorProto message_type = 4; repeated EnumDescriptorProto enum_type = 5; repeated ServiceDescriptorProto service = 6; repeated FieldDescriptorProto extension = 7; optional FileOptions options = 8; // This field contains optional information about the original source code. // You may safely remove this entire field without harming runtime // functionality of the descriptors -- the information is needed only by // development tools. optional SourceCodeInfo source_code_info = 9; // The syntax of the proto file. // The supported values are "proto2" and "proto3". optional string syntax = 12; } // Describes a message type. message DescriptorProto { optional string name = 1; repeated FieldDescriptorProto field = 2; repeated FieldDescriptorProto extension = 6; repeated DescriptorProto nested_type = 3; repeated EnumDescriptorProto enum_type = 4; message ExtensionRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. optional ExtensionRangeOptions options = 3; } repeated ExtensionRange extension_range = 5; repeated OneofDescriptorProto oneof_decl = 8; optional MessageOptions options = 7; // Range of reserved tag numbers. Reserved tag numbers may not be used by // fields or extension ranges in the same message. Reserved ranges may // not overlap. message ReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. } repeated ReservedRange reserved_range = 9; // Reserved field names, which may not be used by fields in the same message. // A given name may only be reserved once. repeated string reserved_name = 10; } message ExtensionRangeOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // Describes a field within a message. message FieldDescriptorProto { enum Type { // 0 is reserved for errors. // Order is weird for historical reasons. TYPE_DOUBLE = 1; TYPE_FLOAT = 2; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. TYPE_INT64 = 3; TYPE_UINT64 = 4; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. TYPE_INT32 = 5; TYPE_FIXED64 = 6; TYPE_FIXED32 = 7; TYPE_BOOL = 8; TYPE_STRING = 9; // Tag-delimited aggregate. // Group type is deprecated and not supported in proto3. However, Proto3 // implementations should still be able to parse the group wire format and // treat group fields as unknown fields. TYPE_GROUP = 10; TYPE_MESSAGE = 11; // Length-delimited aggregate. // New in version 2. TYPE_BYTES = 12; TYPE_UINT32 = 13; TYPE_ENUM = 14; TYPE_SFIXED32 = 15; TYPE_SFIXED64 = 16; TYPE_SINT32 = 17; // Uses ZigZag encoding. TYPE_SINT64 = 18; // Uses ZigZag encoding. } enum Label { // 0 is reserved for errors LABEL_OPTIONAL = 1; LABEL_REQUIRED = 2; LABEL_REPEATED = 3; } optional string name = 1; optional int32 number = 3; optional Label label = 4; // If type_name is set, this need not be set. If both this and type_name // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. optional Type type = 5; // For message and enum types, this is the name of the type. If the name // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping // rules are used to find the type (i.e. first the nested types within this // message are searched, then within the parent, on up to the root // namespace). optional string type_name = 6; // For extensions, this is the name of the type being extended. It is // resolved in the same manner as type_name. optional string extendee = 2; // For numeric types, contains the original text representation of the value. // For booleans, "true" or "false". // For strings, contains the default text contents (not escaped in any way). // For bytes, contains the C escaped value. All bytes >= 128 are escaped. optional string default_value = 7; // If set, gives the index of a oneof in the containing type's oneof_decl // list. This field is a member of that oneof. optional int32 oneof_index = 9; // JSON name of this field. The value is set by protocol compiler. If the // user has set a "json_name" option on this field, that option's value // will be used. Otherwise, it's deduced from the field's name by converting // it to camelCase. optional string json_name = 10; optional FieldOptions options = 8; // If true, this is a proto3 "optional". When a proto3 field is optional, it // tracks presence regardless of field type. // // When proto3_optional is true, this field must be belong to a oneof to // signal to old proto3 clients that presence is tracked for this field. This // oneof is known as a "synthetic" oneof, and this field must be its sole // member (each proto3 optional field gets its own synthetic oneof). Synthetic // oneofs exist in the descriptor only, and do not generate any API. Synthetic // oneofs must be ordered after all "real" oneofs. // // For message fields, proto3_optional doesn't create any semantic change, // since non-repeated message fields always track presence. However it still // indicates the semantic detail of whether the user wrote "optional" or not. // This can be useful for round-tripping the .proto file. For consistency we // give message fields a synthetic oneof also, even though it is not required // to track presence. This is especially important because the parser can't // tell if a field is a message or an enum, so it must always create a // synthetic oneof. // // Proto2 optional fields do not set this flag, because they already indicate // optional with `LABEL_OPTIONAL`. optional bool proto3_optional = 17; } // Describes a oneof. message OneofDescriptorProto { optional string name = 1; optional OneofOptions options = 2; } // Describes an enum type. message EnumDescriptorProto { optional string name = 1; repeated EnumValueDescriptorProto value = 2; optional EnumOptions options = 3; // Range of reserved numeric values. Reserved values may not be used by // entries in the same enum. Reserved ranges may not overlap. // // Note that this is distinct from DescriptorProto.ReservedRange in that it // is inclusive such that it can appropriately represent the entire int32 // domain. message EnumReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Inclusive. } // Range of reserved numeric values. Reserved numeric values may not be used // by enum values in the same enum declaration. Reserved ranges may not // overlap. repeated EnumReservedRange reserved_range = 4; // Reserved enum value names, which may not be reused. A given name may only // be reserved once. repeated string reserved_name = 5; } // Describes a value within an enum. message EnumValueDescriptorProto { optional string name = 1; optional int32 number = 2; optional EnumValueOptions options = 3; } // Describes a service. message ServiceDescriptorProto { optional string name = 1; repeated MethodDescriptorProto method = 2; optional ServiceOptions options = 3; } // Describes a method of a service. message MethodDescriptorProto { optional string name = 1; // Input and output type names. These are resolved in the same way as // FieldDescriptorProto.type_name, but must refer to a message type. optional string input_type = 2; optional string output_type = 3; optional MethodOptions options = 4; // Identifies if client streams multiple client messages optional bool client_streaming = 5 [default = false]; // Identifies if server streams multiple server messages optional bool server_streaming = 6 [default = false]; } // =================================================================== // Options // Each of the definitions above may have "options" attached. These are // just annotations which may cause code to be generated slightly differently // or may contain hints for code that manipulates protocol messages. // // Clients may define custom options as extensions of the *Options messages. // These extensions may not yet be known at parsing time, so the parser cannot // store the values in them. Instead it stores them in a field in the *Options // message called uninterpreted_option. This field must have the same name // across all *Options messages. We then use this field to populate the // extensions when we build a descriptor, at which point all protos have been // parsed and so all extensions are known. // // Extension numbers for custom options may be chosen as follows: // * For options which will only be used within a single application or // organization, or for experimental options, use field numbers 50000 // through 99999. It is up to you to ensure that you do not use the // same number for multiple options. // * For options which will be published and used publicly by multiple // independent entities, e-mail protobuf-global-extension-registry@google.com // to reserve extension numbers. Simply provide your project name (e.g. // Objective-C plugin) and your project website (if available) -- there's no // need to explain how you intend to use them. Usually you only need one // extension number. You can declare multiple options with only one extension // number by putting them in a sub-message. See the Custom Options section of // the docs for examples: // https://developers.google.com/protocol-buffers/docs/proto#options // If this turns out to be popular, a web service will be set up // to automatically assign option numbers. message FileOptions { // Sets the Java package where classes generated from this .proto will be // placed. By default, the proto package is used, but this is often // inappropriate because proto packages do not normally start with backwards // domain names. optional string java_package = 1; // Controls the name of the wrapper Java class generated for the .proto file. // That class will always contain the .proto file's getDescriptor() method as // well as any top-level extensions defined in the .proto file. // If java_multiple_files is disabled, then all the other classes from the // .proto file will be nested inside the single wrapper outer class. optional string java_outer_classname = 8; // If enabled, then the Java code generator will generate a separate .java // file for each top-level message, enum, and service defined in the .proto // file. Thus, these types will *not* be nested inside the wrapper class // named by java_outer_classname. However, the wrapper class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. optional bool java_multiple_files = 10 [default = false]; // This option does nothing. optional bool java_generate_equals_and_hash = 20 [deprecated=true]; // If set true, then the Java2 code generator will generate code that // throws an exception whenever an attempt is made to assign a non-UTF-8 // byte sequence to a string field. // Message reflection will do the same. // However, an extension field still accepts non-UTF-8 byte sequences. // This option has no effect on when used with the lite runtime. optional bool java_string_check_utf8 = 27 [default = false]; // Generated classes can be optimized for speed or code size. enum OptimizeMode { SPEED = 1; // Generate complete code for parsing, serialization, // etc. CODE_SIZE = 2; // Use ReflectionOps to implement these methods. LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. } optional OptimizeMode optimize_for = 9 [default = SPEED]; // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: // - The basename of the package import path, if provided. // - Otherwise, the package statement in the .proto file, if present. // - Otherwise, the basename of the .proto file, without extension. optional string go_package = 11; // Should generic services be generated in each language? "Generic" services // are not specific to any particular RPC system. They are generated by the // main code generators in each language (without additional plugins). // Generic services were the only kind of service generation supported by // early versions of google.protobuf. // // Generic services are now considered deprecated in favor of using plugins // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. optional bool cc_generic_services = 16 [default = false]; optional bool java_generic_services = 17 [default = false]; optional bool py_generic_services = 18 [default = false]; optional bool php_generic_services = 42 [default = false]; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. optional bool deprecated = 23 [default = false]; // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. optional bool cc_enable_arenas = 31 [default = true]; // Sets the objective c class prefix which is prepended to all objective c // generated classes from this .proto. There is no default. optional string objc_class_prefix = 36; // Namespace for generated classes; defaults to the package. optional string csharp_namespace = 37; // By default Swift generators will take the proto package and CamelCase it // replacing '.' with underscore and use that to prefix the types/symbols // defined. When this options is provided, they will use this value instead // to prefix the types/symbols defined. optional string swift_prefix = 39; // Sets the php class prefix which is prepended to all php generated classes // from this .proto. Default is empty. optional string php_class_prefix = 40; // Use this option to change the namespace of php generated classes. Default // is empty. When this option is empty, the package name will be used for // determining the namespace. optional string php_namespace = 41; // Use this option to change the namespace of php generated metadata classes. // Default is empty. When this option is empty, the proto file name will be // used for determining the namespace. optional string php_metadata_namespace = 44; // Use this option to change the package of ruby generated classes. Default // is empty. When this option is not set, the package name will be used for // determining the ruby package. optional string ruby_package = 45; // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. // See the documentation for the "Options" section above. extensions 1000 to max; reserved 38; } message MessageOptions { // Set true to use the old proto1 MessageSet wire format for extensions. // This is provided for backwards-compatibility with the MessageSet wire // format. You should not use this for any other reason: It's less // efficient, has fewer features, and is more complicated. // // The message must be defined exactly as follows: // message Foo { // option message_set_wire_format = true; // extensions 4 to max; // } // Note that the message cannot have any defined fields; MessageSets only // have extensions. // // All extensions of your type must be singular messages; e.g. they cannot // be int32s, enums, or repeated messages. // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. optional bool message_set_wire_format = 1 [default = false]; // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". optional bool no_standard_descriptor_accessor = 2 [default = false]; // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. optional bool deprecated = 3 [default = false]; reserved 4, 5, 6; // Whether the message is an automatically generated map entry type for the // maps field. // // For maps fields: // map map_field = 1; // The parsed descriptor looks like: // message MapFieldEntry { // option map_entry = true; // optional KeyType key = 1; // optional ValueType value = 2; // } // repeated MapFieldEntry map_field = 1; // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax // instead. The option should only be implicitly set by the proto compiler // parser. optional bool map_entry = 7; reserved 8; // javalite_serializable reserved 9; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message FieldOptions { // The ctype option instructs the C++ code generator to use a different // representation of the field than it normally would. See the specific // options below. This option is not yet implemented in the open source // release -- sorry, we'll try to include it in a future version! optional CType ctype = 1 [default = STRING]; enum CType { // Default mode. STRING = 0; CORD = 1; STRING_PIECE = 2; } // The packed option can be enabled for repeated primitive fields to enable // a more efficient representation on the wire. Rather than repeatedly // writing the tag and type for each element, the entire array is encoded as // a single length-delimited blob. In proto3, only explicit setting it to // false will avoid using packed encoding. optional bool packed = 2; // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING // is represented as JavaScript string, which avoids loss of precision that // can happen when a large value is converted to a floating point JavaScript. // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to // use the JavaScript "number" type. The behavior of the default option // JS_NORMAL is implementation dependent. // // This option is an enum to permit additional types to be added, e.g. // goog.math.Integer. optional JSType jstype = 6 [default = JS_NORMAL]; enum JSType { // Use the default type. JS_NORMAL = 0; // Use JavaScript strings. JS_STRING = 1; // Use JavaScript numbers. JS_NUMBER = 2; } // Should this field be parsed lazily? Lazy applies only to message-type // fields. It means that when the outer message is initially parsed, the // inner message's contents will not be parsed but instead stored in encoded // form. The inner message will actually be parsed when it is first accessed. // // This is only a hint. Implementations are free to choose whether to use // eager or lazy parsing regardless of the value of this option. However, // setting this option true suggests that the protocol author believes that // using lazy parsing on this field is worth the additional bookkeeping // overhead typically needed to implement it. // // This option does not affect the public interface of any generated code; // all method signatures remain the same. Furthermore, thread-safety of the // interface is not affected by this option; const methods remain safe to // call from multiple threads concurrently, while non-const methods continue // to require exclusive access. // // // Note that implementations may choose not to check required fields within // a lazy sub-message. That is, calling IsInitialized() on the outer message // may return true even if the inner message has missing required fields. // This is necessary because otherwise the inner message would have to be // parsed in order to perform the check, defeating the purpose of lazy // parsing. An implementation which chooses not to check required fields // must be consistent about it. That is, for any particular sub-message, the // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. // // As of 2021, lazy does no correctness checks on the byte stream during // parsing. This may lead to crashes if and when an invalid byte stream is // finally parsed upon access. // // TODO(b/211906113): Enable validation on lazy fields. optional bool lazy = 5 [default = false]; // unverified_lazy does no correctness checks on the byte stream. This should // only be used where lazy with verification is prohibitive for performance // reasons. optional bool unverified_lazy = 15 [default = false]; // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. optional bool deprecated = 3 [default = false]; // For Google-internal migration only. Do not use. optional bool weak = 10 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; reserved 4; // removed jtype } message OneofOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumOptions { // Set this option to true to allow mapping different tag names to the same // value. optional bool allow_alias = 2; // Is this enum deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. optional bool deprecated = 3 [default = false]; reserved 5; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumValueOptions { // Is this enum value deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. optional bool deprecated = 1 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message ServiceOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this service deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. optional bool deprecated = 33 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message MethodOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this method deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. optional bool deprecated = 33 [default = false]; // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, // or neither? HTTP based RPC implementation may choose GET verb for safe // methods, and PUT verb for idempotent methods instead of the default POST. enum IdempotencyLevel { IDEMPOTENCY_UNKNOWN = 0; NO_SIDE_EFFECTS = 1; // implies idempotent IDEMPOTENT = 2; // idempotent, but may have side effects } optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // A message representing a option the parser does not recognize. This only // appears in options protos created by the compiler::Parser class. // DescriptorPool resolves these when building Descriptor objects. Therefore, // options protos in descriptor objects (e.g. returned by Descriptor::options(), // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions // in them. message UninterpretedOption { // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents // "foo.(bar.baz).qux". message NamePart { required string name_part = 1; required bool is_extension = 2; } repeated NamePart name = 2; // The value of the uninterpreted option, in whatever type the tokenizer // identified it as during parsing. Exactly one of these should be set. optional string identifier_value = 3; optional uint64 positive_int_value = 4; optional int64 negative_int_value = 5; optional double double_value = 6; optional bytes string_value = 7; optional string aggregate_value = 8; } // =================================================================== // Optional source code info // Encapsulates information about the original source file from which a // FileDescriptorProto was generated. message SourceCodeInfo { // A Location identifies a piece of source code in a .proto file which // corresponds to a particular definition. This information is intended // to be useful to IDEs, code indexers, documentation generators, and similar // tools. // // For example, say we have a file like: // message Foo { // optional string foo = 1; // } // Let's look at just the field definition: // optional string foo = 1; // ^ ^^ ^^ ^ ^^^ // a bc de f ghi // We have the following locations: // span path represents // [a,i) [ 4, 0, 2, 0 ] The whole field definition. // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). // // Notes: // - A location may refer to a repeated field itself (i.e. not to any // particular index within it). This is used whenever a set of elements are // logically enclosed in a single code segment. For example, an entire // extend block (possibly containing multiple extension definitions) will // have an outer location whose path refers to the "extensions" repeated // field without an index. // - Multiple locations may have the same path. This happens when a single // logical declaration is spread out across multiple places. The most // obvious example is the "extend" block again -- there may be multiple // extend blocks in the same scope, each of which will have the same path. // - A location's span is not always a subset of its parent's span. For // example, the "extendee" of an extension declaration appears at the // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span // does not mean that it is a descendant. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to // ignore those that it doesn't understand, as more types of locations could // be recorded in the future. repeated Location location = 1; message Location { // Identifies which part of the FileDescriptorProto was defined at this // location. // // Each element is a field number or an index. They form a path from // the root FileDescriptorProto to the place where the definition occurs. // For example, this path: // [ 4, 3, 2, 7, 1 ] // refers to: // file.message_type(3) // 4, 3 // .field(7) // 2, 7 // .name() // 1 // This is because FileDescriptorProto.message_type has field number 4: // repeated DescriptorProto message_type = 4; // and DescriptorProto.field has field number 2: // repeated FieldDescriptorProto field = 2; // and FieldDescriptorProto.name has field number 1: // optional string name = 1; // // Thus, the above path gives the location of a field name. If we removed // the last element: // [ 4, 3, 2, 7 ] // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). repeated int32 path = 1 [packed = true]; // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. repeated int32 span = 2 [packed = true]; // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be // attached to the declaration. // // A series of line comments appearing on consecutive lines, with no other // tokens appearing on those lines, will be treated as a single comment. // // leading_detached_comments will keep paragraphs of comments that appear // before (but not connected to) the current element. Each paragraph, // separated by empty lines, will be one comment element in the repeated // field. // // Only the comment content is provided; comment markers (e.g. //) are // stripped out. For block comments, leading whitespace and an asterisk // will be stripped from the beginning of each line other than the first. // Newlines are included in the output. // // Examples: // // optional int32 foo = 1; // Comment attached to foo. // // Comment attached to bar. // optional int32 bar = 2; // // optional string baz = 3; // // Comment attached to baz. // // Another line attached to baz. // // // Comment attached to qux. // // // // Another line attached to qux. // optional double qux = 4; // // // Detached comment for corge. This is not leading or trailing comments // // to qux or corge because there are blank lines separating it from // // both. // // // Detached comment for corge paragraph 2. // // optional string corge = 5; // /* Block comment attached // * to corge. Leading asterisks // * will be removed. */ // /* Block comment attached to // * grault. */ // optional int32 grault = 6; // // // ignored detached comments. optional string leading_comments = 3; optional string trailing_comments = 4; repeated string leading_detached_comments = 6; } } // Describes the relationship between generated code and its original source // file. A GeneratedCodeInfo message is associated with only one generated // source file, but may contain references to different source .proto files. message GeneratedCodeInfo { // An Annotation connects some span of text in generated code to an element // of its generating .proto file. repeated Annotation annotation = 1; message Annotation { // Identifies the element in the original source .proto file. This field // is formatted the same as SourceCodeInfo.Location.path. repeated int32 path = 1 [packed = true]; // Identifies the filesystem path to the original source .proto. optional string source_file = 2; // Identifies the starting offset in bytes in the generated code // that relates to the identified object. optional int32 begin = 3; // Identifies the ending offset in bytes in the generated code that // relates to the identified offset. The end offset should be one past // the last relevant byte (so the length of the text = end - begin). optional int32 end = 4; } } ================================================ FILE: service/goods/third_party/google/protobuf/duration.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/durationpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DurationProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Duration represents a signed, fixed-length span of time represented // as a count of seconds and fractions of seconds at nanosecond // resolution. It is independent of any calendar and concepts like "day" // or "month". It is related to Timestamp in that the difference between // two Timestamp values is a Duration and it can be added or subtracted // from a Timestamp. Range is approximately +-10,000 years. // // # Examples // // Example 1: Compute Duration from two Timestamps in pseudo code. // // Timestamp start = ...; // Timestamp end = ...; // Duration duration = ...; // // duration.seconds = end.seconds - start.seconds; // duration.nanos = end.nanos - start.nanos; // // if (duration.seconds < 0 && duration.nanos > 0) { // duration.seconds += 1; // duration.nanos -= 1000000000; // } else if (duration.seconds > 0 && duration.nanos < 0) { // duration.seconds -= 1; // duration.nanos += 1000000000; // } // // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. // // Timestamp start = ...; // Duration duration = ...; // Timestamp end = ...; // // end.seconds = start.seconds + duration.seconds; // end.nanos = start.nanos + duration.nanos; // // if (end.nanos < 0) { // end.seconds -= 1; // end.nanos += 1000000000; // } else if (end.nanos >= 1000000000) { // end.seconds += 1; // end.nanos -= 1000000000; // } // // Example 3: Compute Duration from datetime.timedelta in Python. // // td = datetime.timedelta(days=3, minutes=10) // duration = Duration() // duration.FromTimedelta(td) // // # JSON Mapping // // In JSON format, the Duration type is encoded as a string rather than an // object, where the string ends in the suffix "s" (indicating seconds) and // is preceded by the number of seconds, with nanoseconds expressed as // fractional seconds. For example, 3 seconds with 0 nanoseconds should be // encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should // be expressed in JSON format as "3.000000001s", and 3 seconds and 1 // microsecond should be expressed in JSON format as "3.000001s". // // message Duration { // Signed seconds of the span of time. Must be from -315,576,000,000 // to +315,576,000,000 inclusive. Note: these bounds are computed from: // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years int64 seconds = 1; // Signed fractions of a second at nanosecond resolution of the span // of time. Durations less than one second are represented with a 0 // `seconds` field and a positive or negative `nanos` field. For durations // of one second or more, a non-zero value for the `nanos` field must be // of the same sign as the `seconds` field. Must be from -999,999,999 // to +999,999,999 inclusive. int32 nanos = 2; } ================================================ FILE: service/goods/third_party/google/protobuf/empty.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "google.golang.org/protobuf/types/known/emptypb"; option java_package = "com.google.protobuf"; option java_outer_classname = "EmptyProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option cc_enable_arenas = true; // A generic empty message that you can re-use to avoid defining duplicated // empty messages in your APIs. A typical example is to use it as the request // or the response type of an API method. For instance: // // service Foo { // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); // } // // The JSON representation for `Empty` is empty JSON object `{}`. message Empty {} ================================================ FILE: service/goods/third_party/google/protobuf/field_mask.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "FieldMaskProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; option cc_enable_arenas = true; // `FieldMask` represents a set of symbolic field paths, for example: // // paths: "f.a" // paths: "f.b.d" // // Here `f` represents a field in some root message, `a` and `b` // fields in the message found in `f`, and `d` a field found in the // message in `f.b`. // // Field masks are used to specify a subset of fields that should be // returned by a get operation or modified by an update operation. // Field masks also have a custom JSON encoding (see below). // // # Field Masks in Projections // // When used in the context of a projection, a response message or // sub-message is filtered by the API to only contain those fields as // specified in the mask. For example, if the mask in the previous // example is applied to a response message as follows: // // f { // a : 22 // b { // d : 1 // x : 2 // } // y : 13 // } // z: 8 // // The result will not contain specific values for fields x,y and z // (their value will be set to the default, and omitted in proto text // output): // // // f { // a : 22 // b { // d : 1 // } // } // // A repeated field is not allowed except at the last position of a // paths string. // // If a FieldMask object is not present in a get operation, the // operation applies to all fields (as if a FieldMask of all fields // had been specified). // // Note that a field mask does not necessarily apply to the // top-level response message. In case of a REST get operation, the // field mask applies directly to the response, but in case of a REST // list operation, the mask instead applies to each individual message // in the returned resource list. In case of a REST custom method, // other definitions may be used. Where the mask applies will be // clearly documented together with its declaration in the API. In // any case, the effect on the returned resource/resources is required // behavior for APIs. // // # Field Masks in Update Operations // // A field mask in update operations specifies which fields of the // targeted resource are going to be updated. The API is required // to only change the values of the fields as specified in the mask // and leave the others untouched. If a resource is passed in to // describe the updated values, the API ignores the values of all // fields not covered by the mask. // // If a repeated field is specified for an update operation, new values will // be appended to the existing repeated field in the target resource. Note that // a repeated field is only allowed in the last position of a `paths` string. // // If a sub-message is specified in the last position of the field mask for an // update operation, then new value will be merged into the existing sub-message // in the target resource. // // For example, given the target message: // // f { // b { // d: 1 // x: 2 // } // c: [1] // } // // And an update message: // // f { // b { // d: 10 // } // c: [2] // } // // then if the field mask is: // // paths: ["f.b", "f.c"] // // then the result will be: // // f { // b { // d: 10 // x: 2 // } // c: [1, 2] // } // // An implementation may provide options to override this default behavior for // repeated and message fields. // // In order to reset a field's value to the default, the field must // be in the mask and set to the default value in the provided resource. // Hence, in order to reset all fields of a resource, provide a default // instance of the resource and set all fields in the mask, or do // not provide a mask as described below. // // If a field mask is not present on update, the operation applies to // all fields (as if a field mask of all fields has been specified). // Note that in the presence of schema evolution, this may mean that // fields the client does not know and has therefore not filled into // the request will be reset to their default. If this is unwanted // behavior, a specific service may require a client to always specify // a field mask, producing an error if not. // // As with get operations, the location of the resource which // describes the updated values in the request message depends on the // operation kind. In any case, the effect of the field mask is // required to be honored by the API. // // ## Considerations for HTTP REST // // The HTTP kind of an update operation which uses a field mask must // be set to PATCH instead of PUT in order to satisfy HTTP semantics // (PUT must only be used for full updates). // // # JSON Encoding of Field Masks // // In JSON, a field mask is encoded as a single string where paths are // separated by a comma. Fields name in each path are converted // to/from lower-camel naming conventions. // // As an example, consider the following message declarations: // // message Profile { // User user = 1; // Photo photo = 2; // } // message User { // string display_name = 1; // string address = 2; // } // // In proto a field mask for `Profile` may look as such: // // mask { // paths: "user.display_name" // paths: "photo" // } // // In JSON, the same mask is represented as below: // // { // mask: "user.displayName,photo" // } // // # Field Masks and Oneof Fields // // Field masks treat fields in oneofs just as regular fields. Consider the // following message: // // message SampleMessage { // oneof test_oneof { // string name = 4; // SubMessage sub_message = 9; // } // } // // The field mask can be: // // mask { // paths: "name" // } // // Or: // // mask { // paths: "sub_message" // } // // Note that oneof type names ("test_oneof" in this case) cannot be used in // paths. // // ## Field Mask Verification // // The implementation of any API method which has a FieldMask type field in the // request should verify the included field paths, and return an // `INVALID_ARGUMENT` error if any path is unmappable. message FieldMask { // The set of field mask paths. repeated string paths = 1; } ================================================ FILE: service/goods/third_party/google/protobuf/source_context.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "SourceContextProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; // `SourceContext` represents information about the source of a // protobuf element, like the file in which it is defined. message SourceContext { // The path-qualified name of the .proto file that contained the associated // protobuf element. For example: `"google/protobuf/source_context.proto"`. string file_name = 1; } ================================================ FILE: service/goods/third_party/google/protobuf/struct.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/structpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "StructProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // `Struct` represents a structured data value, consisting of fields // which map to dynamically typed values. In some languages, `Struct` // might be supported by a native representation. For example, in // scripting languages like JS a struct is represented as an // object. The details of that representation are described together // with the proto support for the language. // // The JSON representation for `Struct` is JSON object. message Struct { // Unordered map of dynamically typed values. map fields = 1; } // `Value` represents a dynamically typed value which can be either // null, a number, a string, a boolean, a recursive struct value, or a // list of values. A producer of value is expected to set one of these // variants. Absence of any variant indicates an error. // // The JSON representation for `Value` is JSON value. message Value { // The kind of value. oneof kind { // Represents a null value. NullValue null_value = 1; // Represents a double value. double number_value = 2; // Represents a string value. string string_value = 3; // Represents a boolean value. bool bool_value = 4; // Represents a structured value. Struct struct_value = 5; // Represents a repeated `Value`. ListValue list_value = 6; } } // `NullValue` is a singleton enumeration to represent the null value for the // `Value` type union. // // The JSON representation for `NullValue` is JSON `null`. enum NullValue { // Null value. NULL_VALUE = 0; } // `ListValue` is a wrapper around a repeated field of values. // // The JSON representation for `ListValue` is JSON array. message ListValue { // Repeated field of dynamically typed values. repeated Value values = 1; } ================================================ FILE: service/goods/third_party/google/protobuf/timestamp.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/timestamppb"; option java_package = "com.google.protobuf"; option java_outer_classname = "TimestampProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Timestamp represents a point in time independent of any time zone or local // calendar, encoded as a count of seconds and fractions of seconds at // nanosecond resolution. The count is relative to an epoch at UTC midnight on // January 1, 1970, in the proleptic Gregorian calendar which extends the // Gregorian calendar backwards to year one. // // All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap // second table is needed for interpretation, using a [24-hour linear // smear](https://developers.google.com/time/smear). // // The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By // restricting to that range, we ensure that we can convert to and from [RFC // 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. // // # Examples // // Example 1: Compute Timestamp from POSIX `time()`. // // Timestamp timestamp; // timestamp.set_seconds(time(NULL)); // timestamp.set_nanos(0); // // Example 2: Compute Timestamp from POSIX `gettimeofday()`. // // struct timeval tv; // gettimeofday(&tv, NULL); // // Timestamp timestamp; // timestamp.set_seconds(tv.tv_sec); // timestamp.set_nanos(tv.tv_usec * 1000); // // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. // // FILETIME ft; // GetSystemTimeAsFileTime(&ft); // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. // Timestamp timestamp; // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); // // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. // // long millis = System.currentTimeMillis(); // // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) // .setNanos((int) ((millis % 1000) * 1000000)).build(); // // // Example 5: Compute Timestamp from Java `Instant.now()`. // // Instant now = Instant.now(); // // Timestamp timestamp = // Timestamp.newBuilder().setSeconds(now.getEpochSecond()) // .setNanos(now.getNano()).build(); // // // Example 6: Compute Timestamp from current time in Python. // // timestamp = Timestamp() // timestamp.GetCurrentTime() // // # JSON Mapping // // In JSON format, the Timestamp type is encoded as a string in the // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" // where {year} is always expressed using four digits while {month}, {day}, // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone // is required. A proto3 JSON serializer should always use UTC (as indicated by // "Z") when printing the Timestamp type and a proto3 JSON parser should be // able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. // // In JavaScript, one can convert a Date object to this format using the // standard // [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) // method. In Python, a standard `datetime.datetime` object can be converted // to this format using // [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with // the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use // the Joda Time's [`ISODateTimeFormat.dateTime()`]( // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D // ) to obtain a formatter capable of generating timestamps in this format. // // message Timestamp { // Represents seconds of UTC time since Unix epoch // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to // 9999-12-31T23:59:59Z inclusive. int64 seconds = 1; // Non-negative fractions of a second at nanosecond resolution. Negative // second values with fractions must still have non-negative nanos values // that count forward in time. Must be from 0 to 999,999,999 // inclusive. int32 nanos = 2; } ================================================ FILE: service/goods/third_party/google/protobuf/type.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; import "google/protobuf/any.proto"; import "google/protobuf/source_context.proto"; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option java_package = "com.google.protobuf"; option java_outer_classname = "TypeProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/typepb"; // A protocol buffer message type. message Type { // The fully qualified message name. string name = 1; // The list of fields. repeated Field fields = 2; // The list of types appearing in `oneof` definitions in this type. repeated string oneofs = 3; // The protocol buffer options. repeated Option options = 4; // The source context. SourceContext source_context = 5; // The source syntax. Syntax syntax = 6; } // A single field of a message type. message Field { // Basic field types. enum Kind { // Field type unknown. TYPE_UNKNOWN = 0; // Field type double. TYPE_DOUBLE = 1; // Field type float. TYPE_FLOAT = 2; // Field type int64. TYPE_INT64 = 3; // Field type uint64. TYPE_UINT64 = 4; // Field type int32. TYPE_INT32 = 5; // Field type fixed64. TYPE_FIXED64 = 6; // Field type fixed32. TYPE_FIXED32 = 7; // Field type bool. TYPE_BOOL = 8; // Field type string. TYPE_STRING = 9; // Field type group. Proto2 syntax only, and deprecated. TYPE_GROUP = 10; // Field type message. TYPE_MESSAGE = 11; // Field type bytes. TYPE_BYTES = 12; // Field type uint32. TYPE_UINT32 = 13; // Field type enum. TYPE_ENUM = 14; // Field type sfixed32. TYPE_SFIXED32 = 15; // Field type sfixed64. TYPE_SFIXED64 = 16; // Field type sint32. TYPE_SINT32 = 17; // Field type sint64. TYPE_SINT64 = 18; } // Whether a field is optional, required, or repeated. enum Cardinality { // For fields with unknown cardinality. CARDINALITY_UNKNOWN = 0; // For optional fields. CARDINALITY_OPTIONAL = 1; // For required fields. Proto2 syntax only. CARDINALITY_REQUIRED = 2; // For repeated fields. CARDINALITY_REPEATED = 3; } // The field type. Kind kind = 1; // The field cardinality. Cardinality cardinality = 2; // The field number. int32 number = 3; // The field name. string name = 4; // The field type URL, without the scheme, for message or enumeration // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. string type_url = 6; // The index of the field type in `Type.oneofs`, for message or enumeration // types. The first type has index 1; zero means the type is not in the list. int32 oneof_index = 7; // Whether to use alternative packed wire representation. bool packed = 8; // The protocol buffer options. repeated Option options = 9; // The field JSON name. string json_name = 10; // The string value of the default value of this field. Proto2 syntax only. string default_value = 11; } // Enum type definition. message Enum { // Enum type name. string name = 1; // Enum value definitions. repeated EnumValue enumvalue = 2; // Protocol buffer options. repeated Option options = 3; // The source context. SourceContext source_context = 4; // The source syntax. Syntax syntax = 5; } // Enum value definition. message EnumValue { // Enum value name. string name = 1; // Enum value number. int32 number = 2; // Protocol buffer options. repeated Option options = 3; } // A protocol buffer option, which can be attached to a message, field, // enumeration, etc. message Option { // The option's name. For protobuf built-in options (options defined in // descriptor.proto), this is the short name. For example, `"map_entry"`. // For custom options, it should be the fully-qualified name. For example, // `"google.api.http"`. string name = 1; // The option's value packed in an Any message. If the value is a primitive, // the corresponding wrapper type defined in google/protobuf/wrappers.proto // should be used. If the value is an enum, it should be stored as an int32 // value using the google.protobuf.Int32Value type. Any value = 2; } // The syntax in which a protocol buffer element is defined. enum Syntax { // Syntax `proto2`. SYNTAX_PROTO2 = 0; // Syntax `proto3`. SYNTAX_PROTO3 = 1; } ================================================ FILE: service/goods/third_party/google/protobuf/wrappers.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Wrappers for primitive (non-message) types. These types are useful // for embedding primitives in the `google.protobuf.Any` type and for places // where we need to distinguish between the absence of a primitive // typed field and its default value. // // These wrappers have no meaningful use within repeated fields as they lack // the ability to detect presence on individual elements. // These wrappers have no meaningful use within a map or a oneof since // individual entries of a map or fields of a oneof can already detect presence. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; option java_package = "com.google.protobuf"; option java_outer_classname = "WrappersProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // Wrapper message for `double`. // // The JSON representation for `DoubleValue` is JSON number. message DoubleValue { // The double value. double value = 1; } // Wrapper message for `float`. // // The JSON representation for `FloatValue` is JSON number. message FloatValue { // The float value. float value = 1; } // Wrapper message for `int64`. // // The JSON representation for `Int64Value` is JSON string. message Int64Value { // The int64 value. int64 value = 1; } // Wrapper message for `uint64`. // // The JSON representation for `UInt64Value` is JSON string. message UInt64Value { // The uint64 value. uint64 value = 1; } // Wrapper message for `int32`. // // The JSON representation for `Int32Value` is JSON number. message Int32Value { // The int32 value. int32 value = 1; } // Wrapper message for `uint32`. // // The JSON representation for `UInt32Value` is JSON number. message UInt32Value { // The uint32 value. uint32 value = 1; } // Wrapper message for `bool`. // // The JSON representation for `BoolValue` is JSON `true` and `false`. message BoolValue { // The bool value. bool value = 1; } // Wrapper message for `string`. // // The JSON representation for `StringValue` is JSON string. message StringValue { // The string value. string value = 1; } // Wrapper message for `bytes`. // // The JSON representation for `BytesValue` is JSON string. message BytesValue { // The bytes value. bytes value = 1; } ================================================ FILE: service/goods/third_party/openapi/v3/annotations.proto ================================================ // Copyright 2022 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package openapi.v3; import "openapiv3/OpenAPIv3.proto"; import "google/protobuf/descriptor.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "AnnotationsProto"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapi_v3"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; // The Go package name. option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; extend google.protobuf.FileOptions { Document document = 1143; } extend google.protobuf.MethodOptions { Operation operation = 1143; } extend google.protobuf.MessageOptions { Schema schema = 1143; } extend google.protobuf.FieldOptions { Schema property = 1143; } ================================================ FILE: service/goods/third_party/openapi/v3/openapi.proto ================================================ // Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // THIS FILE IS AUTOMATICALLY GENERATED. syntax = "proto3"; package openapi.v3; import "google/protobuf/any.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "OpenAPIProto"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapi_v3"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; // The Go package name. option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; message AdditionalPropertiesItem { oneof oneof { SchemaOrReference schema_or_reference = 1; bool boolean = 2; } } message Any { google.protobuf.Any value = 1; string yaml = 2; } message AnyOrExpression { oneof oneof { Any any = 1; Expression expression = 2; } } // A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation. message Callback { repeated NamedPathItem path = 1; repeated NamedAny specification_extension = 2; } message CallbackOrReference { oneof oneof { Callback callback = 1; Reference reference = 2; } } message CallbacksOrReferences { repeated NamedCallbackOrReference additional_properties = 1; } // Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. message Components { SchemasOrReferences schemas = 1; ResponsesOrReferences responses = 2; ParametersOrReferences parameters = 3; ExamplesOrReferences examples = 4; RequestBodiesOrReferences request_bodies = 5; HeadersOrReferences headers = 6; SecuritySchemesOrReferences security_schemes = 7; LinksOrReferences links = 8; CallbacksOrReferences callbacks = 9; repeated NamedAny specification_extension = 10; } // Contact information for the exposed API. message Contact { string name = 1; string url = 2; string email = 3; repeated NamedAny specification_extension = 4; } message DefaultType { oneof oneof { double number = 1; bool boolean = 2; string string = 3; } } // When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it. When using the discriminator, _inline_ schemas will not be considered. message Discriminator { string property_name = 1; Strings mapping = 2; repeated NamedAny specification_extension = 3; } message Document { string openapi = 1; Info info = 2; repeated Server servers = 3; Paths paths = 4; Components components = 5; repeated SecurityRequirement security = 6; repeated Tag tags = 7; ExternalDocs external_docs = 8; repeated NamedAny specification_extension = 9; } // A single encoding definition applied to a single schema property. message Encoding { string content_type = 1; HeadersOrReferences headers = 2; string style = 3; bool explode = 4; bool allow_reserved = 5; repeated NamedAny specification_extension = 6; } message Encodings { repeated NamedEncoding additional_properties = 1; } message Example { string summary = 1; string description = 2; Any value = 3; string external_value = 4; repeated NamedAny specification_extension = 5; } message ExampleOrReference { oneof oneof { Example example = 1; Reference reference = 2; } } message ExamplesOrReferences { repeated NamedExampleOrReference additional_properties = 1; } message Expression { repeated NamedAny additional_properties = 1; } // Allows referencing an external resource for extended documentation. message ExternalDocs { string description = 1; string url = 2; repeated NamedAny specification_extension = 3; } // The Header Object follows the structure of the Parameter Object with the following changes: 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map. 1. `in` MUST NOT be specified, it is implicitly in `header`. 1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, `style`). message Header { string description = 1; bool required = 2; bool deprecated = 3; bool allow_empty_value = 4; string style = 5; bool explode = 6; bool allow_reserved = 7; SchemaOrReference schema = 8; Any example = 9; ExamplesOrReferences examples = 10; MediaTypes content = 11; repeated NamedAny specification_extension = 12; } message HeaderOrReference { oneof oneof { Header header = 1; Reference reference = 2; } } message HeadersOrReferences { repeated NamedHeaderOrReference additional_properties = 1; } // The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. message Info { string title = 1; string description = 2; string terms_of_service = 3; Contact contact = 4; License license = 5; string version = 6; repeated NamedAny specification_extension = 7; string summary = 8; } message ItemsItem { repeated SchemaOrReference schema_or_reference = 1; } // License information for the exposed API. message License { string name = 1; string url = 2; repeated NamedAny specification_extension = 3; } // The `Link object` represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations. Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response. For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation. message Link { string operation_ref = 1; string operation_id = 2; AnyOrExpression parameters = 3; AnyOrExpression request_body = 4; string description = 5; Server server = 6; repeated NamedAny specification_extension = 7; } message LinkOrReference { oneof oneof { Link link = 1; Reference reference = 2; } } message LinksOrReferences { repeated NamedLinkOrReference additional_properties = 1; } // Each Media Type Object provides schema and examples for the media type identified by its key. message MediaType { SchemaOrReference schema = 1; Any example = 2; ExamplesOrReferences examples = 3; Encodings encoding = 4; repeated NamedAny specification_extension = 5; } message MediaTypes { repeated NamedMediaType additional_properties = 1; } // Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. message NamedAny { // Map key string name = 1; // Mapped value Any value = 2; } // Automatically-generated message used to represent maps of CallbackOrReference as ordered (name,value) pairs. message NamedCallbackOrReference { // Map key string name = 1; // Mapped value CallbackOrReference value = 2; } // Automatically-generated message used to represent maps of Encoding as ordered (name,value) pairs. message NamedEncoding { // Map key string name = 1; // Mapped value Encoding value = 2; } // Automatically-generated message used to represent maps of ExampleOrReference as ordered (name,value) pairs. message NamedExampleOrReference { // Map key string name = 1; // Mapped value ExampleOrReference value = 2; } // Automatically-generated message used to represent maps of HeaderOrReference as ordered (name,value) pairs. message NamedHeaderOrReference { // Map key string name = 1; // Mapped value HeaderOrReference value = 2; } // Automatically-generated message used to represent maps of LinkOrReference as ordered (name,value) pairs. message NamedLinkOrReference { // Map key string name = 1; // Mapped value LinkOrReference value = 2; } // Automatically-generated message used to represent maps of MediaType as ordered (name,value) pairs. message NamedMediaType { // Map key string name = 1; // Mapped value MediaType value = 2; } // Automatically-generated message used to represent maps of ParameterOrReference as ordered (name,value) pairs. message NamedParameterOrReference { // Map key string name = 1; // Mapped value ParameterOrReference value = 2; } // Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. message NamedPathItem { // Map key string name = 1; // Mapped value PathItem value = 2; } // Automatically-generated message used to represent maps of RequestBodyOrReference as ordered (name,value) pairs. message NamedRequestBodyOrReference { // Map key string name = 1; // Mapped value RequestBodyOrReference value = 2; } // Automatically-generated message used to represent maps of ResponseOrReference as ordered (name,value) pairs. message NamedResponseOrReference { // Map key string name = 1; // Mapped value ResponseOrReference value = 2; } // Automatically-generated message used to represent maps of SchemaOrReference as ordered (name,value) pairs. message NamedSchemaOrReference { // Map key string name = 1; // Mapped value SchemaOrReference value = 2; } // Automatically-generated message used to represent maps of SecuritySchemeOrReference as ordered (name,value) pairs. message NamedSecuritySchemeOrReference { // Map key string name = 1; // Mapped value SecuritySchemeOrReference value = 2; } // Automatically-generated message used to represent maps of ServerVariable as ordered (name,value) pairs. message NamedServerVariable { // Map key string name = 1; // Mapped value ServerVariable value = 2; } // Automatically-generated message used to represent maps of string as ordered (name,value) pairs. message NamedString { // Map key string name = 1; // Mapped value string value = 2; } // Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. message NamedStringArray { // Map key string name = 1; // Mapped value StringArray value = 2; } // Configuration details for a supported OAuth Flow message OauthFlow { string authorization_url = 1; string token_url = 2; string refresh_url = 3; Strings scopes = 4; repeated NamedAny specification_extension = 5; } // Allows configuration of the supported OAuth Flows. message OauthFlows { OauthFlow implicit = 1; OauthFlow password = 2; OauthFlow client_credentials = 3; OauthFlow authorization_code = 4; repeated NamedAny specification_extension = 5; } message Object { repeated NamedAny additional_properties = 1; } // Describes a single API operation on a path. message Operation { repeated string tags = 1; string summary = 2; string description = 3; ExternalDocs external_docs = 4; string operation_id = 5; repeated ParameterOrReference parameters = 6; RequestBodyOrReference request_body = 7; Responses responses = 8; CallbacksOrReferences callbacks = 9; bool deprecated = 10; repeated SecurityRequirement security = 11; repeated Server servers = 12; repeated NamedAny specification_extension = 13; } // Describes a single operation parameter. A unique parameter is defined by a combination of a name and location. message Parameter { string name = 1; string in = 2; string description = 3; bool required = 4; bool deprecated = 5; bool allow_empty_value = 6; string style = 7; bool explode = 8; bool allow_reserved = 9; SchemaOrReference schema = 10; Any example = 11; ExamplesOrReferences examples = 12; MediaTypes content = 13; repeated NamedAny specification_extension = 14; } message ParameterOrReference { oneof oneof { Parameter parameter = 1; Reference reference = 2; } } message ParametersOrReferences { repeated NamedParameterOrReference additional_properties = 1; } // Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available. message PathItem { string _ref = 1; string summary = 2; string description = 3; Operation get = 4; Operation put = 5; Operation post = 6; Operation delete = 7; Operation options = 8; Operation head = 9; Operation patch = 10; Operation trace = 11; repeated Server servers = 12; repeated ParameterOrReference parameters = 13; repeated NamedAny specification_extension = 14; } // Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the `Server Object` in order to construct the full URL. The Paths MAY be empty, due to ACL constraints. message Paths { repeated NamedPathItem path = 1; repeated NamedAny specification_extension = 2; } message Properties { repeated NamedSchemaOrReference additional_properties = 1; } // A simple object to allow referencing other components in the specification, internally and externally. The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification. message Reference { string _ref = 1; string summary = 2; string description = 3; } message RequestBodiesOrReferences { repeated NamedRequestBodyOrReference additional_properties = 1; } // Describes a single request body. message RequestBody { string description = 1; MediaTypes content = 2; bool required = 3; repeated NamedAny specification_extension = 4; } message RequestBodyOrReference { oneof oneof { RequestBody request_body = 1; Reference reference = 2; } } // Describes a single response from an API Operation, including design-time, static `links` to operations based on the response. message Response { string description = 1; HeadersOrReferences headers = 2; MediaTypes content = 3; LinksOrReferences links = 4; repeated NamedAny specification_extension = 5; } message ResponseOrReference { oneof oneof { Response response = 1; Reference reference = 2; } } // A container for the expected responses of an operation. The container maps a HTTP response code to the expected response. The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors. The `default` MAY be used as a default response object for all HTTP codes that are not covered individually by the specification. The `Responses Object` MUST contain at least one response code, and it SHOULD be the response for a successful operation call. message Responses { ResponseOrReference default = 1; repeated NamedResponseOrReference response_or_reference = 2; repeated NamedAny specification_extension = 3; } message ResponsesOrReferences { repeated NamedResponseOrReference additional_properties = 1; } // The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the JSON Schema Specification Wright Draft 00. For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema. message Schema { bool nullable = 1; Discriminator discriminator = 2; bool read_only = 3; bool write_only = 4; Xml xml = 5; ExternalDocs external_docs = 6; Any example = 7; bool deprecated = 8; string title = 9; double multiple_of = 10; double maximum = 11; bool exclusive_maximum = 12; double minimum = 13; bool exclusive_minimum = 14; int64 max_length = 15; int64 min_length = 16; string pattern = 17; int64 max_items = 18; int64 min_items = 19; bool unique_items = 20; int64 max_properties = 21; int64 min_properties = 22; repeated string required = 23; repeated Any enum = 24; string type = 25; repeated SchemaOrReference all_of = 26; repeated SchemaOrReference one_of = 27; repeated SchemaOrReference any_of = 28; Schema not = 29; ItemsItem items = 30; Properties properties = 31; AdditionalPropertiesItem additional_properties = 32; DefaultType default = 33; string description = 34; string format = 35; repeated NamedAny specification_extension = 36; } message SchemaOrReference { oneof oneof { Schema schema = 1; Reference reference = 2; } } message SchemasOrReferences { repeated NamedSchemaOrReference additional_properties = 1; } // Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object. Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information. When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object, only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request. message SecurityRequirement { repeated NamedStringArray additional_properties = 1; } // Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect. Please note that currently (2019) the implicit flow is about to be deprecated OAuth 2.0 Security Best Current Practice. Recommended for most use case is Authorization Code Grant flow with PKCE. message SecurityScheme { string type = 1; string description = 2; string name = 3; string in = 4; string scheme = 5; string bearer_format = 6; OauthFlows flows = 7; string open_id_connect_url = 8; repeated NamedAny specification_extension = 9; } message SecuritySchemeOrReference { oneof oneof { SecurityScheme security_scheme = 1; Reference reference = 2; } } message SecuritySchemesOrReferences { repeated NamedSecuritySchemeOrReference additional_properties = 1; } // An object representing a Server. message Server { string url = 1; string description = 2; ServerVariables variables = 3; repeated NamedAny specification_extension = 4; } // An object representing a Server Variable for server URL template substitution. message ServerVariable { repeated string enum = 1; string default = 2; string description = 3; repeated NamedAny specification_extension = 4; } message ServerVariables { repeated NamedServerVariable additional_properties = 1; } // Any property starting with x- is valid. message SpecificationExtension { oneof oneof { double number = 1; bool boolean = 2; string string = 3; } } message StringArray { repeated string value = 1; } message Strings { repeated NamedString additional_properties = 1; } // Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. message Tag { string name = 1; string description = 2; ExternalDocs external_docs = 3; repeated NamedAny specification_extension = 4; } // A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior. message Xml { string name = 1; string namespace = 2; string prefix = 3; bool attribute = 4; bool wrapped = 5; repeated NamedAny specification_extension = 6; } ================================================ FILE: service/goods/third_party/validate/README.md ================================================ # protoc-gen-validate (PGV) * https://github.com/envoyproxy/protoc-gen-validate ================================================ FILE: service/goods/third_party/validate/validate.proto ================================================ syntax = "proto2"; package validate; option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; option java_package = "io.envoyproxy.pgv.validate"; import "google/protobuf/descriptor.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; // Validation rules applied at the message level extend google.protobuf.MessageOptions { // Disabled nullifies any validation rules for this message, including any // message fields associated with it that do support validation. optional bool disabled = 1071; // Ignore skips generation of validation methods for this message. optional bool ignored = 1072; } // Validation rules applied at the oneof level extend google.protobuf.OneofOptions { // Required ensures that exactly one the field options in a oneof is set; // validation fails if no fields in the oneof are set. optional bool required = 1071; } // Validation rules applied at the field level extend google.protobuf.FieldOptions { // Rules specify the validations to be performed on this field. By default, // no validation is performed against a field. optional FieldRules rules = 1071; } // FieldRules encapsulates the rules for each type of field. Depending on the // field, the correct set should be used to ensure proper validations. message FieldRules { optional MessageRules message = 17; oneof type { // Scalar Field Types FloatRules float = 1; DoubleRules double = 2; Int32Rules int32 = 3; Int64Rules int64 = 4; UInt32Rules uint32 = 5; UInt64Rules uint64 = 6; SInt32Rules sint32 = 7; SInt64Rules sint64 = 8; Fixed32Rules fixed32 = 9; Fixed64Rules fixed64 = 10; SFixed32Rules sfixed32 = 11; SFixed64Rules sfixed64 = 12; BoolRules bool = 13; StringRules string = 14; BytesRules bytes = 15; // Complex Field Types EnumRules enum = 16; RepeatedRules repeated = 18; MapRules map = 19; // Well-Known Field Types AnyRules any = 20; DurationRules duration = 21; TimestampRules timestamp = 22; } } // FloatRules describes the constraints applied to `float` values message FloatRules { // Const specifies that this field must be exactly the specified value optional float const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional float lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional float lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional float gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional float gte = 5; // In specifies that this field must be equal to one of the specified // values repeated float in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated float not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // DoubleRules describes the constraints applied to `double` values message DoubleRules { // Const specifies that this field must be exactly the specified value optional double const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional double lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional double lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional double gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional double gte = 5; // In specifies that this field must be equal to one of the specified // values repeated double in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated double not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int32Rules describes the constraints applied to `int32` values message Int32Rules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int64Rules describes the constraints applied to `int64` values message Int64Rules { // Const specifies that this field must be exactly the specified value optional int64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt32Rules describes the constraints applied to `uint32` values message UInt32Rules { // Const specifies that this field must be exactly the specified value optional uint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt64Rules describes the constraints applied to `uint64` values message UInt64Rules { // Const specifies that this field must be exactly the specified value optional uint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt32Rules describes the constraints applied to `sint32` values message SInt32Rules { // Const specifies that this field must be exactly the specified value optional sint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt64Rules describes the constraints applied to `sint64` values message SInt64Rules { // Const specifies that this field must be exactly the specified value optional sint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed32Rules describes the constraints applied to `fixed32` values message Fixed32Rules { // Const specifies that this field must be exactly the specified value optional fixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed64Rules describes the constraints applied to `fixed64` values message Fixed64Rules { // Const specifies that this field must be exactly the specified value optional fixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed32Rules describes the constraints applied to `sfixed32` values message SFixed32Rules { // Const specifies that this field must be exactly the specified value optional sfixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed64Rules describes the constraints applied to `sfixed64` values message SFixed64Rules { // Const specifies that this field must be exactly the specified value optional sfixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // BoolRules describes the constraints applied to `bool` values message BoolRules { // Const specifies that this field must be exactly the specified value optional bool const = 1; } // StringRules describe the constraints applied to `string` values message StringRules { // Const specifies that this field must be exactly the specified value optional string const = 1; // Len specifies that this field must be the specified number of // characters (Unicode code points). Note that the number of // characters may differ from the number of bytes in the string. optional uint64 len = 19; // MinLen specifies that this field must be the specified number of // characters (Unicode code points) at a minimum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of // characters (Unicode code points) at a maximum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 max_len = 3; // LenBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 len_bytes = 20; // MinBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_bytes = 4; // MaxBytes specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_bytes = 5; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 6; // Prefix specifies that this field must have the specified substring at // the beginning of the string. optional string prefix = 7; // Suffix specifies that this field must have the specified substring at // the end of the string. optional string suffix = 8; // Contains specifies that this field must have the specified substring // anywhere in the string. optional string contains = 9; // NotContains specifies that this field cannot have the specified substring // anywhere in the string. optional string not_contains = 23; // In specifies that this field must be equal to one of the specified // values repeated string in = 10; // NotIn specifies that this field cannot be equal to one of the specified // values repeated string not_in = 11; // WellKnown rules provide advanced constraints against common string // patterns oneof well_known { // Email specifies that the field must be a valid email address as // defined by RFC 5322 bool email = 12; // Hostname specifies that the field must be a valid hostname as // defined by RFC 1034. This constraint does not support // internationalized domain names (IDNs). bool hostname = 13; // Ip specifies that the field must be a valid IP (v4 or v6) address. // Valid IPv6 addresses should not include surrounding square brackets. bool ip = 14; // Ipv4 specifies that the field must be a valid IPv4 address. bool ipv4 = 15; // Ipv6 specifies that the field must be a valid IPv6 address. Valid // IPv6 addresses should not include surrounding square brackets. bool ipv6 = 16; // Uri specifies that the field must be a valid, absolute URI as defined // by RFC 3986 bool uri = 17; // UriRef specifies that the field must be a valid URI as defined by RFC // 3986 and may be relative or absolute. bool uri_ref = 18; // Address specifies that the field must be either a valid hostname as // defined by RFC 1034 (which does not support internationalized domain // names or IDNs), or it can be a valid IP (v4 or v6). bool address = 21; // Uuid specifies that the field must be a valid UUID as defined by // RFC 4122 bool uuid = 22; // WellKnownRegex specifies a common well known pattern defined as a regex. KnownRegex well_known_regex = 24; } // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable // strict header validation. // By default, this is true, and HTTP header validations are RFC-compliant. // Setting to false will enable a looser validations that only disallows // \r\n\0 characters, which can be used to bypass header matching rules. optional bool strict = 25 [default = true]; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 26; } // WellKnownRegex contain some well-known patterns. enum KnownRegex { UNKNOWN = 0; // HTTP header name as defined by RFC 7230. HTTP_HEADER_NAME = 1; // HTTP header value as defined by RFC 7230. HTTP_HEADER_VALUE = 2; } // BytesRules describe the constraints applied to `bytes` values message BytesRules { // Const specifies that this field must be exactly the specified value optional bytes const = 1; // Len specifies that this field must be the specified number of bytes optional uint64 len = 13; // MinLen specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_len = 3; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 4; // Prefix specifies that this field must have the specified bytes at the // beginning of the string. optional bytes prefix = 5; // Suffix specifies that this field must have the specified bytes at the // end of the string. optional bytes suffix = 6; // Contains specifies that this field must have the specified bytes // anywhere in the string. optional bytes contains = 7; // In specifies that this field must be equal to one of the specified // values repeated bytes in = 8; // NotIn specifies that this field cannot be equal to one of the specified // values repeated bytes not_in = 9; // WellKnown rules provide advanced constraints against common byte // patterns oneof well_known { // Ip specifies that the field must be a valid IP (v4 or v6) address in // byte format bool ip = 10; // Ipv4 specifies that the field must be a valid IPv4 address in byte // format bool ipv4 = 11; // Ipv6 specifies that the field must be a valid IPv6 address in byte // format bool ipv6 = 12; } // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 14; } // EnumRules describe the constraints applied to enum values message EnumRules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // DefinedOnly specifies that this field must be only one of the defined // values for this enum, failing on any undefined value. optional bool defined_only = 2; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 3; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 4; } // MessageRules describe the constraints applied to embedded message values. // For message-type fields, validation is performed recursively. message MessageRules { // Skip specifies that the validation rules of this field should not be // evaluated optional bool skip = 1; // Required specifies that this field must be set optional bool required = 2; } // RepeatedRules describe the constraints applied to `repeated` values message RepeatedRules { // MinItems specifies that this field must have the specified number of // items at a minimum optional uint64 min_items = 1; // MaxItems specifies that this field must have the specified number of // items at a maximum optional uint64 max_items = 2; // Unique specifies that all elements in this field must be unique. This // contraint is only applicable to scalar and enum types (messages are not // supported). optional bool unique = 3; // Items specifies the contraints to be applied to each item in the field. // Repeated message fields will still execute validation against each item // unless skip is specified here. optional FieldRules items = 4; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 5; } // MapRules describe the constraints applied to `map` values message MapRules { // MinPairs specifies that this field must have the specified number of // KVs at a minimum optional uint64 min_pairs = 1; // MaxPairs specifies that this field must have the specified number of // KVs at a maximum optional uint64 max_pairs = 2; // NoSparse specifies values in this field cannot be unset. This only // applies to map's with message value types. optional bool no_sparse = 3; // Keys specifies the constraints to be applied to each key in the field. optional FieldRules keys = 4; // Values specifies the constraints to be applied to the value of each key // in the field. Message values will still have their validations evaluated // unless skip is specified here. optional FieldRules values = 5; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 6; } // AnyRules describe constraints applied exclusively to the // `google.protobuf.Any` well-known type message AnyRules { // Required specifies that this field must be set optional bool required = 1; // In specifies that this field's `type_url` must be equal to one of the // specified values. repeated string in = 2; // NotIn specifies that this field's `type_url` must not be equal to any of // the specified values. repeated string not_in = 3; } // DurationRules describe the constraints applied exclusively to the // `google.protobuf.Duration` well-known type message DurationRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Duration const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Duration lt = 3; // Lt specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Duration lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Duration gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Duration gte = 6; // In specifies that this field must be equal to one of the specified // values repeated google.protobuf.Duration in = 7; // NotIn specifies that this field cannot be equal to one of the specified // values repeated google.protobuf.Duration not_in = 8; } // TimestampRules describe the constraints applied exclusively to the // `google.protobuf.Timestamp` well-known type message TimestampRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Timestamp const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Timestamp lt = 3; // Lte specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Timestamp lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Timestamp gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Timestamp gte = 6; // LtNow specifies that this must be less than the current time. LtNow // can only be used with the Within rule. optional bool lt_now = 7; // GtNow specifies that this must be greater than the current time. GtNow // can only be used with the Within rule. optional bool gt_now = 8; // Within specifies that this field must be within this duration of the // current time. This constraint can be used alone or with the LtNow and // GtNow rules. optional google.protobuf.Duration within = 9; } ================================================ FILE: service/order/.gitignore ================================================ # Reference https://github.com/github/gitignore/blob/master/Go.gitignore # Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Dependency directories (remove the comment below to include it) vendor/ # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # OS General Thumbs.db .DS_Store # project *.cert *.key *.log bin/ # Develop tools .vscode/ .idea/ *.swp ================================================ FILE: service/order/Dockerfile ================================================ FROM golang:1.16 AS builder COPY . /src WORKDIR /src RUN GOPROXY=https://goproxy.cn make build FROM debian:stable-slim RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/ \ && apt-get autoremove -y && apt-get autoclean -y COPY --from=builder /src/bin /app WORKDIR /app EXPOSE 8000 EXPOSE 9000 VOLUME /data/conf CMD ["./server", "-conf", "/data/conf"] ================================================ FILE: service/order/LICENSE ================================================ MIT License Copyright (c) 2020 go-kratos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: service/order/Makefile ================================================ GOPATH:=$(shell go env GOPATH) VERSION=$(shell git describe --tags --always) INTERNAL_PROTO_FILES=$(shell find internal -name *.proto) API_PROTO_FILES=$(shell find api -name *.proto) .PHONY: init # init env init: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest go install github.com/go-kratos/kratos/cmd/kratos/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest go install github.com/google/gnostic/cmd/protoc-gen-openapi@latest .PHONY: config # generate internal proto config: protoc --proto_path=./internal \ --proto_path=./third_party \ --go_out=paths=source_relative:./internal \ $(INTERNAL_PROTO_FILES) .PHONY: api # generate api proto api: protoc --proto_path=./api \ --proto_path=./third_party \ --go_out=paths=source_relative:./api \ --go-http_out=paths=source_relative:./api \ --go-grpc_out=paths=source_relative:./api \ --openapi_out==paths=source_relative:. \ --validate_out=paths=source_relative,lang=go:./api \ $(API_PROTO_FILES) .PHONY: build # build build: mkdir -p bin/ && go build -ldflags "-X main.Version=$(VERSION)" -o ./bin/ ./... .PHONY: generate # generate generate: go mod tidy go get github.com/google/wire/cmd/wire@latest go generate ./... .PHONY: wire # generate wire wire: cd cmd/order && wire .PHONY: all # generate all all: make api; make config; make generate; make wire; # show help help: @echo '' @echo 'Usage:' @echo ' make [target]' @echo '' @echo 'Targets:' @awk '/^[a-zA-Z\-\_0-9]+:/ { \ helpMessage = match(lastLine, /^# (.*)/); \ if (helpMessage) { \ helpCommand = substr($$1, 0, index($$1, ":")-1); \ helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ } \ } \ { lastLine = $$0 }' $(MAKEFILE_LIST) .DEFAULT_GOAL := help ================================================ FILE: service/order/api/cart/v1/cart.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: cart/v1/cart.proto package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type CartInfoReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` GoodsId int64 `protobuf:"varint,3,opt,name=goodsId,proto3" json:"goodsId,omitempty"` GoodsSn string `protobuf:"bytes,4,opt,name=goodsSn,proto3" json:"goodsSn,omitempty"` GoodsName string `protobuf:"bytes,5,opt,name=goodsName,proto3" json:"goodsName,omitempty"` SkuId int64 `protobuf:"varint,6,opt,name=skuId,proto3" json:"skuId,omitempty"` GoodsPrice int64 `protobuf:"varint,7,opt,name=goodsPrice,proto3" json:"goodsPrice,omitempty"` GoodsNum int32 `protobuf:"varint,8,opt,name=goodsNum,proto3" json:"goodsNum,omitempty"` IsSelect bool `protobuf:"varint,9,opt,name=isSelect,proto3" json:"isSelect,omitempty"` } func (x *CartInfoReply) Reset() { *x = CartInfoReply{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CartInfoReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*CartInfoReply) ProtoMessage() {} func (x *CartInfoReply) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_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 CartInfoReply.ProtoReflect.Descriptor instead. func (*CartInfoReply) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{0} } func (x *CartInfoReply) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *CartInfoReply) GetUserId() int64 { if x != nil { return x.UserId } return 0 } func (x *CartInfoReply) GetGoodsId() int64 { if x != nil { return x.GoodsId } return 0 } func (x *CartInfoReply) GetGoodsSn() string { if x != nil { return x.GoodsSn } return "" } func (x *CartInfoReply) GetGoodsName() string { if x != nil { return x.GoodsName } return "" } func (x *CartInfoReply) GetSkuId() int64 { if x != nil { return x.SkuId } return 0 } func (x *CartInfoReply) GetGoodsPrice() int64 { if x != nil { return x.GoodsPrice } return 0 } func (x *CartInfoReply) GetGoodsNum() int32 { if x != nil { return x.GoodsNum } return 0 } func (x *CartInfoReply) GetIsSelect() bool { if x != nil { return x.IsSelect } return false } type CreateCartRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` GoodsId int64 `protobuf:"varint,3,opt,name=goodsId,proto3" json:"goodsId,omitempty"` GoodsSn string `protobuf:"bytes,4,opt,name=goodsSn,proto3" json:"goodsSn,omitempty"` GoodsName string `protobuf:"bytes,5,opt,name=goodsName,proto3" json:"goodsName,omitempty"` SkuId int64 `protobuf:"varint,6,opt,name=skuId,proto3" json:"skuId,omitempty"` GoodsPrice int64 `protobuf:"varint,7,opt,name=goodsPrice,proto3" json:"goodsPrice,omitempty"` GoodsNum int32 `protobuf:"varint,8,opt,name=goodsNum,proto3" json:"goodsNum,omitempty"` IsSelect bool `protobuf:"varint,9,opt,name=isSelect,proto3" json:"isSelect,omitempty"` } func (x *CreateCartRequest) Reset() { *x = CreateCartRequest{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateCartRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateCartRequest) ProtoMessage() {} func (x *CreateCartRequest) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_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 CreateCartRequest.ProtoReflect.Descriptor instead. func (*CreateCartRequest) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{1} } func (x *CreateCartRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *CreateCartRequest) GetUserId() int64 { if x != nil { return x.UserId } return 0 } func (x *CreateCartRequest) GetGoodsId() int64 { if x != nil { return x.GoodsId } return 0 } func (x *CreateCartRequest) GetGoodsSn() string { if x != nil { return x.GoodsSn } return "" } func (x *CreateCartRequest) GetGoodsName() string { if x != nil { return x.GoodsName } return "" } func (x *CreateCartRequest) GetSkuId() int64 { if x != nil { return x.SkuId } return 0 } func (x *CreateCartRequest) GetGoodsPrice() int64 { if x != nil { return x.GoodsPrice } return 0 } func (x *CreateCartRequest) GetGoodsNum() int32 { if x != nil { return x.GoodsNum } return 0 } func (x *CreateCartRequest) GetIsSelect() bool { if x != nil { return x.IsSelect } return false } type UpdateCartRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` GoodsNum int32 `protobuf:"varint,2,opt,name=goodsNum,proto3" json:"goodsNum,omitempty"` } func (x *UpdateCartRequest) Reset() { *x = UpdateCartRequest{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateCartRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateCartRequest) ProtoMessage() {} func (x *UpdateCartRequest) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_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 UpdateCartRequest.ProtoReflect.Descriptor instead. func (*UpdateCartRequest) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{2} } func (x *UpdateCartRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UpdateCartRequest) GetGoodsNum() int32 { if x != nil { return x.GoodsNum } return 0 } type UpdateCartReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *UpdateCartReply) Reset() { *x = UpdateCartReply{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateCartReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateCartReply) ProtoMessage() {} func (x *UpdateCartReply) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_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 UpdateCartReply.ProtoReflect.Descriptor instead. func (*UpdateCartReply) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{3} } type CheckResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } func (x *CheckResponse) Reset() { *x = CheckResponse{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CheckResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CheckResponse) ProtoMessage() {} func (x *CheckResponse) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead. func (*CheckResponse) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{4} } func (x *CheckResponse) GetSuccess() bool { if x != nil { return x.Success } return false } type DeleteCartRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *DeleteCartRequest) Reset() { *x = DeleteCartRequest{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *DeleteCartRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*DeleteCartRequest) ProtoMessage() {} func (x *DeleteCartRequest) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use DeleteCartRequest.ProtoReflect.Descriptor instead. func (*DeleteCartRequest) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{5} } type DeleteCartReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *DeleteCartReply) Reset() { *x = DeleteCartReply{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *DeleteCartReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*DeleteCartReply) ProtoMessage() {} func (x *DeleteCartReply) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[6] 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 DeleteCartReply.ProtoReflect.Descriptor instead. func (*DeleteCartReply) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{6} } type GetCartRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *GetCartRequest) Reset() { *x = GetCartRequest{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GetCartRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*GetCartRequest) ProtoMessage() {} func (x *GetCartRequest) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[7] 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 GetCartRequest.ProtoReflect.Descriptor instead. func (*GetCartRequest) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{7} } type GetCartReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *GetCartReply) Reset() { *x = GetCartReply{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GetCartReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*GetCartReply) ProtoMessage() {} func (x *GetCartReply) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[8] 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 GetCartReply.ProtoReflect.Descriptor instead. func (*GetCartReply) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{8} } type ListCartRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` } func (x *ListCartRequest) Reset() { *x = ListCartRequest{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListCartRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListCartRequest) ProtoMessage() {} func (x *ListCartRequest) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[9] 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 ListCartRequest.ProtoReflect.Descriptor instead. func (*ListCartRequest) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{9} } func (x *ListCartRequest) GetUserId() int64 { if x != nil { return x.UserId } return 0 } type CartListReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Results []*CartInfoReply `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` } func (x *CartListReply) Reset() { *x = CartListReply{} if protoimpl.UnsafeEnabled { mi := &file_cart_v1_cart_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CartListReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*CartListReply) ProtoMessage() {} func (x *CartListReply) ProtoReflect() protoreflect.Message { mi := &file_cart_v1_cart_proto_msgTypes[10] 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 CartListReply.ProtoReflect.Descriptor instead. func (*CartListReply) Descriptor() ([]byte, []int) { return file_cart_v1_cart_proto_rawDescGZIP(), []int{10} } func (x *CartListReply) GetResults() []*CartInfoReply { if x != nil { return x.Results } return nil } var File_cart_v1_cart_proto protoreflect.FileDescriptor var file_cart_v1_cart_proto_rawDesc = []byte{ 0x0a, 0x12, 0x63, 0x61, 0x72, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 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, 0xf7, 0x01, 0x0a, 0x0d, 0x43, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x22, 0xc3, 0x02, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x12, 0x25, 0x0a, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x23, 0x0a, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x6a, 0x02, 0x08, 0x01, 0x52, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x22, 0x3f, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x29, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x13, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x11, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x29, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x0d, 0x43, 0x61, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x32, 0x8a, 0x02, 0x0a, 0x04, 0x43, 0x61, 0x72, 0x74, 0x12, 0x40, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x12, 0x1a, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x40, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x12, 0x1a, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x12, 0x1a, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x72, 0x74, 0x12, 0x18, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x15, 0x5a, 0x13, 0x63, 0x61, 0x72, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x61, 0x72, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_cart_v1_cart_proto_rawDescOnce sync.Once file_cart_v1_cart_proto_rawDescData = file_cart_v1_cart_proto_rawDesc ) func file_cart_v1_cart_proto_rawDescGZIP() []byte { file_cart_v1_cart_proto_rawDescOnce.Do(func() { file_cart_v1_cart_proto_rawDescData = protoimpl.X.CompressGZIP(file_cart_v1_cart_proto_rawDescData) }) return file_cart_v1_cart_proto_rawDescData } var file_cart_v1_cart_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_cart_v1_cart_proto_goTypes = []interface{}{ (*CartInfoReply)(nil), // 0: cart.v1.CartInfoReply (*CreateCartRequest)(nil), // 1: cart.v1.CreateCartRequest (*UpdateCartRequest)(nil), // 2: cart.v1.UpdateCartRequest (*UpdateCartReply)(nil), // 3: cart.v1.UpdateCartReply (*CheckResponse)(nil), // 4: cart.v1.CheckResponse (*DeleteCartRequest)(nil), // 5: cart.v1.DeleteCartRequest (*DeleteCartReply)(nil), // 6: cart.v1.DeleteCartReply (*GetCartRequest)(nil), // 7: cart.v1.GetCartRequest (*GetCartReply)(nil), // 8: cart.v1.GetCartReply (*ListCartRequest)(nil), // 9: cart.v1.ListCartRequest (*CartListReply)(nil), // 10: cart.v1.CartListReply } var file_cart_v1_cart_proto_depIdxs = []int32{ 0, // 0: cart.v1.CartListReply.results:type_name -> cart.v1.CartInfoReply 1, // 1: cart.v1.Cart.CreateCart:input_type -> cart.v1.CreateCartRequest 2, // 2: cart.v1.Cart.UpdateCart:input_type -> cart.v1.UpdateCartRequest 5, // 3: cart.v1.Cart.DeleteCart:input_type -> cart.v1.DeleteCartRequest 9, // 4: cart.v1.Cart.ListCart:input_type -> cart.v1.ListCartRequest 0, // 5: cart.v1.Cart.CreateCart:output_type -> cart.v1.CartInfoReply 4, // 6: cart.v1.Cart.UpdateCart:output_type -> cart.v1.CheckResponse 4, // 7: cart.v1.Cart.DeleteCart:output_type -> cart.v1.CheckResponse 10, // 8: cart.v1.Cart.ListCart:output_type -> cart.v1.CartListReply 5, // [5:9] is the sub-list for method output_type 1, // [1:5] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name } func init() { file_cart_v1_cart_proto_init() } func file_cart_v1_cart_proto_init() { if File_cart_v1_cart_proto != nil { return } if !protoimpl.UnsafeEnabled { file_cart_v1_cart_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CartInfoReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateCartRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateCartRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateCartReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteCartRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteCartReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCartRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCartReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListCartRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cart_v1_cart_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CartListReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cart_v1_cart_proto_rawDesc, NumEnums: 0, NumMessages: 11, NumExtensions: 0, NumServices: 1, }, GoTypes: file_cart_v1_cart_proto_goTypes, DependencyIndexes: file_cart_v1_cart_proto_depIdxs, MessageInfos: file_cart_v1_cart_proto_msgTypes, }.Build() File_cart_v1_cart_proto = out.File file_cart_v1_cart_proto_rawDesc = nil file_cart_v1_cart_proto_goTypes = nil file_cart_v1_cart_proto_depIdxs = nil } ================================================ FILE: service/order/api/cart/v1/cart.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: cart/v1/cart.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on CartInfoReply 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 *CartInfoReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CartInfoReply 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 CartInfoReplyMultiError, or // nil if none found. func (m *CartInfoReply) ValidateAll() error { return m.validate(true) } func (m *CartInfoReply) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for UserId // no validation rules for GoodsId // no validation rules for GoodsSn // no validation rules for GoodsName // no validation rules for SkuId // no validation rules for GoodsPrice // no validation rules for GoodsNum // no validation rules for IsSelect if len(errors) > 0 { return CartInfoReplyMultiError(errors) } return nil } // CartInfoReplyMultiError is an error wrapping multiple validation errors // returned by CartInfoReply.ValidateAll() if the designated constraints // aren't met. type CartInfoReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CartInfoReplyMultiError) 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 CartInfoReplyMultiError) AllErrors() []error { return m } // CartInfoReplyValidationError is the validation error returned by // CartInfoReply.Validate if the designated constraints aren't met. type CartInfoReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CartInfoReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CartInfoReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CartInfoReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CartInfoReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CartInfoReplyValidationError) ErrorName() string { return "CartInfoReplyValidationError" } // Error satisfies the builtin error interface func (e CartInfoReplyValidationError) 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 %sCartInfoReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CartInfoReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CartInfoReplyValidationError{} // Validate checks the field values on CreateCartRequest 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 *CreateCartRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateCartRequest 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 // CreateCartRequestMultiError, or nil if none found. func (m *CreateCartRequest) ValidateAll() error { return m.validate(true) } func (m *CreateCartRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetUserId() <= 0 { err := CreateCartRequestValidationError{ field: "UserId", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if m.GetGoodsId() <= 0 { err := CreateCartRequestValidationError{ field: "GoodsId", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetGoodsSn()) < 1 { err := CreateCartRequestValidationError{ field: "GoodsSn", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetGoodsName()) < 1 { err := CreateCartRequestValidationError{ field: "GoodsName", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if m.GetSkuId() <= 0 { err := CreateCartRequestValidationError{ field: "SkuId", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if m.GetGoodsPrice() <= 0 { err := CreateCartRequestValidationError{ field: "GoodsPrice", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if m.GetGoodsNum() <= 0 { err := CreateCartRequestValidationError{ field: "GoodsNum", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if m.GetIsSelect() != true { err := CreateCartRequestValidationError{ field: "IsSelect", reason: "value must equal true", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return CreateCartRequestMultiError(errors) } return nil } // CreateCartRequestMultiError is an error wrapping multiple validation errors // returned by CreateCartRequest.ValidateAll() if the designated constraints // aren't met. type CreateCartRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateCartRequestMultiError) 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 CreateCartRequestMultiError) AllErrors() []error { return m } // CreateCartRequestValidationError is the validation error returned by // CreateCartRequest.Validate if the designated constraints aren't met. type CreateCartRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateCartRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateCartRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateCartRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateCartRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateCartRequestValidationError) ErrorName() string { return "CreateCartRequestValidationError" } // Error satisfies the builtin error interface func (e CreateCartRequestValidationError) 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 %sCreateCartRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateCartRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateCartRequestValidationError{} // Validate checks the field values on UpdateCartRequest 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 *UpdateCartRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateCartRequest 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 // UpdateCartRequestMultiError, or nil if none found. func (m *UpdateCartRequest) ValidateAll() error { return m.validate(true) } func (m *UpdateCartRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for GoodsNum if len(errors) > 0 { return UpdateCartRequestMultiError(errors) } return nil } // UpdateCartRequestMultiError is an error wrapping multiple validation errors // returned by UpdateCartRequest.ValidateAll() if the designated constraints // aren't met. type UpdateCartRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateCartRequestMultiError) 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 UpdateCartRequestMultiError) AllErrors() []error { return m } // UpdateCartRequestValidationError is the validation error returned by // UpdateCartRequest.Validate if the designated constraints aren't met. type UpdateCartRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateCartRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateCartRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateCartRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateCartRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateCartRequestValidationError) ErrorName() string { return "UpdateCartRequestValidationError" } // Error satisfies the builtin error interface func (e UpdateCartRequestValidationError) 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 %sUpdateCartRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateCartRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateCartRequestValidationError{} // Validate checks the field values on UpdateCartReply 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 *UpdateCartReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateCartReply 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 // UpdateCartReplyMultiError, or nil if none found. func (m *UpdateCartReply) ValidateAll() error { return m.validate(true) } func (m *UpdateCartReply) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return UpdateCartReplyMultiError(errors) } return nil } // UpdateCartReplyMultiError is an error wrapping multiple validation errors // returned by UpdateCartReply.ValidateAll() if the designated constraints // aren't met. type UpdateCartReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateCartReplyMultiError) 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 UpdateCartReplyMultiError) AllErrors() []error { return m } // UpdateCartReplyValidationError is the validation error returned by // UpdateCartReply.Validate if the designated constraints aren't met. type UpdateCartReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateCartReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateCartReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateCartReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateCartReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateCartReplyValidationError) ErrorName() string { return "UpdateCartReplyValidationError" } // Error satisfies the builtin error interface func (e UpdateCartReplyValidationError) 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 %sUpdateCartReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateCartReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateCartReplyValidationError{} // Validate checks the field values on CheckResponse 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 *CheckResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CheckResponse 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 CheckResponseMultiError, or // nil if none found. func (m *CheckResponse) ValidateAll() error { return m.validate(true) } func (m *CheckResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Success if len(errors) > 0 { return CheckResponseMultiError(errors) } return nil } // CheckResponseMultiError is an error wrapping multiple validation errors // returned by CheckResponse.ValidateAll() if the designated constraints // aren't met. type CheckResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CheckResponseMultiError) 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 CheckResponseMultiError) AllErrors() []error { return m } // CheckResponseValidationError is the validation error returned by // CheckResponse.Validate if the designated constraints aren't met. type CheckResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CheckResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CheckResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CheckResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CheckResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CheckResponseValidationError) ErrorName() string { return "CheckResponseValidationError" } // Error satisfies the builtin error interface func (e CheckResponseValidationError) 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 %sCheckResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CheckResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CheckResponseValidationError{} // Validate checks the field values on DeleteCartRequest 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 *DeleteCartRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on DeleteCartRequest 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 // DeleteCartRequestMultiError, or nil if none found. func (m *DeleteCartRequest) ValidateAll() error { return m.validate(true) } func (m *DeleteCartRequest) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return DeleteCartRequestMultiError(errors) } return nil } // DeleteCartRequestMultiError is an error wrapping multiple validation errors // returned by DeleteCartRequest.ValidateAll() if the designated constraints // aren't met. type DeleteCartRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m DeleteCartRequestMultiError) 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 DeleteCartRequestMultiError) AllErrors() []error { return m } // DeleteCartRequestValidationError is the validation error returned by // DeleteCartRequest.Validate if the designated constraints aren't met. type DeleteCartRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e DeleteCartRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e DeleteCartRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e DeleteCartRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e DeleteCartRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e DeleteCartRequestValidationError) ErrorName() string { return "DeleteCartRequestValidationError" } // Error satisfies the builtin error interface func (e DeleteCartRequestValidationError) 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 %sDeleteCartRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = DeleteCartRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = DeleteCartRequestValidationError{} // Validate checks the field values on DeleteCartReply 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 *DeleteCartReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on DeleteCartReply 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 // DeleteCartReplyMultiError, or nil if none found. func (m *DeleteCartReply) ValidateAll() error { return m.validate(true) } func (m *DeleteCartReply) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return DeleteCartReplyMultiError(errors) } return nil } // DeleteCartReplyMultiError is an error wrapping multiple validation errors // returned by DeleteCartReply.ValidateAll() if the designated constraints // aren't met. type DeleteCartReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m DeleteCartReplyMultiError) 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 DeleteCartReplyMultiError) AllErrors() []error { return m } // DeleteCartReplyValidationError is the validation error returned by // DeleteCartReply.Validate if the designated constraints aren't met. type DeleteCartReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e DeleteCartReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e DeleteCartReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e DeleteCartReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e DeleteCartReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e DeleteCartReplyValidationError) ErrorName() string { return "DeleteCartReplyValidationError" } // Error satisfies the builtin error interface func (e DeleteCartReplyValidationError) 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 %sDeleteCartReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = DeleteCartReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = DeleteCartReplyValidationError{} // Validate checks the field values on GetCartRequest 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 *GetCartRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GetCartRequest 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 GetCartRequestMultiError, // or nil if none found. func (m *GetCartRequest) ValidateAll() error { return m.validate(true) } func (m *GetCartRequest) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return GetCartRequestMultiError(errors) } return nil } // GetCartRequestMultiError is an error wrapping multiple validation errors // returned by GetCartRequest.ValidateAll() if the designated constraints // aren't met. type GetCartRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GetCartRequestMultiError) 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 GetCartRequestMultiError) AllErrors() []error { return m } // GetCartRequestValidationError is the validation error returned by // GetCartRequest.Validate if the designated constraints aren't met. type GetCartRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GetCartRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GetCartRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GetCartRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GetCartRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GetCartRequestValidationError) ErrorName() string { return "GetCartRequestValidationError" } // Error satisfies the builtin error interface func (e GetCartRequestValidationError) 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 %sGetCartRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GetCartRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GetCartRequestValidationError{} // Validate checks the field values on GetCartReply 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 *GetCartReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GetCartReply 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 GetCartReplyMultiError, or // nil if none found. func (m *GetCartReply) ValidateAll() error { return m.validate(true) } func (m *GetCartReply) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return GetCartReplyMultiError(errors) } return nil } // GetCartReplyMultiError is an error wrapping multiple validation errors // returned by GetCartReply.ValidateAll() if the designated constraints aren't met. type GetCartReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GetCartReplyMultiError) 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 GetCartReplyMultiError) AllErrors() []error { return m } // GetCartReplyValidationError is the validation error returned by // GetCartReply.Validate if the designated constraints aren't met. type GetCartReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GetCartReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GetCartReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GetCartReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GetCartReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GetCartReplyValidationError) ErrorName() string { return "GetCartReplyValidationError" } // Error satisfies the builtin error interface func (e GetCartReplyValidationError) 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 %sGetCartReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GetCartReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GetCartReplyValidationError{} // Validate checks the field values on ListCartRequest 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 *ListCartRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListCartRequest 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 // ListCartRequestMultiError, or nil if none found. func (m *ListCartRequest) ValidateAll() error { return m.validate(true) } func (m *ListCartRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for UserId if len(errors) > 0 { return ListCartRequestMultiError(errors) } return nil } // ListCartRequestMultiError is an error wrapping multiple validation errors // returned by ListCartRequest.ValidateAll() if the designated constraints // aren't met. type ListCartRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListCartRequestMultiError) 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 ListCartRequestMultiError) AllErrors() []error { return m } // ListCartRequestValidationError is the validation error returned by // ListCartRequest.Validate if the designated constraints aren't met. type ListCartRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListCartRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListCartRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListCartRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListCartRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListCartRequestValidationError) ErrorName() string { return "ListCartRequestValidationError" } // Error satisfies the builtin error interface func (e ListCartRequestValidationError) 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 %sListCartRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListCartRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListCartRequestValidationError{} // Validate checks the field values on CartListReply 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 *CartListReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CartListReply 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 CartListReplyMultiError, or // nil if none found. func (m *CartListReply) ValidateAll() error { return m.validate(true) } func (m *CartListReply) validate(all bool) error { if m == nil { return nil } var errors []error for idx, item := range m.GetResults() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CartListReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CartListReplyValidationError{ field: fmt.Sprintf("Results[%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 CartListReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return CartListReplyMultiError(errors) } return nil } // CartListReplyMultiError is an error wrapping multiple validation errors // returned by CartListReply.ValidateAll() if the designated constraints // aren't met. type CartListReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CartListReplyMultiError) 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 CartListReplyMultiError) AllErrors() []error { return m } // CartListReplyValidationError is the validation error returned by // CartListReply.Validate if the designated constraints aren't met. type CartListReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CartListReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CartListReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CartListReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CartListReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CartListReplyValidationError) ErrorName() string { return "CartListReplyValidationError" } // Error satisfies the builtin error interface func (e CartListReplyValidationError) 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 %sCartListReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CartListReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CartListReplyValidationError{} ================================================ FILE: service/order/api/cart/v1/cart.proto ================================================ syntax = "proto3"; package cart.v1; import "validate/validate.proto"; option go_package = "cart/api/cart/v1;v1"; // 购物车 service Cart { rpc CreateCart (CreateCartRequest) returns (CartInfoReply); // 添加商品进购物车 rpc UpdateCart (UpdateCartRequest) returns (CheckResponse); // 修改购物车商品数量 rpc DeleteCart (DeleteCartRequest) returns (CheckResponse); // 删除购物车商品 rpc ListCart (ListCartRequest) returns (CartListReply); // 购物车商品列表 } message CartInfoReply { int64 id = 1; int64 userId = 2; int64 goodsId = 3; string goodsSn = 4; string goodsName = 5; int64 skuId = 6; int64 goodsPrice = 7; int32 goodsNum = 8; bool isSelect = 9; } message CreateCartRequest { int64 id = 1; int64 userId = 2 [(validate.rules).int64 = {gt:0}]; int64 goodsId = 3 [(validate.rules).int64 = {gt:0}]; string goodsSn = 4 [(validate.rules).string.min_len = 1]; string goodsName = 5 [(validate.rules).string.min_len = 1]; int64 skuId = 6 [(validate.rules).int64 = {gt:0}]; int64 goodsPrice = 7 [(validate.rules).int64 = {gt:0}]; int32 goodsNum = 8 [(validate.rules).int32 = {gt:0}]; bool isSelect = 9 [(validate.rules).bool.const = true]; } message UpdateCartRequest { int64 id = 1; int32 goodsNum = 2; } message UpdateCartReply {} message CheckResponse{ bool success = 1; } message DeleteCartRequest {} message DeleteCartReply {} message GetCartRequest {} message GetCartReply {} message ListCartRequest { int64 userId = 1; } message CartListReply { repeated CartInfoReply results = 2; } ================================================ FILE: service/order/api/cart/v1/cart_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 // source: cart/v1/cart.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // CartClient is the client API for Cart service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type CartClient interface { CreateCart(ctx context.Context, in *CreateCartRequest, opts ...grpc.CallOption) (*CartInfoReply, error) UpdateCart(ctx context.Context, in *UpdateCartRequest, opts ...grpc.CallOption) (*CheckResponse, error) DeleteCart(ctx context.Context, in *DeleteCartRequest, opts ...grpc.CallOption) (*CheckResponse, error) ListCart(ctx context.Context, in *ListCartRequest, opts ...grpc.CallOption) (*CartListReply, error) } type cartClient struct { cc grpc.ClientConnInterface } func NewCartClient(cc grpc.ClientConnInterface) CartClient { return &cartClient{cc} } func (c *cartClient) CreateCart(ctx context.Context, in *CreateCartRequest, opts ...grpc.CallOption) (*CartInfoReply, error) { out := new(CartInfoReply) err := c.cc.Invoke(ctx, "/cart.v1.Cart/CreateCart", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *cartClient) UpdateCart(ctx context.Context, in *UpdateCartRequest, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/cart.v1.Cart/UpdateCart", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *cartClient) DeleteCart(ctx context.Context, in *DeleteCartRequest, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/cart.v1.Cart/DeleteCart", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *cartClient) ListCart(ctx context.Context, in *ListCartRequest, opts ...grpc.CallOption) (*CartListReply, error) { out := new(CartListReply) err := c.cc.Invoke(ctx, "/cart.v1.Cart/ListCart", in, out, opts...) if err != nil { return nil, err } return out, nil } // CartServer is the server API for Cart service. // All implementations must embed UnimplementedCartServer // for forward compatibility type CartServer interface { CreateCart(context.Context, *CreateCartRequest) (*CartInfoReply, error) UpdateCart(context.Context, *UpdateCartRequest) (*CheckResponse, error) DeleteCart(context.Context, *DeleteCartRequest) (*CheckResponse, error) ListCart(context.Context, *ListCartRequest) (*CartListReply, error) mustEmbedUnimplementedCartServer() } // UnimplementedCartServer must be embedded to have forward compatible implementations. type UnimplementedCartServer struct { } func (UnimplementedCartServer) CreateCart(context.Context, *CreateCartRequest) (*CartInfoReply, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateCart not implemented") } func (UnimplementedCartServer) UpdateCart(context.Context, *UpdateCartRequest) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateCart not implemented") } func (UnimplementedCartServer) DeleteCart(context.Context, *DeleteCartRequest) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteCart not implemented") } func (UnimplementedCartServer) ListCart(context.Context, *ListCartRequest) (*CartListReply, error) { return nil, status.Errorf(codes.Unimplemented, "method ListCart not implemented") } func (UnimplementedCartServer) mustEmbedUnimplementedCartServer() {} // UnsafeCartServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to CartServer will // result in compilation errors. type UnsafeCartServer interface { mustEmbedUnimplementedCartServer() } func RegisterCartServer(s grpc.ServiceRegistrar, srv CartServer) { s.RegisterService(&Cart_ServiceDesc, srv) } func _Cart_CreateCart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateCartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(CartServer).CreateCart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/cart.v1.Cart/CreateCart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CartServer).CreateCart(ctx, req.(*CreateCartRequest)) } return interceptor(ctx, in, info, handler) } func _Cart_UpdateCart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateCartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(CartServer).UpdateCart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/cart.v1.Cart/UpdateCart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CartServer).UpdateCart(ctx, req.(*UpdateCartRequest)) } return interceptor(ctx, in, info, handler) } func _Cart_DeleteCart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteCartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(CartServer).DeleteCart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/cart.v1.Cart/DeleteCart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CartServer).DeleteCart(ctx, req.(*DeleteCartRequest)) } return interceptor(ctx, in, info, handler) } func _Cart_ListCart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListCartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(CartServer).ListCart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/cart.v1.Cart/ListCart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CartServer).ListCart(ctx, req.(*ListCartRequest)) } return interceptor(ctx, in, info, handler) } // Cart_ServiceDesc is the grpc.ServiceDesc for Cart service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Cart_ServiceDesc = grpc.ServiceDesc{ ServiceName: "cart.v1.Cart", HandlerType: (*CartServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateCart", Handler: _Cart_CreateCart_Handler, }, { MethodName: "UpdateCart", Handler: _Cart_UpdateCart_Handler, }, { MethodName: "DeleteCart", Handler: _Cart_DeleteCart_Handler, }, { MethodName: "ListCart", Handler: _Cart_ListCart_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cart/v1/cart.proto", } ================================================ FILE: service/order/api/goods/v1/error_reason.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: goods/v1/error_reason.proto package v1 import ( _ "github.com/go-kratos/kratos/v2/errors" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ErrorReason int32 const ( ErrorReason_USER_NOT_FOUND ErrorReason = 0 ErrorReason_CONTENT_MISSING ErrorReason = 1 ) // Enum value maps for ErrorReason. var ( ErrorReason_name = map[int32]string{ 0: "USER_NOT_FOUND", 1: "CONTENT_MISSING", } ErrorReason_value = map[string]int32{ "USER_NOT_FOUND": 0, "CONTENT_MISSING": 1, } ) func (x ErrorReason) Enum() *ErrorReason { p := new(ErrorReason) *p = x return p } func (x ErrorReason) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ErrorReason) Descriptor() protoreflect.EnumDescriptor { return file_goods_v1_error_reason_proto_enumTypes[0].Descriptor() } func (ErrorReason) Type() protoreflect.EnumType { return &file_goods_v1_error_reason_proto_enumTypes[0] } func (x ErrorReason) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ErrorReason.Descriptor instead. func (ErrorReason) EnumDescriptor() ([]byte, []int) { return file_goods_v1_error_reason_proto_rawDescGZIP(), []int{0} } var File_goods_v1_error_reason_proto protoreflect.FileDescriptor var file_goods_v1_error_reason_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0x48, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x1a, 0x04, 0xa8, 0x45, 0x94, 0x03, 0x12, 0x19, 0x0a, 0x0f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x42, 0x28, 0x5a, 0x15, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0xa2, 0x02, 0x0e, 0x41, 0x50, 0x49, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_goods_v1_error_reason_proto_rawDescOnce sync.Once file_goods_v1_error_reason_proto_rawDescData = file_goods_v1_error_reason_proto_rawDesc ) func file_goods_v1_error_reason_proto_rawDescGZIP() []byte { file_goods_v1_error_reason_proto_rawDescOnce.Do(func() { file_goods_v1_error_reason_proto_rawDescData = protoimpl.X.CompressGZIP(file_goods_v1_error_reason_proto_rawDescData) }) return file_goods_v1_error_reason_proto_rawDescData } var file_goods_v1_error_reason_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_goods_v1_error_reason_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: goods.v1.ErrorReason } var file_goods_v1_error_reason_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_goods_v1_error_reason_proto_init() } func file_goods_v1_error_reason_proto_init() { if File_goods_v1_error_reason_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_goods_v1_error_reason_proto_rawDesc, NumEnums: 1, NumMessages: 0, NumExtensions: 0, NumServices: 0, }, GoTypes: file_goods_v1_error_reason_proto_goTypes, DependencyIndexes: file_goods_v1_error_reason_proto_depIdxs, EnumInfos: file_goods_v1_error_reason_proto_enumTypes, }.Build() File_goods_v1_error_reason_proto = out.File file_goods_v1_error_reason_proto_rawDesc = nil file_goods_v1_error_reason_proto_goTypes = nil file_goods_v1_error_reason_proto_depIdxs = nil } ================================================ FILE: service/order/api/goods/v1/error_reason.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: goods/v1/error_reason.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) ================================================ FILE: service/order/api/goods/v1/error_reason.proto ================================================ syntax = "proto3"; package goods.v1; import "errors/errors.proto"; option go_package = "goods/api/goods/v1;v1"; option objc_class_prefix = "APIGoodsErrors"; enum ErrorReason { option (errors.default_code) = 500; USER_NOT_FOUND = 0 [(errors.code) = 404]; CONTENT_MISSING = 1 [(errors.code) = 400]; } ================================================ FILE: service/order/api/goods/v1/goods.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: goods/v1/goods.proto package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type AttrValueRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AttrId int64 `protobuf:"varint,2,opt,name=attrId,proto3" json:"attrId,omitempty"` GroupId int64 `protobuf:"varint,3,opt,name=groupId,proto3" json:"groupId,omitempty"` Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` } func (x *AttrValueRequest) Reset() { *x = AttrValueRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrValueRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrValueRequest) ProtoMessage() {} func (x *AttrValueRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_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 AttrValueRequest.ProtoReflect.Descriptor instead. func (*AttrValueRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{0} } func (x *AttrValueRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrValueRequest) GetAttrId() int64 { if x != nil { return x.AttrId } return 0 } func (x *AttrValueRequest) GetGroupId() int64 { if x != nil { return x.GroupId } return 0 } func (x *AttrValueRequest) GetValue() string { if x != nil { return x.Value } return "" } type AttrRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` TypeId int64 `protobuf:"varint,2,opt,name=typeId,proto3" json:"typeId,omitempty"` GroupId int64 `protobuf:"varint,3,opt,name=groupId,proto3" json:"groupId,omitempty"` Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` Desc string `protobuf:"bytes,5,opt,name=desc,proto3" json:"desc,omitempty"` Status bool `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` Sort int32 `protobuf:"varint,7,opt,name=sort,proto3" json:"sort,omitempty"` AttrValue []*AttrValueRequest `protobuf:"bytes,8,rep,name=attrValue,proto3" json:"attrValue,omitempty"` } func (x *AttrRequest) Reset() { *x = AttrRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrRequest) ProtoMessage() {} func (x *AttrRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_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 AttrRequest.ProtoReflect.Descriptor instead. func (*AttrRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{1} } func (x *AttrRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrRequest) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *AttrRequest) GetGroupId() int64 { if x != nil { return x.GroupId } return 0 } func (x *AttrRequest) GetTitle() string { if x != nil { return x.Title } return "" } func (x *AttrRequest) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *AttrRequest) GetStatus() bool { if x != nil { return x.Status } return false } func (x *AttrRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } func (x *AttrRequest) GetAttrValue() []*AttrValueRequest { if x != nil { return x.AttrValue } return nil } type AttrValueResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AttrId int64 `protobuf:"varint,2,opt,name=attrId,proto3" json:"attrId,omitempty"` GroupId int64 `protobuf:"varint,3,opt,name=groupId,proto3" json:"groupId,omitempty"` Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` } func (x *AttrValueResponse) Reset() { *x = AttrValueResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrValueResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrValueResponse) ProtoMessage() {} func (x *AttrValueResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_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 AttrValueResponse.ProtoReflect.Descriptor instead. func (*AttrValueResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{2} } func (x *AttrValueResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrValueResponse) GetAttrId() int64 { if x != nil { return x.AttrId } return 0 } func (x *AttrValueResponse) GetGroupId() int64 { if x != nil { return x.GroupId } return 0 } func (x *AttrValueResponse) GetValue() string { if x != nil { return x.Value } return "" } type AttrResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` TypeId int64 `protobuf:"varint,2,opt,name=typeId,proto3" json:"typeId,omitempty"` GroupId int64 `protobuf:"varint,3,opt,name=groupId,proto3" json:"groupId,omitempty"` Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` Desc string `protobuf:"bytes,5,opt,name=desc,proto3" json:"desc,omitempty"` Status bool `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` Sort int32 `protobuf:"varint,7,opt,name=sort,proto3" json:"sort,omitempty"` AttrValue []*AttrValueResponse `protobuf:"bytes,8,rep,name=attrValue,proto3" json:"attrValue,omitempty"` } func (x *AttrResponse) Reset() { *x = AttrResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrResponse) ProtoMessage() {} func (x *AttrResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_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 AttrResponse.ProtoReflect.Descriptor instead. func (*AttrResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{3} } func (x *AttrResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrResponse) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *AttrResponse) GetGroupId() int64 { if x != nil { return x.GroupId } return 0 } func (x *AttrResponse) GetTitle() string { if x != nil { return x.Title } return "" } func (x *AttrResponse) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *AttrResponse) GetStatus() bool { if x != nil { return x.Status } return false } func (x *AttrResponse) GetSort() int32 { if x != nil { return x.Sort } return 0 } func (x *AttrResponse) GetAttrValue() []*AttrValueResponse { if x != nil { return x.AttrValue } return nil } type AttrGroupRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` TypeId int64 `protobuf:"varint,2,opt,name=typeId,proto3" json:"typeId,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` Status bool `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *AttrGroupRequest) Reset() { *x = AttrGroupRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrGroupRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrGroupRequest) ProtoMessage() {} func (x *AttrGroupRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AttrGroupRequest.ProtoReflect.Descriptor instead. func (*AttrGroupRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{4} } func (x *AttrGroupRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrGroupRequest) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *AttrGroupRequest) GetTitle() string { if x != nil { return x.Title } return "" } func (x *AttrGroupRequest) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *AttrGroupRequest) GetStatus() bool { if x != nil { return x.Status } return false } func (x *AttrGroupRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } type AttrGroupResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` TypeId int64 `protobuf:"varint,2,opt,name=typeId,proto3" json:"typeId,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` Status bool `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *AttrGroupResponse) Reset() { *x = AttrGroupResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AttrGroupResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*AttrGroupResponse) ProtoMessage() {} func (x *AttrGroupResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AttrGroupResponse.ProtoReflect.Descriptor instead. func (*AttrGroupResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{5} } func (x *AttrGroupResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AttrGroupResponse) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *AttrGroupResponse) GetTitle() string { if x != nil { return x.Title } return "" } func (x *AttrGroupResponse) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *AttrGroupResponse) GetStatus() bool { if x != nil { return x.Status } return false } func (x *AttrGroupResponse) GetSort() int32 { if x != nil { return x.Sort } return 0 } type SpecificationValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AttrId int64 `protobuf:"varint,2,opt,name=attrId,proto3" json:"attrId,omitempty"` Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *SpecificationValue) Reset() { *x = SpecificationValue{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SpecificationValue) String() string { return protoimpl.X.MessageStringOf(x) } func (*SpecificationValue) ProtoMessage() {} func (x *SpecificationValue) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[6] 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 SpecificationValue.ProtoReflect.Descriptor instead. func (*SpecificationValue) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{6} } func (x *SpecificationValue) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *SpecificationValue) GetAttrId() int64 { if x != nil { return x.AttrId } return 0 } func (x *SpecificationValue) GetValue() string { if x != nil { return x.Value } return "" } func (x *SpecificationValue) GetSort() int32 { if x != nil { return x.Sort } return 0 } type SpecificationValueResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AttrId int64 `protobuf:"varint,2,opt,name=attrId,proto3" json:"attrId,omitempty"` Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *SpecificationValueResponse) Reset() { *x = SpecificationValueResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SpecificationValueResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*SpecificationValueResponse) ProtoMessage() {} func (x *SpecificationValueResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[7] 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 SpecificationValueResponse.ProtoReflect.Descriptor instead. func (*SpecificationValueResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{7} } func (x *SpecificationValueResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *SpecificationValueResponse) GetAttrId() int64 { if x != nil { return x.AttrId } return 0 } func (x *SpecificationValueResponse) GetValue() string { if x != nil { return x.Value } return "" } func (x *SpecificationValueResponse) GetSort() int32 { if x != nil { return x.Sort } return 0 } type SpecificationRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` TypeId int64 `protobuf:"varint,2,opt,name=typeId,proto3" json:"typeId,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` Status bool `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` IsSku bool `protobuf:"varint,6,opt,name=isSku,proto3" json:"isSku,omitempty"` IsSelect bool `protobuf:"varint,7,opt,name=isSelect,proto3" json:"isSelect,omitempty"` SpecificationValue []*SpecificationValue `protobuf:"bytes,8,rep,name=specificationValue,proto3" json:"specificationValue,omitempty"` } func (x *SpecificationRequest) Reset() { *x = SpecificationRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SpecificationRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*SpecificationRequest) ProtoMessage() {} func (x *SpecificationRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[8] 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 SpecificationRequest.ProtoReflect.Descriptor instead. func (*SpecificationRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{8} } func (x *SpecificationRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *SpecificationRequest) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *SpecificationRequest) GetName() string { if x != nil { return x.Name } return "" } func (x *SpecificationRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } func (x *SpecificationRequest) GetStatus() bool { if x != nil { return x.Status } return false } func (x *SpecificationRequest) GetIsSku() bool { if x != nil { return x.IsSku } return false } func (x *SpecificationRequest) GetIsSelect() bool { if x != nil { return x.IsSelect } return false } func (x *SpecificationRequest) GetSpecificationValue() []*SpecificationValue { if x != nil { return x.SpecificationValue } return nil } type SpecificationResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *SpecificationResponse) Reset() { *x = SpecificationResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SpecificationResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*SpecificationResponse) ProtoMessage() {} func (x *SpecificationResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[9] 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 SpecificationResponse.ProtoReflect.Descriptor instead. func (*SpecificationResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{9} } func (x *SpecificationResponse) GetId() int64 { if x != nil { return x.Id } return 0 } type GoodsTypeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` TypeCode string `protobuf:"bytes,3,opt,name=typeCode,proto3" json:"typeCode,omitempty"` NameAlias string `protobuf:"bytes,4,opt,name=nameAlias,proto3" json:"nameAlias,omitempty"` IsVirtual bool `protobuf:"varint,5,opt,name=isVirtual,proto3" json:"isVirtual,omitempty"` Desc string `protobuf:"bytes,6,opt,name=desc,proto3" json:"desc,omitempty"` Sort int32 `protobuf:"varint,7,opt,name=sort,proto3" json:"sort,omitempty"` BrandIds string `protobuf:"bytes,8,opt,name=brandIds,proto3" json:"brandIds,omitempty"` } func (x *GoodsTypeRequest) Reset() { *x = GoodsTypeRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoodsTypeRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoodsTypeRequest) ProtoMessage() {} func (x *GoodsTypeRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[10] 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 GoodsTypeRequest.ProtoReflect.Descriptor instead. func (*GoodsTypeRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{10} } func (x *GoodsTypeRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *GoodsTypeRequest) GetName() string { if x != nil { return x.Name } return "" } func (x *GoodsTypeRequest) GetTypeCode() string { if x != nil { return x.TypeCode } return "" } func (x *GoodsTypeRequest) GetNameAlias() string { if x != nil { return x.NameAlias } return "" } func (x *GoodsTypeRequest) GetIsVirtual() bool { if x != nil { return x.IsVirtual } return false } func (x *GoodsTypeRequest) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *GoodsTypeRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } func (x *GoodsTypeRequest) GetBrandIds() string { if x != nil { return x.BrandIds } return "" } type GoodsTypeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *GoodsTypeResponse) Reset() { *x = GoodsTypeResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoodsTypeResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoodsTypeResponse) ProtoMessage() {} func (x *GoodsTypeResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[11] 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 GoodsTypeResponse.ProtoReflect.Descriptor instead. func (*GoodsTypeResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{11} } func (x *GoodsTypeResponse) GetId() int64 { if x != nil { return x.Id } return 0 } type CreateGoodsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` CategoryId int32 `protobuf:"varint,2,opt,name=categoryId,proto3" json:"categoryId,omitempty"` BrandId int32 `protobuf:"varint,3,opt,name=brandId,proto3" json:"brandId,omitempty"` TypeId int64 `protobuf:"varint,4,opt,name=typeId,proto3" json:"typeId,omitempty"` Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` NameAlias string `protobuf:"bytes,6,opt,name=nameAlias,proto3" json:"nameAlias,omitempty"` GoodsTags string `protobuf:"bytes,7,opt,name=goodsTags,proto3" json:"goodsTags,omitempty"` GoodsSn string `protobuf:"bytes,8,opt,name=goodsSn,proto3" json:"goodsSn,omitempty"` ShopPrice int64 `protobuf:"varint,9,opt,name=shopPrice,proto3" json:"shopPrice,omitempty"` MarketPrice int64 `protobuf:"varint,10,opt,name=marketPrice,proto3" json:"marketPrice,omitempty"` Inventory int64 `protobuf:"varint,11,opt,name=inventory,proto3" json:"inventory,omitempty"` GoodsBrief string `protobuf:"bytes,12,opt,name=goodsBrief,proto3" json:"goodsBrief,omitempty"` GoodsFrontImage string `protobuf:"bytes,13,opt,name=goodsFrontImage,proto3" json:"goodsFrontImage,omitempty"` GoodsImages []string `protobuf:"bytes,14,rep,name=goodsImages,proto3" json:"goodsImages,omitempty"` ShipFree bool `protobuf:"varint,15,opt,name=shipFree,proto3" json:"shipFree,omitempty"` ShipId int32 `protobuf:"varint,16,opt,name=shipId,proto3" json:"shipId,omitempty"` IsNew bool `protobuf:"varint,17,opt,name=isNew,proto3" json:"isNew,omitempty"` IsHot bool `protobuf:"varint,18,opt,name=isHot,proto3" json:"isHot,omitempty"` OnSale bool `protobuf:"varint,19,opt,name=onSale,proto3" json:"onSale,omitempty"` Sku []*CreateGoodsRequestGoodsSku `protobuf:"bytes,20,rep,name=sku,proto3" json:"sku,omitempty"` } func (x *CreateGoodsRequest) Reset() { *x = CreateGoodsRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsRequest) ProtoMessage() {} func (x *CreateGoodsRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[12] 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 CreateGoodsRequest.ProtoReflect.Descriptor instead. func (*CreateGoodsRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{12} } func (x *CreateGoodsRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *CreateGoodsRequest) GetCategoryId() int32 { if x != nil { return x.CategoryId } return 0 } func (x *CreateGoodsRequest) GetBrandId() int32 { if x != nil { return x.BrandId } return 0 } func (x *CreateGoodsRequest) GetTypeId() int64 { if x != nil { return x.TypeId } return 0 } func (x *CreateGoodsRequest) GetName() string { if x != nil { return x.Name } return "" } func (x *CreateGoodsRequest) GetNameAlias() string { if x != nil { return x.NameAlias } return "" } func (x *CreateGoodsRequest) GetGoodsTags() string { if x != nil { return x.GoodsTags } return "" } func (x *CreateGoodsRequest) GetGoodsSn() string { if x != nil { return x.GoodsSn } return "" } func (x *CreateGoodsRequest) GetShopPrice() int64 { if x != nil { return x.ShopPrice } return 0 } func (x *CreateGoodsRequest) GetMarketPrice() int64 { if x != nil { return x.MarketPrice } return 0 } func (x *CreateGoodsRequest) GetInventory() int64 { if x != nil { return x.Inventory } return 0 } func (x *CreateGoodsRequest) GetGoodsBrief() string { if x != nil { return x.GoodsBrief } return "" } func (x *CreateGoodsRequest) GetGoodsFrontImage() string { if x != nil { return x.GoodsFrontImage } return "" } func (x *CreateGoodsRequest) GetGoodsImages() []string { if x != nil { return x.GoodsImages } return nil } func (x *CreateGoodsRequest) GetShipFree() bool { if x != nil { return x.ShipFree } return false } func (x *CreateGoodsRequest) GetShipId() int32 { if x != nil { return x.ShipId } return 0 } func (x *CreateGoodsRequest) GetIsNew() bool { if x != nil { return x.IsNew } return false } func (x *CreateGoodsRequest) GetIsHot() bool { if x != nil { return x.IsHot } return false } func (x *CreateGoodsRequest) GetOnSale() bool { if x != nil { return x.OnSale } return false } func (x *CreateGoodsRequest) GetSku() []*CreateGoodsRequestGoodsSku { if x != nil { return x.Sku } return nil } type CreateGoodsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` } func (x *CreateGoodsResponse) Reset() { *x = CreateGoodsResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsResponse) ProtoMessage() {} func (x *CreateGoodsResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[13] 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 CreateGoodsResponse.ProtoReflect.Descriptor instead. func (*CreateGoodsResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{13} } func (x *CreateGoodsResponse) GetID() int64 { if x != nil { return x.ID } return 0 } type GoodsInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` CategoryId int32 `protobuf:"varint,2,opt,name=categoryId,proto3" json:"categoryId,omitempty"` BrandId int32 `protobuf:"varint,3,opt,name=brandId,proto3" json:"brandId,omitempty"` Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` GoodsSn string `protobuf:"bytes,5,opt,name=goodsSn,proto3" json:"goodsSn,omitempty"` ClickNum int64 `protobuf:"varint,6,opt,name=clickNum,proto3" json:"clickNum,omitempty"` SoldNum int64 `protobuf:"varint,7,opt,name=soldNum,proto3" json:"soldNum,omitempty"` FavNum int64 `protobuf:"varint,8,opt,name=favNum,proto3" json:"favNum,omitempty"` MarketPrice int64 `protobuf:"varint,9,opt,name=marketPrice,proto3" json:"marketPrice,omitempty"` GoodsBrief string `protobuf:"bytes,10,opt,name=goodsBrief,proto3" json:"goodsBrief,omitempty"` GoodsDesc string `protobuf:"bytes,11,opt,name=goodsDesc,proto3" json:"goodsDesc,omitempty"` ShipFree bool `protobuf:"varint,12,opt,name=shipFree,proto3" json:"shipFree,omitempty"` Images string `protobuf:"bytes,13,opt,name=images,proto3" json:"images,omitempty"` GoodsImages []string `protobuf:"bytes,14,rep,name=goodsImages,proto3" json:"goodsImages,omitempty"` IsNew bool `protobuf:"varint,15,opt,name=isNew,proto3" json:"isNew,omitempty"` IsHot bool `protobuf:"varint,16,opt,name=isHot,proto3" json:"isHot,omitempty"` OnSale bool `protobuf:"varint,17,opt,name=onSale,proto3" json:"onSale,omitempty"` } func (x *GoodsInfoResponse) Reset() { *x = GoodsInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoodsInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoodsInfoResponse) ProtoMessage() {} func (x *GoodsInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[14] 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 GoodsInfoResponse.ProtoReflect.Descriptor instead. func (*GoodsInfoResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{14} } func (x *GoodsInfoResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *GoodsInfoResponse) GetCategoryId() int32 { if x != nil { return x.CategoryId } return 0 } func (x *GoodsInfoResponse) GetBrandId() int32 { if x != nil { return x.BrandId } return 0 } func (x *GoodsInfoResponse) GetName() string { if x != nil { return x.Name } return "" } func (x *GoodsInfoResponse) GetGoodsSn() string { if x != nil { return x.GoodsSn } return "" } func (x *GoodsInfoResponse) GetClickNum() int64 { if x != nil { return x.ClickNum } return 0 } func (x *GoodsInfoResponse) GetSoldNum() int64 { if x != nil { return x.SoldNum } return 0 } func (x *GoodsInfoResponse) GetFavNum() int64 { if x != nil { return x.FavNum } return 0 } func (x *GoodsInfoResponse) GetMarketPrice() int64 { if x != nil { return x.MarketPrice } return 0 } func (x *GoodsInfoResponse) GetGoodsBrief() string { if x != nil { return x.GoodsBrief } return "" } func (x *GoodsInfoResponse) GetGoodsDesc() string { if x != nil { return x.GoodsDesc } return "" } func (x *GoodsInfoResponse) GetShipFree() bool { if x != nil { return x.ShipFree } return false } func (x *GoodsInfoResponse) GetImages() string { if x != nil { return x.Images } return "" } func (x *GoodsInfoResponse) GetGoodsImages() []string { if x != nil { return x.GoodsImages } return nil } func (x *GoodsInfoResponse) GetIsNew() bool { if x != nil { return x.IsNew } return false } func (x *GoodsInfoResponse) GetIsHot() bool { if x != nil { return x.IsHot } return false } func (x *GoodsInfoResponse) GetOnSale() bool { if x != nil { return x.OnSale } return false } type GoodsListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` List []*GoodsInfoResponse `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` } func (x *GoodsListResponse) Reset() { *x = GoodsListResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoodsListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoodsListResponse) ProtoMessage() {} func (x *GoodsListResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[15] 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 GoodsListResponse.ProtoReflect.Descriptor instead. func (*GoodsListResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{15} } func (x *GoodsListResponse) GetTotal() int64 { if x != nil { return x.Total } return 0 } func (x *GoodsListResponse) GetList() []*GoodsInfoResponse { if x != nil { return x.List } return nil } type GoodsFilterRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Keywords string `protobuf:"bytes,1,opt,name=keywords,proto3" json:"keywords,omitempty"` CategoryId int32 `protobuf:"varint,2,opt,name=categoryId,proto3" json:"categoryId,omitempty"` BrandId int32 `protobuf:"varint,3,opt,name=brandId,proto3" json:"brandId,omitempty"` MinPrice int64 `protobuf:"varint,4,opt,name=minPrice,proto3" json:"minPrice,omitempty"` MaxPrice int64 `protobuf:"varint,5,opt,name=maxPrice,proto3" json:"maxPrice,omitempty"` IsHot bool `protobuf:"varint,6,opt,name=isHot,proto3" json:"isHot,omitempty"` IsNew bool `protobuf:"varint,7,opt,name=isNew,proto3" json:"isNew,omitempty"` IsTab bool `protobuf:"varint,8,opt,name=isTab,proto3" json:"isTab,omitempty"` ClickNum int64 `protobuf:"varint,9,opt,name=clickNum,proto3" json:"clickNum,omitempty"` SoldNum int64 `protobuf:"varint,10,opt,name=soldNum,proto3" json:"soldNum,omitempty"` FavNum int64 `protobuf:"varint,11,opt,name=favNum,proto3" json:"favNum,omitempty"` Pages int64 `protobuf:"varint,12,opt,name=pages,proto3" json:"pages,omitempty"` PagePerNums int64 `protobuf:"varint,13,opt,name=pagePerNums,proto3" json:"pagePerNums,omitempty"` Id int64 `protobuf:"varint,14,opt,name=id,proto3" json:"id,omitempty"` } func (x *GoodsFilterRequest) Reset() { *x = GoodsFilterRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoodsFilterRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoodsFilterRequest) ProtoMessage() {} func (x *GoodsFilterRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[16] 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 GoodsFilterRequest.ProtoReflect.Descriptor instead. func (*GoodsFilterRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{16} } func (x *GoodsFilterRequest) GetKeywords() string { if x != nil { return x.Keywords } return "" } func (x *GoodsFilterRequest) GetCategoryId() int32 { if x != nil { return x.CategoryId } return 0 } func (x *GoodsFilterRequest) GetBrandId() int32 { if x != nil { return x.BrandId } return 0 } func (x *GoodsFilterRequest) GetMinPrice() int64 { if x != nil { return x.MinPrice } return 0 } func (x *GoodsFilterRequest) GetMaxPrice() int64 { if x != nil { return x.MaxPrice } return 0 } func (x *GoodsFilterRequest) GetIsHot() bool { if x != nil { return x.IsHot } return false } func (x *GoodsFilterRequest) GetIsNew() bool { if x != nil { return x.IsNew } return false } func (x *GoodsFilterRequest) GetIsTab() bool { if x != nil { return x.IsTab } return false } func (x *GoodsFilterRequest) GetClickNum() int64 { if x != nil { return x.ClickNum } return 0 } func (x *GoodsFilterRequest) GetSoldNum() int64 { if x != nil { return x.SoldNum } return 0 } func (x *GoodsFilterRequest) GetFavNum() int64 { if x != nil { return x.FavNum } return 0 } func (x *GoodsFilterRequest) GetPages() int64 { if x != nil { return x.Pages } return 0 } func (x *GoodsFilterRequest) GetPagePerNums() int64 { if x != nil { return x.PagePerNums } return 0 } func (x *GoodsFilterRequest) GetId() int64 { if x != nil { return x.Id } return 0 } // 商品分类 type CategoryInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` ParentCategory int32 `protobuf:"varint,3,opt,name=parentCategory,proto3" json:"parentCategory,omitempty"` Level int32 `protobuf:"varint,4,opt,name=level,proto3" json:"level,omitempty"` IsTab bool `protobuf:"varint,5,opt,name=isTab,proto3" json:"isTab,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *CategoryInfoResponse) Reset() { *x = CategoryInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CategoryInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CategoryInfoResponse) ProtoMessage() {} func (x *CategoryInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[17] 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 CategoryInfoResponse.ProtoReflect.Descriptor instead. func (*CategoryInfoResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{17} } func (x *CategoryInfoResponse) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *CategoryInfoResponse) GetName() string { if x != nil { return x.Name } return "" } func (x *CategoryInfoResponse) GetParentCategory() int32 { if x != nil { return x.ParentCategory } return 0 } func (x *CategoryInfoResponse) GetLevel() int32 { if x != nil { return x.Level } return 0 } func (x *CategoryInfoResponse) GetIsTab() bool { if x != nil { return x.IsTab } return false } func (x *CategoryInfoResponse) GetSort() int32 { if x != nil { return x.Sort } return 0 } type CategoryListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields JsonData string `protobuf:"bytes,1,opt,name=jsonData,proto3" json:"jsonData,omitempty"` } func (x *CategoryListResponse) Reset() { *x = CategoryListResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CategoryListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CategoryListResponse) ProtoMessage() {} func (x *CategoryListResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[18] 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 CategoryListResponse.ProtoReflect.Descriptor instead. func (*CategoryListResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{18} } func (x *CategoryListResponse) GetJsonData() string { if x != nil { return x.JsonData } return "" } type CategoryListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` } func (x *CategoryListRequest) Reset() { *x = CategoryListRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CategoryListRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*CategoryListRequest) ProtoMessage() {} func (x *CategoryListRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[19] 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 CategoryListRequest.ProtoReflect.Descriptor instead. func (*CategoryListRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{19} } func (x *CategoryListRequest) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *CategoryListRequest) GetLevel() int32 { if x != nil { return x.Level } return 0 } type SubCategoryListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Info *CategoryInfoResponse `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` SubCategory []*CategoryInfoResponse `protobuf:"bytes,2,rep,name=subCategory,proto3" json:"subCategory,omitempty"` } func (x *SubCategoryListResponse) Reset() { *x = SubCategoryListResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SubCategoryListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*SubCategoryListResponse) ProtoMessage() {} func (x *SubCategoryListResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[20] 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 SubCategoryListResponse.ProtoReflect.Descriptor instead. func (*SubCategoryListResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{20} } func (x *SubCategoryListResponse) GetInfo() *CategoryInfoResponse { if x != nil { return x.Info } return nil } func (x *SubCategoryListResponse) GetSubCategory() []*CategoryInfoResponse { if x != nil { return x.SubCategory } return nil } type CategoryInfoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` ParentCategory int32 `protobuf:"varint,3,opt,name=parentCategory,proto3" json:"parentCategory,omitempty"` Level int32 `protobuf:"varint,4,opt,name=level,proto3" json:"level,omitempty"` IsTab bool `protobuf:"varint,5,opt,name=isTab,proto3" json:"isTab,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *CategoryInfoRequest) Reset() { *x = CategoryInfoRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CategoryInfoRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*CategoryInfoRequest) ProtoMessage() {} func (x *CategoryInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[21] 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 CategoryInfoRequest.ProtoReflect.Descriptor instead. func (*CategoryInfoRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{21} } func (x *CategoryInfoRequest) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *CategoryInfoRequest) GetName() string { if x != nil { return x.Name } return "" } func (x *CategoryInfoRequest) GetParentCategory() int32 { if x != nil { return x.ParentCategory } return 0 } func (x *CategoryInfoRequest) GetLevel() int32 { if x != nil { return x.Level } return 0 } func (x *CategoryInfoRequest) GetIsTab() bool { if x != nil { return x.IsTab } return false } func (x *CategoryInfoRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } type BatchCategoryInfoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id []int32 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` GoodsNums int32 `protobuf:"varint,2,opt,name=goodsNums,proto3" json:"goodsNums,omitempty"` BrandNums int32 `protobuf:"varint,3,opt,name=brandNums,proto3" json:"brandNums,omitempty"` } func (x *BatchCategoryInfoRequest) Reset() { *x = BatchCategoryInfoRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BatchCategoryInfoRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*BatchCategoryInfoRequest) ProtoMessage() {} func (x *BatchCategoryInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[22] 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 BatchCategoryInfoRequest.ProtoReflect.Descriptor instead. func (*BatchCategoryInfoRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{22} } func (x *BatchCategoryInfoRequest) GetId() []int32 { if x != nil { return x.Id } return nil } func (x *BatchCategoryInfoRequest) GetGoodsNums() int32 { if x != nil { return x.GoodsNums } return 0 } func (x *BatchCategoryInfoRequest) GetBrandNums() int32 { if x != nil { return x.BrandNums } return 0 } type DeleteCategoryRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *DeleteCategoryRequest) Reset() { *x = DeleteCategoryRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *DeleteCategoryRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*DeleteCategoryRequest) ProtoMessage() {} func (x *DeleteCategoryRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[23] 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 DeleteCategoryRequest.ProtoReflect.Descriptor instead. func (*DeleteCategoryRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{23} } func (x *DeleteCategoryRequest) GetId() int32 { if x != nil { return x.Id } return 0 } type BrandListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Pages int32 `protobuf:"varint,1,opt,name=pages,proto3" json:"pages,omitempty"` PagePerNums int32 `protobuf:"varint,2,opt,name=pagePerNums,proto3" json:"pagePerNums,omitempty"` } func (x *BrandListRequest) Reset() { *x = BrandListRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BrandListRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*BrandListRequest) ProtoMessage() {} func (x *BrandListRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[24] 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 BrandListRequest.ProtoReflect.Descriptor instead. func (*BrandListRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{24} } func (x *BrandListRequest) GetPages() int32 { if x != nil { return x.Pages } return 0 } func (x *BrandListRequest) GetPagePerNums() int32 { if x != nil { return x.PagePerNums } return 0 } type BrandRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Logo string `protobuf:"bytes,3,opt,name=logo,proto3" json:"logo,omitempty"` Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` IsTab bool `protobuf:"varint,5,opt,name=isTab,proto3" json:"isTab,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *BrandRequest) Reset() { *x = BrandRequest{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BrandRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*BrandRequest) ProtoMessage() {} func (x *BrandRequest) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[25] 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 BrandRequest.ProtoReflect.Descriptor instead. func (*BrandRequest) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{25} } func (x *BrandRequest) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *BrandRequest) GetName() string { if x != nil { return x.Name } return "" } func (x *BrandRequest) GetLogo() string { if x != nil { return x.Logo } return "" } func (x *BrandRequest) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *BrandRequest) GetIsTab() bool { if x != nil { return x.IsTab } return false } func (x *BrandRequest) GetSort() int32 { if x != nil { return x.Sort } return 0 } type BrandInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Logo string `protobuf:"bytes,3,opt,name=logo,proto3" json:"logo,omitempty"` Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` IsTab bool `protobuf:"varint,5,opt,name=isTab,proto3" json:"isTab,omitempty"` Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` } func (x *BrandInfoResponse) Reset() { *x = BrandInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BrandInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*BrandInfoResponse) ProtoMessage() {} func (x *BrandInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[26] 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 BrandInfoResponse.ProtoReflect.Descriptor instead. func (*BrandInfoResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{26} } func (x *BrandInfoResponse) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *BrandInfoResponse) GetName() string { if x != nil { return x.Name } return "" } func (x *BrandInfoResponse) GetLogo() string { if x != nil { return x.Logo } return "" } func (x *BrandInfoResponse) GetDesc() string { if x != nil { return x.Desc } return "" } func (x *BrandInfoResponse) GetIsTab() bool { if x != nil { return x.IsTab } return false } func (x *BrandInfoResponse) GetSort() int32 { if x != nil { return x.Sort } return 0 } type BrandListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Data []*BrandInfoResponse `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` } func (x *BrandListResponse) Reset() { *x = BrandListResponse{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BrandListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*BrandListResponse) ProtoMessage() {} func (x *BrandListResponse) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[27] 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 BrandListResponse.ProtoReflect.Descriptor instead. func (*BrandListResponse) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{27} } func (x *BrandListResponse) GetTotal() int32 { if x != nil { return x.Total } return 0 } func (x *BrandListResponse) GetData() []*BrandInfoResponse { if x != nil { return x.Data } return nil } // 根据商品类型 选择商品规格信息并选择 // 商品 sku 属性值 里面有规格的ID和属性的ID,分别是几组信息 type CreateGoodsRequestGoodsSku struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` GoodsId int64 `protobuf:"varint,2,opt,name=goodsId,proto3" json:"goodsId,omitempty"` SkuName string `protobuf:"bytes,3,opt,name=skuName,proto3" json:"skuName,omitempty"` Code string `protobuf:"bytes,4,opt,name=code,proto3" json:"code,omitempty"` BarCode string `protobuf:"bytes,5,opt,name=barCode,proto3" json:"barCode,omitempty"` Price int64 `protobuf:"varint,6,opt,name=price,proto3" json:"price,omitempty"` PromotionPrice int64 `protobuf:"varint,7,opt,name=promotionPrice,proto3" json:"promotionPrice,omitempty"` Points int64 `protobuf:"varint,8,opt,name=points,proto3" json:"points,omitempty"` Image string `protobuf:"bytes,9,opt,name=image,proto3" json:"image,omitempty"` Sort int32 `protobuf:"varint,10,opt,name=sort,proto3" json:"sort,omitempty"` Inventory int64 `protobuf:"varint,11,opt,name=inventory,proto3" json:"inventory,omitempty"` // sku 库存 SpecificationInfo []*CreateGoodsRequestGoodsSkuSpecification `protobuf:"bytes,12,rep,name=specificationInfo,proto3" json:"specificationInfo,omitempty"` GroupAttrInfo []*CreateGoodsRequestGoodsSkuGroupAttr `protobuf:"bytes,13,rep,name=groupAttrInfo,proto3" json:"groupAttrInfo,omitempty"` } func (x *CreateGoodsRequestGoodsSku) Reset() { *x = CreateGoodsRequestGoodsSku{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsRequestGoodsSku) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsRequestGoodsSku) ProtoMessage() {} func (x *CreateGoodsRequestGoodsSku) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[28] 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 CreateGoodsRequestGoodsSku.ProtoReflect.Descriptor instead. func (*CreateGoodsRequestGoodsSku) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{12, 0} } func (x *CreateGoodsRequestGoodsSku) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *CreateGoodsRequestGoodsSku) GetGoodsId() int64 { if x != nil { return x.GoodsId } return 0 } func (x *CreateGoodsRequestGoodsSku) GetSkuName() string { if x != nil { return x.SkuName } return "" } func (x *CreateGoodsRequestGoodsSku) GetCode() string { if x != nil { return x.Code } return "" } func (x *CreateGoodsRequestGoodsSku) GetBarCode() string { if x != nil { return x.BarCode } return "" } func (x *CreateGoodsRequestGoodsSku) GetPrice() int64 { if x != nil { return x.Price } return 0 } func (x *CreateGoodsRequestGoodsSku) GetPromotionPrice() int64 { if x != nil { return x.PromotionPrice } return 0 } func (x *CreateGoodsRequestGoodsSku) GetPoints() int64 { if x != nil { return x.Points } return 0 } func (x *CreateGoodsRequestGoodsSku) GetImage() string { if x != nil { return x.Image } return "" } func (x *CreateGoodsRequestGoodsSku) GetSort() int32 { if x != nil { return x.Sort } return 0 } func (x *CreateGoodsRequestGoodsSku) GetInventory() int64 { if x != nil { return x.Inventory } return 0 } func (x *CreateGoodsRequestGoodsSku) GetSpecificationInfo() []*CreateGoodsRequestGoodsSkuSpecification { if x != nil { return x.SpecificationInfo } return nil } func (x *CreateGoodsRequestGoodsSku) GetGroupAttrInfo() []*CreateGoodsRequestGoodsSkuGroupAttr { if x != nil { return x.GroupAttrInfo } return nil } // 规格 type CreateGoodsRequestGoodsSkuSpecification struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields SId int64 `protobuf:"varint,1,opt,name=sId,proto3" json:"sId,omitempty"` VId int64 `protobuf:"varint,2,opt,name=vId,proto3" json:"vId,omitempty"` } func (x *CreateGoodsRequestGoodsSkuSpecification) Reset() { *x = CreateGoodsRequestGoodsSkuSpecification{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsRequestGoodsSkuSpecification) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsRequestGoodsSkuSpecification) ProtoMessage() {} func (x *CreateGoodsRequestGoodsSkuSpecification) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[29] 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 CreateGoodsRequestGoodsSkuSpecification.ProtoReflect.Descriptor instead. func (*CreateGoodsRequestGoodsSkuSpecification) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{12, 0, 0} } func (x *CreateGoodsRequestGoodsSkuSpecification) GetSId() int64 { if x != nil { return x.SId } return 0 } func (x *CreateGoodsRequestGoodsSkuSpecification) GetVId() int64 { if x != nil { return x.VId } return 0 } // 属性组 type CreateGoodsRequestGoodsSkuGroupAttr struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields GroupId int64 `protobuf:"varint,1,opt,name=groupId,proto3" json:"groupId,omitempty"` GroupName string `protobuf:"bytes,2,opt,name=groupName,proto3" json:"groupName,omitempty"` AttrInfo []*CreateGoodsRequestGoodsSkuGroupAttrAttr `protobuf:"bytes,3,rep,name=attrInfo,proto3" json:"attrInfo,omitempty"` } func (x *CreateGoodsRequestGoodsSkuGroupAttr) Reset() { *x = CreateGoodsRequestGoodsSkuGroupAttr{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsRequestGoodsSkuGroupAttr) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsRequestGoodsSkuGroupAttr) ProtoMessage() {} func (x *CreateGoodsRequestGoodsSkuGroupAttr) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[30] 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 CreateGoodsRequestGoodsSkuGroupAttr.ProtoReflect.Descriptor instead. func (*CreateGoodsRequestGoodsSkuGroupAttr) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{12, 0, 1} } func (x *CreateGoodsRequestGoodsSkuGroupAttr) GetGroupId() int64 { if x != nil { return x.GroupId } return 0 } func (x *CreateGoodsRequestGoodsSkuGroupAttr) GetGroupName() string { if x != nil { return x.GroupName } return "" } func (x *CreateGoodsRequestGoodsSkuGroupAttr) GetAttrInfo() []*CreateGoodsRequestGoodsSkuGroupAttrAttr { if x != nil { return x.AttrInfo } return nil } type CreateGoodsRequestGoodsSkuGroupAttrAttr struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AttrId int64 `protobuf:"varint,1,opt,name=attrId,proto3" json:"attrId,omitempty"` AttrName string `protobuf:"bytes,2,opt,name=attrName,proto3" json:"attrName,omitempty"` AttrValueId int64 `protobuf:"varint,3,opt,name=attrValueId,proto3" json:"attrValueId,omitempty"` AttrValueName string `protobuf:"bytes,4,opt,name=attrValueName,proto3" json:"attrValueName,omitempty"` } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) Reset() { *x = CreateGoodsRequestGoodsSkuGroupAttrAttr{} if protoimpl.UnsafeEnabled { mi := &file_goods_v1_goods_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateGoodsRequestGoodsSkuGroupAttrAttr) ProtoMessage() {} func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) ProtoReflect() protoreflect.Message { mi := &file_goods_v1_goods_proto_msgTypes[31] 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 CreateGoodsRequestGoodsSkuGroupAttrAttr.ProtoReflect.Descriptor instead. func (*CreateGoodsRequestGoodsSkuGroupAttrAttr) Descriptor() ([]byte, []int) { return file_goods_v1_goods_proto_rawDescGZIP(), []int{12, 0, 1, 0} } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) GetAttrId() int64 { if x != nil { return x.AttrId } return 0 } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) GetAttrName() string { if x != nil { return x.AttrName } return "" } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) GetAttrValueId() int64 { if x != nil { return x.AttrValueId } return 0 } func (x *CreateGoodsRequestGoodsSkuGroupAttrAttr) GetAttrValueName() string { if x != nil { return x.AttrValueName } return "" } var File_goods_v1_goods_proto protoreflect.FileDescriptor var file_goods_v1_goods_proto_rawDesc = []byte{ 0x0a, 0x14, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 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, 0x7c, 0x0a, 0x10, 0x41, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x83, 0x02, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x6b, 0x0a, 0x11, 0x41, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xe1, 0x01, 0x0a, 0x0c, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x39, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x10, 0x41, 0x74, 0x74, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x03, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x91, 0x01, 0x0a, 0x11, 0x41, 0x74, 0x74, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x78, 0x0a, 0x12, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x6e, 0x0a, 0x1a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x99, 0x02, 0x0a, 0x14, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x53, 0x6b, 0x75, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x53, 0x6b, 0x75, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x4c, 0x0a, 0x12, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x27, 0x0a, 0x15, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xed, 0x01, 0x0a, 0x10, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 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, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x03, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x23, 0x0a, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x73, 0x22, 0x23, 0x0a, 0x11, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xf0, 0x0b, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x61, 0x67, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x61, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x70, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x70, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x42, 0x72, 0x69, 0x65, 0x66, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x42, 0x72, 0x69, 0x65, 0x66, 0x12, 0x28, 0x0a, 0x0f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x68, 0x69, 0x70, 0x46, 0x72, 0x65, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x68, 0x69, 0x70, 0x46, 0x72, 0x65, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x68, 0x69, 0x70, 0x49, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x68, 0x69, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x53, 0x61, 0x6c, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, 0x53, 0x61, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x6b, 0x75, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6b, 0x75, 0x52, 0x03, 0x73, 0x6b, 0x75, 0x1a, 0xf7, 0x06, 0x0a, 0x08, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6b, 0x75, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x73, 0x6b, 0x75, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x73, 0x6b, 0x75, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x07, 0x62, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x62, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x61, 0x0a, 0x11, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6b, 0x75, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x55, 0x0a, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6b, 0x75, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x52, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x45, 0x0a, 0x0d, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x03, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x03, 0x73, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x03, 0x76, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x03, 0x76, 0x49, 0x64, 0x1a, 0xbe, 0x02, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x08, 0x61, 0x74, 0x74, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6b, 0x75, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x52, 0x08, 0x61, 0x74, 0x74, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0xa6, 0x01, 0x0a, 0x04, 0x61, 0x74, 0x74, 0x72, 0x12, 0x1f, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x06, 0x61, 0x74, 0x74, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x08, 0x61, 0x74, 0x74, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x61, 0x74, 0x74, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x0b, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0d, 0x61, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x25, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x44, 0x22, 0xd3, 0x03, 0x0a, 0x11, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x76, 0x4e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x61, 0x76, 0x4e, 0x75, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x42, 0x72, 0x69, 0x65, 0x66, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x42, 0x72, 0x69, 0x65, 0x66, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x65, 0x73, 0x63, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x65, 0x73, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x68, 0x69, 0x70, 0x46, 0x72, 0x65, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x68, 0x69, 0x70, 0x46, 0x72, 0x65, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x53, 0x61, 0x6c, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, 0x53, 0x61, 0x6c, 0x65, 0x22, 0x5a, 0x0a, 0x11, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2f, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xfa, 0x02, 0x0a, 0x12, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x48, 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x76, 0x4e, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x61, 0x76, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xa2, 0x01, 0x0a, 0x14, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x32, 0x0a, 0x14, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3b, 0x0a, 0x13, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x8f, 0x01, 0x0a, 0x17, 0x53, 0x75, 0x62, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x40, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0xa1, 0x01, 0x0a, 0x13, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x66, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x75, 0x6d, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x73, 0x22, 0x27, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4a, 0x0a, 0x10, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x0c, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x11, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x54, 0x61, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x5a, 0x0a, 0x11, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xa6, 0x09, 0x0a, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x4c, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x09, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4a, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x17, 0x5a, 0x15, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_goods_v1_goods_proto_rawDescOnce sync.Once file_goods_v1_goods_proto_rawDescData = file_goods_v1_goods_proto_rawDesc ) func file_goods_v1_goods_proto_rawDescGZIP() []byte { file_goods_v1_goods_proto_rawDescOnce.Do(func() { file_goods_v1_goods_proto_rawDescData = protoimpl.X.CompressGZIP(file_goods_v1_goods_proto_rawDescData) }) return file_goods_v1_goods_proto_rawDescData } var file_goods_v1_goods_proto_msgTypes = make([]protoimpl.MessageInfo, 32) var file_goods_v1_goods_proto_goTypes = []interface{}{ (*AttrValueRequest)(nil), // 0: goods.v1.AttrValueRequest (*AttrRequest)(nil), // 1: goods.v1.AttrRequest (*AttrValueResponse)(nil), // 2: goods.v1.AttrValueResponse (*AttrResponse)(nil), // 3: goods.v1.AttrResponse (*AttrGroupRequest)(nil), // 4: goods.v1.AttrGroupRequest (*AttrGroupResponse)(nil), // 5: goods.v1.AttrGroupResponse (*SpecificationValue)(nil), // 6: goods.v1.SpecificationValue (*SpecificationValueResponse)(nil), // 7: goods.v1.SpecificationValueResponse (*SpecificationRequest)(nil), // 8: goods.v1.SpecificationRequest (*SpecificationResponse)(nil), // 9: goods.v1.SpecificationResponse (*GoodsTypeRequest)(nil), // 10: goods.v1.GoodsTypeRequest (*GoodsTypeResponse)(nil), // 11: goods.v1.GoodsTypeResponse (*CreateGoodsRequest)(nil), // 12: goods.v1.CreateGoodsRequest (*CreateGoodsResponse)(nil), // 13: goods.v1.CreateGoodsResponse (*GoodsInfoResponse)(nil), // 14: goods.v1.GoodsInfoResponse (*GoodsListResponse)(nil), // 15: goods.v1.GoodsListResponse (*GoodsFilterRequest)(nil), // 16: goods.v1.GoodsFilterRequest (*CategoryInfoResponse)(nil), // 17: goods.v1.CategoryInfoResponse (*CategoryListResponse)(nil), // 18: goods.v1.CategoryListResponse (*CategoryListRequest)(nil), // 19: goods.v1.CategoryListRequest (*SubCategoryListResponse)(nil), // 20: goods.v1.SubCategoryListResponse (*CategoryInfoRequest)(nil), // 21: goods.v1.CategoryInfoRequest (*BatchCategoryInfoRequest)(nil), // 22: goods.v1.BatchCategoryInfoRequest (*DeleteCategoryRequest)(nil), // 23: goods.v1.DeleteCategoryRequest (*BrandListRequest)(nil), // 24: goods.v1.BrandListRequest (*BrandRequest)(nil), // 25: goods.v1.BrandRequest (*BrandInfoResponse)(nil), // 26: goods.v1.BrandInfoResponse (*BrandListResponse)(nil), // 27: goods.v1.BrandListResponse (*CreateGoodsRequestGoodsSku)(nil), // 28: goods.v1.CreateGoodsRequest.goodsSku (*CreateGoodsRequestGoodsSkuSpecification)(nil), // 29: goods.v1.CreateGoodsRequest.goodsSku.specification (*CreateGoodsRequestGoodsSkuGroupAttr)(nil), // 30: goods.v1.CreateGoodsRequest.goodsSku.groupAttr (*CreateGoodsRequestGoodsSkuGroupAttrAttr)(nil), // 31: goods.v1.CreateGoodsRequest.goodsSku.groupAttr.attr (*emptypb.Empty)(nil), // 32: google.protobuf.Empty } var file_goods_v1_goods_proto_depIdxs = []int32{ 0, // 0: goods.v1.AttrRequest.attrValue:type_name -> goods.v1.AttrValueRequest 2, // 1: goods.v1.AttrResponse.attrValue:type_name -> goods.v1.AttrValueResponse 6, // 2: goods.v1.SpecificationRequest.specificationValue:type_name -> goods.v1.SpecificationValue 28, // 3: goods.v1.CreateGoodsRequest.sku:type_name -> goods.v1.CreateGoodsRequest.goodsSku 14, // 4: goods.v1.GoodsListResponse.list:type_name -> goods.v1.GoodsInfoResponse 17, // 5: goods.v1.SubCategoryListResponse.info:type_name -> goods.v1.CategoryInfoResponse 17, // 6: goods.v1.SubCategoryListResponse.subCategory:type_name -> goods.v1.CategoryInfoResponse 26, // 7: goods.v1.BrandListResponse.data:type_name -> goods.v1.BrandInfoResponse 29, // 8: goods.v1.CreateGoodsRequest.goodsSku.specificationInfo:type_name -> goods.v1.CreateGoodsRequest.goodsSku.specification 30, // 9: goods.v1.CreateGoodsRequest.goodsSku.groupAttrInfo:type_name -> goods.v1.CreateGoodsRequest.goodsSku.groupAttr 31, // 10: goods.v1.CreateGoodsRequest.goodsSku.groupAttr.attrInfo:type_name -> goods.v1.CreateGoodsRequest.goodsSku.groupAttr.attr 32, // 11: goods.v1.Goods.GetAllCategoryList:input_type -> google.protobuf.Empty 19, // 12: goods.v1.Goods.GetSubCategory:input_type -> goods.v1.CategoryListRequest 21, // 13: goods.v1.Goods.CreateCategory:input_type -> goods.v1.CategoryInfoRequest 23, // 14: goods.v1.Goods.DeleteCategory:input_type -> goods.v1.DeleteCategoryRequest 21, // 15: goods.v1.Goods.UpdateCategory:input_type -> goods.v1.CategoryInfoRequest 24, // 16: goods.v1.Goods.BrandList:input_type -> goods.v1.BrandListRequest 25, // 17: goods.v1.Goods.CreateBrand:input_type -> goods.v1.BrandRequest 25, // 18: goods.v1.Goods.DeleteBrand:input_type -> goods.v1.BrandRequest 25, // 19: goods.v1.Goods.UpdateBrand:input_type -> goods.v1.BrandRequest 10, // 20: goods.v1.Goods.CreateGoodsType:input_type -> goods.v1.GoodsTypeRequest 8, // 21: goods.v1.Goods.CreateGoodsSpecification:input_type -> goods.v1.SpecificationRequest 4, // 22: goods.v1.Goods.CreateAttrGroup:input_type -> goods.v1.AttrGroupRequest 1, // 23: goods.v1.Goods.CreateAttrValue:input_type -> goods.v1.AttrRequest 12, // 24: goods.v1.Goods.CreateGoods:input_type -> goods.v1.CreateGoodsRequest 12, // 25: goods.v1.Goods.UpdateGoods:input_type -> goods.v1.CreateGoodsRequest 16, // 26: goods.v1.Goods.GoodsList:input_type -> goods.v1.GoodsFilterRequest 18, // 27: goods.v1.Goods.GetAllCategoryList:output_type -> goods.v1.CategoryListResponse 20, // 28: goods.v1.Goods.GetSubCategory:output_type -> goods.v1.SubCategoryListResponse 17, // 29: goods.v1.Goods.CreateCategory:output_type -> goods.v1.CategoryInfoResponse 32, // 30: goods.v1.Goods.DeleteCategory:output_type -> google.protobuf.Empty 32, // 31: goods.v1.Goods.UpdateCategory:output_type -> google.protobuf.Empty 27, // 32: goods.v1.Goods.BrandList:output_type -> goods.v1.BrandListResponse 26, // 33: goods.v1.Goods.CreateBrand:output_type -> goods.v1.BrandInfoResponse 32, // 34: goods.v1.Goods.DeleteBrand:output_type -> google.protobuf.Empty 32, // 35: goods.v1.Goods.UpdateBrand:output_type -> google.protobuf.Empty 11, // 36: goods.v1.Goods.CreateGoodsType:output_type -> goods.v1.GoodsTypeResponse 9, // 37: goods.v1.Goods.CreateGoodsSpecification:output_type -> goods.v1.SpecificationResponse 5, // 38: goods.v1.Goods.CreateAttrGroup:output_type -> goods.v1.AttrGroupResponse 3, // 39: goods.v1.Goods.CreateAttrValue:output_type -> goods.v1.AttrResponse 13, // 40: goods.v1.Goods.CreateGoods:output_type -> goods.v1.CreateGoodsResponse 32, // 41: goods.v1.Goods.UpdateGoods:output_type -> google.protobuf.Empty 15, // 42: goods.v1.Goods.GoodsList:output_type -> goods.v1.GoodsListResponse 27, // [27:43] is the sub-list for method output_type 11, // [11:27] is the sub-list for method input_type 11, // [11:11] is the sub-list for extension type_name 11, // [11:11] is the sub-list for extension extendee 0, // [0:11] is the sub-list for field type_name } func init() { file_goods_v1_goods_proto_init() } func file_goods_v1_goods_proto_init() { if File_goods_v1_goods_proto != nil { return } if !protoimpl.UnsafeEnabled { file_goods_v1_goods_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrValueRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrValueResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrGroupRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttrGroupResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SpecificationValue); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SpecificationValueResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SpecificationRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SpecificationResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoodsTypeRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoodsTypeResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoodsInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoodsListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoodsFilterRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CategoryInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CategoryListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CategoryListRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubCategoryListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CategoryInfoRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchCategoryInfoRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteCategoryRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BrandListRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BrandRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BrandInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BrandListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsRequestGoodsSku); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsRequestGoodsSkuSpecification); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsRequestGoodsSkuGroupAttr); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_goods_v1_goods_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGoodsRequestGoodsSkuGroupAttrAttr); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_goods_v1_goods_proto_rawDesc, NumEnums: 0, NumMessages: 32, NumExtensions: 0, NumServices: 1, }, GoTypes: file_goods_v1_goods_proto_goTypes, DependencyIndexes: file_goods_v1_goods_proto_depIdxs, MessageInfos: file_goods_v1_goods_proto_msgTypes, }.Build() File_goods_v1_goods_proto = out.File file_goods_v1_goods_proto_rawDesc = nil file_goods_v1_goods_proto_goTypes = nil file_goods_v1_goods_proto_depIdxs = nil } ================================================ FILE: service/order/api/goods/v1/goods.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: goods/v1/goods.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on AttrValueRequest 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 *AttrValueRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrValueRequest 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 // AttrValueRequestMultiError, or nil if none found. func (m *AttrValueRequest) ValidateAll() error { return m.validate(true) } func (m *AttrValueRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for AttrId if m.GetGroupId() < 1 { err := AttrValueRequestValidationError{ field: "GroupId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetValue()) < 3 { err := AttrValueRequestValidationError{ field: "Value", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return AttrValueRequestMultiError(errors) } return nil } // AttrValueRequestMultiError is an error wrapping multiple validation errors // returned by AttrValueRequest.ValidateAll() if the designated constraints // aren't met. type AttrValueRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrValueRequestMultiError) 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 AttrValueRequestMultiError) AllErrors() []error { return m } // AttrValueRequestValidationError is the validation error returned by // AttrValueRequest.Validate if the designated constraints aren't met. type AttrValueRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrValueRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrValueRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrValueRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrValueRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrValueRequestValidationError) ErrorName() string { return "AttrValueRequestValidationError" } // Error satisfies the builtin error interface func (e AttrValueRequestValidationError) 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 %sAttrValueRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrValueRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrValueRequestValidationError{} // Validate checks the field values on AttrRequest 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 *AttrRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrRequest 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 AttrRequestMultiError, or // nil if none found. func (m *AttrRequest) ValidateAll() error { return m.validate(true) } func (m *AttrRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetTypeId() < 1 { err := AttrRequestValidationError{ field: "TypeId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if m.GetGroupId() < 1 { err := AttrRequestValidationError{ field: "GroupId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetTitle()) < 1 { err := AttrRequestValidationError{ field: "Title", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Desc // no validation rules for Status if m.GetSort() < 1 { err := AttrRequestValidationError{ field: "Sort", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } for idx, item := range m.GetAttrValue() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, AttrRequestValidationError{ field: fmt.Sprintf("AttrValue[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, AttrRequestValidationError{ field: fmt.Sprintf("AttrValue[%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 AttrRequestValidationError{ field: fmt.Sprintf("AttrValue[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return AttrRequestMultiError(errors) } return nil } // AttrRequestMultiError is an error wrapping multiple validation errors // returned by AttrRequest.ValidateAll() if the designated constraints aren't met. type AttrRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrRequestMultiError) 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 AttrRequestMultiError) AllErrors() []error { return m } // AttrRequestValidationError is the validation error returned by // AttrRequest.Validate if the designated constraints aren't met. type AttrRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrRequestValidationError) ErrorName() string { return "AttrRequestValidationError" } // Error satisfies the builtin error interface func (e AttrRequestValidationError) 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 %sAttrRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrRequestValidationError{} // Validate checks the field values on AttrValueResponse 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 *AttrValueResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrValueResponse 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 // AttrValueResponseMultiError, or nil if none found. func (m *AttrValueResponse) ValidateAll() error { return m.validate(true) } func (m *AttrValueResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for AttrId // no validation rules for GroupId // no validation rules for Value if len(errors) > 0 { return AttrValueResponseMultiError(errors) } return nil } // AttrValueResponseMultiError is an error wrapping multiple validation errors // returned by AttrValueResponse.ValidateAll() if the designated constraints // aren't met. type AttrValueResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrValueResponseMultiError) 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 AttrValueResponseMultiError) AllErrors() []error { return m } // AttrValueResponseValidationError is the validation error returned by // AttrValueResponse.Validate if the designated constraints aren't met. type AttrValueResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrValueResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrValueResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrValueResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrValueResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrValueResponseValidationError) ErrorName() string { return "AttrValueResponseValidationError" } // Error satisfies the builtin error interface func (e AttrValueResponseValidationError) 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 %sAttrValueResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrValueResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrValueResponseValidationError{} // Validate checks the field values on AttrResponse 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 *AttrResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrResponse 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 AttrResponseMultiError, or // nil if none found. func (m *AttrResponse) ValidateAll() error { return m.validate(true) } func (m *AttrResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for TypeId // no validation rules for GroupId // no validation rules for Title // no validation rules for Desc // no validation rules for Status // no validation rules for Sort for idx, item := range m.GetAttrValue() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, AttrResponseValidationError{ field: fmt.Sprintf("AttrValue[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, AttrResponseValidationError{ field: fmt.Sprintf("AttrValue[%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 AttrResponseValidationError{ field: fmt.Sprintf("AttrValue[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return AttrResponseMultiError(errors) } return nil } // AttrResponseMultiError is an error wrapping multiple validation errors // returned by AttrResponse.ValidateAll() if the designated constraints aren't met. type AttrResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrResponseMultiError) 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 AttrResponseMultiError) AllErrors() []error { return m } // AttrResponseValidationError is the validation error returned by // AttrResponse.Validate if the designated constraints aren't met. type AttrResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrResponseValidationError) ErrorName() string { return "AttrResponseValidationError" } // Error satisfies the builtin error interface func (e AttrResponseValidationError) 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 %sAttrResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrResponseValidationError{} // Validate checks the field values on AttrGroupRequest 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 *AttrGroupRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrGroupRequest 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 // AttrGroupRequestMultiError, or nil if none found. func (m *AttrGroupRequest) ValidateAll() error { return m.validate(true) } func (m *AttrGroupRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetTypeId() < 1 { err := AttrGroupRequestValidationError{ field: "TypeId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetTitle()) < 3 { err := AttrGroupRequestValidationError{ field: "Title", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Desc // no validation rules for Status if m.GetSort() < 1 { err := AttrGroupRequestValidationError{ field: "Sort", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return AttrGroupRequestMultiError(errors) } return nil } // AttrGroupRequestMultiError is an error wrapping multiple validation errors // returned by AttrGroupRequest.ValidateAll() if the designated constraints // aren't met. type AttrGroupRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrGroupRequestMultiError) 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 AttrGroupRequestMultiError) AllErrors() []error { return m } // AttrGroupRequestValidationError is the validation error returned by // AttrGroupRequest.Validate if the designated constraints aren't met. type AttrGroupRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrGroupRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrGroupRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrGroupRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrGroupRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrGroupRequestValidationError) ErrorName() string { return "AttrGroupRequestValidationError" } // Error satisfies the builtin error interface func (e AttrGroupRequestValidationError) 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 %sAttrGroupRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrGroupRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrGroupRequestValidationError{} // Validate checks the field values on AttrGroupResponse 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 *AttrGroupResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AttrGroupResponse 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 // AttrGroupResponseMultiError, or nil if none found. func (m *AttrGroupResponse) ValidateAll() error { return m.validate(true) } func (m *AttrGroupResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for TypeId // no validation rules for Title // no validation rules for Desc // no validation rules for Status // no validation rules for Sort if len(errors) > 0 { return AttrGroupResponseMultiError(errors) } return nil } // AttrGroupResponseMultiError is an error wrapping multiple validation errors // returned by AttrGroupResponse.ValidateAll() if the designated constraints // aren't met. type AttrGroupResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AttrGroupResponseMultiError) 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 AttrGroupResponseMultiError) AllErrors() []error { return m } // AttrGroupResponseValidationError is the validation error returned by // AttrGroupResponse.Validate if the designated constraints aren't met. type AttrGroupResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AttrGroupResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AttrGroupResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AttrGroupResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AttrGroupResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AttrGroupResponseValidationError) ErrorName() string { return "AttrGroupResponseValidationError" } // Error satisfies the builtin error interface func (e AttrGroupResponseValidationError) 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 %sAttrGroupResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AttrGroupResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AttrGroupResponseValidationError{} // Validate checks the field values on SpecificationValue 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 *SpecificationValue) Validate() error { return m.validate(false) } // ValidateAll checks the field values on SpecificationValue 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 // SpecificationValueMultiError, or nil if none found. func (m *SpecificationValue) ValidateAll() error { return m.validate(true) } func (m *SpecificationValue) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for AttrId if utf8.RuneCountInString(m.GetValue()) < 3 { err := SpecificationValueValidationError{ field: "Value", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } if m.GetSort() < 1 { err := SpecificationValueValidationError{ field: "Sort", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return SpecificationValueMultiError(errors) } return nil } // SpecificationValueMultiError is an error wrapping multiple validation errors // returned by SpecificationValue.ValidateAll() if the designated constraints // aren't met. type SpecificationValueMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m SpecificationValueMultiError) 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 SpecificationValueMultiError) AllErrors() []error { return m } // SpecificationValueValidationError is the validation error returned by // SpecificationValue.Validate if the designated constraints aren't met. type SpecificationValueValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e SpecificationValueValidationError) Field() string { return e.field } // Reason function returns reason value. func (e SpecificationValueValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e SpecificationValueValidationError) Cause() error { return e.cause } // Key function returns key value. func (e SpecificationValueValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e SpecificationValueValidationError) ErrorName() string { return "SpecificationValueValidationError" } // Error satisfies the builtin error interface func (e SpecificationValueValidationError) 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 %sSpecificationValue.%s: %s%s", key, e.field, e.reason, cause) } var _ error = SpecificationValueValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = SpecificationValueValidationError{} // Validate checks the field values on SpecificationValueResponse 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 *SpecificationValueResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on SpecificationValueResponse 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 // SpecificationValueResponseMultiError, or nil if none found. func (m *SpecificationValueResponse) ValidateAll() error { return m.validate(true) } func (m *SpecificationValueResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for AttrId // no validation rules for Value // no validation rules for Sort if len(errors) > 0 { return SpecificationValueResponseMultiError(errors) } return nil } // SpecificationValueResponseMultiError is an error wrapping multiple // validation errors returned by SpecificationValueResponse.ValidateAll() if // the designated constraints aren't met. type SpecificationValueResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m SpecificationValueResponseMultiError) 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 SpecificationValueResponseMultiError) AllErrors() []error { return m } // SpecificationValueResponseValidationError is the validation error returned // by SpecificationValueResponse.Validate if the designated constraints aren't met. type SpecificationValueResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e SpecificationValueResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e SpecificationValueResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e SpecificationValueResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e SpecificationValueResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e SpecificationValueResponseValidationError) ErrorName() string { return "SpecificationValueResponseValidationError" } // Error satisfies the builtin error interface func (e SpecificationValueResponseValidationError) 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 %sSpecificationValueResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = SpecificationValueResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = SpecificationValueResponseValidationError{} // Validate checks the field values on SpecificationRequest 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 *SpecificationRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on SpecificationRequest 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 // SpecificationRequestMultiError, or nil if none found. func (m *SpecificationRequest) ValidateAll() error { return m.validate(true) } func (m *SpecificationRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetTypeId() < 1 { err := SpecificationRequestValidationError{ field: "TypeId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetName()) < 2 { err := SpecificationRequestValidationError{ field: "Name", reason: "value length must be at least 2 runes", } if !all { return err } errors = append(errors, err) } if m.GetSort() < 1 { err := SpecificationRequestValidationError{ field: "Sort", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } // no validation rules for Status // no validation rules for IsSku // no validation rules for IsSelect for idx, item := range m.GetSpecificationValue() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SpecificationRequestValidationError{ field: fmt.Sprintf("SpecificationValue[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, SpecificationRequestValidationError{ field: fmt.Sprintf("SpecificationValue[%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 SpecificationRequestValidationError{ field: fmt.Sprintf("SpecificationValue[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return SpecificationRequestMultiError(errors) } return nil } // SpecificationRequestMultiError is an error wrapping multiple validation // errors returned by SpecificationRequest.ValidateAll() if the designated // constraints aren't met. type SpecificationRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m SpecificationRequestMultiError) 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 SpecificationRequestMultiError) AllErrors() []error { return m } // SpecificationRequestValidationError is the validation error returned by // SpecificationRequest.Validate if the designated constraints aren't met. type SpecificationRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e SpecificationRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e SpecificationRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e SpecificationRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e SpecificationRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e SpecificationRequestValidationError) ErrorName() string { return "SpecificationRequestValidationError" } // Error satisfies the builtin error interface func (e SpecificationRequestValidationError) 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 %sSpecificationRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = SpecificationRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = SpecificationRequestValidationError{} // Validate checks the field values on SpecificationResponse 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 *SpecificationResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on SpecificationResponse 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 // SpecificationResponseMultiError, or nil if none found. func (m *SpecificationResponse) ValidateAll() error { return m.validate(true) } func (m *SpecificationResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return SpecificationResponseMultiError(errors) } return nil } // SpecificationResponseMultiError is an error wrapping multiple validation // errors returned by SpecificationResponse.ValidateAll() if the designated // constraints aren't met. type SpecificationResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m SpecificationResponseMultiError) 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 SpecificationResponseMultiError) AllErrors() []error { return m } // SpecificationResponseValidationError is the validation error returned by // SpecificationResponse.Validate if the designated constraints aren't met. type SpecificationResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e SpecificationResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e SpecificationResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e SpecificationResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e SpecificationResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e SpecificationResponseValidationError) ErrorName() string { return "SpecificationResponseValidationError" } // Error satisfies the builtin error interface func (e SpecificationResponseValidationError) 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 %sSpecificationResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = SpecificationResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = SpecificationResponseValidationError{} // Validate checks the field values on GoodsTypeRequest 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 *GoodsTypeRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GoodsTypeRequest 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 // GoodsTypeRequestMultiError, or nil if none found. func (m *GoodsTypeRequest) ValidateAll() error { return m.validate(true) } func (m *GoodsTypeRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if utf8.RuneCountInString(m.GetName()) < 3 { err := GoodsTypeRequestValidationError{ field: "Name", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetTypeCode()) < 3 { err := GoodsTypeRequestValidationError{ field: "TypeCode", reason: "value length must be at least 3 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for NameAlias // no validation rules for IsVirtual // no validation rules for Desc // no validation rules for Sort if utf8.RuneCountInString(m.GetBrandIds()) < 1 { err := GoodsTypeRequestValidationError{ field: "BrandIds", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return GoodsTypeRequestMultiError(errors) } return nil } // GoodsTypeRequestMultiError is an error wrapping multiple validation errors // returned by GoodsTypeRequest.ValidateAll() if the designated constraints // aren't met. type GoodsTypeRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GoodsTypeRequestMultiError) 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 GoodsTypeRequestMultiError) AllErrors() []error { return m } // GoodsTypeRequestValidationError is the validation error returned by // GoodsTypeRequest.Validate if the designated constraints aren't met. type GoodsTypeRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GoodsTypeRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GoodsTypeRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GoodsTypeRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GoodsTypeRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GoodsTypeRequestValidationError) ErrorName() string { return "GoodsTypeRequestValidationError" } // Error satisfies the builtin error interface func (e GoodsTypeRequestValidationError) 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 %sGoodsTypeRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GoodsTypeRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GoodsTypeRequestValidationError{} // Validate checks the field values on GoodsTypeResponse 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 *GoodsTypeResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GoodsTypeResponse 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 // GoodsTypeResponseMultiError, or nil if none found. func (m *GoodsTypeResponse) ValidateAll() error { return m.validate(true) } func (m *GoodsTypeResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return GoodsTypeResponseMultiError(errors) } return nil } // GoodsTypeResponseMultiError is an error wrapping multiple validation errors // returned by GoodsTypeResponse.ValidateAll() if the designated constraints // aren't met. type GoodsTypeResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GoodsTypeResponseMultiError) 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 GoodsTypeResponseMultiError) AllErrors() []error { return m } // GoodsTypeResponseValidationError is the validation error returned by // GoodsTypeResponse.Validate if the designated constraints aren't met. type GoodsTypeResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GoodsTypeResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GoodsTypeResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GoodsTypeResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GoodsTypeResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GoodsTypeResponseValidationError) ErrorName() string { return "GoodsTypeResponseValidationError" } // Error satisfies the builtin error interface func (e GoodsTypeResponseValidationError) 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 %sGoodsTypeResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GoodsTypeResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GoodsTypeResponseValidationError{} // Validate checks the field values on CreateGoodsRequest 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 *CreateGoodsRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateGoodsRequest 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 // CreateGoodsRequestMultiError, or nil if none found. func (m *CreateGoodsRequest) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetCategoryId() < 1 { err := CreateGoodsRequestValidationError{ field: "CategoryId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if m.GetBrandId() < 1 { err := CreateGoodsRequestValidationError{ field: "BrandId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if m.GetTypeId() < 1 { err := CreateGoodsRequestValidationError{ field: "TypeId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } // no validation rules for Name // no validation rules for NameAlias // no validation rules for GoodsTags // no validation rules for GoodsSn // no validation rules for ShopPrice // no validation rules for MarketPrice // no validation rules for Inventory // no validation rules for GoodsBrief // no validation rules for GoodsFrontImage // no validation rules for ShipFree // no validation rules for ShipId // no validation rules for IsNew // no validation rules for IsHot // no validation rules for OnSale for idx, item := range m.GetSku() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CreateGoodsRequestValidationError{ field: fmt.Sprintf("Sku[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CreateGoodsRequestValidationError{ field: fmt.Sprintf("Sku[%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 CreateGoodsRequestValidationError{ field: fmt.Sprintf("Sku[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return CreateGoodsRequestMultiError(errors) } return nil } // CreateGoodsRequestMultiError is an error wrapping multiple validation errors // returned by CreateGoodsRequest.ValidateAll() if the designated constraints // aren't met. type CreateGoodsRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsRequestMultiError) 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 CreateGoodsRequestMultiError) AllErrors() []error { return m } // CreateGoodsRequestValidationError is the validation error returned by // CreateGoodsRequest.Validate if the designated constraints aren't met. type CreateGoodsRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsRequestValidationError) ErrorName() string { return "CreateGoodsRequestValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsRequestValidationError) 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 %sCreateGoodsRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsRequestValidationError{} // Validate checks the field values on CreateGoodsResponse 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 *CreateGoodsResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateGoodsResponse 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 // CreateGoodsResponseMultiError, or nil if none found. func (m *CreateGoodsResponse) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for ID if len(errors) > 0 { return CreateGoodsResponseMultiError(errors) } return nil } // CreateGoodsResponseMultiError is an error wrapping multiple validation // errors returned by CreateGoodsResponse.ValidateAll() if the designated // constraints aren't met. type CreateGoodsResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsResponseMultiError) 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 CreateGoodsResponseMultiError) AllErrors() []error { return m } // CreateGoodsResponseValidationError is the validation error returned by // CreateGoodsResponse.Validate if the designated constraints aren't met. type CreateGoodsResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsResponseValidationError) ErrorName() string { return "CreateGoodsResponseValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsResponseValidationError) 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 %sCreateGoodsResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsResponseValidationError{} // Validate checks the field values on GoodsInfoResponse 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 *GoodsInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GoodsInfoResponse 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 // GoodsInfoResponseMultiError, or nil if none found. func (m *GoodsInfoResponse) ValidateAll() error { return m.validate(true) } func (m *GoodsInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for CategoryId // no validation rules for BrandId // no validation rules for Name // no validation rules for GoodsSn // no validation rules for ClickNum // no validation rules for SoldNum // no validation rules for FavNum // no validation rules for MarketPrice // no validation rules for GoodsBrief // no validation rules for GoodsDesc // no validation rules for ShipFree // no validation rules for Images // no validation rules for IsNew // no validation rules for IsHot // no validation rules for OnSale if len(errors) > 0 { return GoodsInfoResponseMultiError(errors) } return nil } // GoodsInfoResponseMultiError is an error wrapping multiple validation errors // returned by GoodsInfoResponse.ValidateAll() if the designated constraints // aren't met. type GoodsInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GoodsInfoResponseMultiError) 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 GoodsInfoResponseMultiError) AllErrors() []error { return m } // GoodsInfoResponseValidationError is the validation error returned by // GoodsInfoResponse.Validate if the designated constraints aren't met. type GoodsInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GoodsInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GoodsInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GoodsInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GoodsInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GoodsInfoResponseValidationError) ErrorName() string { return "GoodsInfoResponseValidationError" } // Error satisfies the builtin error interface func (e GoodsInfoResponseValidationError) 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 %sGoodsInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GoodsInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GoodsInfoResponseValidationError{} // Validate checks the field values on GoodsListResponse 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 *GoodsListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GoodsListResponse 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 // GoodsListResponseMultiError, or nil if none found. func (m *GoodsListResponse) ValidateAll() error { return m.validate(true) } func (m *GoodsListResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Total for idx, item := range m.GetList() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, GoodsListResponseValidationError{ field: fmt.Sprintf("List[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, GoodsListResponseValidationError{ field: fmt.Sprintf("List[%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 GoodsListResponseValidationError{ field: fmt.Sprintf("List[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return GoodsListResponseMultiError(errors) } return nil } // GoodsListResponseMultiError is an error wrapping multiple validation errors // returned by GoodsListResponse.ValidateAll() if the designated constraints // aren't met. type GoodsListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GoodsListResponseMultiError) 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 GoodsListResponseMultiError) AllErrors() []error { return m } // GoodsListResponseValidationError is the validation error returned by // GoodsListResponse.Validate if the designated constraints aren't met. type GoodsListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GoodsListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GoodsListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GoodsListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GoodsListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GoodsListResponseValidationError) ErrorName() string { return "GoodsListResponseValidationError" } // Error satisfies the builtin error interface func (e GoodsListResponseValidationError) 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 %sGoodsListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GoodsListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GoodsListResponseValidationError{} // Validate checks the field values on GoodsFilterRequest 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 *GoodsFilterRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on GoodsFilterRequest 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 // GoodsFilterRequestMultiError, or nil if none found. func (m *GoodsFilterRequest) ValidateAll() error { return m.validate(true) } func (m *GoodsFilterRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Keywords // no validation rules for CategoryId // no validation rules for BrandId // no validation rules for MinPrice // no validation rules for MaxPrice // no validation rules for IsHot // no validation rules for IsNew // no validation rules for IsTab // no validation rules for ClickNum // no validation rules for SoldNum // no validation rules for FavNum // no validation rules for Pages // no validation rules for PagePerNums // no validation rules for Id if len(errors) > 0 { return GoodsFilterRequestMultiError(errors) } return nil } // GoodsFilterRequestMultiError is an error wrapping multiple validation errors // returned by GoodsFilterRequest.ValidateAll() if the designated constraints // aren't met. type GoodsFilterRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m GoodsFilterRequestMultiError) 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 GoodsFilterRequestMultiError) AllErrors() []error { return m } // GoodsFilterRequestValidationError is the validation error returned by // GoodsFilterRequest.Validate if the designated constraints aren't met. type GoodsFilterRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GoodsFilterRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GoodsFilterRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GoodsFilterRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GoodsFilterRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GoodsFilterRequestValidationError) ErrorName() string { return "GoodsFilterRequestValidationError" } // Error satisfies the builtin error interface func (e GoodsFilterRequestValidationError) 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 %sGoodsFilterRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GoodsFilterRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GoodsFilterRequestValidationError{} // Validate checks the field values on CategoryInfoResponse 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 *CategoryInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CategoryInfoResponse 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 // CategoryInfoResponseMultiError, or nil if none found. func (m *CategoryInfoResponse) ValidateAll() error { return m.validate(true) } func (m *CategoryInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for ParentCategory // no validation rules for Level // no validation rules for IsTab // no validation rules for Sort if len(errors) > 0 { return CategoryInfoResponseMultiError(errors) } return nil } // CategoryInfoResponseMultiError is an error wrapping multiple validation // errors returned by CategoryInfoResponse.ValidateAll() if the designated // constraints aren't met. type CategoryInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CategoryInfoResponseMultiError) 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 CategoryInfoResponseMultiError) AllErrors() []error { return m } // CategoryInfoResponseValidationError is the validation error returned by // CategoryInfoResponse.Validate if the designated constraints aren't met. type CategoryInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CategoryInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CategoryInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CategoryInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CategoryInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CategoryInfoResponseValidationError) ErrorName() string { return "CategoryInfoResponseValidationError" } // Error satisfies the builtin error interface func (e CategoryInfoResponseValidationError) 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 %sCategoryInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CategoryInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CategoryInfoResponseValidationError{} // Validate checks the field values on CategoryListResponse 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 *CategoryListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CategoryListResponse 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 // CategoryListResponseMultiError, or nil if none found. func (m *CategoryListResponse) ValidateAll() error { return m.validate(true) } func (m *CategoryListResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for JsonData if len(errors) > 0 { return CategoryListResponseMultiError(errors) } return nil } // CategoryListResponseMultiError is an error wrapping multiple validation // errors returned by CategoryListResponse.ValidateAll() if the designated // constraints aren't met. type CategoryListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CategoryListResponseMultiError) 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 CategoryListResponseMultiError) AllErrors() []error { return m } // CategoryListResponseValidationError is the validation error returned by // CategoryListResponse.Validate if the designated constraints aren't met. type CategoryListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CategoryListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CategoryListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CategoryListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CategoryListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CategoryListResponseValidationError) ErrorName() string { return "CategoryListResponseValidationError" } // Error satisfies the builtin error interface func (e CategoryListResponseValidationError) 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 %sCategoryListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CategoryListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CategoryListResponseValidationError{} // Validate checks the field values on CategoryListRequest 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 *CategoryListRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CategoryListRequest 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 // CategoryListRequestMultiError, or nil if none found. func (m *CategoryListRequest) ValidateAll() error { return m.validate(true) } func (m *CategoryListRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Level if len(errors) > 0 { return CategoryListRequestMultiError(errors) } return nil } // CategoryListRequestMultiError is an error wrapping multiple validation // errors returned by CategoryListRequest.ValidateAll() if the designated // constraints aren't met. type CategoryListRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CategoryListRequestMultiError) 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 CategoryListRequestMultiError) AllErrors() []error { return m } // CategoryListRequestValidationError is the validation error returned by // CategoryListRequest.Validate if the designated constraints aren't met. type CategoryListRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CategoryListRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CategoryListRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CategoryListRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CategoryListRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CategoryListRequestValidationError) ErrorName() string { return "CategoryListRequestValidationError" } // Error satisfies the builtin error interface func (e CategoryListRequestValidationError) 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 %sCategoryListRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CategoryListRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CategoryListRequestValidationError{} // Validate checks the field values on SubCategoryListResponse 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 *SubCategoryListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on SubCategoryListResponse 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 // SubCategoryListResponseMultiError, or nil if none found. func (m *SubCategoryListResponse) ValidateAll() error { return m.validate(true) } func (m *SubCategoryListResponse) validate(all bool) error { if m == nil { return nil } var errors []error if all { switch v := interface{}(m.GetInfo()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SubCategoryListResponseValidationError{ field: "Info", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, SubCategoryListResponseValidationError{ field: "Info", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetInfo()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SubCategoryListResponseValidationError{ field: "Info", reason: "embedded message failed validation", cause: err, } } } for idx, item := range m.GetSubCategory() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SubCategoryListResponseValidationError{ field: fmt.Sprintf("SubCategory[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, SubCategoryListResponseValidationError{ field: fmt.Sprintf("SubCategory[%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 SubCategoryListResponseValidationError{ field: fmt.Sprintf("SubCategory[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return SubCategoryListResponseMultiError(errors) } return nil } // SubCategoryListResponseMultiError is an error wrapping multiple validation // errors returned by SubCategoryListResponse.ValidateAll() if the designated // constraints aren't met. type SubCategoryListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m SubCategoryListResponseMultiError) 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 SubCategoryListResponseMultiError) AllErrors() []error { return m } // SubCategoryListResponseValidationError is the validation error returned by // SubCategoryListResponse.Validate if the designated constraints aren't met. type SubCategoryListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e SubCategoryListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e SubCategoryListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e SubCategoryListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e SubCategoryListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e SubCategoryListResponseValidationError) ErrorName() string { return "SubCategoryListResponseValidationError" } // Error satisfies the builtin error interface func (e SubCategoryListResponseValidationError) 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 %sSubCategoryListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = SubCategoryListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = SubCategoryListResponseValidationError{} // Validate checks the field values on CategoryInfoRequest 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 *CategoryInfoRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CategoryInfoRequest 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 // CategoryInfoRequestMultiError, or nil if none found. func (m *CategoryInfoRequest) ValidateAll() error { return m.validate(true) } func (m *CategoryInfoRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for ParentCategory // no validation rules for Level // no validation rules for IsTab // no validation rules for Sort if len(errors) > 0 { return CategoryInfoRequestMultiError(errors) } return nil } // CategoryInfoRequestMultiError is an error wrapping multiple validation // errors returned by CategoryInfoRequest.ValidateAll() if the designated // constraints aren't met. type CategoryInfoRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CategoryInfoRequestMultiError) 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 CategoryInfoRequestMultiError) AllErrors() []error { return m } // CategoryInfoRequestValidationError is the validation error returned by // CategoryInfoRequest.Validate if the designated constraints aren't met. type CategoryInfoRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CategoryInfoRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CategoryInfoRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CategoryInfoRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CategoryInfoRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CategoryInfoRequestValidationError) ErrorName() string { return "CategoryInfoRequestValidationError" } // Error satisfies the builtin error interface func (e CategoryInfoRequestValidationError) 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 %sCategoryInfoRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CategoryInfoRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CategoryInfoRequestValidationError{} // Validate checks the field values on BatchCategoryInfoRequest 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 *BatchCategoryInfoRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on BatchCategoryInfoRequest 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 // BatchCategoryInfoRequestMultiError, or nil if none found. func (m *BatchCategoryInfoRequest) ValidateAll() error { return m.validate(true) } func (m *BatchCategoryInfoRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for GoodsNums // no validation rules for BrandNums if len(errors) > 0 { return BatchCategoryInfoRequestMultiError(errors) } return nil } // BatchCategoryInfoRequestMultiError is an error wrapping multiple validation // errors returned by BatchCategoryInfoRequest.ValidateAll() if the designated // constraints aren't met. type BatchCategoryInfoRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m BatchCategoryInfoRequestMultiError) 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 BatchCategoryInfoRequestMultiError) AllErrors() []error { return m } // BatchCategoryInfoRequestValidationError is the validation error returned by // BatchCategoryInfoRequest.Validate if the designated constraints aren't met. type BatchCategoryInfoRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e BatchCategoryInfoRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e BatchCategoryInfoRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e BatchCategoryInfoRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e BatchCategoryInfoRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e BatchCategoryInfoRequestValidationError) ErrorName() string { return "BatchCategoryInfoRequestValidationError" } // Error satisfies the builtin error interface func (e BatchCategoryInfoRequestValidationError) 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 %sBatchCategoryInfoRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = BatchCategoryInfoRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = BatchCategoryInfoRequestValidationError{} // Validate checks the field values on DeleteCategoryRequest 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 *DeleteCategoryRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on DeleteCategoryRequest 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 // DeleteCategoryRequestMultiError, or nil if none found. func (m *DeleteCategoryRequest) ValidateAll() error { return m.validate(true) } func (m *DeleteCategoryRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return DeleteCategoryRequestMultiError(errors) } return nil } // DeleteCategoryRequestMultiError is an error wrapping multiple validation // errors returned by DeleteCategoryRequest.ValidateAll() if the designated // constraints aren't met. type DeleteCategoryRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m DeleteCategoryRequestMultiError) 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 DeleteCategoryRequestMultiError) AllErrors() []error { return m } // DeleteCategoryRequestValidationError is the validation error returned by // DeleteCategoryRequest.Validate if the designated constraints aren't met. type DeleteCategoryRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e DeleteCategoryRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e DeleteCategoryRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e DeleteCategoryRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e DeleteCategoryRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e DeleteCategoryRequestValidationError) ErrorName() string { return "DeleteCategoryRequestValidationError" } // Error satisfies the builtin error interface func (e DeleteCategoryRequestValidationError) 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 %sDeleteCategoryRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = DeleteCategoryRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = DeleteCategoryRequestValidationError{} // Validate checks the field values on BrandListRequest 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 *BrandListRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on BrandListRequest 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 // BrandListRequestMultiError, or nil if none found. func (m *BrandListRequest) ValidateAll() error { return m.validate(true) } func (m *BrandListRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Pages // no validation rules for PagePerNums if len(errors) > 0 { return BrandListRequestMultiError(errors) } return nil } // BrandListRequestMultiError is an error wrapping multiple validation errors // returned by BrandListRequest.ValidateAll() if the designated constraints // aren't met. type BrandListRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m BrandListRequestMultiError) 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 BrandListRequestMultiError) AllErrors() []error { return m } // BrandListRequestValidationError is the validation error returned by // BrandListRequest.Validate if the designated constraints aren't met. type BrandListRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e BrandListRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e BrandListRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e BrandListRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e BrandListRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e BrandListRequestValidationError) ErrorName() string { return "BrandListRequestValidationError" } // Error satisfies the builtin error interface func (e BrandListRequestValidationError) 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 %sBrandListRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = BrandListRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = BrandListRequestValidationError{} // Validate checks the field values on BrandRequest 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 *BrandRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on BrandRequest 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 BrandRequestMultiError, or // nil if none found. func (m *BrandRequest) ValidateAll() error { return m.validate(true) } func (m *BrandRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for Logo // no validation rules for Desc // no validation rules for IsTab // no validation rules for Sort if len(errors) > 0 { return BrandRequestMultiError(errors) } return nil } // BrandRequestMultiError is an error wrapping multiple validation errors // returned by BrandRequest.ValidateAll() if the designated constraints aren't met. type BrandRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m BrandRequestMultiError) 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 BrandRequestMultiError) AllErrors() []error { return m } // BrandRequestValidationError is the validation error returned by // BrandRequest.Validate if the designated constraints aren't met. type BrandRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e BrandRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e BrandRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e BrandRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e BrandRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e BrandRequestValidationError) ErrorName() string { return "BrandRequestValidationError" } // Error satisfies the builtin error interface func (e BrandRequestValidationError) 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 %sBrandRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = BrandRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = BrandRequestValidationError{} // Validate checks the field values on BrandInfoResponse 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 *BrandInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on BrandInfoResponse 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 // BrandInfoResponseMultiError, or nil if none found. func (m *BrandInfoResponse) ValidateAll() error { return m.validate(true) } func (m *BrandInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for Logo // no validation rules for Desc // no validation rules for IsTab // no validation rules for Sort if len(errors) > 0 { return BrandInfoResponseMultiError(errors) } return nil } // BrandInfoResponseMultiError is an error wrapping multiple validation errors // returned by BrandInfoResponse.ValidateAll() if the designated constraints // aren't met. type BrandInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m BrandInfoResponseMultiError) 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 BrandInfoResponseMultiError) AllErrors() []error { return m } // BrandInfoResponseValidationError is the validation error returned by // BrandInfoResponse.Validate if the designated constraints aren't met. type BrandInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e BrandInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e BrandInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e BrandInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e BrandInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e BrandInfoResponseValidationError) ErrorName() string { return "BrandInfoResponseValidationError" } // Error satisfies the builtin error interface func (e BrandInfoResponseValidationError) 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 %sBrandInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = BrandInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = BrandInfoResponseValidationError{} // Validate checks the field values on BrandListResponse 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 *BrandListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on BrandListResponse 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 // BrandListResponseMultiError, or nil if none found. func (m *BrandListResponse) ValidateAll() error { return m.validate(true) } func (m *BrandListResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Total for idx, item := range m.GetData() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, BrandListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, BrandListResponseValidationError{ field: fmt.Sprintf("Data[%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 BrandListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return BrandListResponseMultiError(errors) } return nil } // BrandListResponseMultiError is an error wrapping multiple validation errors // returned by BrandListResponse.ValidateAll() if the designated constraints // aren't met. type BrandListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m BrandListResponseMultiError) 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 BrandListResponseMultiError) AllErrors() []error { return m } // BrandListResponseValidationError is the validation error returned by // BrandListResponse.Validate if the designated constraints aren't met. type BrandListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e BrandListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e BrandListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e BrandListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e BrandListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e BrandListResponseValidationError) ErrorName() string { return "BrandListResponseValidationError" } // Error satisfies the builtin error interface func (e BrandListResponseValidationError) 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 %sBrandListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = BrandListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = BrandListResponseValidationError{} // Validate checks the field values on CreateGoodsRequestGoodsSku 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 *CreateGoodsRequestGoodsSku) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateGoodsRequestGoodsSku 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 // CreateGoodsRequestGoodsSkuMultiError, or nil if none found. func (m *CreateGoodsRequestGoodsSku) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsRequestGoodsSku) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for GoodsId if utf8.RuneCountInString(m.GetSkuName()) < 1 { err := CreateGoodsRequestGoodsSkuValidationError{ field: "SkuName", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetCode()) < 1 { err := CreateGoodsRequestGoodsSkuValidationError{ field: "Code", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetBarCode()) < 1 { err := CreateGoodsRequestGoodsSkuValidationError{ field: "BarCode", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Price // no validation rules for PromotionPrice // no validation rules for Points // no validation rules for Image // no validation rules for Sort // no validation rules for Inventory for idx, item := range m.GetSpecificationInfo() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("SpecificationInfo[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("SpecificationInfo[%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 CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("SpecificationInfo[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetGroupAttrInfo() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("GroupAttrInfo[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("GroupAttrInfo[%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 CreateGoodsRequestGoodsSkuValidationError{ field: fmt.Sprintf("GroupAttrInfo[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return CreateGoodsRequestGoodsSkuMultiError(errors) } return nil } // CreateGoodsRequestGoodsSkuMultiError is an error wrapping multiple // validation errors returned by CreateGoodsRequestGoodsSku.ValidateAll() if // the designated constraints aren't met. type CreateGoodsRequestGoodsSkuMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsRequestGoodsSkuMultiError) 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 CreateGoodsRequestGoodsSkuMultiError) AllErrors() []error { return m } // CreateGoodsRequestGoodsSkuValidationError is the validation error returned // by CreateGoodsRequestGoodsSku.Validate if the designated constraints aren't met. type CreateGoodsRequestGoodsSkuValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsRequestGoodsSkuValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsRequestGoodsSkuValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsRequestGoodsSkuValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsRequestGoodsSkuValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsRequestGoodsSkuValidationError) ErrorName() string { return "CreateGoodsRequestGoodsSkuValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsRequestGoodsSkuValidationError) 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 %sCreateGoodsRequestGoodsSku.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsRequestGoodsSkuValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsRequestGoodsSkuValidationError{} // Validate checks the field values on CreateGoodsRequestGoodsSkuSpecification // 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 *CreateGoodsRequestGoodsSkuSpecification) Validate() error { return m.validate(false) } // ValidateAll checks the field values on // CreateGoodsRequestGoodsSkuSpecification 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 // CreateGoodsRequestGoodsSkuSpecificationMultiError, or nil if none found. func (m *CreateGoodsRequestGoodsSkuSpecification) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsRequestGoodsSkuSpecification) validate(all bool) error { if m == nil { return nil } var errors []error if m.GetSId() < 1 { err := CreateGoodsRequestGoodsSkuSpecificationValidationError{ field: "SId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if m.GetVId() < 1 { err := CreateGoodsRequestGoodsSkuSpecificationValidationError{ field: "VId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return CreateGoodsRequestGoodsSkuSpecificationMultiError(errors) } return nil } // CreateGoodsRequestGoodsSkuSpecificationMultiError is an error wrapping // multiple validation errors returned by // CreateGoodsRequestGoodsSkuSpecification.ValidateAll() if the designated // constraints aren't met. type CreateGoodsRequestGoodsSkuSpecificationMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsRequestGoodsSkuSpecificationMultiError) 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 CreateGoodsRequestGoodsSkuSpecificationMultiError) AllErrors() []error { return m } // CreateGoodsRequestGoodsSkuSpecificationValidationError is the validation // error returned by CreateGoodsRequestGoodsSkuSpecification.Validate if the // designated constraints aren't met. type CreateGoodsRequestGoodsSkuSpecificationValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) ErrorName() string { return "CreateGoodsRequestGoodsSkuSpecificationValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) 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 %sCreateGoodsRequestGoodsSkuSpecification.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsRequestGoodsSkuSpecificationValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsRequestGoodsSkuSpecificationValidationError{} // Validate checks the field values on CreateGoodsRequestGoodsSkuGroupAttr 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 *CreateGoodsRequestGoodsSkuGroupAttr) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateGoodsRequestGoodsSkuGroupAttr // 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 // CreateGoodsRequestGoodsSkuGroupAttrMultiError, or nil if none found. func (m *CreateGoodsRequestGoodsSkuGroupAttr) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsRequestGoodsSkuGroupAttr) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for GroupId // no validation rules for GroupName for idx, item := range m.GetAttrInfo() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuGroupAttrValidationError{ field: fmt.Sprintf("AttrInfo[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CreateGoodsRequestGoodsSkuGroupAttrValidationError{ field: fmt.Sprintf("AttrInfo[%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 CreateGoodsRequestGoodsSkuGroupAttrValidationError{ field: fmt.Sprintf("AttrInfo[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return CreateGoodsRequestGoodsSkuGroupAttrMultiError(errors) } return nil } // CreateGoodsRequestGoodsSkuGroupAttrMultiError is an error wrapping multiple // validation errors returned by // CreateGoodsRequestGoodsSkuGroupAttr.ValidateAll() if the designated // constraints aren't met. type CreateGoodsRequestGoodsSkuGroupAttrMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsRequestGoodsSkuGroupAttrMultiError) 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 CreateGoodsRequestGoodsSkuGroupAttrMultiError) AllErrors() []error { return m } // CreateGoodsRequestGoodsSkuGroupAttrValidationError is the validation error // returned by CreateGoodsRequestGoodsSkuGroupAttr.Validate if the designated // constraints aren't met. type CreateGoodsRequestGoodsSkuGroupAttrValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) ErrorName() string { return "CreateGoodsRequestGoodsSkuGroupAttrValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) 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 %sCreateGoodsRequestGoodsSkuGroupAttr.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsRequestGoodsSkuGroupAttrValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsRequestGoodsSkuGroupAttrValidationError{} // Validate checks the field values on CreateGoodsRequestGoodsSkuGroupAttrAttr // 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 *CreateGoodsRequestGoodsSkuGroupAttrAttr) Validate() error { return m.validate(false) } // ValidateAll checks the field values on // CreateGoodsRequestGoodsSkuGroupAttrAttr 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 // CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError, or nil if none found. func (m *CreateGoodsRequestGoodsSkuGroupAttrAttr) ValidateAll() error { return m.validate(true) } func (m *CreateGoodsRequestGoodsSkuGroupAttrAttr) validate(all bool) error { if m == nil { return nil } var errors []error if m.GetAttrId() < 1 { err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{ field: "AttrId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetAttrName()) < 1 { err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{ field: "AttrName", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if m.GetAttrValueId() < 1 { err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{ field: "AttrValueId", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetAttrValueName()) < 1 { err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{ field: "AttrValueName", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError(errors) } return nil } // CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError is an error wrapping // multiple validation errors returned by // CreateGoodsRequestGoodsSkuGroupAttrAttr.ValidateAll() if the designated // constraints aren't met. type CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError) 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 CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError) AllErrors() []error { return m } // CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError is the validation // error returned by CreateGoodsRequestGoodsSkuGroupAttrAttr.Validate if the // designated constraints aren't met. type CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) ErrorName() string { return "CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError" } // Error satisfies the builtin error interface func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) 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 %sCreateGoodsRequestGoodsSkuGroupAttrAttr.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{} ================================================ FILE: service/order/api/goods/v1/goods.proto ================================================ syntax = "proto3"; package goods.v1; import "google/protobuf/empty.proto"; import "validate/validate.proto"; option go_package = "goods/api/goods/v1;v1"; service Goods { // 商品分类 rpc GetAllCategoryList(google.protobuf.Empty) returns(CategoryListResponse); // 获取所有的分类 rpc GetSubCategory(CategoryListRequest) returns(SubCategoryListResponse);// 获取子分类 rpc CreateCategory(CategoryInfoRequest) returns(CategoryInfoResponse); // 新建分类信息 rpc DeleteCategory(DeleteCategoryRequest) returns(google.protobuf.Empty); // 删除分类 rpc UpdateCategory(CategoryInfoRequest) returns(google.protobuf.Empty); // 修改分类信息 // 商品品牌 rpc BrandList(BrandListRequest) returns(BrandListResponse); rpc CreateBrand(BrandRequest) returns(BrandInfoResponse); rpc DeleteBrand(BrandRequest) returns(google.protobuf.Empty); rpc UpdateBrand(BrandRequest) returns(google.protobuf.Empty); // 商品类型 goods_property_names // 商品类型不同于商品分类,指的是依据某一类商品的相同属性归纳成的属性集合 // 手机类型都有屏幕尺寸、网络制式等共同的属性 rpc CreateGoodsType(GoodsTypeRequest) returns(GoodsTypeResponse); // 商品类型基本信息创建 // 创建商品规格 也就是 手机的颜色、内存版本、购买方式之类的 // 商品规格的值,比如手机颜色对应的有 红、白、黑,内存,128g、256g, 也一起创建了 rpc CreateGoodsSpecification(SpecificationRequest) returns(SpecificationResponse); // 商品规格或属性的信息 // 商品参数属性 ,手机:主体,屏幕, 操作系统,网络支持之类的 rpc CreateAttrGroup(AttrGroupRequest) returns(AttrGroupResponse); // 商品参数属性组下的一些信息 ,主体:上市年份 产品名称 ,网络支持 5G网络,双卡双待类型, rpc CreateAttrValue(AttrRequest) returns(AttrResponse); // 商品接口 rpc CreateGoods(CreateGoodsRequest) returns (CreateGoodsResponse); rpc UpdateGoods(CreateGoodsRequest) returns (google.protobuf.Empty); rpc GoodsList(GoodsFilterRequest) returns(GoodsListResponse); // rpc GetGoodsDetail(GoodInfoRequest) returns(GoodsInfoResponse); // rpc BatchGetGoods(BatchGoodsIdInfo) returns(GoodsListResponse); // 现在用户提交订单有多个商品,你得批量查询商品的信息吧 // rpc DeleteGoods(DeleteGoodsInfo) returns (google.protobuf.Empty); } message AttrValueRequest { int64 id = 1; int64 attrId = 2; int64 groupId = 3 [(validate.rules).int64.gte = 1]; string value = 4 [(validate.rules).string.min_len = 3]; } message AttrRequest { int64 id = 1; int64 typeId = 2 [(validate.rules).int64.gte = 1]; int64 groupId = 3 [(validate.rules).int64.gte = 1]; string title = 4 [(validate.rules).string = {min_len: 1}]; string desc = 5; bool status = 6; int32 sort = 7 [(validate.rules).int32.gte = 1]; repeated AttrValueRequest attrValue = 8; } message AttrValueResponse { int64 id = 1; int64 attrId = 2; int64 groupId = 3; string value = 4; } message AttrResponse { int64 id = 1; int64 typeId = 2; int64 groupId = 3; string title = 4; string desc = 5; bool status = 6; int32 sort = 7; repeated AttrValueResponse attrValue = 8; } message AttrGroupRequest { int64 id = 1; int64 typeId = 2 [(validate.rules).int64.gte = 1]; string title = 3 [(validate.rules).string.min_len = 3]; string desc = 4; bool status = 5; int32 sort = 6 [(validate.rules).int32.gte = 1]; } message AttrGroupResponse { int64 id = 1; int64 typeId = 2; string title = 3; string desc = 4; bool status = 5; int32 sort = 6; } message SpecificationValue { int64 id = 1; int64 attrId = 2; string value = 3 [(validate.rules).string.min_len = 3]; int32 sort = 4 [(validate.rules).int32.gte = 1]; } message SpecificationValueResponse { int64 id = 1; int64 attrId = 2; string value = 3 ; int32 sort = 4; } message SpecificationRequest { int64 id = 1; int64 typeId = 2 [(validate.rules).int64.gte = 1]; string name = 3 [(validate.rules).string.min_len = 2]; int32 sort = 4 [(validate.rules).int32.gte = 1]; bool status = 5; bool isSku = 6; bool isSelect = 7; repeated SpecificationValue specificationValue = 8; } message SpecificationResponse { int64 id = 1; } message GoodsTypeRequest { int64 id = 1; string name = 2 [(validate.rules).string.min_len = 3]; string typeCode = 3 [(validate.rules).string.min_len = 3]; string nameAlias = 4; bool isVirtual = 5; string desc = 6; int32 sort = 7; string brandIds = 8 [(validate.rules).string.min_len = 1]; } message GoodsTypeResponse { int64 id = 1; } message CreateGoodsRequest { int64 id = 1; int32 categoryId = 2 [(validate.rules).int32.gte = 1]; int32 brandId = 3 [(validate.rules).int32.gte = 1]; int64 typeId = 4 [(validate.rules).int64.gte = 1]; string name = 5; string nameAlias = 6; string goodsTags = 7; string goodsSn = 8; int64 shopPrice = 9; int64 marketPrice = 10; int64 inventory = 11; string goodsBrief = 12; string goodsFrontImage = 13; repeated string goodsImages = 14; bool shipFree = 15; int32 shipId = 16; bool isNew = 17; bool isHot = 18; bool onSale = 19; // 根据商品类型 选择商品规格信息并选择 // 商品 sku 属性值 里面有规格的ID和属性的ID,分别是几组信息 message goodsSku { int64 id = 1; int64 goodsId = 2; string skuName = 3 [(validate.rules).string.min_len = 1]; string code = 4 [(validate.rules).string.min_len = 1]; string barCode = 5 [(validate.rules).string.min_len = 1]; int64 price = 6; int64 promotionPrice = 7; int64 points = 8; string image = 9; int32 sort = 10; int64 inventory = 11; // sku 库存 // 规格 message specification { int64 sId = 1 [(validate.rules).int64.gte = 1]; int64 vId = 2 [(validate.rules).int64.gte = 1]; } repeated specification specificationInfo = 12; // 属性组 message groupAttr { int64 groupId = 1; string groupName = 2; message attr { int64 attrId = 1 [(validate.rules).int64.gte = 1]; string attrName = 2 [(validate.rules).string.min_len = 1]; int64 attrValueId = 3 [(validate.rules).int64.gte = 1]; string attrValueName = 4 [(validate.rules).string.min_len = 1]; } repeated attr attrInfo = 3; } repeated groupAttr groupAttrInfo = 13; } repeated goodsSku sku = 20; } message CreateGoodsResponse { int64 ID = 1; } message GoodsInfoResponse { int64 id = 1; int32 categoryId = 2; int32 brandId = 3; string name = 4; string goodsSn = 5; int64 clickNum = 6; int64 soldNum = 7; int64 favNum = 8; int64 marketPrice = 9; string goodsBrief = 10; string goodsDesc = 11; bool shipFree = 12; string images = 13; repeated string goodsImages = 14; bool isNew = 15; bool isHot = 16; bool onSale = 17; } message GoodsListResponse { int64 total = 1; repeated GoodsInfoResponse list = 2; } message GoodsFilterRequest { string keywords = 1; int32 categoryId = 2; int32 brandId = 3; int64 minPrice = 4; int64 maxPrice = 5; bool isHot = 6; bool isNew = 7; bool isTab = 8; int64 clickNum = 9; int64 soldNum = 10; int64 favNum = 11; int64 pages = 12; int64 pagePerNums = 13; int64 id = 14; } // 商品分类 message CategoryInfoResponse { int32 id = 1; string name = 2; int32 parentCategory = 3; int32 level = 4; bool isTab = 5; int32 sort = 6; } message CategoryListResponse { string jsonData = 1; } message CategoryListRequest { int32 id = 1; int32 level = 2; } message SubCategoryListResponse { CategoryInfoResponse info = 1; repeated CategoryInfoResponse subCategory = 2; } message CategoryInfoRequest { int32 id = 1; string name = 2; int32 parentCategory = 3; int32 level = 4; bool isTab = 5; int32 sort = 6; } message BatchCategoryInfoRequest { repeated int32 id = 1; int32 goodsNums = 2; int32 brandNums = 3; } message DeleteCategoryRequest { int32 id = 1; } message BrandListRequest { int32 pages = 1; int32 pagePerNums = 2; } message BrandRequest { int32 id = 1; string name = 2; string logo = 3; string desc = 4; bool isTab = 5; int32 sort = 6; } message BrandInfoResponse { int32 id = 1; string name = 2; string logo = 3; string desc = 4; bool isTab = 5; int32 sort = 6; } message BrandListResponse { int32 total = 1; repeated BrandInfoResponse data = 2; } ================================================ FILE: service/order/api/goods/v1/goods_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 // source: goods/v1/goods.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // GoodsClient is the client API for Goods service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type GoodsClient interface { // 商品分类 GetAllCategoryList(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CategoryListResponse, error) GetSubCategory(ctx context.Context, in *CategoryListRequest, opts ...grpc.CallOption) (*SubCategoryListResponse, error) CreateCategory(ctx context.Context, in *CategoryInfoRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error) DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) UpdateCategory(ctx context.Context, in *CategoryInfoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // 商品品牌 BrandList(ctx context.Context, in *BrandListRequest, opts ...grpc.CallOption) (*BrandListResponse, error) CreateBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*BrandInfoResponse, error) DeleteBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) UpdateBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // 商品类型 goods_property_names // 商品类型不同于商品分类,指的是依据某一类商品的相同属性归纳成的属性集合 // 手机类型都有屏幕尺寸、网络制式等共同的属性 CreateGoodsType(ctx context.Context, in *GoodsTypeRequest, opts ...grpc.CallOption) (*GoodsTypeResponse, error) // 创建商品规格 也就是 手机的颜色、内存版本、购买方式之类的 // 商品规格的值,比如手机颜色对应的有 红、白、黑,内存,128g、256g, 也一起创建了 CreateGoodsSpecification(ctx context.Context, in *SpecificationRequest, opts ...grpc.CallOption) (*SpecificationResponse, error) // 商品参数属性 ,手机:主体,屏幕, 操作系统,网络支持之类的 CreateAttrGroup(ctx context.Context, in *AttrGroupRequest, opts ...grpc.CallOption) (*AttrGroupResponse, error) // 商品参数属性组下的一些信息 ,主体:上市年份 产品名称 ,网络支持 5G网络,双卡双待类型, CreateAttrValue(ctx context.Context, in *AttrRequest, opts ...grpc.CallOption) (*AttrResponse, error) // 商品接口 CreateGoods(ctx context.Context, in *CreateGoodsRequest, opts ...grpc.CallOption) (*CreateGoodsResponse, error) UpdateGoods(ctx context.Context, in *CreateGoodsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) GoodsList(ctx context.Context, in *GoodsFilterRequest, opts ...grpc.CallOption) (*GoodsListResponse, error) } type goodsClient struct { cc grpc.ClientConnInterface } func NewGoodsClient(cc grpc.ClientConnInterface) GoodsClient { return &goodsClient{cc} } func (c *goodsClient) GetAllCategoryList(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CategoryListResponse, error) { out := new(CategoryListResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/GetAllCategoryList", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) GetSubCategory(ctx context.Context, in *CategoryListRequest, opts ...grpc.CallOption) (*SubCategoryListResponse, error) { out := new(SubCategoryListResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/GetSubCategory", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateCategory(ctx context.Context, in *CategoryInfoRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error) { out := new(CategoryInfoResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateCategory", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/goods.v1.Goods/DeleteCategory", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) UpdateCategory(ctx context.Context, in *CategoryInfoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/goods.v1.Goods/UpdateCategory", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) BrandList(ctx context.Context, in *BrandListRequest, opts ...grpc.CallOption) (*BrandListResponse, error) { out := new(BrandListResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/BrandList", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*BrandInfoResponse, error) { out := new(BrandInfoResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateBrand", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) DeleteBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/goods.v1.Goods/DeleteBrand", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) UpdateBrand(ctx context.Context, in *BrandRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/goods.v1.Goods/UpdateBrand", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateGoodsType(ctx context.Context, in *GoodsTypeRequest, opts ...grpc.CallOption) (*GoodsTypeResponse, error) { out := new(GoodsTypeResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateGoodsType", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateGoodsSpecification(ctx context.Context, in *SpecificationRequest, opts ...grpc.CallOption) (*SpecificationResponse, error) { out := new(SpecificationResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateGoodsSpecification", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateAttrGroup(ctx context.Context, in *AttrGroupRequest, opts ...grpc.CallOption) (*AttrGroupResponse, error) { out := new(AttrGroupResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateAttrGroup", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateAttrValue(ctx context.Context, in *AttrRequest, opts ...grpc.CallOption) (*AttrResponse, error) { out := new(AttrResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateAttrValue", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) CreateGoods(ctx context.Context, in *CreateGoodsRequest, opts ...grpc.CallOption) (*CreateGoodsResponse, error) { out := new(CreateGoodsResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/CreateGoods", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) UpdateGoods(ctx context.Context, in *CreateGoodsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/goods.v1.Goods/UpdateGoods", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *goodsClient) GoodsList(ctx context.Context, in *GoodsFilterRequest, opts ...grpc.CallOption) (*GoodsListResponse, error) { out := new(GoodsListResponse) err := c.cc.Invoke(ctx, "/goods.v1.Goods/GoodsList", in, out, opts...) if err != nil { return nil, err } return out, nil } // GoodsServer is the server API for Goods service. // All implementations must embed UnimplementedGoodsServer // for forward compatibility type GoodsServer interface { // 商品分类 GetAllCategoryList(context.Context, *emptypb.Empty) (*CategoryListResponse, error) GetSubCategory(context.Context, *CategoryListRequest) (*SubCategoryListResponse, error) CreateCategory(context.Context, *CategoryInfoRequest) (*CategoryInfoResponse, error) DeleteCategory(context.Context, *DeleteCategoryRequest) (*emptypb.Empty, error) UpdateCategory(context.Context, *CategoryInfoRequest) (*emptypb.Empty, error) // 商品品牌 BrandList(context.Context, *BrandListRequest) (*BrandListResponse, error) CreateBrand(context.Context, *BrandRequest) (*BrandInfoResponse, error) DeleteBrand(context.Context, *BrandRequest) (*emptypb.Empty, error) UpdateBrand(context.Context, *BrandRequest) (*emptypb.Empty, error) // 商品类型 goods_property_names // 商品类型不同于商品分类,指的是依据某一类商品的相同属性归纳成的属性集合 // 手机类型都有屏幕尺寸、网络制式等共同的属性 CreateGoodsType(context.Context, *GoodsTypeRequest) (*GoodsTypeResponse, error) // 创建商品规格 也就是 手机的颜色、内存版本、购买方式之类的 // 商品规格的值,比如手机颜色对应的有 红、白、黑,内存,128g、256g, 也一起创建了 CreateGoodsSpecification(context.Context, *SpecificationRequest) (*SpecificationResponse, error) // 商品参数属性 ,手机:主体,屏幕, 操作系统,网络支持之类的 CreateAttrGroup(context.Context, *AttrGroupRequest) (*AttrGroupResponse, error) // 商品参数属性组下的一些信息 ,主体:上市年份 产品名称 ,网络支持 5G网络,双卡双待类型, CreateAttrValue(context.Context, *AttrRequest) (*AttrResponse, error) // 商品接口 CreateGoods(context.Context, *CreateGoodsRequest) (*CreateGoodsResponse, error) UpdateGoods(context.Context, *CreateGoodsRequest) (*emptypb.Empty, error) GoodsList(context.Context, *GoodsFilterRequest) (*GoodsListResponse, error) mustEmbedUnimplementedGoodsServer() } // UnimplementedGoodsServer must be embedded to have forward compatible implementations. type UnimplementedGoodsServer struct { } func (UnimplementedGoodsServer) GetAllCategoryList(context.Context, *emptypb.Empty) (*CategoryListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAllCategoryList not implemented") } func (UnimplementedGoodsServer) GetSubCategory(context.Context, *CategoryListRequest) (*SubCategoryListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetSubCategory not implemented") } func (UnimplementedGoodsServer) CreateCategory(context.Context, *CategoryInfoRequest) (*CategoryInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateCategory not implemented") } func (UnimplementedGoodsServer) DeleteCategory(context.Context, *DeleteCategoryRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteCategory not implemented") } func (UnimplementedGoodsServer) UpdateCategory(context.Context, *CategoryInfoRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateCategory not implemented") } func (UnimplementedGoodsServer) BrandList(context.Context, *BrandListRequest) (*BrandListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BrandList not implemented") } func (UnimplementedGoodsServer) CreateBrand(context.Context, *BrandRequest) (*BrandInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateBrand not implemented") } func (UnimplementedGoodsServer) DeleteBrand(context.Context, *BrandRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteBrand not implemented") } func (UnimplementedGoodsServer) UpdateBrand(context.Context, *BrandRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateBrand not implemented") } func (UnimplementedGoodsServer) CreateGoodsType(context.Context, *GoodsTypeRequest) (*GoodsTypeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateGoodsType not implemented") } func (UnimplementedGoodsServer) CreateGoodsSpecification(context.Context, *SpecificationRequest) (*SpecificationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateGoodsSpecification not implemented") } func (UnimplementedGoodsServer) CreateAttrGroup(context.Context, *AttrGroupRequest) (*AttrGroupResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAttrGroup not implemented") } func (UnimplementedGoodsServer) CreateAttrValue(context.Context, *AttrRequest) (*AttrResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAttrValue not implemented") } func (UnimplementedGoodsServer) CreateGoods(context.Context, *CreateGoodsRequest) (*CreateGoodsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateGoods not implemented") } func (UnimplementedGoodsServer) UpdateGoods(context.Context, *CreateGoodsRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateGoods not implemented") } func (UnimplementedGoodsServer) GoodsList(context.Context, *GoodsFilterRequest) (*GoodsListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GoodsList not implemented") } func (UnimplementedGoodsServer) mustEmbedUnimplementedGoodsServer() {} // UnsafeGoodsServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to GoodsServer will // result in compilation errors. type UnsafeGoodsServer interface { mustEmbedUnimplementedGoodsServer() } func RegisterGoodsServer(s grpc.ServiceRegistrar, srv GoodsServer) { s.RegisterService(&Goods_ServiceDesc, srv) } func _Goods_GetAllCategoryList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).GetAllCategoryList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/GetAllCategoryList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).GetAllCategoryList(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _Goods_GetSubCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CategoryListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).GetSubCategory(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/GetSubCategory", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).GetSubCategory(ctx, req.(*CategoryListRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CategoryInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateCategory(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateCategory", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateCategory(ctx, req.(*CategoryInfoRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_DeleteCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteCategoryRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).DeleteCategory(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/DeleteCategory", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).DeleteCategory(ctx, req.(*DeleteCategoryRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_UpdateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CategoryInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).UpdateCategory(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/UpdateCategory", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).UpdateCategory(ctx, req.(*CategoryInfoRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_BrandList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BrandListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).BrandList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/BrandList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).BrandList(ctx, req.(*BrandListRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateBrand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BrandRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateBrand(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateBrand", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateBrand(ctx, req.(*BrandRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_DeleteBrand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BrandRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).DeleteBrand(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/DeleteBrand", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).DeleteBrand(ctx, req.(*BrandRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_UpdateBrand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BrandRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).UpdateBrand(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/UpdateBrand", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).UpdateBrand(ctx, req.(*BrandRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateGoodsType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GoodsTypeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateGoodsType(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateGoodsType", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateGoodsType(ctx, req.(*GoodsTypeRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateGoodsSpecification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SpecificationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateGoodsSpecification(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateGoodsSpecification", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateGoodsSpecification(ctx, req.(*SpecificationRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateAttrGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AttrGroupRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateAttrGroup(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateAttrGroup", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateAttrGroup(ctx, req.(*AttrGroupRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateAttrValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AttrRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateAttrValue(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateAttrValue", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateAttrValue(ctx, req.(*AttrRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_CreateGoods_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateGoodsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).CreateGoods(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/CreateGoods", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).CreateGoods(ctx, req.(*CreateGoodsRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_UpdateGoods_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateGoodsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).UpdateGoods(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/UpdateGoods", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).UpdateGoods(ctx, req.(*CreateGoodsRequest)) } return interceptor(ctx, in, info, handler) } func _Goods_GoodsList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GoodsFilterRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GoodsServer).GoodsList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/goods.v1.Goods/GoodsList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GoodsServer).GoodsList(ctx, req.(*GoodsFilterRequest)) } return interceptor(ctx, in, info, handler) } // Goods_ServiceDesc is the grpc.ServiceDesc for Goods service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Goods_ServiceDesc = grpc.ServiceDesc{ ServiceName: "goods.v1.Goods", HandlerType: (*GoodsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetAllCategoryList", Handler: _Goods_GetAllCategoryList_Handler, }, { MethodName: "GetSubCategory", Handler: _Goods_GetSubCategory_Handler, }, { MethodName: "CreateCategory", Handler: _Goods_CreateCategory_Handler, }, { MethodName: "DeleteCategory", Handler: _Goods_DeleteCategory_Handler, }, { MethodName: "UpdateCategory", Handler: _Goods_UpdateCategory_Handler, }, { MethodName: "BrandList", Handler: _Goods_BrandList_Handler, }, { MethodName: "CreateBrand", Handler: _Goods_CreateBrand_Handler, }, { MethodName: "DeleteBrand", Handler: _Goods_DeleteBrand_Handler, }, { MethodName: "UpdateBrand", Handler: _Goods_UpdateBrand_Handler, }, { MethodName: "CreateGoodsType", Handler: _Goods_CreateGoodsType_Handler, }, { MethodName: "CreateGoodsSpecification", Handler: _Goods_CreateGoodsSpecification_Handler, }, { MethodName: "CreateAttrGroup", Handler: _Goods_CreateAttrGroup_Handler, }, { MethodName: "CreateAttrValue", Handler: _Goods_CreateAttrValue_Handler, }, { MethodName: "CreateGoods", Handler: _Goods_CreateGoods_Handler, }, { MethodName: "UpdateGoods", Handler: _Goods_UpdateGoods_Handler, }, { MethodName: "GoodsList", Handler: _Goods_GoodsList_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "goods/v1/goods.proto", } ================================================ FILE: service/order/api/order/v1/error_reason.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: order/v1/error_reason.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ErrorReason int32 const ( ErrorReason_ORDER_UNSPECIFIED ErrorReason = 0 ErrorReason_ORDER_NOT_FOUND ErrorReason = 1 ) // Enum value maps for ErrorReason. var ( ErrorReason_name = map[int32]string{ 0: "ORDER_UNSPECIFIED", 1: "ORDER_NOT_FOUND", } ErrorReason_value = map[string]int32{ "ORDER_UNSPECIFIED": 0, "ORDER_NOT_FOUND": 1, } ) func (x ErrorReason) Enum() *ErrorReason { p := new(ErrorReason) *p = x return p } func (x ErrorReason) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ErrorReason) Descriptor() protoreflect.EnumDescriptor { return file_order_v1_error_reason_proto_enumTypes[0].Descriptor() } func (ErrorReason) Type() protoreflect.EnumType { return &file_order_v1_error_reason_proto_enumTypes[0] } func (x ErrorReason) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ErrorReason.Descriptor instead. func (ErrorReason) EnumDescriptor() ([]byte, []int) { return file_order_v1_error_reason_proto_rawDescGZIP(), []int{0} } var File_order_v1_error_reason_proto protoreflect.FileDescriptor var file_order_v1_error_reason_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2a, 0x39, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x42, 0x30, 0x0a, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a, 0x15, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0xa2, 0x02, 0x0a, 0x41, 0x50, 0x49, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_order_v1_error_reason_proto_rawDescOnce sync.Once file_order_v1_error_reason_proto_rawDescData = file_order_v1_error_reason_proto_rawDesc ) func file_order_v1_error_reason_proto_rawDescGZIP() []byte { file_order_v1_error_reason_proto_rawDescOnce.Do(func() { file_order_v1_error_reason_proto_rawDescData = protoimpl.X.CompressGZIP(file_order_v1_error_reason_proto_rawDescData) }) return file_order_v1_error_reason_proto_rawDescData } var file_order_v1_error_reason_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_order_v1_error_reason_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: Order.v1.ErrorReason } var file_order_v1_error_reason_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_order_v1_error_reason_proto_init() } func file_order_v1_error_reason_proto_init() { if File_order_v1_error_reason_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_order_v1_error_reason_proto_rawDesc, NumEnums: 1, NumMessages: 0, NumExtensions: 0, NumServices: 0, }, GoTypes: file_order_v1_error_reason_proto_goTypes, DependencyIndexes: file_order_v1_error_reason_proto_depIdxs, EnumInfos: file_order_v1_error_reason_proto_enumTypes, }.Build() File_order_v1_error_reason_proto = out.File file_order_v1_error_reason_proto_rawDesc = nil file_order_v1_error_reason_proto_goTypes = nil file_order_v1_error_reason_proto_depIdxs = nil } ================================================ FILE: service/order/api/order/v1/error_reason.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: order/v1/error_reason.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) ================================================ FILE: service/order/api/order/v1/error_reason.proto ================================================ syntax = "proto3"; package Order.v1; option go_package = "order/api/order/v1;v1"; option java_multiple_files = true; option java_package = "Order.v1"; option objc_class_prefix = "APIOrderV1"; enum ErrorReason { ORDER_UNSPECIFIED = 0; ORDER_NOT_FOUND = 1; } ================================================ FILE: service/order/api/order/v1/order.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: order/v1/order.proto package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type CartItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields CartId int64 `protobuf:"varint,1,opt,name=cartId,proto3" json:"cartId,omitempty"` SkuId int64 `protobuf:"varint,2,opt,name=skuId,proto3" json:"skuId,omitempty"` SkuPrice int64 `protobuf:"varint,3,opt,name=skuPrice,proto3" json:"skuPrice,omitempty"` SkuNum int32 `protobuf:"varint,4,opt,name=skuNum,proto3" json:"skuNum,omitempty"` } func (x *CartItem) Reset() { *x = CartItem{} if protoimpl.UnsafeEnabled { mi := &file_order_v1_order_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CartItem) String() string { return protoimpl.X.MessageStringOf(x) } func (*CartItem) ProtoMessage() {} func (x *CartItem) ProtoReflect() protoreflect.Message { mi := &file_order_v1_order_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 CartItem.ProtoReflect.Descriptor instead. func (*CartItem) Descriptor() ([]byte, []int) { return file_order_v1_order_proto_rawDescGZIP(), []int{0} } func (x *CartItem) GetCartId() int64 { if x != nil { return x.CartId } return 0 } func (x *CartItem) GetSkuId() int64 { if x != nil { return x.SkuId } return 0 } func (x *CartItem) GetSkuPrice() int64 { if x != nil { return x.SkuPrice } return 0 } func (x *CartItem) GetSkuNum() int32 { if x != nil { return x.SkuNum } return 0 } type OrderRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` Address int64 `protobuf:"varint,3,opt,name=address,proto3" json:"address,omitempty"` CartItem []*CartItem `protobuf:"bytes,4,rep,name=cartItem,proto3" json:"cartItem,omitempty"` // 购物车购买 } func (x *OrderRequest) Reset() { *x = OrderRequest{} if protoimpl.UnsafeEnabled { mi := &file_order_v1_order_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OrderRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*OrderRequest) ProtoMessage() {} func (x *OrderRequest) ProtoReflect() protoreflect.Message { mi := &file_order_v1_order_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 OrderRequest.ProtoReflect.Descriptor instead. func (*OrderRequest) Descriptor() ([]byte, []int) { return file_order_v1_order_proto_rawDescGZIP(), []int{1} } func (x *OrderRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *OrderRequest) GetUserId() int64 { if x != nil { return x.UserId } return 0 } func (x *OrderRequest) GetAddress() int64 { if x != nil { return x.Address } return 0 } func (x *OrderRequest) GetCartItem() []*CartItem { if x != nil { return x.CartItem } return nil } type OrderInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` UserId int32 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` OrderSn string `protobuf:"bytes,3,opt,name=orderSn,proto3" json:"orderSn,omitempty"` PayType string `protobuf:"bytes,4,opt,name=payType,proto3" json:"payType,omitempty"` Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` Post string `protobuf:"bytes,6,opt,name=post,proto3" json:"post,omitempty"` Total float32 `protobuf:"fixed32,7,opt,name=total,proto3" json:"total,omitempty"` Address string `protobuf:"bytes,8,opt,name=address,proto3" json:"address,omitempty"` Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,10,opt,name=mobile,proto3" json:"mobile,omitempty"` AddTime string `protobuf:"bytes,11,opt,name=addTime,proto3" json:"addTime,omitempty"` } func (x *OrderInfoResponse) Reset() { *x = OrderInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_order_v1_order_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OrderInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*OrderInfoResponse) ProtoMessage() {} func (x *OrderInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_order_v1_order_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 OrderInfoResponse.ProtoReflect.Descriptor instead. func (*OrderInfoResponse) Descriptor() ([]byte, []int) { return file_order_v1_order_proto_rawDescGZIP(), []int{2} } func (x *OrderInfoResponse) GetId() int32 { if x != nil { return x.Id } return 0 } func (x *OrderInfoResponse) GetUserId() int32 { if x != nil { return x.UserId } return 0 } func (x *OrderInfoResponse) GetOrderSn() string { if x != nil { return x.OrderSn } return "" } func (x *OrderInfoResponse) GetPayType() string { if x != nil { return x.PayType } return "" } func (x *OrderInfoResponse) GetStatus() string { if x != nil { return x.Status } return "" } func (x *OrderInfoResponse) GetPost() string { if x != nil { return x.Post } return "" } func (x *OrderInfoResponse) GetTotal() float32 { if x != nil { return x.Total } return 0 } func (x *OrderInfoResponse) GetAddress() string { if x != nil { return x.Address } return "" } func (x *OrderInfoResponse) GetName() string { if x != nil { return x.Name } return "" } func (x *OrderInfoResponse) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *OrderInfoResponse) GetAddTime() string { if x != nil { return x.AddTime } return "" } var File_order_v1_order_proto protoreflect.FileDescriptor var file_order_v1_order_proto_rawDesc = []byte{ 0x0a, 0x14, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 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, 0x6c, 0x0a, 0x08, 0x43, 0x61, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x72, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x61, 0x72, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6b, 0x75, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x6b, 0x75, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6b, 0x75, 0x4e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6b, 0x75, 0x4e, 0x75, 0x6d, 0x22, 0x92, 0x01, 0x0a, 0x0c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x61, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, 0x63, 0x61, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x91, 0x02, 0x0a, 0x11, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x4b, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x17, 0x5a, 0x15, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_order_v1_order_proto_rawDescOnce sync.Once file_order_v1_order_proto_rawDescData = file_order_v1_order_proto_rawDesc ) func file_order_v1_order_proto_rawDescGZIP() []byte { file_order_v1_order_proto_rawDescOnce.Do(func() { file_order_v1_order_proto_rawDescData = protoimpl.X.CompressGZIP(file_order_v1_order_proto_rawDescData) }) return file_order_v1_order_proto_rawDescData } var file_order_v1_order_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_order_v1_order_proto_goTypes = []interface{}{ (*CartItem)(nil), // 0: order.v1.CartItem (*OrderRequest)(nil), // 1: order.v1.OrderRequest (*OrderInfoResponse)(nil), // 2: order.v1.OrderInfoResponse } var file_order_v1_order_proto_depIdxs = []int32{ 0, // 0: order.v1.OrderRequest.cartItem:type_name -> order.v1.CartItem 1, // 1: order.v1.Order.CreateOrder:input_type -> order.v1.OrderRequest 2, // 2: order.v1.Order.CreateOrder:output_type -> order.v1.OrderInfoResponse 2, // [2:3] is the sub-list for method output_type 1, // [1:2] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name } func init() { file_order_v1_order_proto_init() } func file_order_v1_order_proto_init() { if File_order_v1_order_proto != nil { return } if !protoimpl.UnsafeEnabled { file_order_v1_order_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CartItem); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_order_v1_order_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OrderRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_order_v1_order_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OrderInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_order_v1_order_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 1, }, GoTypes: file_order_v1_order_proto_goTypes, DependencyIndexes: file_order_v1_order_proto_depIdxs, MessageInfos: file_order_v1_order_proto_msgTypes, }.Build() File_order_v1_order_proto = out.File file_order_v1_order_proto_rawDesc = nil file_order_v1_order_proto_goTypes = nil file_order_v1_order_proto_depIdxs = nil } ================================================ FILE: service/order/api/order/v1/order.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: order/v1/order.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on CartItem 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 *CartItem) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CartItem 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 CartItemMultiError, or nil // if none found. func (m *CartItem) ValidateAll() error { return m.validate(true) } func (m *CartItem) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for CartId // no validation rules for SkuId // no validation rules for SkuPrice // no validation rules for SkuNum if len(errors) > 0 { return CartItemMultiError(errors) } return nil } // CartItemMultiError is an error wrapping multiple validation errors returned // by CartItem.ValidateAll() if the designated constraints aren't met. type CartItemMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CartItemMultiError) 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 CartItemMultiError) AllErrors() []error { return m } // CartItemValidationError is the validation error returned by // CartItem.Validate if the designated constraints aren't met. type CartItemValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CartItemValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CartItemValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CartItemValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CartItemValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CartItemValidationError) ErrorName() string { return "CartItemValidationError" } // Error satisfies the builtin error interface func (e CartItemValidationError) 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 %sCartItem.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CartItemValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CartItemValidationError{} // Validate checks the field values on OrderRequest 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 *OrderRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on OrderRequest 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 OrderRequestMultiError, or // nil if none found. func (m *OrderRequest) ValidateAll() error { return m.validate(true) } func (m *OrderRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if m.GetUserId() <= 0 { err := OrderRequestValidationError{ field: "UserId", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if m.GetAddress() <= 0 { err := OrderRequestValidationError{ field: "Address", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } for idx, item := range m.GetCartItem() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, OrderRequestValidationError{ field: fmt.Sprintf("CartItem[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, OrderRequestValidationError{ field: fmt.Sprintf("CartItem[%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 OrderRequestValidationError{ field: fmt.Sprintf("CartItem[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return OrderRequestMultiError(errors) } return nil } // OrderRequestMultiError is an error wrapping multiple validation errors // returned by OrderRequest.ValidateAll() if the designated constraints aren't met. type OrderRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m OrderRequestMultiError) 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 OrderRequestMultiError) AllErrors() []error { return m } // OrderRequestValidationError is the validation error returned by // OrderRequest.Validate if the designated constraints aren't met. type OrderRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e OrderRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e OrderRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e OrderRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e OrderRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e OrderRequestValidationError) ErrorName() string { return "OrderRequestValidationError" } // Error satisfies the builtin error interface func (e OrderRequestValidationError) 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 %sOrderRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = OrderRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = OrderRequestValidationError{} // Validate checks the field values on OrderInfoResponse 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 *OrderInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on OrderInfoResponse 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 // OrderInfoResponseMultiError, or nil if none found. func (m *OrderInfoResponse) ValidateAll() error { return m.validate(true) } func (m *OrderInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for UserId // no validation rules for OrderSn // no validation rules for PayType // no validation rules for Status // no validation rules for Post // no validation rules for Total // no validation rules for Address // no validation rules for Name // no validation rules for Mobile // no validation rules for AddTime if len(errors) > 0 { return OrderInfoResponseMultiError(errors) } return nil } // OrderInfoResponseMultiError is an error wrapping multiple validation errors // returned by OrderInfoResponse.ValidateAll() if the designated constraints // aren't met. type OrderInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m OrderInfoResponseMultiError) 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 OrderInfoResponseMultiError) AllErrors() []error { return m } // OrderInfoResponseValidationError is the validation error returned by // OrderInfoResponse.Validate if the designated constraints aren't met. type OrderInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e OrderInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e OrderInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e OrderInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e OrderInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e OrderInfoResponseValidationError) ErrorName() string { return "OrderInfoResponseValidationError" } // Error satisfies the builtin error interface func (e OrderInfoResponseValidationError) 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 %sOrderInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = OrderInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = OrderInfoResponseValidationError{} ================================================ FILE: service/order/api/order/v1/order.proto ================================================ syntax = "proto3"; package order.v1; import "validate/validate.proto"; option go_package = "order/api/order/v1;v1"; service Order { rpc CreateOrder(OrderRequest) returns (OrderInfoResponse); // 创建订单 } message CartItem { int64 cartId = 1; int64 skuId = 2; int64 skuPrice = 3; int32 skuNum = 4; } message OrderRequest { int64 id = 1; int64 userId = 2 [(validate.rules).int64 = {gt:0}]; int64 address = 3 [(validate.rules).int64 = {gt:0}]; repeated CartItem cartItem = 4; // 购物车购买 } message OrderInfoResponse { int32 id = 1; int32 userId = 2; string orderSn = 3; string payType = 4; string status = 5; string post = 6; float total = 7; string address = 8; string name = 9; string mobile = 10; string addTime = 11; } ================================================ FILE: service/order/api/order/v1/order_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 // source: order/v1/order.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // OrderClient is the client API for Order service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type OrderClient interface { CreateOrder(ctx context.Context, in *OrderRequest, opts ...grpc.CallOption) (*OrderInfoResponse, error) } type orderClient struct { cc grpc.ClientConnInterface } func NewOrderClient(cc grpc.ClientConnInterface) OrderClient { return &orderClient{cc} } func (c *orderClient) CreateOrder(ctx context.Context, in *OrderRequest, opts ...grpc.CallOption) (*OrderInfoResponse, error) { out := new(OrderInfoResponse) err := c.cc.Invoke(ctx, "/order.v1.Order/CreateOrder", in, out, opts...) if err != nil { return nil, err } return out, nil } // OrderServer is the server API for Order service. // All implementations must embed UnimplementedOrderServer // for forward compatibility type OrderServer interface { CreateOrder(context.Context, *OrderRequest) (*OrderInfoResponse, error) mustEmbedUnimplementedOrderServer() } // UnimplementedOrderServer must be embedded to have forward compatible implementations. type UnimplementedOrderServer struct { } func (UnimplementedOrderServer) CreateOrder(context.Context, *OrderRequest) (*OrderInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateOrder not implemented") } func (UnimplementedOrderServer) mustEmbedUnimplementedOrderServer() {} // UnsafeOrderServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to OrderServer will // result in compilation errors. type UnsafeOrderServer interface { mustEmbedUnimplementedOrderServer() } func RegisterOrderServer(s grpc.ServiceRegistrar, srv OrderServer) { s.RegisterService(&Order_ServiceDesc, srv) } func _Order_CreateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(OrderRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(OrderServer).CreateOrder(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/order.v1.Order/CreateOrder", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(OrderServer).CreateOrder(ctx, req.(*OrderRequest)) } return interceptor(ctx, in, info, handler) } // Order_ServiceDesc is the grpc.ServiceDesc for Order service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Order_ServiceDesc = grpc.ServiceDesc{ ServiceName: "order.v1.Order", HandlerType: (*OrderServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateOrder", Handler: _Order_CreateOrder_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "order/v1/order.proto", } ================================================ FILE: service/order/api/user/v1/user.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: user/v1/user.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ListAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *ListAddressReq) Reset() { *x = ListAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReq) ProtoMessage() {} func (x *ListAddressReq) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_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 ListAddressReq.ProtoReflect.Descriptor instead. func (*ListAddressReq) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{0} } func (x *ListAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type AddressInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *AddressInfo) Reset() { *x = AddressInfo{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressInfo) ProtoMessage() {} func (x *AddressInfo) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_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 AddressInfo.ProtoReflect.Descriptor instead. func (*AddressInfo) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{1} } func (x *AddressInfo) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressInfo) GetName() string { if x != nil { return x.Name } return "" } func (x *AddressInfo) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *AddressInfo) GetProvince() string { if x != nil { return x.Province } return "" } func (x *AddressInfo) GetCity() string { if x != nil { return x.City } return "" } func (x *AddressInfo) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *AddressInfo) GetAddress() string { if x != nil { return x.Address } return "" } func (x *AddressInfo) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *AddressInfo) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type ListAddressReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Results []*AddressInfo `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } func (x *ListAddressReply) Reset() { *x = ListAddressReply{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReply) ProtoMessage() {} func (x *ListAddressReply) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_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 ListAddressReply.ProtoReflect.Descriptor instead. func (*ListAddressReply) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{2} } func (x *ListAddressReply) GetResults() []*AddressInfo { if x != nil { return x.Results } return nil } type CreateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *CreateAddressReq) Reset() { *x = CreateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateAddressReq) ProtoMessage() {} func (x *CreateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_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 CreateAddressReq.ProtoReflect.Descriptor instead. func (*CreateAddressReq) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{3} } func (x *CreateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *CreateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *CreateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *CreateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *CreateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *CreateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *CreateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *CreateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *CreateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type UpdateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` Id int64 `protobuf:"varint,10,opt,name=id,proto3" json:"id,omitempty"` } func (x *UpdateAddressReq) Reset() { *x = UpdateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateAddressReq) ProtoMessage() {} func (x *UpdateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use UpdateAddressReq.ProtoReflect.Descriptor instead. func (*UpdateAddressReq) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{4} } func (x *UpdateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *UpdateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *UpdateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UpdateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *UpdateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *UpdateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *UpdateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *UpdateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *UpdateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } func (x *UpdateAddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } type AddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Uid int64 `protobuf:"varint,2,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *AddressReq) Reset() { *x = AddressReq{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressReq) ProtoMessage() {} func (x *AddressReq) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AddressReq.ProtoReflect.Descriptor instead. func (*AddressReq) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{5} } func (x *AddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type CheckResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } func (x *CheckResponse) Reset() { *x = CheckResponse{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CheckResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CheckResponse) ProtoMessage() {} func (x *CheckResponse) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[6] 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 CheckResponse.ProtoReflect.Descriptor instead. func (*CheckResponse) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{6} } func (x *CheckResponse) GetSuccess() bool { if x != nil { return x.Success } return false } // 分页 type PageInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Pn uint32 `protobuf:"varint,1,opt,name=pn,proto3" json:"pn,omitempty"` PSize uint32 `protobuf:"varint,2,opt,name=pSize,proto3" json:"pSize,omitempty"` } func (x *PageInfo) Reset() { *x = PageInfo{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PageInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*PageInfo) ProtoMessage() {} func (x *PageInfo) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[7] 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 PageInfo.ProtoReflect.Descriptor instead. func (*PageInfo) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{7} } func (x *PageInfo) GetPn() uint32 { if x != nil { return x.Pn } return 0 } func (x *PageInfo) GetPSize() uint32 { if x != nil { return x.PSize } return 0 } // 用户信息 type UserInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` NickName string `protobuf:"bytes,4,opt,name=nickName,proto3" json:"nickName,omitempty"` Birthday uint64 `protobuf:"varint,5,opt,name=birthday,proto3" json:"birthday,omitempty"` Gender string `protobuf:"bytes,6,opt,name=gender,proto3" json:"gender,omitempty"` Role int32 `protobuf:"varint,7,opt,name=role,proto3" json:"role,omitempty"` } func (x *UserInfoResponse) Reset() { *x = UserInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UserInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*UserInfoResponse) ProtoMessage() {} func (x *UserInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[8] 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 UserInfoResponse.ProtoReflect.Descriptor instead. func (*UserInfoResponse) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{8} } func (x *UserInfoResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UserInfoResponse) GetPassword() string { if x != nil { return x.Password } return "" } func (x *UserInfoResponse) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UserInfoResponse) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *UserInfoResponse) GetBirthday() uint64 { if x != nil { return x.Birthday } return 0 } func (x *UserInfoResponse) GetGender() string { if x != nil { return x.Gender } return "" } func (x *UserInfoResponse) GetRole() int32 { if x != nil { return x.Role } return 0 } // 用户列表 type UserListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Data []*UserInfoResponse `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` } func (x *UserListResponse) Reset() { *x = UserListResponse{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UserListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*UserListResponse) ProtoMessage() {} func (x *UserListResponse) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[9] 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 UserListResponse.ProtoReflect.Descriptor instead. func (*UserListResponse) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{9} } func (x *UserListResponse) GetTotal() int32 { if x != nil { return x.Total } return 0 } func (x *UserListResponse) GetData() []*UserInfoResponse { if x != nil { return x.Data } return nil } type MobileRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"` } func (x *MobileRequest) Reset() { *x = MobileRequest{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *MobileRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*MobileRequest) ProtoMessage() {} func (x *MobileRequest) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[10] 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 MobileRequest.ProtoReflect.Descriptor instead. func (*MobileRequest) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{10} } func (x *MobileRequest) GetMobile() string { if x != nil { return x.Mobile } return "" } type IdRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *IdRequest) Reset() { *x = IdRequest{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *IdRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*IdRequest) ProtoMessage() {} func (x *IdRequest) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[11] 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 IdRequest.ProtoReflect.Descriptor instead. func (*IdRequest) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{11} } func (x *IdRequest) GetId() int64 { if x != nil { return x.Id } return 0 } // 创建用户 type CreateUserInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields NickName string `protobuf:"bytes,1,opt,name=nickName,proto3" json:"nickName,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` } func (x *CreateUserInfo) Reset() { *x = CreateUserInfo{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateUserInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateUserInfo) ProtoMessage() {} func (x *CreateUserInfo) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[12] 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 CreateUserInfo.ProtoReflect.Descriptor instead. func (*CreateUserInfo) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{12} } func (x *CreateUserInfo) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *CreateUserInfo) GetPassword() string { if x != nil { return x.Password } return "" } func (x *CreateUserInfo) GetMobile() string { if x != nil { return x.Mobile } return "" } type UpdateUserInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` NickName string `protobuf:"bytes,2,opt,name=nickName,proto3" json:"nickName,omitempty"` Gender string `protobuf:"bytes,3,opt,name=gender,proto3" json:"gender,omitempty"` Birthday uint64 `protobuf:"varint,4,opt,name=birthday,proto3" json:"birthday,omitempty"` } func (x *UpdateUserInfo) Reset() { *x = UpdateUserInfo{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateUserInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateUserInfo) ProtoMessage() {} func (x *UpdateUserInfo) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[13] 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 UpdateUserInfo.ProtoReflect.Descriptor instead. func (*UpdateUserInfo) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{13} } func (x *UpdateUserInfo) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UpdateUserInfo) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *UpdateUserInfo) GetGender() string { if x != nil { return x.Gender } return "" } func (x *UpdateUserInfo) GetBirthday() uint64 { if x != nil { return x.Birthday } return 0 } type PasswordCheckInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` EncryptedPassword string `protobuf:"bytes,2,opt,name=encryptedPassword,proto3" json:"encryptedPassword,omitempty"` } func (x *PasswordCheckInfo) Reset() { *x = PasswordCheckInfo{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PasswordCheckInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*PasswordCheckInfo) ProtoMessage() {} func (x *PasswordCheckInfo) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[14] 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 PasswordCheckInfo.ProtoReflect.Descriptor instead. func (*PasswordCheckInfo) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{14} } func (x *PasswordCheckInfo) GetPassword() string { if x != nil { return x.Password } return "" } func (x *PasswordCheckInfo) GetEncryptedPassword() string { if x != nil { return x.EncryptedPassword } return "" } var File_user_v1_user_proto protoreflect.FileDescriptor var file_user_v1_user_proto_rawDesc = []byte{ 0x0a, 0x12, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x22, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0xed, 0x01, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x42, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xf4, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x84, 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x30, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x70, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xba, 0x01, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x57, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x27, 0x0a, 0x0d, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x22, 0x1b, 0x0a, 0x09, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x60, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x22, 0x70, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x22, 0x5d, 0x0a, 0x11, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0xa4, 0x06, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x12, 0x12, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x42, 0x15, 0x5a, 0x13, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_user_v1_user_proto_rawDescOnce sync.Once file_user_v1_user_proto_rawDescData = file_user_v1_user_proto_rawDesc ) func file_user_v1_user_proto_rawDescGZIP() []byte { file_user_v1_user_proto_rawDescOnce.Do(func() { file_user_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_v1_user_proto_rawDescData) }) return file_user_v1_user_proto_rawDescData } var file_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_user_v1_user_proto_goTypes = []interface{}{ (*ListAddressReq)(nil), // 0: user.v1.ListAddressReq (*AddressInfo)(nil), // 1: user.v1.AddressInfo (*ListAddressReply)(nil), // 2: user.v1.ListAddressReply (*CreateAddressReq)(nil), // 3: user.v1.CreateAddressReq (*UpdateAddressReq)(nil), // 4: user.v1.UpdateAddressReq (*AddressReq)(nil), // 5: user.v1.AddressReq (*CheckResponse)(nil), // 6: user.v1.CheckResponse (*PageInfo)(nil), // 7: user.v1.PageInfo (*UserInfoResponse)(nil), // 8: user.v1.UserInfoResponse (*UserListResponse)(nil), // 9: user.v1.UserListResponse (*MobileRequest)(nil), // 10: user.v1.MobileRequest (*IdRequest)(nil), // 11: user.v1.IdRequest (*CreateUserInfo)(nil), // 12: user.v1.CreateUserInfo (*UpdateUserInfo)(nil), // 13: user.v1.UpdateUserInfo (*PasswordCheckInfo)(nil), // 14: user.v1.PasswordCheckInfo (*emptypb.Empty)(nil), // 15: google.protobuf.Empty } var file_user_v1_user_proto_depIdxs = []int32{ 1, // 0: user.v1.ListAddressReply.results:type_name -> user.v1.AddressInfo 8, // 1: user.v1.UserListResponse.data:type_name -> user.v1.UserInfoResponse 7, // 2: user.v1.User.GetUserList:input_type -> user.v1.PageInfo 10, // 3: user.v1.User.GetUserByMobile:input_type -> user.v1.MobileRequest 11, // 4: user.v1.User.GetUserById:input_type -> user.v1.IdRequest 12, // 5: user.v1.User.CreateUser:input_type -> user.v1.CreateUserInfo 13, // 6: user.v1.User.UpdateUser:input_type -> user.v1.UpdateUserInfo 14, // 7: user.v1.User.CheckPassword:input_type -> user.v1.PasswordCheckInfo 0, // 8: user.v1.User.ListAddress:input_type -> user.v1.ListAddressReq 3, // 9: user.v1.User.CreateAddress:input_type -> user.v1.CreateAddressReq 4, // 10: user.v1.User.UpdateAddress:input_type -> user.v1.UpdateAddressReq 5, // 11: user.v1.User.DefaultAddress:input_type -> user.v1.AddressReq 5, // 12: user.v1.User.DeleteAddress:input_type -> user.v1.AddressReq 5, // 13: user.v1.User.GetAddress:input_type -> user.v1.AddressReq 9, // 14: user.v1.User.GetUserList:output_type -> user.v1.UserListResponse 8, // 15: user.v1.User.GetUserByMobile:output_type -> user.v1.UserInfoResponse 8, // 16: user.v1.User.GetUserById:output_type -> user.v1.UserInfoResponse 8, // 17: user.v1.User.CreateUser:output_type -> user.v1.UserInfoResponse 15, // 18: user.v1.User.UpdateUser:output_type -> google.protobuf.Empty 6, // 19: user.v1.User.CheckPassword:output_type -> user.v1.CheckResponse 2, // 20: user.v1.User.ListAddress:output_type -> user.v1.ListAddressReply 1, // 21: user.v1.User.CreateAddress:output_type -> user.v1.AddressInfo 6, // 22: user.v1.User.UpdateAddress:output_type -> user.v1.CheckResponse 6, // 23: user.v1.User.DefaultAddress:output_type -> user.v1.CheckResponse 6, // 24: user.v1.User.DeleteAddress:output_type -> user.v1.CheckResponse 1, // 25: user.v1.User.GetAddress:output_type -> user.v1.AddressInfo 14, // [14:26] is the sub-list for method output_type 2, // [2:14] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } func init() { file_user_v1_user_proto_init() } func file_user_v1_user_proto_init() { if File_user_v1_user_proto != nil { return } if !protoimpl.UnsafeEnabled { file_user_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PageInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MobileRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IdRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateUserInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateUserInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_user_v1_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PasswordCheckInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_v1_user_proto_rawDesc, NumEnums: 0, NumMessages: 15, NumExtensions: 0, NumServices: 1, }, GoTypes: file_user_v1_user_proto_goTypes, DependencyIndexes: file_user_v1_user_proto_depIdxs, MessageInfos: file_user_v1_user_proto_msgTypes, }.Build() File_user_v1_user_proto = out.File file_user_v1_user_proto_rawDesc = nil file_user_v1_user_proto_goTypes = nil file_user_v1_user_proto_depIdxs = nil } ================================================ FILE: service/order/api/user/v1/user.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: user/v1/user.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on ListAddressReq 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 *ListAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReq 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 ListAddressReqMultiError, // or nil if none found. func (m *ListAddressReq) ValidateAll() error { return m.validate(true) } func (m *ListAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid if len(errors) > 0 { return ListAddressReqMultiError(errors) } return nil } // ListAddressReqMultiError is an error wrapping multiple validation errors // returned by ListAddressReq.ValidateAll() if the designated constraints // aren't met. type ListAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReqMultiError) 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 ListAddressReqMultiError) AllErrors() []error { return m } // ListAddressReqValidationError is the validation error returned by // ListAddressReq.Validate if the designated constraints aren't met. type ListAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReqValidationError) ErrorName() string { return "ListAddressReqValidationError" } // Error satisfies the builtin error interface func (e ListAddressReqValidationError) 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 %sListAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReqValidationError{} // Validate checks the field values on AddressInfo 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 *AddressInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressInfo 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 AddressInfoMultiError, or // nil if none found. func (m *AddressInfo) ValidateAll() error { return m.validate(true) } func (m *AddressInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return AddressInfoMultiError(errors) } return nil } // AddressInfoMultiError is an error wrapping multiple validation errors // returned by AddressInfo.ValidateAll() if the designated constraints aren't met. type AddressInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressInfoMultiError) 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 AddressInfoMultiError) AllErrors() []error { return m } // AddressInfoValidationError is the validation error returned by // AddressInfo.Validate if the designated constraints aren't met. type AddressInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressInfoValidationError) ErrorName() string { return "AddressInfoValidationError" } // Error satisfies the builtin error interface func (e AddressInfoValidationError) 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 %sAddressInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressInfoValidationError{} // Validate checks the field values on ListAddressReply 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 *ListAddressReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReply 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 // ListAddressReplyMultiError, or nil if none found. func (m *ListAddressReply) ValidateAll() error { return m.validate(true) } func (m *ListAddressReply) validate(all bool) error { if m == nil { return nil } var errors []error for idx, item := range m.GetResults() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%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 ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return ListAddressReplyMultiError(errors) } return nil } // ListAddressReplyMultiError is an error wrapping multiple validation errors // returned by ListAddressReply.ValidateAll() if the designated constraints // aren't met. type ListAddressReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReplyMultiError) 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 ListAddressReplyMultiError) AllErrors() []error { return m } // ListAddressReplyValidationError is the validation error returned by // ListAddressReply.Validate if the designated constraints aren't met. type ListAddressReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReplyValidationError) ErrorName() string { return "ListAddressReplyValidationError" } // Error satisfies the builtin error interface func (e ListAddressReplyValidationError) 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 %sListAddressReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReplyValidationError{} // Validate checks the field values on CreateAddressReq 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 *CreateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateAddressReq 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 // CreateAddressReqMultiError, or nil if none found. func (m *CreateAddressReq) ValidateAll() error { return m.validate(true) } func (m *CreateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return CreateAddressReqMultiError(errors) } return nil } // CreateAddressReqMultiError is an error wrapping multiple validation errors // returned by CreateAddressReq.ValidateAll() if the designated constraints // aren't met. type CreateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateAddressReqMultiError) 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 CreateAddressReqMultiError) AllErrors() []error { return m } // CreateAddressReqValidationError is the validation error returned by // CreateAddressReq.Validate if the designated constraints aren't met. type CreateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateAddressReqValidationError) ErrorName() string { return "CreateAddressReqValidationError" } // Error satisfies the builtin error interface func (e CreateAddressReqValidationError) 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 %sCreateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateAddressReqValidationError{} // Validate checks the field values on UpdateAddressReq 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 *UpdateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateAddressReq 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 // UpdateAddressReqMultiError, or nil if none found. func (m *UpdateAddressReq) ValidateAll() error { return m.validate(true) } func (m *UpdateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault // no validation rules for Id if len(errors) > 0 { return UpdateAddressReqMultiError(errors) } return nil } // UpdateAddressReqMultiError is an error wrapping multiple validation errors // returned by UpdateAddressReq.ValidateAll() if the designated constraints // aren't met. type UpdateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateAddressReqMultiError) 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 UpdateAddressReqMultiError) AllErrors() []error { return m } // UpdateAddressReqValidationError is the validation error returned by // UpdateAddressReq.Validate if the designated constraints aren't met. type UpdateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateAddressReqValidationError) ErrorName() string { return "UpdateAddressReqValidationError" } // Error satisfies the builtin error interface func (e UpdateAddressReqValidationError) 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 %sUpdateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateAddressReqValidationError{} // Validate checks the field values on AddressReq 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 *AddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressReq 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 AddressReqMultiError, or // nil if none found. func (m *AddressReq) ValidateAll() error { return m.validate(true) } func (m *AddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Uid if len(errors) > 0 { return AddressReqMultiError(errors) } return nil } // AddressReqMultiError is an error wrapping multiple validation errors // returned by AddressReq.ValidateAll() if the designated constraints aren't met. type AddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressReqMultiError) 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 AddressReqMultiError) AllErrors() []error { return m } // AddressReqValidationError is the validation error returned by // AddressReq.Validate if the designated constraints aren't met. type AddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressReqValidationError) ErrorName() string { return "AddressReqValidationError" } // Error satisfies the builtin error interface func (e AddressReqValidationError) 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 %sAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressReqValidationError{} // Validate checks the field values on CheckResponse 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 *CheckResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CheckResponse 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 CheckResponseMultiError, or // nil if none found. func (m *CheckResponse) ValidateAll() error { return m.validate(true) } func (m *CheckResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Success if len(errors) > 0 { return CheckResponseMultiError(errors) } return nil } // CheckResponseMultiError is an error wrapping multiple validation errors // returned by CheckResponse.ValidateAll() if the designated constraints // aren't met. type CheckResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CheckResponseMultiError) 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 CheckResponseMultiError) AllErrors() []error { return m } // CheckResponseValidationError is the validation error returned by // CheckResponse.Validate if the designated constraints aren't met. type CheckResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CheckResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CheckResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CheckResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CheckResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CheckResponseValidationError) ErrorName() string { return "CheckResponseValidationError" } // Error satisfies the builtin error interface func (e CheckResponseValidationError) 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 %sCheckResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CheckResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CheckResponseValidationError{} // Validate checks the field values on PageInfo 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 *PageInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PageInfo 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 PageInfoMultiError, or nil // if none found. func (m *PageInfo) ValidateAll() error { return m.validate(true) } func (m *PageInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Pn // no validation rules for PSize if len(errors) > 0 { return PageInfoMultiError(errors) } return nil } // PageInfoMultiError is an error wrapping multiple validation errors returned // by PageInfo.ValidateAll() if the designated constraints aren't met. type PageInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PageInfoMultiError) 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 PageInfoMultiError) AllErrors() []error { return m } // PageInfoValidationError is the validation error returned by // PageInfo.Validate if the designated constraints aren't met. type PageInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PageInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PageInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PageInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PageInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PageInfoValidationError) ErrorName() string { return "PageInfoValidationError" } // Error satisfies the builtin error interface func (e PageInfoValidationError) 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 %sPageInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PageInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PageInfoValidationError{} // Validate checks the field values on UserInfoResponse 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 *UserInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UserInfoResponse 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 // UserInfoResponseMultiError, or nil if none found. func (m *UserInfoResponse) ValidateAll() error { return m.validate(true) } func (m *UserInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Password // no validation rules for Mobile // no validation rules for NickName // no validation rules for Birthday // no validation rules for Gender // no validation rules for Role if len(errors) > 0 { return UserInfoResponseMultiError(errors) } return nil } // UserInfoResponseMultiError is an error wrapping multiple validation errors // returned by UserInfoResponse.ValidateAll() if the designated constraints // aren't met. type UserInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UserInfoResponseMultiError) 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 UserInfoResponseMultiError) AllErrors() []error { return m } // UserInfoResponseValidationError is the validation error returned by // UserInfoResponse.Validate if the designated constraints aren't met. type UserInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UserInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UserInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UserInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UserInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UserInfoResponseValidationError) ErrorName() string { return "UserInfoResponseValidationError" } // Error satisfies the builtin error interface func (e UserInfoResponseValidationError) 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 %sUserInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UserInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UserInfoResponseValidationError{} // Validate checks the field values on UserListResponse 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 *UserListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UserListResponse 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 // UserListResponseMultiError, or nil if none found. func (m *UserListResponse) ValidateAll() error { return m.validate(true) } func (m *UserListResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Total for idx, item := range m.GetData() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, UserListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, UserListResponseValidationError{ field: fmt.Sprintf("Data[%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 UserListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return UserListResponseMultiError(errors) } return nil } // UserListResponseMultiError is an error wrapping multiple validation errors // returned by UserListResponse.ValidateAll() if the designated constraints // aren't met. type UserListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UserListResponseMultiError) 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 UserListResponseMultiError) AllErrors() []error { return m } // UserListResponseValidationError is the validation error returned by // UserListResponse.Validate if the designated constraints aren't met. type UserListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UserListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UserListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UserListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UserListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UserListResponseValidationError) ErrorName() string { return "UserListResponseValidationError" } // Error satisfies the builtin error interface func (e UserListResponseValidationError) 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 %sUserListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UserListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UserListResponseValidationError{} // Validate checks the field values on MobileRequest 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 *MobileRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on MobileRequest 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 MobileRequestMultiError, or // nil if none found. func (m *MobileRequest) ValidateAll() error { return m.validate(true) } func (m *MobileRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Mobile if len(errors) > 0 { return MobileRequestMultiError(errors) } return nil } // MobileRequestMultiError is an error wrapping multiple validation errors // returned by MobileRequest.ValidateAll() if the designated constraints // aren't met. type MobileRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m MobileRequestMultiError) 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 MobileRequestMultiError) AllErrors() []error { return m } // MobileRequestValidationError is the validation error returned by // MobileRequest.Validate if the designated constraints aren't met. type MobileRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e MobileRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e MobileRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e MobileRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e MobileRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e MobileRequestValidationError) ErrorName() string { return "MobileRequestValidationError" } // Error satisfies the builtin error interface func (e MobileRequestValidationError) 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 %sMobileRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = MobileRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = MobileRequestValidationError{} // Validate checks the field values on IdRequest 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 *IdRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on IdRequest 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 IdRequestMultiError, or nil // if none found. func (m *IdRequest) ValidateAll() error { return m.validate(true) } func (m *IdRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return IdRequestMultiError(errors) } return nil } // IdRequestMultiError is an error wrapping multiple validation errors returned // by IdRequest.ValidateAll() if the designated constraints aren't met. type IdRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m IdRequestMultiError) 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 IdRequestMultiError) AllErrors() []error { return m } // IdRequestValidationError is the validation error returned by // IdRequest.Validate if the designated constraints aren't met. type IdRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e IdRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e IdRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e IdRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e IdRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e IdRequestValidationError) ErrorName() string { return "IdRequestValidationError" } // Error satisfies the builtin error interface func (e IdRequestValidationError) 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 %sIdRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = IdRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = IdRequestValidationError{} // Validate checks the field values on CreateUserInfo 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 *CreateUserInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateUserInfo 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 CreateUserInfoMultiError, // or nil if none found. func (m *CreateUserInfo) ValidateAll() error { return m.validate(true) } func (m *CreateUserInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for NickName // no validation rules for Password // no validation rules for Mobile if len(errors) > 0 { return CreateUserInfoMultiError(errors) } return nil } // CreateUserInfoMultiError is an error wrapping multiple validation errors // returned by CreateUserInfo.ValidateAll() if the designated constraints // aren't met. type CreateUserInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateUserInfoMultiError) 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 CreateUserInfoMultiError) AllErrors() []error { return m } // CreateUserInfoValidationError is the validation error returned by // CreateUserInfo.Validate if the designated constraints aren't met. type CreateUserInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateUserInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateUserInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateUserInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateUserInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateUserInfoValidationError) ErrorName() string { return "CreateUserInfoValidationError" } // Error satisfies the builtin error interface func (e CreateUserInfoValidationError) 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 %sCreateUserInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateUserInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateUserInfoValidationError{} // Validate checks the field values on UpdateUserInfo 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 *UpdateUserInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateUserInfo 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 UpdateUserInfoMultiError, // or nil if none found. func (m *UpdateUserInfo) ValidateAll() error { return m.validate(true) } func (m *UpdateUserInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for NickName // no validation rules for Gender // no validation rules for Birthday if len(errors) > 0 { return UpdateUserInfoMultiError(errors) } return nil } // UpdateUserInfoMultiError is an error wrapping multiple validation errors // returned by UpdateUserInfo.ValidateAll() if the designated constraints // aren't met. type UpdateUserInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateUserInfoMultiError) 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 UpdateUserInfoMultiError) AllErrors() []error { return m } // UpdateUserInfoValidationError is the validation error returned by // UpdateUserInfo.Validate if the designated constraints aren't met. type UpdateUserInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateUserInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateUserInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateUserInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateUserInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateUserInfoValidationError) ErrorName() string { return "UpdateUserInfoValidationError" } // Error satisfies the builtin error interface func (e UpdateUserInfoValidationError) 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 %sUpdateUserInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateUserInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateUserInfoValidationError{} // Validate checks the field values on PasswordCheckInfo 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 *PasswordCheckInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PasswordCheckInfo 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 // PasswordCheckInfoMultiError, or nil if none found. func (m *PasswordCheckInfo) ValidateAll() error { return m.validate(true) } func (m *PasswordCheckInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Password // no validation rules for EncryptedPassword if len(errors) > 0 { return PasswordCheckInfoMultiError(errors) } return nil } // PasswordCheckInfoMultiError is an error wrapping multiple validation errors // returned by PasswordCheckInfo.ValidateAll() if the designated constraints // aren't met. type PasswordCheckInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PasswordCheckInfoMultiError) 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 PasswordCheckInfoMultiError) AllErrors() []error { return m } // PasswordCheckInfoValidationError is the validation error returned by // PasswordCheckInfo.Validate if the designated constraints aren't met. type PasswordCheckInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PasswordCheckInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PasswordCheckInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PasswordCheckInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PasswordCheckInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PasswordCheckInfoValidationError) ErrorName() string { return "PasswordCheckInfoValidationError" } // Error satisfies the builtin error interface func (e PasswordCheckInfoValidationError) 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 %sPasswordCheckInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PasswordCheckInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PasswordCheckInfoValidationError{} ================================================ FILE: service/order/api/user/v1/user.proto ================================================ syntax = "proto3"; package user.v1; import "google/protobuf/empty.proto"; option go_package = "user/api/user/v1;v1"; service User{ rpc GetUserList(PageInfo) returns (UserListResponse){}; // 用户列表 rpc GetUserByMobile(MobileRequest) returns (UserInfoResponse){}; // 通过 mobile 查询用户 rpc GetUserById(IdRequest) returns (UserInfoResponse){}; // 通过 Id 查询用户 rpc CreateUser(CreateUserInfo) returns (UserInfoResponse){}; // 创建用户 rpc UpdateUser(UpdateUserInfo) returns (google.protobuf.Empty){}; // 更新用户 rpc CheckPassword(PasswordCheckInfo) returns (CheckResponse){}; // 检查用户密码 // 收货地址 rpc ListAddress(ListAddressReq) returns (ListAddressReply) {} // 所有收货地址列表 rpc CreateAddress(CreateAddressReq) returns (AddressInfo) {} // 新增收货地址 rpc UpdateAddress(UpdateAddressReq) returns (CheckResponse) {} // 修改收货地址 rpc DefaultAddress(AddressReq) returns (CheckResponse) {} // 设置默认地址 rpc DeleteAddress(AddressReq) returns (CheckResponse) {} // 删除收货地址 rpc GetAddress(AddressReq) returns (AddressInfo) {} // 查询收货地址 } message ListAddressReq { int64 uid = 1; } message AddressInfo { int64 id = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; } message ListAddressReply { repeated AddressInfo results = 1; } message CreateAddressReq { int64 uid = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; } message UpdateAddressReq { int64 uid = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; int64 id = 10; } message AddressReq { int64 id = 1; int64 uid = 2; } message CheckResponse{ bool success = 1; } // 分页 message PageInfo{ uint32 pn = 1; uint32 pSize = 2; } // 用户信息 message UserInfoResponse{ int64 id = 1; string password = 2; string mobile = 3; string nickName = 4; uint64 birthday = 5; string gender = 6; int32 role = 7; } // 用户列表 message UserListResponse{ int32 total = 1; repeated UserInfoResponse data = 2; } message MobileRequest{ string mobile = 1; } message IdRequest{ int64 id = 1; } // 创建用户 message CreateUserInfo{ string nickName = 1; string password = 2; string mobile = 3; } message UpdateUserInfo{ int64 id = 1; string nickName = 2; string gender = 3; uint64 birthday = 4; } message PasswordCheckInfo{ string password = 1; string encryptedPassword = 2; } ================================================ FILE: service/order/api/user/v1/user_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 // source: user/v1/user.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // UserClient is the client API for User service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type UserClient interface { GetUserList(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*UserListResponse, error) GetUserByMobile(ctx context.Context, in *MobileRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) GetUserById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) CreateUser(ctx context.Context, in *CreateUserInfo, opts ...grpc.CallOption) (*UserInfoResponse, error) UpdateUser(ctx context.Context, in *UpdateUserInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) CheckPassword(ctx context.Context, in *PasswordCheckInfo, opts ...grpc.CallOption) (*CheckResponse, error) // 收货地址 ListAddress(ctx context.Context, in *ListAddressReq, opts ...grpc.CallOption) (*ListAddressReply, error) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) GetAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*AddressInfo, error) } type userClient struct { cc grpc.ClientConnInterface } func NewUserClient(cc grpc.ClientConnInterface) UserClient { return &userClient{cc} } func (c *userClient) GetUserList(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*UserListResponse, error) { out := new(UserListResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserList", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) GetUserByMobile(ctx context.Context, in *MobileRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserByMobile", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) GetUserById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserById", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CreateUser(ctx context.Context, in *CreateUserInfo, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/CreateUser", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) UpdateUser(ctx context.Context, in *UpdateUserInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/user.v1.User/UpdateUser", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CheckPassword(ctx context.Context, in *PasswordCheckInfo, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/CheckPassword", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) ListAddress(ctx context.Context, in *ListAddressReq, opts ...grpc.CallOption) (*ListAddressReply, error) { out := new(ListAddressReply) err := c.cc.Invoke(ctx, "/user.v1.User/ListAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) { out := new(AddressInfo) err := c.cc.Invoke(ctx, "/user.v1.User/CreateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/UpdateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/DefaultAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/DeleteAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) GetAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*AddressInfo, error) { out := new(AddressInfo) err := c.cc.Invoke(ctx, "/user.v1.User/GetAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } // UserServer is the server API for User service. // All implementations must embed UnimplementedUserServer // for forward compatibility type UserServer interface { GetUserList(context.Context, *PageInfo) (*UserListResponse, error) GetUserByMobile(context.Context, *MobileRequest) (*UserInfoResponse, error) GetUserById(context.Context, *IdRequest) (*UserInfoResponse, error) CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error) UpdateUser(context.Context, *UpdateUserInfo) (*emptypb.Empty, error) CheckPassword(context.Context, *PasswordCheckInfo) (*CheckResponse, error) // 收货地址 ListAddress(context.Context, *ListAddressReq) (*ListAddressReply, error) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) GetAddress(context.Context, *AddressReq) (*AddressInfo, error) mustEmbedUnimplementedUserServer() } // UnimplementedUserServer must be embedded to have forward compatible implementations. type UnimplementedUserServer struct { } func (UnimplementedUserServer) GetUserList(context.Context, *PageInfo) (*UserListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserList not implemented") } func (UnimplementedUserServer) GetUserByMobile(context.Context, *MobileRequest) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserByMobile not implemented") } func (UnimplementedUserServer) GetUserById(context.Context, *IdRequest) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserById not implemented") } func (UnimplementedUserServer) CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") } func (UnimplementedUserServer) UpdateUser(context.Context, *UpdateUserInfo) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") } func (UnimplementedUserServer) CheckPassword(context.Context, *PasswordCheckInfo) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CheckPassword not implemented") } func (UnimplementedUserServer) ListAddress(context.Context, *ListAddressReq) (*ListAddressReply, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAddress not implemented") } func (UnimplementedUserServer) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAddress not implemented") } func (UnimplementedUserServer) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateAddress not implemented") } func (UnimplementedUserServer) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DefaultAddress not implemented") } func (UnimplementedUserServer) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteAddress not implemented") } func (UnimplementedUserServer) GetAddress(context.Context, *AddressReq) (*AddressInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAddress not implemented") } func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {} // UnsafeUserServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to UserServer will // result in compilation errors. type UnsafeUserServer interface { mustEmbedUnimplementedUserServer() } func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer) { s.RegisterService(&User_ServiceDesc, srv) } func _User_GetUserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PageInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserList(ctx, req.(*PageInfo)) } return interceptor(ctx, in, info, handler) } func _User_GetUserByMobile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MobileRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserByMobile(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserByMobile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserByMobile(ctx, req.(*MobileRequest)) } return interceptor(ctx, in, info, handler) } func _User_GetUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserById(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserById", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserById(ctx, req.(*IdRequest)) } return interceptor(ctx, in, info, handler) } func _User_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateUserInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CreateUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CreateUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CreateUser(ctx, req.(*CreateUserInfo)) } return interceptor(ctx, in, info, handler) } func _User_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateUserInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).UpdateUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/UpdateUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).UpdateUser(ctx, req.(*UpdateUserInfo)) } return interceptor(ctx, in, info, handler) } func _User_CheckPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PasswordCheckInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CheckPassword(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CheckPassword", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CheckPassword(ctx, req.(*PasswordCheckInfo)) } return interceptor(ctx, in, info, handler) } func _User_ListAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).ListAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/ListAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).ListAddress(ctx, req.(*ListAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_CreateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CreateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CreateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CreateAddress(ctx, req.(*CreateAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_UpdateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).UpdateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/UpdateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).UpdateAddress(ctx, req.(*UpdateAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_DefaultAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).DefaultAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/DefaultAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).DefaultAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } func _User_DeleteAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).DeleteAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/DeleteAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).DeleteAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } func _User_GetAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } // User_ServiceDesc is the grpc.ServiceDesc for User service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.v1.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUserList", Handler: _User_GetUserList_Handler, }, { MethodName: "GetUserByMobile", Handler: _User_GetUserByMobile_Handler, }, { MethodName: "GetUserById", Handler: _User_GetUserById_Handler, }, { MethodName: "CreateUser", Handler: _User_CreateUser_Handler, }, { MethodName: "UpdateUser", Handler: _User_UpdateUser_Handler, }, { MethodName: "CheckPassword", Handler: _User_CheckPassword_Handler, }, { MethodName: "ListAddress", Handler: _User_ListAddress_Handler, }, { MethodName: "CreateAddress", Handler: _User_CreateAddress_Handler, }, { MethodName: "UpdateAddress", Handler: _User_UpdateAddress_Handler, }, { MethodName: "DefaultAddress", Handler: _User_DefaultAddress_Handler, }, { MethodName: "DeleteAddress", Handler: _User_DeleteAddress_Handler, }, { MethodName: "GetAddress", Handler: _User_GetAddress_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user/v1/user.proto", } ================================================ FILE: service/order/cmd/order/main.go ================================================ package main import ( "flag" "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/registry" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/exporters/jaeger" "go.opentelemetry.io/otel/sdk/resource" tracesdk "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" "os" "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/transport/grpc" "order/internal/conf" ) // go build -ldflags "-X main.Version=x.y.z" var ( // Name is the name of the compiled software. Name = "shop.order.service" // Version is the version of the compiled software. Version string // flagconf is the config flag. flagconf string id, _ = os.Hostname() ) func init() { flag.StringVar(&flagconf, "conf", "../../configs", "config path, eg: -conf config.yaml") } func newApp(logger log.Logger, gs *grpc.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.ID(id+"order service"), kratos.Name(Name), kratos.Version(Version), kratos.Metadata(map[string]string{}), kratos.Logger(logger), kratos.Server( gs, ), kratos.Registrar(rr), ) } func main() { flag.Parse() logger := log.With(log.NewStdLogger(os.Stdout), "ts", log.DefaultTimestamp, "caller", log.DefaultCaller, "service.id", id, "service.name", Name, "service.version", Version, "trace.id", tracing.TraceID(), "span.id", tracing.SpanID(), ) c := config.New( config.WithSource( file.NewSource(flagconf), ), ) defer c.Close() if err := c.Load(); err != nil { panic(err) } var bc conf.Bootstrap if err := c.Scan(&bc); err != nil { panic(err) } if err := setTracerProvider(bc.Trace.Endpoint); err != nil { panic(err) } var rc conf.Registry if err := c.Scan(&rc); err != nil { panic(err) } app, cleanup, err := wireApp(bc.Server, &rc, bc.Data, bc.Auth, bc.Service, logger) if err != nil { panic(err) } defer cleanup() // start and wait for stop signal if err := app.Run(); err != nil { panic(err) } } // Set global trace provider func setTracerProvider(url string) error { // Create the Jaeger exporter exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url))) if err != nil { return err } tp := tracesdk.NewTracerProvider( // Set the sampling rate based on the parent span to 100% tracesdk.WithSampler(tracesdk.ParentBased(tracesdk.TraceIDRatioBased(1.0))), // Always be sure to batch in production. tracesdk.WithBatcher(exp), // Record information about this application in an Resource. tracesdk.WithResource(resource.NewSchemaless( semconv.ServiceNameKey.String(Name), attribute.String("env", "dev"), )), ) otel.SetTracerProvider(tp) return nil } ================================================ FILE: service/order/cmd/order/wire.go ================================================ //go:build wireinject // +build wireinject // The build tag makes sure the stub is not built in the final build. package main import ( "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" "github.com/google/wire" "order/internal/biz" "order/internal/conf" "order/internal/data" "order/internal/server" "order/internal/service" ) // wireApp init kratos application. func wireApp(*conf.Server, *conf.Registry, *conf.Data, *conf.Auth, *conf.Service, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } ================================================ FILE: service/order/cmd/order/wire_gen.go ================================================ // Code generated by Wire. DO NOT EDIT. //go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject package main import ( "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" "order/internal/biz" "order/internal/conf" "order/internal/data" "order/internal/server" "order/internal/service" ) // Injectors from wire.go: // wireApp init kratos application. func wireApp(confServer *conf.Server, registry *conf.Registry, confData *conf.Data, auth *conf.Auth, confService *conf.Service, logger log.Logger) (*kratos.App, func(), error) { db := data.NewDB(confData) client := data.NewRedis(confData) dataData, cleanup, err := data.NewData(confData, logger, db, client) if err != nil { return nil, nil, err } orderRepo := data.NewOrderRepo(dataData, logger) discovery := data.NewDiscovery(registry) userClient := data.NewUserServiceClient(auth, confService, discovery) cartClient := data.NewCartServiceClient(auth, confService, discovery) goodsClient := data.NewGoodsServiceClient(auth, confService, discovery) orderUsecase := biz.NewOrderUsecase(orderRepo, userClient, cartClient, goodsClient, logger) orderService := service.NewOrderService(orderUsecase, logger) grpcServer := server.NewGRPCServer(confServer, orderService, logger) registrar := server.NewRegistrar(registry) app := newApp(logger, grpcServer, registrar) return app, func() { cleanup() }, nil } ================================================ FILE: service/order/configs/config.yaml ================================================ server: http: addr: 0.0.0.0:8000 timeout: 1s grpc: addr: 0.0.0.0:50054 timeout: 1s data: database: driver: mysql source: root:root@tcp(127.0.0.1:3306)/shop_order?charset=utf8mb4&parseTime=True&loc=Local redis: addr: 127.0.0.1:6379 dial_timeout: 1s read_timeout: 0.2s write_timeout: 0.2s trace: endpoint: http://127.0.0.1:14268/api/traces auth: jwt_key: hqFr%3ddt32DGlSTOI5cO6@TH#fFwYnP$S service: user: endpoint: discovery:///shop.user.service cart: endpoint: discovery:///shop.cart.service goods: endpoint: discovery:///shop.goods.service ================================================ FILE: service/order/configs/registry.yaml ================================================ consul: address: 127.0.0.1:8500 scheme: http ================================================ FILE: service/order/go.mod ================================================ module order go 1.17 require ( github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220422120629-fbf7855cf262 github.com/go-kratos/kratos/v2 v2.2.1 github.com/go-redis/redis/extra/redisotel v0.3.0 github.com/go-redis/redis/v8 v8.11.5 github.com/golang/mock v1.4.4 github.com/google/wire v0.5.0 github.com/hashicorp/consul/api v1.12.0 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.19.0 github.com/ory/dockertest/v3 v3.8.1 github.com/pkg/errors v0.9.1 go.opentelemetry.io/otel v1.6.3 go.opentelemetry.io/otel/exporters/jaeger v1.6.3 go.opentelemetry.io/otel/sdk v1.6.3 google.golang.org/protobuf v1.28.0 gorm.io/driver/mysql v1.3.3 gorm.io/gorm v1.23.4 ) require ( github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect github.com/Microsoft/go-winio v0.5.1 // indirect github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect github.com/cenkalti/backoff/v4 v4.1.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/cli v20.10.11+incompatible // indirect github.com/docker/docker v20.10.7+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect github.com/fatih/color v1.9.0 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-playground/form/v4 v4.2.0 // indirect github.com/go-redis/redis/extra/rediscmd v0.2.0 // indirect github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.1 // indirect github.com/hashicorp/go-hclog v0.12.0 // indirect github.com/hashicorp/go-immutable-radix v1.0.0 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.1 // indirect github.com/hashicorp/serf v0.9.6 // indirect github.com/iancoleman/strcase v0.2.0 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.4 // indirect github.com/lyft/protoc-gen-star v0.6.0 // indirect github.com/mattn/go-colorable v0.1.6 // indirect github.com/mattn/go-isatty v0.0.12 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.4.1 // indirect github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/opencontainers/go-digest v1.0.0-rc1 // indirect github.com/opencontainers/image-spec v1.0.2 // indirect github.com/opencontainers/runc v1.0.2 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/spf13/afero v1.8.2 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect go.opentelemetry.io/otel/trace v1.6.3 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/net v0.0.0-20220615171555-694bf12d69de // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/tools v0.1.11 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90 // indirect google.golang.org/grpc v1.47.0 // indirect google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) ================================================ FILE: service/order/go.sum ================================================ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/cli v20.10.11+incompatible h1:tXU1ezXcruZQRrMP8RN2z9N91h+6egZTS1gsPsKantc= github.com/docker/cli v20.10.11+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v20.10.7+incompatible h1:Z6O9Nhsjv+ayUEeI1IojKbYcsGdgYSNqxe1s2MYzUhQ= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kratos/aegis v0.1.1/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220422120629-fbf7855cf262 h1:lYjRFN2hg3Gl88SS+jHR+JkJRUBeH2i2gZRax8qJAdI= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220422120629-fbf7855cf262/go.mod h1:CFHMR6oi+wIEdqxjH4TwKvPlMWUfRY3SMke9++r/dB8= github.com/go-kratos/kratos/v2 v2.2.1 h1:sm29txvyqiQw4v+MftnYWTMgEBjjzWHjrim8kaTVQWE= github.com/go-kratos/kratos/v2 v2.2.1/go.mod h1:yebXu5KMayLjXZzMTY5HWIPRDwcBehHpiNF/Ot8A2pA= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= github.com/go-redis/redis/extra/rediscmd v0.2.0 h1:A3bhCsCKsedClEH9/jYlcKqOuBoeeV+H0yDie5t+a6w= github.com/go-redis/redis/extra/rediscmd v0.2.0/go.mod h1:Z5bP1EHl9PvWhx/DupfCdZwB0JgOO3aVxWc/PFux+BE= github.com/go-redis/redis/extra/redisotel v0.3.0 h1:8rrizwFAUUeMgmelyiQi9KeFwmpQhay9E+/rE6qHsBM= github.com/go-redis/redis/extra/redisotel v0.3.0/go.mod h1:sGV3dQnPMBUuqzowEP2nZPhLXCMeh83nY64yaju249c= github.com/go-redis/redis/v8 v8.3.2/go.mod h1:jszGxBCez8QA1HWSmQxJO9Y82kNibbUmeYhKWrBejTU= github.com/go-redis/redis/v8 v8.5.0/go.mod h1:YmEcgBDttjnkbMzDAhDtQxY9yVA7jMN6PCR5HeMvqFE= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.9.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= 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/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 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-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0 h1:8+567mCcFDnS5ADl7lrpxPMWiFCElyUEeW0gtj34fMA= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6 h1:uuEX1kLR6aoda1TBttmJQKDLZE1Ob7KN0NPdE7EtCDc= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2 h1:hRGSmZu7j271trc9sneMrpOW7GN5ngLm8YUZIPzf394= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lyft/protoc-gen-star v0.6.0 h1:xOpFu4vwmIoUeUrRuAtdCrZZymT/6AkW/bsUWA506Fo= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/ory/dockertest/v3 v3.8.1 h1:vU/8d1We4qIad2YM0kOwRVtnyue7ExvacPiw1yDm17g= github.com/ory/dockertest/v3 v3.8.1/go.mod h1:wSRQ3wmkz+uSARYMk7kVJFDBGm8x5gSxIhI7NDc+BAQ= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.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 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA= go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel v1.6.3 h1:FLOfo8f9JzFVFVyU+MSRJc2HdEAXQgm7pIv2uFKRSZE= go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI= go.opentelemetry.io/otel/exporters/jaeger v1.6.3 h1:7tvBU1Ydbzq080efuepYYqC1Pv3/vOFBgCSrxLb24d0= go.opentelemetry.io/otel/exporters/jaeger v1.6.3/go.mod h1:YgX3eZWbJzgrNyNHCK0otGreAMBTIAcObtZS2VRi6sU= go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/sdk v1.6.3 h1:prSHYdwCQOX5DrsEzxowH3nLhoAzEBdZhvrR79scfLs= go.opentelemetry.io/otel/sdk v1.6.3/go.mod h1:A4iWF7HTXa+GWL/AaqESz28VuSBIcZ+0CV+IzJ5NMiQ= go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/otel/trace v1.6.3 h1:IqN4L+5b0mPNjdXIiZ90Ni4Bl5BRkDQywePLWemd9bc= go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220615171555-694bf12d69de h1:ogOG2+P6LjO2j55AkRScrkB2BFpd+Z8TY2wcM0Z3MGo= golang.org/x/net v0.0.0-20220615171555-694bf12d69de/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 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= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.11 h1:loJ25fNOEhSXfHrpoGj91eCUThwdNX6u24rO1xnNteY= golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf h1:SVYXkUz2yZS9FWb2Gm8ivSlbNQzL2Z/NpPKE3RG2jWk= google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90 h1:4SPz2GL2CXJt28MTF8V6Ap/9ZiVbQlJeGSd9qtA7DLs= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 h1:TLkBREm4nIsEcexnCjgQd5GQWaHcqMzwQV0TX9pq8S0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.3.3 h1:jXG9ANrwBc4+bMvBcSl8zCfPBaVoPyBEBshA8dA93X8= gorm.io/driver/mysql v1.3.3/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U= gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.4 h1:1BKWM67O6CflSLcwGQR7ccfmC4ebOxQrTfOQGRE9wjg= gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= ================================================ FILE: service/order/internal/biz/README.md ================================================ # Biz ================================================ FILE: service/order/internal/biz/biz.go ================================================ package biz import ( "context" "github.com/google/wire" ) // ProviderSet is biz providers. var ProviderSet = wire.NewSet(NewOrderUsecase) type Transaction interface { ExecTx(context.Context, func(ctx context.Context) error) error } ================================================ FILE: service/order/internal/biz/order.go ================================================ package biz import ( "context" "fmt" "github.com/go-kratos/kratos/v2/log" cartV1 "order/api/cart/v1" goodsV1 "order/api/goods/v1" userV1 "order/api/user/v1" "order/internal/domain" ) //go:generate mockgen -destination=../mocks/mrepo/order.go -package=mrepo . OrderRepo type OrderRepo interface { GetAddressByID(ctx context.Context, aid int64, userId int64) (*domain.OrderAddress, error) } type OrderUsecase struct { repo OrderRepo userRPC userV1.UserClient cartRPC cartV1.CartClient goodsRPC goodsV1.GoodsClient log *log.Helper } func NewOrderUsecase(repo OrderRepo, userRPC userV1.UserClient, cartRPC cartV1.CartClient, goodsRPC goodsV1.GoodsClient, logger log.Logger) *OrderUsecase { return &OrderUsecase{ repo: repo, userRPC: userRPC, cartRPC: cartRPC, goodsRPC: goodsRPC, log: log.NewHelper(logger), } } func (oc *OrderUsecase) CreateOrder(ctx context.Context, order *domain.CreateOrder) { // 跨服务(购物车)查询购物车信息 { // 已选中,根据用户ID,查询这个用户的所有已经选中的购物车商品 cartList, err := oc.cartRPC.ListCart(ctx, &cartV1.ListCartRequest{UserId: order.UserId}) if err != nil { fmt.Println(err) } // 判断购物车的数量跟用户提交数量是否一致 if len(cartList.Results) != len(order.CartItem) { fmt.Println(err) } // 判断购物车是否真实存在 for _, cart := range cartList.Results { if ci := order.CartItem.FindById(cart.Id); ci == nil { fmt.Println(err) } } } { // 跨服务(商品服务)查询商品信息 // 商品ID,去查询商品对比价格 skuIds := order.CartItem.GetSkuId() cartList, err := oc.goodsRPC.SkuList(ctx, &goodsV1.SkuIds{UserId: order.UserId}) } // 跨服务 查询用户收货地址 { address, err := oc.userRPC.GetAddress(ctx, &userV1.AddressReq{ Id: order.AddressId, Uid: order.UserId, }) if err != nil { return } fmt.Println(address) } // 跨服务 查询库存信息 // 删除购物车的数据 (分布式 rocketmq) // 支付抠库存(分布式 rocketmq) } ================================================ FILE: service/order/internal/conf/conf.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: conf/conf.proto package conf import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Bootstrap struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Trace *Trace `protobuf:"bytes,3,opt,name=trace,proto3" json:"trace,omitempty"` Auth *Auth `protobuf:"bytes,4,opt,name=auth,proto3" json:"auth,omitempty"` Service *Service `protobuf:"bytes,5,opt,name=service,proto3" json:"service,omitempty"` } func (x *Bootstrap) Reset() { *x = Bootstrap{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Bootstrap) String() string { return protoimpl.X.MessageStringOf(x) } func (*Bootstrap) ProtoMessage() {} func (x *Bootstrap) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_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 Bootstrap.ProtoReflect.Descriptor instead. func (*Bootstrap) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{0} } func (x *Bootstrap) GetServer() *Server { if x != nil { return x.Server } return nil } func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data } return nil } func (x *Bootstrap) GetTrace() *Trace { if x != nil { return x.Trace } return nil } func (x *Bootstrap) GetAuth() *Auth { if x != nil { return x.Auth } return nil } func (x *Bootstrap) GetService() *Service { if x != nil { return x.Service } return nil } type Server struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Http *Server_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` Grpc *Server_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` } func (x *Server) Reset() { *x = Server{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server) ProtoMessage() {} func (x *Server) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_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 Server.ProtoReflect.Descriptor instead. func (*Server) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{1} } func (x *Server) GetHttp() *Server_HTTP { if x != nil { return x.Http } return nil } func (x *Server) GetGrpc() *Server_GRPC { if x != nil { return x.Grpc } return nil } type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` } func (x *Data) Reset() { *x = Data{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data) ProtoMessage() {} func (x *Data) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_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 Data.ProtoReflect.Descriptor instead. func (*Data) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{2} } func (x *Data) GetDatabase() *Data_Database { if x != nil { return x.Database } return nil } func (x *Data) GetRedis() *Data_Redis { if x != nil { return x.Redis } return nil } type Auth struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields JwtKey string `protobuf:"bytes,1,opt,name=jwt_key,json=jwtKey,proto3" json:"jwt_key,omitempty"` } func (x *Auth) Reset() { *x = Auth{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Auth) String() string { return protoimpl.X.MessageStringOf(x) } func (*Auth) ProtoMessage() {} func (x *Auth) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_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 Auth.ProtoReflect.Descriptor instead. func (*Auth) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{3} } func (x *Auth) GetJwtKey() string { if x != nil { return x.JwtKey } return "" } type Registry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` } func (x *Registry) Reset() { *x = Registry{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry) ProtoMessage() {} func (x *Registry) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Registry.ProtoReflect.Descriptor instead. func (*Registry) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{4} } func (x *Registry) GetConsul() *Registry_Consul { if x != nil { return x.Consul } return nil } type Trace struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Trace) Reset() { *x = Trace{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Trace) String() string { return protoimpl.X.MessageStringOf(x) } func (*Trace) ProtoMessage() {} func (x *Trace) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Trace.ProtoReflect.Descriptor instead. func (*Trace) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{5} } func (x *Trace) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Service struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields User *Service_User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Cart *Service_Cart `protobuf:"bytes,2,opt,name=cart,proto3" json:"cart,omitempty"` Goods *Service_Goods `protobuf:"bytes,3,opt,name=goods,proto3" json:"goods,omitempty"` } func (x *Service) Reset() { *x = Service{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Service) String() string { return protoimpl.X.MessageStringOf(x) } func (*Service) ProtoMessage() {} func (x *Service) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[6] 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 Service.ProtoReflect.Descriptor instead. func (*Service) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{6} } func (x *Service) GetUser() *Service_User { if x != nil { return x.User } return nil } func (x *Service) GetCart() *Service_Cart { if x != nil { return x.Cart } return nil } func (x *Service) GetGoods() *Service_Goods { if x != nil { return x.Goods } return nil } type Server_HTTP struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_HTTP) Reset() { *x = Server_HTTP{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_HTTP) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_HTTP) ProtoMessage() {} func (x *Server_HTTP) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[7] 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 Server_HTTP.ProtoReflect.Descriptor instead. func (*Server_HTTP) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{1, 0} } func (x *Server_HTTP) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_HTTP) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_HTTP) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Server_GRPC struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_GRPC) Reset() { *x = Server_GRPC{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_GRPC) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_GRPC) ProtoMessage() {} func (x *Server_GRPC) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[8] 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 Server_GRPC.ProtoReflect.Descriptor instead. func (*Server_GRPC) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{1, 1} } func (x *Server_GRPC) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_GRPC) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_GRPC) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Data_Database struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` } func (x *Data_Database) Reset() { *x = Data_Database{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Database) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Database) ProtoMessage() {} func (x *Data_Database) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[9] 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 Data_Database.ProtoReflect.Descriptor instead. func (*Data_Database) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{2, 0} } func (x *Data_Database) GetDriver() string { if x != nil { return x.Driver } return "" } func (x *Data_Database) GetSource() string { if x != nil { return x.Source } return "" } type Data_Redis struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` Db int32 `protobuf:"varint,4,opt,name=db,proto3" json:"db,omitempty"` DialTimeout *durationpb.Duration `protobuf:"bytes,5,opt,name=dial_timeout,json=dialTimeout,proto3" json:"dial_timeout,omitempty"` ReadTimeout *durationpb.Duration `protobuf:"bytes,6,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"` WriteTimeout *durationpb.Duration `protobuf:"bytes,7,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"` } func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Redis) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[10] 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 Data_Redis.ProtoReflect.Descriptor instead. func (*Data_Redis) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{2, 1} } func (x *Data_Redis) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Data_Redis) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Data_Redis) GetPassword() string { if x != nil { return x.Password } return "" } func (x *Data_Redis) GetDb() int32 { if x != nil { return x.Db } return 0 } func (x *Data_Redis) GetDialTimeout() *durationpb.Duration { if x != nil { return x.DialTimeout } return nil } func (x *Data_Redis) GetReadTimeout() *durationpb.Duration { if x != nil { return x.ReadTimeout } return nil } func (x *Data_Redis) GetWriteTimeout() *durationpb.Duration { if x != nil { return x.WriteTimeout } return nil } type Registry_Consul struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` } func (x *Registry_Consul) Reset() { *x = Registry_Consul{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry_Consul) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry_Consul) ProtoMessage() {} func (x *Registry_Consul) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[11] 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 Registry_Consul.ProtoReflect.Descriptor instead. func (*Registry_Consul) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{4, 0} } func (x *Registry_Consul) GetAddress() string { if x != nil { return x.Address } return "" } func (x *Registry_Consul) GetScheme() string { if x != nil { return x.Scheme } return "" } type Service_User struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Service_User) Reset() { *x = Service_User{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Service_User) String() string { return protoimpl.X.MessageStringOf(x) } func (*Service_User) ProtoMessage() {} func (x *Service_User) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[12] 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 Service_User.ProtoReflect.Descriptor instead. func (*Service_User) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{6, 0} } func (x *Service_User) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Service_Cart struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Service_Cart) Reset() { *x = Service_Cart{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Service_Cart) String() string { return protoimpl.X.MessageStringOf(x) } func (*Service_Cart) ProtoMessage() {} func (x *Service_Cart) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[13] 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 Service_Cart.ProtoReflect.Descriptor instead. func (*Service_Cart) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{6, 1} } func (x *Service_Cart) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Service_Goods struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Service_Goods) Reset() { *x = Service_Goods{} if protoimpl.UnsafeEnabled { mi := &file_conf_conf_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Service_Goods) String() string { return protoimpl.X.MessageStringOf(x) } func (*Service_Goods) ProtoMessage() {} func (x *Service_Goods) ProtoReflect() protoreflect.Message { mi := &file_conf_conf_proto_msgTypes[14] 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 Service_Goods.ProtoReflect.Descriptor instead. func (*Service_Goods) Descriptor() ([]byte, []int) { return file_conf_conf_proto_rawDescGZIP(), []int{6, 2} } func (x *Service_Goods) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } var File_conf_conf_proto protoreflect.FileDescriptor var file_conf_conf_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x2c, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xb6, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x2a, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x69, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xc5, 0x03, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x34, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x1a, 0x3a, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x9d, 0x02, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x1f, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x77, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6a, 0x77, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x7a, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x32, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x23, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x80, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x63, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x52, 0x04, 0x63, 0x61, 0x72, 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x1a, 0x22, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x1a, 0x22, 0x0a, 0x04, 0x43, 0x61, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x1a, 0x23, 0x0a, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x42, 0x1c, 0x5a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_conf_conf_proto_rawDescOnce sync.Once file_conf_conf_proto_rawDescData = file_conf_conf_proto_rawDesc ) func file_conf_conf_proto_rawDescGZIP() []byte { file_conf_conf_proto_rawDescOnce.Do(func() { file_conf_conf_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_conf_proto_rawDescData) }) return file_conf_conf_proto_rawDescData } var file_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: order.api.Bootstrap (*Server)(nil), // 1: order.api.Server (*Data)(nil), // 2: order.api.Data (*Auth)(nil), // 3: order.api.Auth (*Registry)(nil), // 4: order.api.Registry (*Trace)(nil), // 5: order.api.Trace (*Service)(nil), // 6: order.api.Service (*Server_HTTP)(nil), // 7: order.api.Server.HTTP (*Server_GRPC)(nil), // 8: order.api.Server.GRPC (*Data_Database)(nil), // 9: order.api.Data.Database (*Data_Redis)(nil), // 10: order.api.Data.Redis (*Registry_Consul)(nil), // 11: order.api.Registry.Consul (*Service_User)(nil), // 12: order.api.Service.User (*Service_Cart)(nil), // 13: order.api.Service.Cart (*Service_Goods)(nil), // 14: order.api.Service.Goods (*durationpb.Duration)(nil), // 15: google.protobuf.Duration } var file_conf_conf_proto_depIdxs = []int32{ 1, // 0: order.api.Bootstrap.server:type_name -> order.api.Server 2, // 1: order.api.Bootstrap.data:type_name -> order.api.Data 5, // 2: order.api.Bootstrap.trace:type_name -> order.api.Trace 3, // 3: order.api.Bootstrap.auth:type_name -> order.api.Auth 6, // 4: order.api.Bootstrap.service:type_name -> order.api.Service 7, // 5: order.api.Server.http:type_name -> order.api.Server.HTTP 8, // 6: order.api.Server.grpc:type_name -> order.api.Server.GRPC 9, // 7: order.api.Data.database:type_name -> order.api.Data.Database 10, // 8: order.api.Data.redis:type_name -> order.api.Data.Redis 11, // 9: order.api.Registry.consul:type_name -> order.api.Registry.Consul 12, // 10: order.api.Service.user:type_name -> order.api.Service.User 13, // 11: order.api.Service.cart:type_name -> order.api.Service.Cart 14, // 12: order.api.Service.goods:type_name -> order.api.Service.Goods 15, // 13: order.api.Server.HTTP.timeout:type_name -> google.protobuf.Duration 15, // 14: order.api.Server.GRPC.timeout:type_name -> google.protobuf.Duration 15, // 15: order.api.Data.Redis.dial_timeout:type_name -> google.protobuf.Duration 15, // 16: order.api.Data.Redis.read_timeout:type_name -> google.protobuf.Duration 15, // 17: order.api.Data.Redis.write_timeout:type_name -> google.protobuf.Duration 18, // [18:18] is the sub-list for method output_type 18, // [18:18] 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_conf_conf_proto_init() } func file_conf_conf_proto_init() { if File_conf_conf_proto != nil { return } if !protoimpl.UnsafeEnabled { file_conf_conf_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Bootstrap); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Auth); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Trace); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_HTTP); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_GRPC); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Database); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry_Consul); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service_User); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service_Cart); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_conf_conf_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service_Goods); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_conf_conf_proto_rawDesc, NumEnums: 0, NumMessages: 15, NumExtensions: 0, NumServices: 0, }, GoTypes: file_conf_conf_proto_goTypes, DependencyIndexes: file_conf_conf_proto_depIdxs, MessageInfos: file_conf_conf_proto_msgTypes, }.Build() File_conf_conf_proto = out.File file_conf_conf_proto_rawDesc = nil file_conf_conf_proto_goTypes = nil file_conf_conf_proto_depIdxs = nil } ================================================ FILE: service/order/internal/conf/conf.proto ================================================ syntax = "proto3"; package order.api; option go_package = "service/internal/conf;conf"; import "google/protobuf/duration.proto"; message Bootstrap { Server server = 1; Data data = 2; Trace trace = 3; Auth auth = 4; Service service = 5; } message Server { message HTTP { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } message GRPC { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } HTTP http = 1; GRPC grpc = 2; } message Data { message Database { string driver = 1; string source = 2; } message Redis { string network = 1; string addr = 2; string password = 3; int32 db = 4; google.protobuf.Duration dial_timeout = 5; google.protobuf.Duration read_timeout = 6; google.protobuf.Duration write_timeout = 7; } Database database = 1; Redis redis = 2; } message Auth { string jwt_key = 1; } message Registry { message Consul { string address = 1; string scheme = 2; } Consul consul = 1; } message Trace { string endpoint = 1; } message Service { message User { string endpoint = 1; } message Cart { string endpoint = 1; } message Goods { string endpoint = 1; } User user = 1; Cart cart = 2; Goods goods = 3; } ================================================ FILE: service/order/internal/data/data.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/contrib/registry/consul/v2" "github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" consulAPI "github.com/hashicorp/consul/api" grpcx "google.golang.org/grpc" slog "log" "order/internal/biz" "order/internal/conf" "os" "time" "github.com/go-kratos/kratos/v2/log" "github.com/go-redis/redis/extra/redisotel" "github.com/go-redis/redis/v8" "github.com/google/wire" "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger" "gorm.io/gorm/schema" cartV1 "order/api/cart/v1" goodsV1 "order/api/goods/v1" userV1 "order/api/user/v1" ) // ProviderSet is data providers. var ProviderSet = wire.NewSet(NewData, NewDB, NewTransaction, NewRedis, NewOrderRepo, NewUserServiceClient, NewCartServiceClient, NewGoodsServiceClient, NewDiscovery) type Data struct { db *gorm.DB rdb *redis.Client } type contextTxKey struct{} // NewData . func NewData(c *conf.Data, logger log.Logger, db *gorm.DB, rdb *redis.Client) (*Data, func(), error) { cleanup := func() { log.NewHelper(logger).Info("closing the data resources") } return &Data{db: db, rdb: rdb}, cleanup, nil } func NewTransaction(d *Data) biz.Transaction { return d } func (d *Data) DB(ctx context.Context) *gorm.DB { tx, ok := ctx.Value(contextTxKey{}).(*gorm.DB) if ok { return tx } return d.db } // ExecTx gorm Transaction func (d *Data) ExecTx(ctx context.Context, fn func(ctx context.Context) error) error { return d.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error { ctx = context.WithValue(ctx, contextTxKey{}, tx) return fn(ctx) }) } // NewDB . func NewDB(c *conf.Data) *gorm.DB { // 终端打印输入 sql 执行记录 newLogger := logger.New( slog.New(os.Stdout, "\r\n", slog.LstdFlags), // io writer logger.Config{ SlowThreshold: time.Second, // 慢查询 SQL 阈值 Colorful: true, // 禁用彩色打印 //IgnoreRecordNotFoundError: false, LogLevel: logger.Info, // Log lever }, ) db, err := gorm.Open(mysql.Open(c.Database.Source), &gorm.Config{ Logger: newLogger, DisableForeignKeyConstraintWhenMigrating: true, NamingStrategy: schema.NamingStrategy{ //SingularTable: true, // 表名是否加 s }, }) if err != nil { log.Errorf("failed opening connection to sqlite: %v", err) panic("failed to connect database") } // &Order{}, &OrderGoods{}, _ = db.AutoMigrate(&Order{}, &OrderGoods{}, &OrderPay{}, &OrderAddress{}) return db } func NewRedis(c *conf.Data) *redis.Client { rdb := redis.NewClient(&redis.Options{ Addr: c.Redis.Addr, Password: c.Redis.Password, DB: int(c.Redis.Db), DialTimeout: c.Redis.DialTimeout.AsDuration(), WriteTimeout: c.Redis.WriteTimeout.AsDuration(), ReadTimeout: c.Redis.ReadTimeout.AsDuration(), }) rdb.AddHook(redisotel.TracingHook{}) if err := rdb.Close(); err != nil { log.Error(err) } return rdb } // NewUserServiceClient 链接用户服务 grpc func NewUserServiceClient(ac *conf.Auth, sr *conf.Service, rr registry.Discovery) userV1.UserClient { conn, err := grpc.DialInsecure( context.Background(), grpc.WithEndpoint(sr.User.Endpoint), grpc.WithDiscovery(rr), grpc.WithMiddleware( tracing.Client(), recovery.Recovery(), ), grpc.WithTimeout(2*time.Second), grpc.WithOptions(grpcx.WithStatsHandler(&tracing.ClientHandler{})), ) if err != nil { panic(err) } c := userV1.NewUserClient(conn) return c } // NewCartServiceClient 链接购物车 grpc func NewCartServiceClient(ac *conf.Auth, sr *conf.Service, rr registry.Discovery) cartV1.CartClient { conn, err := grpc.DialInsecure( context.Background(), grpc.WithEndpoint(sr.Cart.Endpoint), grpc.WithDiscovery(rr), grpc.WithMiddleware( tracing.Client(), recovery.Recovery(), ), grpc.WithTimeout(2*time.Second), grpc.WithOptions(grpcx.WithStatsHandler(&tracing.ClientHandler{})), ) if err != nil { panic(err) } c := cartV1.NewCartClient(conn) return c } // NewGoodsServiceClient 链接购物车 grpc func NewGoodsServiceClient(ac *conf.Auth, sr *conf.Service, rr registry.Discovery) goodsV1.GoodsClient { conn, err := grpc.DialInsecure( context.Background(), grpc.WithEndpoint(sr.Cart.Endpoint), grpc.WithDiscovery(rr), grpc.WithMiddleware( tracing.Client(), recovery.Recovery(), ), grpc.WithTimeout(2*time.Second), grpc.WithOptions(grpcx.WithStatsHandler(&tracing.ClientHandler{})), ) if err != nil { panic(err) } c := goodsV1.NewGoodsClient(conn) return c } func NewDiscovery(conf *conf.Registry) registry.Discovery { c := consulAPI.DefaultConfig() c.Address = conf.Consul.Address c.Scheme = conf.Consul.Scheme cli, err := consulAPI.NewClient(c) if err != nil { panic(err) } r := consul.New(cli, consul.WithHealthCheck(false)) return r } ================================================ FILE: service/order/internal/data/data_suite_test.go ================================================ package data_test import ( "context" "github.com/pkg/errors" "gorm.io/gorm" "order/internal/conf" "order/internal/data" "testing" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) // 测试 data 方法 func TestData(t *testing.T) { // Ginkgo 测试通过调用 Fail(description string) 功能来表示失败 // 使用 RegisterFailHandler 将此函数传递给 Gomega 。这是 Ginkgo 和 Gomega 之间的唯一连接点 RegisterFailHandler(Fail) // 通知 Ginkgo 启动测试套件。如果您的任何 specs 失败,Ginkgo 将自动使 testing.T 失败。 RunSpecs(t, "biz data test s") } var cleaner func() // 定义删除 mysql 容器的回调函数 var Db *data.Data // 用于测试的 data var ctx context.Context // 上下文 // initialize AutoMigrate gorm自动建表 func initialize(db *gorm.DB) error { err := db.AutoMigrate( &data.Order{}, ) return errors.WithStack(err) } // ginkgo 使用 BeforeEach 为您的 Specs 设置状态 var _ = BeforeSuite(func() { // 执行测试数据库操作之前,链接之前 docker 容器创建的 mysql //con, f := data.DockerMysql("mysql", "latest") con, f := data.DockerMysql("mariadb", "latest") cleaner = f // 测试完成,关闭容器的回调方法 config := &conf.Data{Database: &conf.Data_Database{Driver: "mysql", Source: con}} db := data.NewDB(config) mySQLDb, _, err := data.NewData(config, nil, db, nil) if err != nil { return } if err != nil { return } Db = mySQLDb err = initialize(db) if err != nil { return } Expect(err).NotTo(HaveOccurred()) }) // 测试结束后 通过回调函数,关闭并删除 docker 创建的容器 var _ = AfterSuite(func() { cleaner() }) ================================================ FILE: service/order/internal/data/docker_mysql.go ================================================ package data import ( "database/sql" "fmt" "github.com/ory/dockertest/v3" "log" "time" ) func DockerMysql(img, version string) (string, func()) { return innerDockerMysql(img, version) } func innerDockerMysql(img, version string) (string, func()) { // uses a sensible default on windows (tcp/http) and linux/osx (socket) pool, err := dockertest.NewPool("") pool.MaxWait = time.Minute * 2 if err != nil { log.Fatalf("Could not connect to docker: %s", err) } //time.Sleep(time.Second * 20) // pulls an image, creates a container based on it and runs it resource, err := pool.Run(img, version, []string{"MYSQL_ROOT_PASSWORD=secret", "MYSQL_ROOT_HOST=%"}) if err != nil { log.Fatalf("Could not start resource: %s", err) } conStr := fmt.Sprintf("root:secret@(localhost:%s)/mysql?parseTime=true", resource.GetPort("3306/tcp")) // exponential backoff-retry, because the application in the container might not be ready to accept connections yet if err := pool.Retry(func() error { var err error db, err := sql.Open("mysql", conStr) if err != nil { return err } return db.Ping() }); err != nil { log.Fatalf("Could not connect to docker: %s", err) } // 关闭容器 return conStr, func() { if err = pool.Purge(resource); err != nil { log.Fatalf("Could not purge resource: %s", err) } } } ================================================ FILE: service/order/internal/data/order.go ================================================ package data import ( "github.com/go-kratos/kratos/v2/log" "golang.org/x/net/context" "gorm.io/gorm" "order/internal/biz" "order/internal/domain" "time" ) type Order struct { ID int64 `gorm:"primarykey"` User int64 `gorm:"type:int not null;default:0;index"` OrderSn string `gorm:"type:varchar(30) not null;default:'';index"` // 订单号,我们平台自己生成的订单号 OrderAmount int64 `gorm:"type:int not null;default:0; comment:订单金额"` GoodsAmount int64 `gorm:"type:int not null;default:0; comment:商品总金额"` OrderStatus int `gorm:"type:tinyint(1) unsigned not null; default:0; comment:1待支付,2已支付,3已发货,4已签收,5已取消,6交易完成"` ExpressAmount int64 `gorm:"type:int not null;default:0;comment:运费"` DeliveryAt time.Time `gorm:"column:delivery_at; comment:发货时间"` RefundTime time.Time `gorm:"type:datetime; comment:退款时间"` Post string `gorm:"type:varchar(200) not null;default:''; comment:订单备注信息"` // 优惠信息、赠品、买反、优惠卷 CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` DeletedAt gorm.DeletedAt } func (Order) TableName() string { return "orders" } type orderRepo struct { data *Data log *log.Helper } // NewOrderRepo . func NewOrderRepo(data *Data, logger log.Logger) biz.OrderRepo { return &orderRepo{ data: data, log: log.NewHelper(logger), } } func (p *Order) ToDomain() *domain.Order { return &domain.Order{ ID: 0, User: 0, OrderSn: "", PayType: "", Status: "", TradeNo: "", OrderMount: 0, PayTime: time.Time{}, Address: "", SignerName: "", SingerMobile: "", Post: "", CreatedAt: time.Time{}, UpdatedAt: time.Time{}, DeletedAt: time.Time{}, } } func (o *orderRepo) GetAddressByID(c context.Context, id, uid int64) (*domain.OrderAddress, error) { return &domain.OrderAddress{}, nil } ================================================ FILE: service/order/internal/data/orderaddress.go ================================================ package data import ( "github.com/go-kratos/kratos/v2/log" "order/internal/biz" "order/internal/domain" "time" ) type OrderAddress struct { ID int64 `gorm:"primarykey"` User int64 `gorm:"type:int not null;default:0;index;comment:用户ID"` OrderSn string `gorm:"type:varchar(30) not null;default:'';index"` // 订单号,我们平台自己生成的订单号 // 用户收货信息 RecipientName string `gorm:"type:varchar(20) not null;default:''; comment:收货姓名"` RecipientMobile string `gorm:"type:varchar(20) not null;default:''; comment:收货电话"` Province string `gorm:"type:varchar(25) not null;default:''; comment:省"` City string `gorm:"type:varchar(25) not null;default:''; comment:市"` Districts string `gorm:"type:varchar(25) not null;default:''; comment:区/县"` Address string `gorm:"type:varchar(255) not null;default:''; comment:收货详细地址"` PostCode string `gorm:"type:varchar(25) not null;default:''; comment:邮编"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` } func (OrderAddress) TableName() string { return "order_address" } type orderAddressRepo struct { data *Data log *log.Helper } // NewOrderAddressRepo . func NewOrderAddressRepo(data *Data, logger log.Logger) biz.OrderRepo { return &orderRepo{ data: data, log: log.NewHelper(logger), } } func (p *OrderAddress) ToDomain() *domain.Order { return &domain.Order{ ID: 0, User: 0, OrderSn: "", PayType: "", Status: "", TradeNo: "", OrderMount: 0, PayTime: time.Time{}, Address: "", SignerName: "", SingerMobile: "", Post: "", CreatedAt: time.Time{}, UpdatedAt: time.Time{}, DeletedAt: time.Time{}, } } ================================================ FILE: service/order/internal/data/ordergoods.go ================================================ package data import ( "time" ) type OrderGoods struct { ID int64 `gorm:"primarykey;type:int" json:"id"` OrderSn string `gorm:"type:varchar(30) not null;default:'';index"` // 订单号,我们平台自己生成的订单号 UserId int64 `gorm:"type:int not null;default:0;index"` SkuId int64 `gorm:"type:int not null;default:0;index"` SkuName string `gorm:"type:varchar(100) not null;default:'';index"` SkuPrice int64 `gorm:"type:int not null;default:0 comment '生成订单时的商品价格(单)'"` Num int32 `gorm:"type:int(10) not null;default:0; comment:商品数量"` TotalPrice int64 `gorm:"type:int not null;default:0; comment:生成订单时的商品总价"` // 商品快照信息根据需求后期添加 CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` } func (OrderGoods) TableName() string { return "order_goods" } ================================================ FILE: service/order/internal/data/orderpay.go ================================================ package data import "time" // OrderPay 支付信息 type OrderPay struct { ID int64 `gorm:"primarykey"` User int64 `gorm:"type:int not null;default:0;index;comment:用户ID"` OrderSn string `gorm:"type:varchar(30) not null;default:'';index"` // 订单号,我们平台自己生成的订单号 TradeNo string `gorm:"type:varchar(100) not null;default:''; comment:交易号、流水号"` // 交易号就是支付宝的订单号 查账 PayType string `gorm:"type:tinyint(1) not null;default:0 comment '1alipay(支付宝), 2wechat(微信)'"` PayStatus int `gorm:"type:tinyint(1) not null;default:0 comment '1PAYING(待支付), 2TRADE_SUCCESS(成功), 3TRADE_CLOSED(超时关闭), 4WAIT_BUYER_PAY(交易创建), 5TRADE_FINISHED(交易结束)'"` PayTime time.Time `gorm:"type:datetime comment '支付时间'"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` } ================================================ FILE: service/order/internal/domain/order.go ================================================ package domain import ( "time" ) type Order struct { ID int64 User int64 OrderSn string PayType string Status string TradeNo string OrderMount int64 PayTime time.Time Address string SignerName string SingerMobile string Post string CreatedAt time.Time UpdatedAt time.Time DeletedAt time.Time } type CreateOrder struct { UserId int64 AddressId int64 CartItem CartItemList } type CartItem struct { CartId int64 SkuId int64 SkuPrice int64 SkuNum int32 } type CartItemList []*CartItem func (p CartItemList) FindById(id int64) *CartItem { for _, item := range p { if item.CartId == id { return item } } return nil } func (p CartItemList) GetSkuId() []int64 { var l []int64 for _, item := range p { l = append(l, item.SkuId) } return l } ================================================ FILE: service/order/internal/domain/orderaddress.go ================================================ package domain type OrderAddress struct { ID int64 User int64 OrderSn string RecipientName string RecipientMobile string Province string City string Districts string Address string PostCode string } ================================================ FILE: service/order/internal/mocks/mrepo/order.go ================================================ // Code generated by MockGen. DO NOT EDIT. // Source: order/internal/biz (interfaces: OrderRepo) // Package mrepo is a generated GoMock package. package mrepo import ( gomock "github.com/golang/mock/gomock" ) // MockOrderRepo is a mock of OrderRepo interface. type MockOrderRepo struct { ctrl *gomock.Controller recorder *MockOrderRepoMockRecorder } // MockOrderRepoMockRecorder is the mock recorder for MockOrderRepo. type MockOrderRepoMockRecorder struct { mock *MockOrderRepo } // NewMockOrderRepo creates a new mock instance. func NewMockOrderRepo(ctrl *gomock.Controller) *MockOrderRepo { mock := &MockOrderRepo{ctrl: ctrl} mock.recorder = &MockOrderRepoMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. func (m *MockOrderRepo) EXPECT() *MockOrderRepoMockRecorder { return m.recorder } ================================================ FILE: service/order/internal/server/grpc.go ================================================ package server import ( "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/logging" "github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/transport/grpc" v1 "order/api/order/v1" "order/internal/conf" "order/internal/service" ) // NewGRPCServer new a gRPC s. func NewGRPCServer(c *conf.Server, u *service.OrderService, logger log.Logger) *grpc.Server { var opts = []grpc.ServerOption{ grpc.Middleware( recovery.Recovery(), tracing.Server(), logging.Server(logger), ), } if c.Grpc.Network != "" { opts = append(opts, grpc.Network(c.Grpc.Network)) } if c.Grpc.Addr != "" { opts = append(opts, grpc.Address(c.Grpc.Addr)) } if c.Grpc.Timeout != nil { opts = append(opts, grpc.Timeout(c.Grpc.Timeout.AsDuration())) } srv := grpc.NewServer(opts...) v1.RegisterOrderServer(srv, u) return srv } ================================================ FILE: service/order/internal/server/server.go ================================================ package server import ( "github.com/go-kratos/kratos/v2/registry" "github.com/google/wire" "order/internal/conf" consul "github.com/go-kratos/kratos/contrib/registry/consul/v2" consulAPI "github.com/hashicorp/consul/api" ) // ProviderSet is s providers. var ProviderSet = wire.NewSet(NewGRPCServer, NewRegistrar) // NewRegistrar 引入 consul func NewRegistrar(conf *conf.Registry) registry.Registrar { c := consulAPI.DefaultConfig() c.Address = conf.Consul.Address c.Scheme = conf.Consul.Scheme cli, err := consulAPI.NewClient(c) if err != nil { panic(err) } r := consul.New(cli, consul.WithHealthCheck(false)) return r } ================================================ FILE: service/order/internal/service/README.md ================================================ # Service ================================================ FILE: service/order/internal/service/order.go ================================================ package service import ( "context" "github.com/go-kratos/kratos/v2/log" v1 "order/api/order/v1" "order/internal/biz" "order/internal/domain" ) type OrderService struct { v1.UnimplementedOrderServer oc *biz.OrderUsecase log *log.Helper } func NewOrderService(o *biz.OrderUsecase, logger log.Logger) *OrderService { return &OrderService{oc: o, log: log.NewHelper(logger)} } func (o *OrderService) CreateOrder(ctx context.Context, r *v1.OrderRequest) (*v1.OrderInfoResponse, error) { var cartItem []*domain.CartItem for _, cart := range r.CartItem { res := &domain.CartItem{ CartId: cart.CartId, SkuId: cart.SkuId, SkuPrice: cart.SkuPrice, SkuNum: cart.SkuNum, } cartItem = append(cartItem, res) } o.oc.CreateOrder(ctx, &domain.CreateOrder{ UserId: r.UserId, AddressId: r.Address, CartItem: cartItem, }) return &v1.OrderInfoResponse{}, nil } ================================================ FILE: service/order/internal/service/service.go ================================================ package service import "github.com/google/wire" // ProviderSet is service providers. var ProviderSet = wire.NewSet(NewOrderService) ================================================ FILE: service/order/openapi.yaml ================================================ # Generated with protoc-gen-openapi # https://github.com/google/gnostic/tree/master/apps/protoc-gen-openapi openapi: 3.0.3 info: title: "" version: 0.0.1 paths: {} components: schemas: {} ================================================ FILE: service/order/third_party/README.md ================================================ # third_party ================================================ FILE: service/order/third_party/errors/errors.proto ================================================ syntax = "proto3"; package errors; option go_package = "github.com/go-kratos/kratos/v2/errors;errors"; option java_multiple_files = true; option java_package = "com.github.kratos.errors"; option objc_class_prefix = "KratosErrors"; import "google/protobuf/descriptor.proto"; extend google.protobuf.EnumOptions { int32 default_code = 1108; } extend google.protobuf.EnumValueOptions { int32 code = 1109; } ================================================ FILE: service/order/third_party/google/api/annotations.proto ================================================ // Copyright (c) 2015, Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/api/http.proto"; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "AnnotationsProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.MethodOptions { // See `HttpRule`. HttpRule http = 72295728; } ================================================ FILE: service/order/third_party/google/api/client.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "ClientProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.ServiceOptions { // The hostname for this service. // This should be specified with no prefix or protocol. // // Example: // // service Foo { // option (google.api.default_host) = "foo.googleapi.com"; // ... // } string default_host = 1049; // OAuth scopes needed for the client. // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform"; // ... // } // // If there is more than one scope, use a comma-separated string: // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform," // "https://www.googleapis.com/auth/monitoring"; // ... // } string oauth_scopes = 1050; } extend google.protobuf.MethodOptions { // A definition of a client library method signature. // // In client libraries, each proto RPC corresponds to one or more methods // which the end user is able to call, and calls the underlying RPC. // Normally, this method receives a single argument (a struct or instance // corresponding to the RPC request object). Defining this field will // add one or more overloads providing flattened or simpler method signatures // in some languages. // // The fields on the method signature are provided as a comma-separated // string. // // For example, the proto RPC and annotation: // // rpc CreateSubscription(CreateSubscriptionRequest) // returns (Subscription) { // option (google.api.method_signature) = "name,topic"; // } // // Would add the following Java overload (in addition to the method accepting // the request object): // // public final Subscription createSubscription(String name, String topic) // // The following backwards-compatibility guidelines apply: // // * Adding this annotation to an unannotated method is backwards // compatible. // * Adding this annotation to a method which already has existing // method signature annotations is backwards compatible if and only if // the new method signature annotation is last in the sequence. // * Modifying or removing an existing method signature annotation is // a breaking change. // * Re-ordering existing method signature annotations is a breaking // change. repeated string method_signature = 1051; } ================================================ FILE: service/order/third_party/google/api/field_behavior.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "FieldBehaviorProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // An indicator of the behavior of a given field (for example, that a field // is required in requests, or given as output but ignored as input). // This **does not** change the behavior in protocol buffers itself; it only // denotes the behavior and may affect how API tooling handles the field. // // Note: This enum **may** receive new values in the future. enum FieldBehavior { // Conventional default for enums. Do not use this. FIELD_BEHAVIOR_UNSPECIFIED = 0; // Specifically denotes a field as optional. // While all fields in protocol buffers are optional, this may be specified // for emphasis if appropriate. OPTIONAL = 1; // Denotes a field as required. // This indicates that the field **must** be provided as part of the request, // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). REQUIRED = 2; // Denotes a field as output only. // This indicates that the field is provided in responses, but including the // field in a request does nothing (the server *must* ignore it and // *must not* throw an error as a result of the field's presence). OUTPUT_ONLY = 3; // Denotes a field as input only. // This indicates that the field is provided in requests, and the // corresponding field is not included in output. INPUT_ONLY = 4; // Denotes a field as immutable. // This indicates that the field may be set once in a request to create a // resource, but may not be changed thereafter. IMMUTABLE = 5; } extend google.protobuf.FieldOptions { // A designation of a specific field behavior (required, output only, etc.) // in protobuf messages. // // Examples: // // string name = 1 [(google.api.field_behavior) = REQUIRED]; // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // google.protobuf.Duration ttl = 1 // [(google.api.field_behavior) = INPUT_ONLY]; // google.protobuf.Timestamp expire_time = 1 // [(google.api.field_behavior) = OUTPUT_ONLY, // (google.api.field_behavior) = IMMUTABLE]; repeated FieldBehavior field_behavior = 1052; } ================================================ FILE: service/order/third_party/google/api/http.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "HttpProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Defines the HTTP configuration for an API service. It contains a list of // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method // to one or more HTTP REST API methods. message Http { // A list of HTTP configuration rules that apply to individual API methods. // // **NOTE:** All service configuration rules follow "last one wins" order. repeated HttpRule rules = 1; // When set to true, URL path parameters will be fully URI-decoded except in // cases of single segment matches in reserved expansion, where "%2F" will be // left encoded. // // The default behavior is to not decode RFC 6570 reserved characters in multi // segment matches. bool fully_decode_reserved_expansion = 2; } // # gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service // that supports both gRPC APIs and REST APIs. Many systems, including [Google // APIs](https://github.com/googleapis/googleapis), // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC // Gateway](https://github.com/grpc-ecosystem/grpc-gateway), // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature // and use it for large scale production services. // // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies // how different portions of the gRPC request message are mapped to the URL // path, URL query parameters, and HTTP request body. It also controls how the // gRPC response message is mapped to the HTTP response body. `HttpRule` is // typically specified as an `google.api.http` annotation on the gRPC method. // // Each mapping specifies a URL path template and an HTTP method. The path // template may refer to one or more fields in the gRPC request message, as long // as each field is a non-repeated field with a primitive (non-message) type. // The path template controls how fields of the request message are mapped to // the URL path. // // Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/{name=messages/*}" // }; // } // } // message GetMessageRequest { // string name = 1; // Mapped to URL path. // } // message Message { // string text = 1; // The resource content. // } // // This enables an HTTP REST to gRPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. // For example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get:"/v1/messages/{message_id}" // }; // } // } // message GetMessageRequest { // message SubMessage { // string subfield = 1; // } // string message_id = 1; // Mapped to URL path. // int64 revision = 2; // Mapped to URL query parameter `revision`. // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. // } // // This enables a HTTP JSON to RPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: // "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. // In the case of a repeated type, the parameter can be repeated in the URL // as `...?param=A¶m=B`. In the case of a message type, each field of the // message is mapped to a separate parameter, such as // `...?foo.a=A&foo.b=B&foo.c=C`. // // For HTTP methods that allow a request body, the `body` field // specifies the mapping. Consider a REST update method on the // message resource collection: // // service Messaging { // rpc UpdateMessage(UpdateMessageRequest) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "message" // }; // } // } // message UpdateMessageRequest { // string message_id = 1; // mapped to the URL // Message message = 2; // mapped to the body // } // // The following HTTP JSON to RPC mapping is enabled, where the // representation of the JSON in the request body is determined by // protos JSON encoding: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the // request body. This enables the following alternative definition of // the update method: // // service Messaging { // rpc UpdateMessage(Message) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "*" // }; // } // } // message Message { // string message_id = 1; // string text = 2; // } // // // The following HTTP JSON to RPC mapping is enabled: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in // the body. This makes this option more rarely used in practice when // defining REST APIs. The common usage of `*` is in custom methods // which don't use the URL at all for transferring data. // // It is possible to define multiple HTTP methods for one RPC by using // the `additional_bindings` option. Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/messages/{message_id}" // additional_bindings { // get: "/v1/users/{user_id}/messages/{message_id}" // } // }; // } // } // message GetMessageRequest { // string message_id = 1; // string user_id = 2; // } // // This enables the following two alternative HTTP JSON to RPC mappings: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: // "123456")` // // ## Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: // - Fields referred by the path template. They are passed via the URL path. // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP // request body. // - All other fields are passed via the URL query parameters, and the // parameter name is the field path in the request message. A repeated // field can be represented as multiple query parameters under the same // name. // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields // are passed via URL path and HTTP request body. // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all // fields are passed via URL path and URL query parameters. // // ### Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; // Segment = "*" | "**" | LITERAL | Variable ; // Variable = "{" FieldPath [ "=" Segments ] "}" ; // FieldPath = IDENT { "." IDENT } ; // Verb = ":" LITERAL ; // // The syntax `*` matches a single URL path segment. The syntax `**` matches // zero or more URL path segments, which must be the last part of the URL path // except the `Verb`. // // The syntax `Variable` matches part of the URL path as specified by its // template. A variable template must not contain other variables. If a variable // matches a single path segment, its template may be omitted, e.g. `{var}` // is equivalent to `{var=*}`. // // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` // contains any reserved character, such characters should be percent-encoded // before the matching. // // If a variable contains exactly one path segment, such as `"{var}"` or // `"{var=*}"`, when such a variable is expanded into a URL path on the client // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The // server side does the reverse decoding. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{var}`. // // If a variable contains multiple path segments, such as `"{var=foo/*}"` // or `"{var=**}"`, when such a variable is expanded into a URL path on the // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. // The server side does the reverse decoding, except "%2F" and "%2f" are left // unchanged. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // // ## Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The // service config is simply the YAML representation of the `google.api.Service` // proto message. // // As an alternative to annotating your proto file, you can configure gRPC // transcoding in your service config YAML files. You do this by specifying a // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same // effect as the proto annotation. This can be particularly useful if you // have a proto that is reused in multiple services. Note that any transcoding // specified in the service config will override any matching transcoding // configuration in the proto. // // Example: // // http: // rules: // # Selects a gRPC method and applies HttpRule to it. // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // // ## Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 // specification](https://developers.google.com/protocol-buffers/docs/proto3#json). // // While the single segment variable follows the semantics of // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String // Expansion, the multi segment variable **does not** follow RFC 6570 Section // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion // does not expand special characters like `?` and `#`, which would lead // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding // for multi segment variables. // // The path variables **must not** refer to any repeated or mapped field, // because client libraries are not capable of handling such variable expansion. // // The path variables **must not** capture the leading "/" character. The reason // is that the most common use case "{var}" does not capture the leading "/" // character. For consistency, all path variables must share the same behavior. // // Repeated message fields must not be mapped to URL query parameters, because // no client library can support such complicated mapping. // // If an API needs to use a JSON array for request or response body, it can map // the request or response body to a repeated field. However, some gRPC // Transcoding implementations may not support this feature. message HttpRule { // Selects a method to which this rule applies. // // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. string selector = 1; // Determines the URL pattern is matched by this rules. This pattern can be // used with any of the {get|put|post|delete|patch} methods. A custom method // can be defined using the 'custom' field. oneof pattern { // Maps to HTTP GET. Used for listing and getting information about // resources. string get = 2; // Maps to HTTP PUT. Used for replacing a resource. string put = 3; // Maps to HTTP POST. Used for creating a resource or performing an action. string post = 4; // Maps to HTTP DELETE. Used for deleting a resource. string delete = 5; // Maps to HTTP PATCH. Used for updating a resource. string patch = 6; // The custom pattern is used for specifying an HTTP method that is not // included in the `pattern` field, such as HEAD, or "*" to leave the // HTTP method unspecified for this rule. The wild-card rule is useful // for services that provide content to Web (HTML) clients. CustomHttpPattern custom = 8; } // The name of the request field whose value is mapped to the HTTP request // body, or `*` for mapping all request fields not captured by the path // pattern to the HTTP body, or omitted for not having any HTTP request body. // // NOTE: the referred field must be present at the top-level of the request // message type. string body = 7; // Optional. The name of the response field whose value is mapped to the HTTP // response body. When omitted, the entire response message will be used // as the HTTP response body. // // NOTE: The referred field must be present at the top-level of the response // message type. string response_body = 12; // Additional HTTP bindings for the selector. Nested bindings must // not contain an `additional_bindings` field themselves (that is, // the nesting may only be one level deep). repeated HttpRule additional_bindings = 11; } // A custom pattern is used for defining custom HTTP verb. message CustomHttpPattern { // The name of this custom HTTP verb. string kind = 1; // The path matched by this custom verb. string path = 2; } ================================================ FILE: service/order/third_party/google/api/httpbody.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/any.proto"; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; option java_multiple_files = true; option java_outer_classname = "HttpBodyProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Message that represents an arbitrary HTTP body. It should only be used for // payload formats that can't be represented as JSON, such as raw binary or // an HTML page. // // // This message can be used both in streaming and non-streaming API methods in // the request as well as the response. // // It can be used as a top-level request field, which is convenient if one // wants to extract parameters from either the URL or HTTP template into the // request fields and also want access to the raw HTTP body. // // Example: // // message GetResourceRequest { // // A unique request id. // string request_id = 1; // // // The raw HTTP body is bound to this field. // google.api.HttpBody http_body = 2; // } // // service ResourceService { // rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); // rpc UpdateResource(google.api.HttpBody) returns // (google.protobuf.Empty); // } // // Example with streaming methods: // // service CaldavService { // rpc GetCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // rpc UpdateCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // } // // Use of this type only changes how the request and response bodies are // handled, all other features will continue to work unchanged. message HttpBody { // The HTTP Content-Type header value specifying the content type of the body. string content_type = 1; // The HTTP request/response body as raw binary. bytes data = 2; // Application specific response metadata. Must be set in the first response // for streaming APIs. repeated google.protobuf.Any extensions = 3; } ================================================ FILE: service/order/third_party/google/protobuf/any.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "google.golang.org/protobuf/types/known/anypb"; option java_package = "com.google.protobuf"; option java_outer_classname = "AnyProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // // Protobuf library provides support to pack/unpack Any values in the form // of utility functions or additional generated methods of the Any type. // // Example 1: Pack and unpack a message in C++. // // Foo foo = ...; // Any any; // any.PackFrom(foo); // ... // if (any.UnpackTo(&foo)) { // ... // } // // Example 2: Pack and unpack a message in Java. // // Foo foo = ...; // Any any = Any.pack(foo); // ... // if (any.is(Foo.class)) { // foo = any.unpack(Foo.class); // } // // Example 3: Pack and unpack a message in Python. // // foo = Foo(...) // any = Any() // any.Pack(foo) // ... // if any.Is(Foo.DESCRIPTOR): // any.Unpack(foo) // ... // // Example 4: Pack and unpack a message in Go // // foo := &pb.Foo{...} // any, err := anypb.New(foo) // if err != nil { // ... // } // ... // foo := &pb.Foo{} // if err := any.UnmarshalTo(foo); err != nil { // ... // } // // The pack methods provided by protobuf library will by default use // 'type.googleapis.com/full.type.name' as the type URL and the unpack // methods only use the fully qualified type name after the last '/' // in the type URL, for example "foo.bar.com/x/y.z" will yield type // name "y.z". // // // JSON // // The JSON representation of an `Any` value uses the regular // representation of the deserialized, embedded message, with an // additional field `@type` which contains the type URL. Example: // // package google.profile; // message Person { // string first_name = 1; // string last_name = 2; // } // // { // "@type": "type.googleapis.com/google.profile.Person", // "firstName": , // "lastName": // } // // If the embedded message type is well-known and has a custom JSON // representation, that representation will be embedded adding a field // `value` which holds the custom JSON in addition to the `@type` // field. Example (for message [google.protobuf.Duration][]): // // { // "@type": "type.googleapis.com/google.protobuf.Duration", // "value": "1.212s" // } // message Any { // A URL/resource name that uniquely identifies the type of the serialized // protocol buffer message. This string must contain at least // one "/" character. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). // // In practice, teams usually precompile into the binary all types that they // expect it to use in the context of Any. However, for URLs which use the // scheme `http`, `https`, or no scheme, one can optionally set up a type // server that maps type URLs to message definitions as follows: // // * If no scheme is provided, `https` is assumed. // * An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // * Applications are allowed to cache lookup results based on the // URL, or have them precompiled into a binary to avoid any // lookup. Therefore, binary compatibility needs to be preserved // on changes to types. (Use versioned type names to manage // breaking changes.) // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with // type.googleapis.com. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. // string type_url = 1; // Must be a valid serialized protocol buffer of the above specified type. bytes value = 2; } ================================================ FILE: service/order/third_party/google/protobuf/api.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; import "google/protobuf/source_context.proto"; import "google/protobuf/type.proto"; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "ApiProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/apipb"; // Api is a light-weight descriptor for an API Interface. // // Interfaces are also described as "protocol buffer services" in some contexts, // such as by the "service" keyword in a .proto file, but they are different // from API Services, which represent a concrete implementation of an interface // as opposed to simply a description of methods and bindings. They are also // sometimes simply referred to as "APIs" in other contexts, such as the name of // this message itself. See https://cloud.google.com/apis/design/glossary for // detailed terminology. message Api { // The fully qualified name of this interface, including package name // followed by the interface's simple name. string name = 1; // The methods of this interface, in unspecified order. repeated Method methods = 2; // Any metadata attached to the interface. repeated Option options = 3; // A version string for this interface. If specified, must have the form // `major-version.minor-version`, as in `1.10`. If the minor version is // omitted, it defaults to zero. If the entire version field is empty, the // major version is derived from the package name, as outlined below. If the // field is not empty, the version in the package name will be verified to be // consistent with what is provided here. // // The versioning schema uses [semantic // versioning](http://semver.org) where the major version number // indicates a breaking change and the minor version an additive, // non-breaking change. Both version numbers are signals to users // what to expect from different versions, and should be carefully // chosen based on the product plan. // // The major version is also reflected in the package name of the // interface, which must end in `v`, as in // `google.feature.v1`. For major versions 0 and 1, the suffix can // be omitted. Zero major versions must only be used for // experimental, non-GA interfaces. // // string version = 4; // Source context for the protocol buffer service represented by this // message. SourceContext source_context = 5; // Included interfaces. See [Mixin][]. repeated Mixin mixins = 6; // The source syntax of the service. Syntax syntax = 7; } // Method represents a method of an API interface. message Method { // The simple name of this method. string name = 1; // A URL of the input message type. string request_type_url = 2; // If true, the request is streamed. bool request_streaming = 3; // The URL of the output message type. string response_type_url = 4; // If true, the response is streamed. bool response_streaming = 5; // Any metadata attached to the method. repeated Option options = 6; // The source syntax of this method. Syntax syntax = 7; } // Declares an API Interface to be included in this interface. The including // interface must redeclare all the methods from the included interface, but // documentation and options are inherited as follows: // // - If after comment and whitespace stripping, the documentation // string of the redeclared method is empty, it will be inherited // from the original method. // // - Each annotation belonging to the service config (http, // visibility) which is not set in the redeclared method will be // inherited. // // - If an http annotation is inherited, the path pattern will be // modified as follows. Any version prefix will be replaced by the // version of the including interface plus the [root][] path if // specified. // // Example of a simple mixin: // // package google.acl.v1; // service AccessControl { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v1/{resource=**}:getAcl"; // } // } // // package google.storage.v2; // service Storage { // rpc GetAcl(GetAclRequest) returns (Acl); // // // Get a data record. // rpc GetData(GetDataRequest) returns (Data) { // option (google.api.http).get = "/v2/{resource=**}"; // } // } // // Example of a mixin configuration: // // apis: // - name: google.storage.v2.Storage // mixins: // - name: google.acl.v1.AccessControl // // The mixin construct implies that all methods in `AccessControl` are // also declared with same name and request/response types in // `Storage`. A documentation generator or annotation processor will // see the effective `Storage.GetAcl` method after inheriting // documentation and annotations as follows: // // service Storage { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v2/{resource=**}:getAcl"; // } // ... // } // // Note how the version in the path pattern changed from `v1` to `v2`. // // If the `root` field in the mixin is specified, it should be a // relative path under which inherited HTTP paths are placed. Example: // // apis: // - name: google.storage.v2.Storage // mixins: // - name: google.acl.v1.AccessControl // root: acls // // This implies the following inherited HTTP annotation: // // service Storage { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; // } // ... // } message Mixin { // The fully qualified name of the interface which is included. string name = 1; // If non-empty specifies a path under which inherited HTTP paths // are rooted. string root = 2; } ================================================ FILE: service/order/third_party/google/protobuf/compiler/plugin.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // // WARNING: The plugin interface is currently EXPERIMENTAL and is subject to // change. // // protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is // just a program that reads a CodeGeneratorRequest from stdin and writes a // CodeGeneratorResponse to stdout. // // Plugins written using C++ can use google/protobuf/compiler/plugin.h instead // of dealing with the raw protocol defined here. // // A plugin executable needs only to be placed somewhere in the path. The // plugin should be named "protoc-gen-$NAME", and will then be used when the // flag "--${NAME}_out" is passed to protoc. syntax = "proto2"; package google.protobuf.compiler; option java_package = "com.google.protobuf.compiler"; option java_outer_classname = "PluginProtos"; option go_package = "google.golang.org/protobuf/types/pluginpb"; import "google/protobuf/descriptor.proto"; // The version number of protocol compiler. message Version { optional int32 major = 1; optional int32 minor = 2; optional int32 patch = 3; // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should // be empty for mainline stable releases. optional string suffix = 4; } // An encoded CodeGeneratorRequest is written to the plugin's stdin. message CodeGeneratorRequest { // The .proto files that were explicitly listed on the command-line. The // code generator should generate code only for these files. Each file's // descriptor will be included in proto_file, below. repeated string file_to_generate = 1; // The generator parameter passed on the command-line. optional string parameter = 2; // FileDescriptorProtos for all files in files_to_generate and everything // they import. The files will appear in topological order, so each file // appears before any file that imports it. // // protoc guarantees that all proto_files will be written after // the fields above, even though this is not technically guaranteed by the // protobuf wire format. This theoretically could allow a plugin to stream // in the FileDescriptorProtos and handle them one by one rather than read // the entire set into memory at once. However, as of this writing, this // is not similarly optimized on protoc's end -- it will store all fields in // memory at once before sending them to the plugin. // // Type names of fields and extensions in the FileDescriptorProto are always // fully qualified. repeated FileDescriptorProto proto_file = 15; // The version number of protocol compiler. optional Version compiler_version = 3; } // The plugin writes an encoded CodeGeneratorResponse to stdout. message CodeGeneratorResponse { // Error message. If non-empty, code generation failed. The plugin process // should exit with status code zero even if it reports an error in this way. // // This should be used to indicate errors in .proto files which prevent the // code generator from generating correct code. Errors which indicate a // problem in protoc itself -- such as the input CodeGeneratorRequest being // unparseable -- should be reported by writing a message to stderr and // exiting with a non-zero status code. optional string error = 1; // A bitmask of supported features that the code generator supports. // This is a bitwise "or" of values from the Feature enum. optional uint64 supported_features = 2; // Sync with code_generator.h. enum Feature { FEATURE_NONE = 0; FEATURE_PROTO3_OPTIONAL = 1; } // Represents a single generated file. message File { // The file name, relative to the output directory. The name must not // contain "." or ".." components and must be relative, not be absolute (so, // the file cannot lie outside the output directory). "/" must be used as // the path separator, not "\". // // If the name is omitted, the content will be appended to the previous // file. This allows the generator to break large files into small chunks, // and allows the generated text to be streamed back to protoc so that large // files need not reside completely in memory at one time. Note that as of // this writing protoc does not optimize for this -- it will read the entire // CodeGeneratorResponse before writing files to disk. optional string name = 1; // If non-empty, indicates that the named file should already exist, and the // content here is to be inserted into that file at a defined insertion // point. This feature allows a code generator to extend the output // produced by another code generator. The original generator may provide // insertion points by placing special annotations in the file that look // like: // @@protoc_insertion_point(NAME) // The annotation can have arbitrary text before and after it on the line, // which allows it to be placed in a comment. NAME should be replaced with // an identifier naming the point -- this is what other generators will use // as the insertion_point. Code inserted at this point will be placed // immediately above the line containing the insertion point (thus multiple // insertions to the same point will come out in the order they were added). // The double-@ is intended to make it unlikely that the generated code // could contain things that look like insertion points by accident. // // For example, the C++ code generator places the following line in the // .pb.h files that it generates: // // @@protoc_insertion_point(namespace_scope) // This line appears within the scope of the file's package namespace, but // outside of any particular class. Another plugin can then specify the // insertion_point "namespace_scope" to generate additional classes or // other declarations that should be placed in this scope. // // Note that if the line containing the insertion point begins with // whitespace, the same whitespace will be added to every line of the // inserted text. This is useful for languages like Python, where // indentation matters. In these languages, the insertion point comment // should be indented the same amount as any inserted code will need to be // in order to work correctly in that context. // // The code generator that generates the initial file and the one which // inserts into it must both run as part of a single invocation of protoc. // Code generators are executed in the order in which they appear on the // command line. // // If |insertion_point| is present, |name| must also be present. optional string insertion_point = 2; // The file contents. optional string content = 15; // Information describing the file content being inserted. If an insertion // point is used, this information will be appropriately offset and inserted // into the code generation metadata for the generated files. optional GeneratedCodeInfo generated_code_info = 16; } repeated File file = 15; } ================================================ FILE: service/order/third_party/google/protobuf/descriptor.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. // // The messages in this file describe the definitions found in .proto files. // A valid .proto file can be translated directly to a FileDescriptorProto // without any other information (e.g. without reading its imports). syntax = "proto2"; package google.protobuf; option go_package = "google.golang.org/protobuf/types/descriptorpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; option csharp_namespace = "Google.Protobuf.Reflection"; option objc_class_prefix = "GPB"; option cc_enable_arenas = true; // descriptor.proto must be optimized for speed because reflection-based // algorithms don't work during bootstrapping. option optimize_for = SPEED; // The protocol compiler can output a FileDescriptorSet containing the .proto // files it parses. message FileDescriptorSet { repeated FileDescriptorProto file = 1; } // Describes a complete .proto file. message FileDescriptorProto { optional string name = 1; // file name, relative to root of source tree optional string package = 2; // e.g. "foo", "foo.bar", etc. // Names of files imported by this file. repeated string dependency = 3; // Indexes of the public imported files in the dependency list above. repeated int32 public_dependency = 10; // Indexes of the weak imported files in the dependency list. // For Google-internal migration only. Do not use. repeated int32 weak_dependency = 11; // All top-level definitions in this file. repeated DescriptorProto message_type = 4; repeated EnumDescriptorProto enum_type = 5; repeated ServiceDescriptorProto service = 6; repeated FieldDescriptorProto extension = 7; optional FileOptions options = 8; // This field contains optional information about the original source code. // You may safely remove this entire field without harming runtime // functionality of the descriptors -- the information is needed only by // development tools. optional SourceCodeInfo source_code_info = 9; // The syntax of the proto file. // The supported values are "proto2" and "proto3". optional string syntax = 12; } // Describes a message type. message DescriptorProto { optional string name = 1; repeated FieldDescriptorProto field = 2; repeated FieldDescriptorProto extension = 6; repeated DescriptorProto nested_type = 3; repeated EnumDescriptorProto enum_type = 4; message ExtensionRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. optional ExtensionRangeOptions options = 3; } repeated ExtensionRange extension_range = 5; repeated OneofDescriptorProto oneof_decl = 8; optional MessageOptions options = 7; // Range of reserved tag numbers. Reserved tag numbers may not be used by // fields or extension ranges in the same message. Reserved ranges may // not overlap. message ReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. } repeated ReservedRange reserved_range = 9; // Reserved field names, which may not be used by fields in the same message. // A given name may only be reserved once. repeated string reserved_name = 10; } message ExtensionRangeOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // Describes a field within a message. message FieldDescriptorProto { enum Type { // 0 is reserved for errors. // Order is weird for historical reasons. TYPE_DOUBLE = 1; TYPE_FLOAT = 2; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. TYPE_INT64 = 3; TYPE_UINT64 = 4; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. TYPE_INT32 = 5; TYPE_FIXED64 = 6; TYPE_FIXED32 = 7; TYPE_BOOL = 8; TYPE_STRING = 9; // Tag-delimited aggregate. // Group type is deprecated and not supported in proto3. However, Proto3 // implementations should still be able to parse the group wire format and // treat group fields as unknown fields. TYPE_GROUP = 10; TYPE_MESSAGE = 11; // Length-delimited aggregate. // New in version 2. TYPE_BYTES = 12; TYPE_UINT32 = 13; TYPE_ENUM = 14; TYPE_SFIXED32 = 15; TYPE_SFIXED64 = 16; TYPE_SINT32 = 17; // Uses ZigZag encoding. TYPE_SINT64 = 18; // Uses ZigZag encoding. } enum Label { // 0 is reserved for errors LABEL_OPTIONAL = 1; LABEL_REQUIRED = 2; LABEL_REPEATED = 3; } optional string name = 1; optional int32 number = 3; optional Label label = 4; // If type_name is set, this need not be set. If both this and type_name // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. optional Type type = 5; // For message and enum types, this is the name of the type. If the name // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping // rules are used to find the type (i.e. first the nested types within this // message are searched, then within the parent, on up to the root // namespace). optional string type_name = 6; // For extensions, this is the name of the type being extended. It is // resolved in the same manner as type_name. optional string extendee = 2; // For numeric types, contains the original text representation of the value. // For booleans, "true" or "false". // For strings, contains the default text contents (not escaped in any way). // For bytes, contains the C escaped value. All bytes >= 128 are escaped. optional string default_value = 7; // If set, gives the index of a oneof in the containing type's oneof_decl // list. This field is a member of that oneof. optional int32 oneof_index = 9; // JSON name of this field. The value is set by protocol compiler. If the // user has set a "json_name" option on this field, that option's value // will be used. Otherwise, it's deduced from the field's name by converting // it to camelCase. optional string json_name = 10; optional FieldOptions options = 8; // If true, this is a proto3 "optional". When a proto3 field is optional, it // tracks presence regardless of field type. // // When proto3_optional is true, this field must be belong to a oneof to // signal to old proto3 clients that presence is tracked for this field. This // oneof is known as a "synthetic" oneof, and this field must be its sole // member (each proto3 optional field gets its own synthetic oneof). Synthetic // oneofs exist in the descriptor only, and do not generate any API. Synthetic // oneofs must be ordered after all "real" oneofs. // // For message fields, proto3_optional doesn't create any semantic change, // since non-repeated message fields always track presence. However it still // indicates the semantic detail of whether the user wrote "optional" or not. // This can be useful for round-tripping the .proto file. For consistency we // give message fields a synthetic oneof also, even though it is not required // to track presence. This is especially important because the parser can't // tell if a field is a message or an enum, so it must always create a // synthetic oneof. // // Proto2 optional fields do not set this flag, because they already indicate // optional with `LABEL_OPTIONAL`. optional bool proto3_optional = 17; } // Describes a oneof. message OneofDescriptorProto { optional string name = 1; optional OneofOptions options = 2; } // Describes an enum type. message EnumDescriptorProto { optional string name = 1; repeated EnumValueDescriptorProto value = 2; optional EnumOptions options = 3; // Range of reserved numeric values. Reserved values may not be used by // entries in the same enum. Reserved ranges may not overlap. // // Note that this is distinct from DescriptorProto.ReservedRange in that it // is inclusive such that it can appropriately represent the entire int32 // domain. message EnumReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Inclusive. } // Range of reserved numeric values. Reserved numeric values may not be used // by enum values in the same enum declaration. Reserved ranges may not // overlap. repeated EnumReservedRange reserved_range = 4; // Reserved enum value names, which may not be reused. A given name may only // be reserved once. repeated string reserved_name = 5; } // Describes a value within an enum. message EnumValueDescriptorProto { optional string name = 1; optional int32 number = 2; optional EnumValueOptions options = 3; } // Describes a service. message ServiceDescriptorProto { optional string name = 1; repeated MethodDescriptorProto method = 2; optional ServiceOptions options = 3; } // Describes a method of a service. message MethodDescriptorProto { optional string name = 1; // Input and output type names. These are resolved in the same way as // FieldDescriptorProto.type_name, but must refer to a message type. optional string input_type = 2; optional string output_type = 3; optional MethodOptions options = 4; // Identifies if client streams multiple client messages optional bool client_streaming = 5 [default = false]; // Identifies if server streams multiple server messages optional bool server_streaming = 6 [default = false]; } // =================================================================== // Options // Each of the definitions above may have "options" attached. These are // just annotations which may cause code to be generated slightly differently // or may contain hints for code that manipulates protocol messages. // // Clients may define custom options as extensions of the *Options messages. // These extensions may not yet be known at parsing time, so the parser cannot // store the values in them. Instead it stores them in a field in the *Options // message called uninterpreted_option. This field must have the same name // across all *Options messages. We then use this field to populate the // extensions when we build a descriptor, at which point all protos have been // parsed and so all extensions are known. // // Extension numbers for custom options may be chosen as follows: // * For options which will only be used within a single application or // organization, or for experimental options, use field numbers 50000 // through 99999. It is up to you to ensure that you do not use the // same number for multiple options. // * For options which will be published and used publicly by multiple // independent entities, e-mail protobuf-global-extension-registry@google.com // to reserve extension numbers. Simply provide your project name (e.g. // Objective-C plugin) and your project website (if available) -- there's no // need to explain how you intend to use them. Usually you only need one // extension number. You can declare multiple options with only one extension // number by putting them in a sub-message. See the Custom Options section of // the docs for examples: // https://developers.google.com/protocol-buffers/docs/proto#options // If this turns out to be popular, a web service will be set up // to automatically assign option numbers. message FileOptions { // Sets the Java package where classes generated from this .proto will be // placed. By default, the proto package is used, but this is often // inappropriate because proto packages do not normally start with backwards // domain names. optional string java_package = 1; // Controls the name of the wrapper Java class generated for the .proto file. // That class will always contain the .proto file's getDescriptor() method as // well as any top-level extensions defined in the .proto file. // If java_multiple_files is disabled, then all the other classes from the // .proto file will be nested inside the single wrapper outer class. optional string java_outer_classname = 8; // If enabled, then the Java code generator will generate a separate .java // file for each top-level message, enum, and service defined in the .proto // file. Thus, these types will *not* be nested inside the wrapper class // named by java_outer_classname. However, the wrapper class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. optional bool java_multiple_files = 10 [default = false]; // This option does nothing. optional bool java_generate_equals_and_hash = 20 [deprecated=true]; // If set true, then the Java2 code generator will generate code that // throws an exception whenever an attempt is made to assign a non-UTF-8 // byte sequence to a string field. // Message reflection will do the same. // However, an extension field still accepts non-UTF-8 byte sequences. // This option has no effect on when used with the lite runtime. optional bool java_string_check_utf8 = 27 [default = false]; // Generated classes can be optimized for speed or code size. enum OptimizeMode { SPEED = 1; // Generate complete code for parsing, serialization, // etc. CODE_SIZE = 2; // Use ReflectionOps to implement these methods. LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. } optional OptimizeMode optimize_for = 9 [default = SPEED]; // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: // - The basename of the package import path, if provided. // - Otherwise, the package statement in the .proto file, if present. // - Otherwise, the basename of the .proto file, without extension. optional string go_package = 11; // Should generic services be generated in each language? "Generic" services // are not specific to any particular RPC system. They are generated by the // main code generators in each language (without additional plugins). // Generic services were the only kind of service generation supported by // early versions of google.protobuf. // // Generic services are now considered deprecated in favor of using plugins // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. optional bool cc_generic_services = 16 [default = false]; optional bool java_generic_services = 17 [default = false]; optional bool py_generic_services = 18 [default = false]; optional bool php_generic_services = 42 [default = false]; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. optional bool deprecated = 23 [default = false]; // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. optional bool cc_enable_arenas = 31 [default = true]; // Sets the objective c class prefix which is prepended to all objective c // generated classes from this .proto. There is no default. optional string objc_class_prefix = 36; // Namespace for generated classes; defaults to the package. optional string csharp_namespace = 37; // By default Swift generators will take the proto package and CamelCase it // replacing '.' with underscore and use that to prefix the types/symbols // defined. When this options is provided, they will use this value instead // to prefix the types/symbols defined. optional string swift_prefix = 39; // Sets the php class prefix which is prepended to all php generated classes // from this .proto. Default is empty. optional string php_class_prefix = 40; // Use this option to change the namespace of php generated classes. Default // is empty. When this option is empty, the package name will be used for // determining the namespace. optional string php_namespace = 41; // Use this option to change the namespace of php generated metadata classes. // Default is empty. When this option is empty, the proto file name will be // used for determining the namespace. optional string php_metadata_namespace = 44; // Use this option to change the package of ruby generated classes. Default // is empty. When this option is not set, the package name will be used for // determining the ruby package. optional string ruby_package = 45; // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. // See the documentation for the "Options" section above. extensions 1000 to max; reserved 38; } message MessageOptions { // Set true to use the old proto1 MessageSet wire format for extensions. // This is provided for backwards-compatibility with the MessageSet wire // format. You should not use this for any other reason: It's less // efficient, has fewer features, and is more complicated. // // The message must be defined exactly as follows: // message Foo { // option message_set_wire_format = true; // extensions 4 to max; // } // Note that the message cannot have any defined fields; MessageSets only // have extensions. // // All extensions of your type must be singular messages; e.g. they cannot // be int32s, enums, or repeated messages. // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. optional bool message_set_wire_format = 1 [default = false]; // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". optional bool no_standard_descriptor_accessor = 2 [default = false]; // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. optional bool deprecated = 3 [default = false]; reserved 4, 5, 6; // Whether the message is an automatically generated map entry type for the // maps field. // // For maps fields: // map map_field = 1; // The parsed descriptor looks like: // message MapFieldEntry { // option map_entry = true; // optional KeyType key = 1; // optional ValueType value = 2; // } // repeated MapFieldEntry map_field = 1; // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax // instead. The option should only be implicitly set by the proto compiler // parser. optional bool map_entry = 7; reserved 8; // javalite_serializable reserved 9; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message FieldOptions { // The ctype option instructs the C++ code generator to use a different // representation of the field than it normally would. See the specific // options below. This option is not yet implemented in the open source // release -- sorry, we'll try to include it in a future version! optional CType ctype = 1 [default = STRING]; enum CType { // Default mode. STRING = 0; CORD = 1; STRING_PIECE = 2; } // The packed option can be enabled for repeated primitive fields to enable // a more efficient representation on the wire. Rather than repeatedly // writing the tag and type for each element, the entire array is encoded as // a single length-delimited blob. In proto3, only explicit setting it to // false will avoid using packed encoding. optional bool packed = 2; // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING // is represented as JavaScript string, which avoids loss of precision that // can happen when a large value is converted to a floating point JavaScript. // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to // use the JavaScript "number" type. The behavior of the default option // JS_NORMAL is implementation dependent. // // This option is an enum to permit additional types to be added, e.g. // goog.math.Integer. optional JSType jstype = 6 [default = JS_NORMAL]; enum JSType { // Use the default type. JS_NORMAL = 0; // Use JavaScript strings. JS_STRING = 1; // Use JavaScript numbers. JS_NUMBER = 2; } // Should this field be parsed lazily? Lazy applies only to message-type // fields. It means that when the outer message is initially parsed, the // inner message's contents will not be parsed but instead stored in encoded // form. The inner message will actually be parsed when it is first accessed. // // This is only a hint. Implementations are free to choose whether to use // eager or lazy parsing regardless of the value of this option. However, // setting this option true suggests that the protocol author believes that // using lazy parsing on this field is worth the additional bookkeeping // overhead typically needed to implement it. // // This option does not affect the public interface of any generated code; // all method signatures remain the same. Furthermore, thread-safety of the // interface is not affected by this option; const methods remain safe to // call from multiple threads concurrently, while non-const methods continue // to require exclusive access. // // // Note that implementations may choose not to check required fields within // a lazy sub-message. That is, calling IsInitialized() on the outer message // may return true even if the inner message has missing required fields. // This is necessary because otherwise the inner message would have to be // parsed in order to perform the check, defeating the purpose of lazy // parsing. An implementation which chooses not to check required fields // must be consistent about it. That is, for any particular sub-message, the // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. // // As of 2021, lazy does no correctness checks on the byte stream during // parsing. This may lead to crashes if and when an invalid byte stream is // finally parsed upon access. // // TODO(b/211906113): Enable validation on lazy fields. optional bool lazy = 5 [default = false]; // unverified_lazy does no correctness checks on the byte stream. This should // only be used where lazy with verification is prohibitive for performance // reasons. optional bool unverified_lazy = 15 [default = false]; // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. optional bool deprecated = 3 [default = false]; // For Google-internal migration only. Do not use. optional bool weak = 10 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; reserved 4; // removed jtype } message OneofOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumOptions { // Set this option to true to allow mapping different tag names to the same // value. optional bool allow_alias = 2; // Is this enum deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. optional bool deprecated = 3 [default = false]; reserved 5; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumValueOptions { // Is this enum value deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. optional bool deprecated = 1 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message ServiceOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this service deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. optional bool deprecated = 33 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message MethodOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this method deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. optional bool deprecated = 33 [default = false]; // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, // or neither? HTTP based RPC implementation may choose GET verb for safe // methods, and PUT verb for idempotent methods instead of the default POST. enum IdempotencyLevel { IDEMPOTENCY_UNKNOWN = 0; NO_SIDE_EFFECTS = 1; // implies idempotent IDEMPOTENT = 2; // idempotent, but may have side effects } optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // A message representing a option the parser does not recognize. This only // appears in options protos created by the compiler::Parser class. // DescriptorPool resolves these when building Descriptor objects. Therefore, // options protos in descriptor objects (e.g. returned by Descriptor::options(), // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions // in them. message UninterpretedOption { // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents // "foo.(bar.baz).qux". message NamePart { required string name_part = 1; required bool is_extension = 2; } repeated NamePart name = 2; // The value of the uninterpreted option, in whatever type the tokenizer // identified it as during parsing. Exactly one of these should be set. optional string identifier_value = 3; optional uint64 positive_int_value = 4; optional int64 negative_int_value = 5; optional double double_value = 6; optional bytes string_value = 7; optional string aggregate_value = 8; } // =================================================================== // Optional source code info // Encapsulates information about the original source file from which a // FileDescriptorProto was generated. message SourceCodeInfo { // A Location identifies a piece of source code in a .proto file which // corresponds to a particular definition. This information is intended // to be useful to IDEs, code indexers, documentation generators, and similar // tools. // // For example, say we have a file like: // message Foo { // optional string foo = 1; // } // Let's look at just the field definition: // optional string foo = 1; // ^ ^^ ^^ ^ ^^^ // a bc de f ghi // We have the following locations: // span path represents // [a,i) [ 4, 0, 2, 0 ] The whole field definition. // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). // // Notes: // - A location may refer to a repeated field itself (i.e. not to any // particular index within it). This is used whenever a set of elements are // logically enclosed in a single code segment. For example, an entire // extend block (possibly containing multiple extension definitions) will // have an outer location whose path refers to the "extensions" repeated // field without an index. // - Multiple locations may have the same path. This happens when a single // logical declaration is spread out across multiple places. The most // obvious example is the "extend" block again -- there may be multiple // extend blocks in the same scope, each of which will have the same path. // - A location's span is not always a subset of its parent's span. For // example, the "extendee" of an extension declaration appears at the // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span // does not mean that it is a descendant. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to // ignore those that it doesn't understand, as more types of locations could // be recorded in the future. repeated Location location = 1; message Location { // Identifies which part of the FileDescriptorProto was defined at this // location. // // Each element is a field number or an index. They form a path from // the root FileDescriptorProto to the place where the definition occurs. // For example, this path: // [ 4, 3, 2, 7, 1 ] // refers to: // file.message_type(3) // 4, 3 // .field(7) // 2, 7 // .name() // 1 // This is because FileDescriptorProto.message_type has field number 4: // repeated DescriptorProto message_type = 4; // and DescriptorProto.field has field number 2: // repeated FieldDescriptorProto field = 2; // and FieldDescriptorProto.name has field number 1: // optional string name = 1; // // Thus, the above path gives the location of a field name. If we removed // the last element: // [ 4, 3, 2, 7 ] // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). repeated int32 path = 1 [packed = true]; // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. repeated int32 span = 2 [packed = true]; // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be // attached to the declaration. // // A series of line comments appearing on consecutive lines, with no other // tokens appearing on those lines, will be treated as a single comment. // // leading_detached_comments will keep paragraphs of comments that appear // before (but not connected to) the current element. Each paragraph, // separated by empty lines, will be one comment element in the repeated // field. // // Only the comment content is provided; comment markers (e.g. //) are // stripped out. For block comments, leading whitespace and an asterisk // will be stripped from the beginning of each line other than the first. // Newlines are included in the output. // // Examples: // // optional int32 foo = 1; // Comment attached to foo. // // Comment attached to bar. // optional int32 bar = 2; // // optional string baz = 3; // // Comment attached to baz. // // Another line attached to baz. // // // Comment attached to qux. // // // // Another line attached to qux. // optional double qux = 4; // // // Detached comment for corge. This is not leading or trailing comments // // to qux or corge because there are blank lines separating it from // // both. // // // Detached comment for corge paragraph 2. // // optional string corge = 5; // /* Block comment attached // * to corge. Leading asterisks // * will be removed. */ // /* Block comment attached to // * grault. */ // optional int32 grault = 6; // // // ignored detached comments. optional string leading_comments = 3; optional string trailing_comments = 4; repeated string leading_detached_comments = 6; } } // Describes the relationship between generated code and its original source // file. A GeneratedCodeInfo message is associated with only one generated // source file, but may contain references to different source .proto files. message GeneratedCodeInfo { // An Annotation connects some span of text in generated code to an element // of its generating .proto file. repeated Annotation annotation = 1; message Annotation { // Identifies the element in the original source .proto file. This field // is formatted the same as SourceCodeInfo.Location.path. repeated int32 path = 1 [packed = true]; // Identifies the filesystem path to the original source .proto. optional string source_file = 2; // Identifies the starting offset in bytes in the generated code // that relates to the identified object. optional int32 begin = 3; // Identifies the ending offset in bytes in the generated code that // relates to the identified offset. The end offset should be one past // the last relevant byte (so the length of the text = end - begin). optional int32 end = 4; } } ================================================ FILE: service/order/third_party/google/protobuf/duration.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/durationpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DurationProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Duration represents a signed, fixed-length span of time represented // as a count of seconds and fractions of seconds at nanosecond // resolution. It is independent of any calendar and concepts like "day" // or "month". It is related to Timestamp in that the difference between // two Timestamp values is a Duration and it can be added or subtracted // from a Timestamp. Range is approximately +-10,000 years. // // # Examples // // Example 1: Compute Duration from two Timestamps in pseudo code. // // Timestamp start = ...; // Timestamp end = ...; // Duration duration = ...; // // duration.seconds = end.seconds - start.seconds; // duration.nanos = end.nanos - start.nanos; // // if (duration.seconds < 0 && duration.nanos > 0) { // duration.seconds += 1; // duration.nanos -= 1000000000; // } else if (duration.seconds > 0 && duration.nanos < 0) { // duration.seconds -= 1; // duration.nanos += 1000000000; // } // // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. // // Timestamp start = ...; // Duration duration = ...; // Timestamp end = ...; // // end.seconds = start.seconds + duration.seconds; // end.nanos = start.nanos + duration.nanos; // // if (end.nanos < 0) { // end.seconds -= 1; // end.nanos += 1000000000; // } else if (end.nanos >= 1000000000) { // end.seconds += 1; // end.nanos -= 1000000000; // } // // Example 3: Compute Duration from datetime.timedelta in Python. // // td = datetime.timedelta(days=3, minutes=10) // duration = Duration() // duration.FromTimedelta(td) // // # JSON Mapping // // In JSON format, the Duration type is encoded as a string rather than an // object, where the string ends in the suffix "s" (indicating seconds) and // is preceded by the number of seconds, with nanoseconds expressed as // fractional seconds. For example, 3 seconds with 0 nanoseconds should be // encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should // be expressed in JSON format as "3.000000001s", and 3 seconds and 1 // microsecond should be expressed in JSON format as "3.000001s". // // message Duration { // Signed seconds of the span of time. Must be from -315,576,000,000 // to +315,576,000,000 inclusive. Note: these bounds are computed from: // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years int64 seconds = 1; // Signed fractions of a second at nanosecond resolution of the span // of time. Durations less than one second are represented with a 0 // `seconds` field and a positive or negative `nanos` field. For durations // of one second or more, a non-zero value for the `nanos` field must be // of the same sign as the `seconds` field. Must be from -999,999,999 // to +999,999,999 inclusive. int32 nanos = 2; } ================================================ FILE: service/order/third_party/google/protobuf/empty.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "google.golang.org/protobuf/types/known/emptypb"; option java_package = "com.google.protobuf"; option java_outer_classname = "EmptyProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option cc_enable_arenas = true; // A generic empty message that you can re-use to avoid defining duplicated // empty messages in your APIs. A typical example is to use it as the request // or the response type of an API method. For instance: // // service Foo { // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); // } // // The JSON representation for `Empty` is empty JSON object `{}`. message Empty {} ================================================ FILE: service/order/third_party/google/protobuf/field_mask.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "FieldMaskProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; option cc_enable_arenas = true; // `FieldMask` represents a set of symbolic field paths, for example: // // paths: "f.a" // paths: "f.b.d" // // Here `f` represents a field in some root message, `a` and `b` // fields in the message found in `f`, and `d` a field found in the // message in `f.b`. // // Field masks are used to specify a subset of fields that should be // returned by a get operation or modified by an update operation. // Field masks also have a custom JSON encoding (see below). // // # Field Masks in Projections // // When used in the context of a projection, a response message or // sub-message is filtered by the API to only contain those fields as // specified in the mask. For example, if the mask in the previous // example is applied to a response message as follows: // // f { // a : 22 // b { // d : 1 // x : 2 // } // y : 13 // } // z: 8 // // The result will not contain specific values for fields x,y and z // (their value will be set to the default, and omitted in proto text // output): // // // f { // a : 22 // b { // d : 1 // } // } // // A repeated field is not allowed except at the last position of a // paths string. // // If a FieldMask object is not present in a get operation, the // operation applies to all fields (as if a FieldMask of all fields // had been specified). // // Note that a field mask does not necessarily apply to the // top-level response message. In case of a REST get operation, the // field mask applies directly to the response, but in case of a REST // list operation, the mask instead applies to each individual message // in the returned resource list. In case of a REST custom method, // other definitions may be used. Where the mask applies will be // clearly documented together with its declaration in the API. In // any case, the effect on the returned resource/resources is required // behavior for APIs. // // # Field Masks in Update Operations // // A field mask in update operations specifies which fields of the // targeted resource are going to be updated. The API is required // to only change the values of the fields as specified in the mask // and leave the others untouched. If a resource is passed in to // describe the updated values, the API ignores the values of all // fields not covered by the mask. // // If a repeated field is specified for an update operation, new values will // be appended to the existing repeated field in the target resource. Note that // a repeated field is only allowed in the last position of a `paths` string. // // If a sub-message is specified in the last position of the field mask for an // update operation, then new value will be merged into the existing sub-message // in the target resource. // // For example, given the target message: // // f { // b { // d: 1 // x: 2 // } // c: [1] // } // // And an update message: // // f { // b { // d: 10 // } // c: [2] // } // // then if the field mask is: // // paths: ["f.b", "f.c"] // // then the result will be: // // f { // b { // d: 10 // x: 2 // } // c: [1, 2] // } // // An implementation may provide options to override this default behavior for // repeated and message fields. // // In order to reset a field's value to the default, the field must // be in the mask and set to the default value in the provided resource. // Hence, in order to reset all fields of a resource, provide a default // instance of the resource and set all fields in the mask, or do // not provide a mask as described below. // // If a field mask is not present on update, the operation applies to // all fields (as if a field mask of all fields has been specified). // Note that in the presence of schema evolution, this may mean that // fields the client does not know and has therefore not filled into // the request will be reset to their default. If this is unwanted // behavior, a specific service may require a client to always specify // a field mask, producing an error if not. // // As with get operations, the location of the resource which // describes the updated values in the request message depends on the // operation kind. In any case, the effect of the field mask is // required to be honored by the API. // // ## Considerations for HTTP REST // // The HTTP kind of an update operation which uses a field mask must // be set to PATCH instead of PUT in order to satisfy HTTP semantics // (PUT must only be used for full updates). // // # JSON Encoding of Field Masks // // In JSON, a field mask is encoded as a single string where paths are // separated by a comma. Fields name in each path are converted // to/from lower-camel naming conventions. // // As an example, consider the following message declarations: // // message Profile { // User user = 1; // Photo photo = 2; // } // message User { // string display_name = 1; // string address = 2; // } // // In proto a field mask for `Profile` may look as such: // // mask { // paths: "user.display_name" // paths: "photo" // } // // In JSON, the same mask is represented as below: // // { // mask: "user.displayName,photo" // } // // # Field Masks and Oneof Fields // // Field masks treat fields in oneofs just as regular fields. Consider the // following message: // // message SampleMessage { // oneof test_oneof { // string name = 4; // SubMessage sub_message = 9; // } // } // // The field mask can be: // // mask { // paths: "name" // } // // Or: // // mask { // paths: "sub_message" // } // // Note that oneof type names ("test_oneof" in this case) cannot be used in // paths. // // ## Field Mask Verification // // The implementation of any API method which has a FieldMask type field in the // request should verify the included field paths, and return an // `INVALID_ARGUMENT` error if any path is unmappable. message FieldMask { // The set of field mask paths. repeated string paths = 1; } ================================================ FILE: service/order/third_party/google/protobuf/source_context.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "SourceContextProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; // `SourceContext` represents information about the source of a // protobuf element, like the file in which it is defined. message SourceContext { // The path-qualified name of the .proto file that contained the associated // protobuf element. For example: `"google/protobuf/source_context.proto"`. string file_name = 1; } ================================================ FILE: service/order/third_party/google/protobuf/struct.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/structpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "StructProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // `Struct` represents a structured data value, consisting of fields // which map to dynamically typed values. In some languages, `Struct` // might be supported by a native representation. For example, in // scripting languages like JS a struct is represented as an // object. The details of that representation are described together // with the proto support for the language. // // The JSON representation for `Struct` is JSON object. message Struct { // Unordered map of dynamically typed values. map fields = 1; } // `Value` represents a dynamically typed value which can be either // null, a number, a string, a boolean, a recursive struct value, or a // list of values. A producer of value is expected to set one of these // variants. Absence of any variant indicates an error. // // The JSON representation for `Value` is JSON value. message Value { // The kind of value. oneof kind { // Represents a null value. NullValue null_value = 1; // Represents a double value. double number_value = 2; // Represents a string value. string string_value = 3; // Represents a boolean value. bool bool_value = 4; // Represents a structured value. Struct struct_value = 5; // Represents a repeated `Value`. ListValue list_value = 6; } } // `NullValue` is a singleton enumeration to represent the null value for the // `Value` type union. // // The JSON representation for `NullValue` is JSON `null`. enum NullValue { // Null value. NULL_VALUE = 0; } // `ListValue` is a wrapper around a repeated field of values. // // The JSON representation for `ListValue` is JSON array. message ListValue { // Repeated field of dynamically typed values. repeated Value values = 1; } ================================================ FILE: service/order/third_party/google/protobuf/timestamp.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/timestamppb"; option java_package = "com.google.protobuf"; option java_outer_classname = "TimestampProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Timestamp represents a point in time independent of any time zone or local // calendar, encoded as a count of seconds and fractions of seconds at // nanosecond resolution. The count is relative to an epoch at UTC midnight on // January 1, 1970, in the proleptic Gregorian calendar which extends the // Gregorian calendar backwards to year one. // // All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap // second table is needed for interpretation, using a [24-hour linear // smear](https://developers.google.com/time/smear). // // The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By // restricting to that range, we ensure that we can convert to and from [RFC // 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. // // # Examples // // Example 1: Compute Timestamp from POSIX `time()`. // // Timestamp timestamp; // timestamp.set_seconds(time(NULL)); // timestamp.set_nanos(0); // // Example 2: Compute Timestamp from POSIX `gettimeofday()`. // // struct timeval tv; // gettimeofday(&tv, NULL); // // Timestamp timestamp; // timestamp.set_seconds(tv.tv_sec); // timestamp.set_nanos(tv.tv_usec * 1000); // // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. // // FILETIME ft; // GetSystemTimeAsFileTime(&ft); // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. // Timestamp timestamp; // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); // // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. // // long millis = System.currentTimeMillis(); // // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) // .setNanos((int) ((millis % 1000) * 1000000)).build(); // // // Example 5: Compute Timestamp from Java `Instant.now()`. // // Instant now = Instant.now(); // // Timestamp timestamp = // Timestamp.newBuilder().setSeconds(now.getEpochSecond()) // .setNanos(now.getNano()).build(); // // // Example 6: Compute Timestamp from current time in Python. // // timestamp = Timestamp() // timestamp.GetCurrentTime() // // # JSON Mapping // // In JSON format, the Timestamp type is encoded as a string in the // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" // where {year} is always expressed using four digits while {month}, {day}, // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone // is required. A proto3 JSON serializer should always use UTC (as indicated by // "Z") when printing the Timestamp type and a proto3 JSON parser should be // able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. // // In JavaScript, one can convert a Date object to this format using the // standard // [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) // method. In Python, a standard `datetime.datetime` object can be converted // to this format using // [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with // the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use // the Joda Time's [`ISODateTimeFormat.dateTime()`]( // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D // ) to obtain a formatter capable of generating timestamps in this format. // // message Timestamp { // Represents seconds of UTC time since Unix epoch // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to // 9999-12-31T23:59:59Z inclusive. int64 seconds = 1; // Non-negative fractions of a second at nanosecond resolution. Negative // second values with fractions must still have non-negative nanos values // that count forward in time. Must be from 0 to 999,999,999 // inclusive. int32 nanos = 2; } ================================================ FILE: service/order/third_party/google/protobuf/type.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; import "google/protobuf/any.proto"; import "google/protobuf/source_context.proto"; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option java_package = "com.google.protobuf"; option java_outer_classname = "TypeProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/typepb"; // A protocol buffer message type. message Type { // The fully qualified message name. string name = 1; // The list of fields. repeated Field fields = 2; // The list of types appearing in `oneof` definitions in this type. repeated string oneofs = 3; // The protocol buffer options. repeated Option options = 4; // The source context. SourceContext source_context = 5; // The source syntax. Syntax syntax = 6; } // A single field of a message type. message Field { // Basic field types. enum Kind { // Field type unknown. TYPE_UNKNOWN = 0; // Field type double. TYPE_DOUBLE = 1; // Field type float. TYPE_FLOAT = 2; // Field type int64. TYPE_INT64 = 3; // Field type uint64. TYPE_UINT64 = 4; // Field type int32. TYPE_INT32 = 5; // Field type fixed64. TYPE_FIXED64 = 6; // Field type fixed32. TYPE_FIXED32 = 7; // Field type bool. TYPE_BOOL = 8; // Field type string. TYPE_STRING = 9; // Field type group. Proto2 syntax only, and deprecated. TYPE_GROUP = 10; // Field type message. TYPE_MESSAGE = 11; // Field type bytes. TYPE_BYTES = 12; // Field type uint32. TYPE_UINT32 = 13; // Field type enum. TYPE_ENUM = 14; // Field type sfixed32. TYPE_SFIXED32 = 15; // Field type sfixed64. TYPE_SFIXED64 = 16; // Field type sint32. TYPE_SINT32 = 17; // Field type sint64. TYPE_SINT64 = 18; } // Whether a field is optional, required, or repeated. enum Cardinality { // For fields with unknown cardinality. CARDINALITY_UNKNOWN = 0; // For optional fields. CARDINALITY_OPTIONAL = 1; // For required fields. Proto2 syntax only. CARDINALITY_REQUIRED = 2; // For repeated fields. CARDINALITY_REPEATED = 3; } // The field type. Kind kind = 1; // The field cardinality. Cardinality cardinality = 2; // The field number. int32 number = 3; // The field name. string name = 4; // The field type URL, without the scheme, for message or enumeration // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. string type_url = 6; // The index of the field type in `Type.oneofs`, for message or enumeration // types. The first type has index 1; zero means the type is not in the list. int32 oneof_index = 7; // Whether to use alternative packed wire representation. bool packed = 8; // The protocol buffer options. repeated Option options = 9; // The field JSON name. string json_name = 10; // The string value of the default value of this field. Proto2 syntax only. string default_value = 11; } // Enum type definition. message Enum { // Enum type name. string name = 1; // Enum value definitions. repeated EnumValue enumvalue = 2; // Protocol buffer options. repeated Option options = 3; // The source context. SourceContext source_context = 4; // The source syntax. Syntax syntax = 5; } // Enum value definition. message EnumValue { // Enum value name. string name = 1; // Enum value number. int32 number = 2; // Protocol buffer options. repeated Option options = 3; } // A protocol buffer option, which can be attached to a message, field, // enumeration, etc. message Option { // The option's name. For protobuf built-in options (options defined in // descriptor.proto), this is the short name. For example, `"map_entry"`. // For custom options, it should be the fully-qualified name. For example, // `"google.api.http"`. string name = 1; // The option's value packed in an Any message. If the value is a primitive, // the corresponding wrapper type defined in google/protobuf/wrappers.proto // should be used. If the value is an enum, it should be stored as an int32 // value using the google.protobuf.Int32Value type. Any value = 2; } // The syntax in which a protocol buffer element is defined. enum Syntax { // Syntax `proto2`. SYNTAX_PROTO2 = 0; // Syntax `proto3`. SYNTAX_PROTO3 = 1; } ================================================ FILE: service/order/third_party/google/protobuf/wrappers.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Wrappers for primitive (non-message) types. These types are useful // for embedding primitives in the `google.protobuf.Any` type and for places // where we need to distinguish between the absence of a primitive // typed field and its default value. // // These wrappers have no meaningful use within repeated fields as they lack // the ability to detect presence on individual elements. // These wrappers have no meaningful use within a map or a oneof since // individual entries of a map or fields of a oneof can already detect presence. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; option java_package = "com.google.protobuf"; option java_outer_classname = "WrappersProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // Wrapper message for `double`. // // The JSON representation for `DoubleValue` is JSON number. message DoubleValue { // The double value. double value = 1; } // Wrapper message for `float`. // // The JSON representation for `FloatValue` is JSON number. message FloatValue { // The float value. float value = 1; } // Wrapper message for `int64`. // // The JSON representation for `Int64Value` is JSON string. message Int64Value { // The int64 value. int64 value = 1; } // Wrapper message for `uint64`. // // The JSON representation for `UInt64Value` is JSON string. message UInt64Value { // The uint64 value. uint64 value = 1; } // Wrapper message for `int32`. // // The JSON representation for `Int32Value` is JSON number. message Int32Value { // The int32 value. int32 value = 1; } // Wrapper message for `uint32`. // // The JSON representation for `UInt32Value` is JSON number. message UInt32Value { // The uint32 value. uint32 value = 1; } // Wrapper message for `bool`. // // The JSON representation for `BoolValue` is JSON `true` and `false`. message BoolValue { // The bool value. bool value = 1; } // Wrapper message for `string`. // // The JSON representation for `StringValue` is JSON string. message StringValue { // The string value. string value = 1; } // Wrapper message for `bytes`. // // The JSON representation for `BytesValue` is JSON string. message BytesValue { // The bytes value. bytes value = 1; } ================================================ FILE: service/order/third_party/openapi/v3/annotations.proto ================================================ // Copyright 2022 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package openapi.v3; import "openapiv3/OpenAPIv3.proto"; import "google/protobuf/descriptor.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "AnnotationsProto"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapi_v3"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; // The Go package name. option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; extend google.protobuf.FileOptions { Document document = 1143; } extend google.protobuf.MethodOptions { Operation operation = 1143; } extend google.protobuf.MessageOptions { Schema schema = 1143; } extend google.protobuf.FieldOptions { Schema property = 1143; } ================================================ FILE: service/order/third_party/openapi/v3/openapi.proto ================================================ // Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // THIS FILE IS AUTOMATICALLY GENERATED. syntax = "proto3"; package openapi.v3; import "google/protobuf/any.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "OpenAPIProto"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapi_v3"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; // The Go package name. option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; message AdditionalPropertiesItem { oneof oneof { SchemaOrReference schema_or_reference = 1; bool boolean = 2; } } message Any { google.protobuf.Any value = 1; string yaml = 2; } message AnyOrExpression { oneof oneof { Any any = 1; Expression expression = 2; } } // A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation. message Callback { repeated NamedPathItem path = 1; repeated NamedAny specification_extension = 2; } message CallbackOrReference { oneof oneof { Callback callback = 1; Reference reference = 2; } } message CallbacksOrReferences { repeated NamedCallbackOrReference additional_properties = 1; } // Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. message Components { SchemasOrReferences schemas = 1; ResponsesOrReferences responses = 2; ParametersOrReferences parameters = 3; ExamplesOrReferences examples = 4; RequestBodiesOrReferences request_bodies = 5; HeadersOrReferences headers = 6; SecuritySchemesOrReferences security_schemes = 7; LinksOrReferences links = 8; CallbacksOrReferences callbacks = 9; repeated NamedAny specification_extension = 10; } // Contact information for the exposed API. message Contact { string name = 1; string url = 2; string email = 3; repeated NamedAny specification_extension = 4; } message DefaultType { oneof oneof { double number = 1; bool boolean = 2; string string = 3; } } // When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it. When using the discriminator, _inline_ schemas will not be considered. message Discriminator { string property_name = 1; Strings mapping = 2; repeated NamedAny specification_extension = 3; } message Document { string openapi = 1; Info info = 2; repeated Server servers = 3; Paths paths = 4; Components components = 5; repeated SecurityRequirement security = 6; repeated Tag tags = 7; ExternalDocs external_docs = 8; repeated NamedAny specification_extension = 9; } // A single encoding definition applied to a single schema property. message Encoding { string content_type = 1; HeadersOrReferences headers = 2; string style = 3; bool explode = 4; bool allow_reserved = 5; repeated NamedAny specification_extension = 6; } message Encodings { repeated NamedEncoding additional_properties = 1; } message Example { string summary = 1; string description = 2; Any value = 3; string external_value = 4; repeated NamedAny specification_extension = 5; } message ExampleOrReference { oneof oneof { Example example = 1; Reference reference = 2; } } message ExamplesOrReferences { repeated NamedExampleOrReference additional_properties = 1; } message Expression { repeated NamedAny additional_properties = 1; } // Allows referencing an external resource for extended documentation. message ExternalDocs { string description = 1; string url = 2; repeated NamedAny specification_extension = 3; } // The Header Object follows the structure of the Parameter Object with the following changes: 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map. 1. `in` MUST NOT be specified, it is implicitly in `header`. 1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, `style`). message Header { string description = 1; bool required = 2; bool deprecated = 3; bool allow_empty_value = 4; string style = 5; bool explode = 6; bool allow_reserved = 7; SchemaOrReference schema = 8; Any example = 9; ExamplesOrReferences examples = 10; MediaTypes content = 11; repeated NamedAny specification_extension = 12; } message HeaderOrReference { oneof oneof { Header header = 1; Reference reference = 2; } } message HeadersOrReferences { repeated NamedHeaderOrReference additional_properties = 1; } // The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. message Info { string title = 1; string description = 2; string terms_of_service = 3; Contact contact = 4; License license = 5; string version = 6; repeated NamedAny specification_extension = 7; string summary = 8; } message ItemsItem { repeated SchemaOrReference schema_or_reference = 1; } // License information for the exposed API. message License { string name = 1; string url = 2; repeated NamedAny specification_extension = 3; } // The `Link object` represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations. Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response. For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation. message Link { string operation_ref = 1; string operation_id = 2; AnyOrExpression parameters = 3; AnyOrExpression request_body = 4; string description = 5; Server server = 6; repeated NamedAny specification_extension = 7; } message LinkOrReference { oneof oneof { Link link = 1; Reference reference = 2; } } message LinksOrReferences { repeated NamedLinkOrReference additional_properties = 1; } // Each Media Type Object provides schema and examples for the media type identified by its key. message MediaType { SchemaOrReference schema = 1; Any example = 2; ExamplesOrReferences examples = 3; Encodings encoding = 4; repeated NamedAny specification_extension = 5; } message MediaTypes { repeated NamedMediaType additional_properties = 1; } // Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. message NamedAny { // Map key string name = 1; // Mapped value Any value = 2; } // Automatically-generated message used to represent maps of CallbackOrReference as ordered (name,value) pairs. message NamedCallbackOrReference { // Map key string name = 1; // Mapped value CallbackOrReference value = 2; } // Automatically-generated message used to represent maps of Encoding as ordered (name,value) pairs. message NamedEncoding { // Map key string name = 1; // Mapped value Encoding value = 2; } // Automatically-generated message used to represent maps of ExampleOrReference as ordered (name,value) pairs. message NamedExampleOrReference { // Map key string name = 1; // Mapped value ExampleOrReference value = 2; } // Automatically-generated message used to represent maps of HeaderOrReference as ordered (name,value) pairs. message NamedHeaderOrReference { // Map key string name = 1; // Mapped value HeaderOrReference value = 2; } // Automatically-generated message used to represent maps of LinkOrReference as ordered (name,value) pairs. message NamedLinkOrReference { // Map key string name = 1; // Mapped value LinkOrReference value = 2; } // Automatically-generated message used to represent maps of MediaType as ordered (name,value) pairs. message NamedMediaType { // Map key string name = 1; // Mapped value MediaType value = 2; } // Automatically-generated message used to represent maps of ParameterOrReference as ordered (name,value) pairs. message NamedParameterOrReference { // Map key string name = 1; // Mapped value ParameterOrReference value = 2; } // Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. message NamedPathItem { // Map key string name = 1; // Mapped value PathItem value = 2; } // Automatically-generated message used to represent maps of RequestBodyOrReference as ordered (name,value) pairs. message NamedRequestBodyOrReference { // Map key string name = 1; // Mapped value RequestBodyOrReference value = 2; } // Automatically-generated message used to represent maps of ResponseOrReference as ordered (name,value) pairs. message NamedResponseOrReference { // Map key string name = 1; // Mapped value ResponseOrReference value = 2; } // Automatically-generated message used to represent maps of SchemaOrReference as ordered (name,value) pairs. message NamedSchemaOrReference { // Map key string name = 1; // Mapped value SchemaOrReference value = 2; } // Automatically-generated message used to represent maps of SecuritySchemeOrReference as ordered (name,value) pairs. message NamedSecuritySchemeOrReference { // Map key string name = 1; // Mapped value SecuritySchemeOrReference value = 2; } // Automatically-generated message used to represent maps of ServerVariable as ordered (name,value) pairs. message NamedServerVariable { // Map key string name = 1; // Mapped value ServerVariable value = 2; } // Automatically-generated message used to represent maps of string as ordered (name,value) pairs. message NamedString { // Map key string name = 1; // Mapped value string value = 2; } // Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. message NamedStringArray { // Map key string name = 1; // Mapped value StringArray value = 2; } // Configuration details for a supported OAuth Flow message OauthFlow { string authorization_url = 1; string token_url = 2; string refresh_url = 3; Strings scopes = 4; repeated NamedAny specification_extension = 5; } // Allows configuration of the supported OAuth Flows. message OauthFlows { OauthFlow implicit = 1; OauthFlow password = 2; OauthFlow client_credentials = 3; OauthFlow authorization_code = 4; repeated NamedAny specification_extension = 5; } message Object { repeated NamedAny additional_properties = 1; } // Describes a single API operation on a path. message Operation { repeated string tags = 1; string summary = 2; string description = 3; ExternalDocs external_docs = 4; string operation_id = 5; repeated ParameterOrReference parameters = 6; RequestBodyOrReference request_body = 7; Responses responses = 8; CallbacksOrReferences callbacks = 9; bool deprecated = 10; repeated SecurityRequirement security = 11; repeated Server servers = 12; repeated NamedAny specification_extension = 13; } // Describes a single operation parameter. A unique parameter is defined by a combination of a name and location. message Parameter { string name = 1; string in = 2; string description = 3; bool required = 4; bool deprecated = 5; bool allow_empty_value = 6; string style = 7; bool explode = 8; bool allow_reserved = 9; SchemaOrReference schema = 10; Any example = 11; ExamplesOrReferences examples = 12; MediaTypes content = 13; repeated NamedAny specification_extension = 14; } message ParameterOrReference { oneof oneof { Parameter parameter = 1; Reference reference = 2; } } message ParametersOrReferences { repeated NamedParameterOrReference additional_properties = 1; } // Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available. message PathItem { string _ref = 1; string summary = 2; string description = 3; Operation get = 4; Operation put = 5; Operation post = 6; Operation delete = 7; Operation options = 8; Operation head = 9; Operation patch = 10; Operation trace = 11; repeated Server servers = 12; repeated ParameterOrReference parameters = 13; repeated NamedAny specification_extension = 14; } // Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the `Server Object` in order to construct the full URL. The Paths MAY be empty, due to ACL constraints. message Paths { repeated NamedPathItem path = 1; repeated NamedAny specification_extension = 2; } message Properties { repeated NamedSchemaOrReference additional_properties = 1; } // A simple object to allow referencing other components in the specification, internally and externally. The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification. message Reference { string _ref = 1; string summary = 2; string description = 3; } message RequestBodiesOrReferences { repeated NamedRequestBodyOrReference additional_properties = 1; } // Describes a single request body. message RequestBody { string description = 1; MediaTypes content = 2; bool required = 3; repeated NamedAny specification_extension = 4; } message RequestBodyOrReference { oneof oneof { RequestBody request_body = 1; Reference reference = 2; } } // Describes a single response from an API Operation, including design-time, static `links` to operations based on the response. message Response { string description = 1; HeadersOrReferences headers = 2; MediaTypes content = 3; LinksOrReferences links = 4; repeated NamedAny specification_extension = 5; } message ResponseOrReference { oneof oneof { Response response = 1; Reference reference = 2; } } // A container for the expected responses of an operation. The container maps a HTTP response code to the expected response. The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors. The `default` MAY be used as a default response object for all HTTP codes that are not covered individually by the specification. The `Responses Object` MUST contain at least one response code, and it SHOULD be the response for a successful operation call. message Responses { ResponseOrReference default = 1; repeated NamedResponseOrReference response_or_reference = 2; repeated NamedAny specification_extension = 3; } message ResponsesOrReferences { repeated NamedResponseOrReference additional_properties = 1; } // The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the JSON Schema Specification Wright Draft 00. For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema. message Schema { bool nullable = 1; Discriminator discriminator = 2; bool read_only = 3; bool write_only = 4; Xml xml = 5; ExternalDocs external_docs = 6; Any example = 7; bool deprecated = 8; string title = 9; double multiple_of = 10; double maximum = 11; bool exclusive_maximum = 12; double minimum = 13; bool exclusive_minimum = 14; int64 max_length = 15; int64 min_length = 16; string pattern = 17; int64 max_items = 18; int64 min_items = 19; bool unique_items = 20; int64 max_properties = 21; int64 min_properties = 22; repeated string required = 23; repeated Any enum = 24; string type = 25; repeated SchemaOrReference all_of = 26; repeated SchemaOrReference one_of = 27; repeated SchemaOrReference any_of = 28; Schema not = 29; ItemsItem items = 30; Properties properties = 31; AdditionalPropertiesItem additional_properties = 32; DefaultType default = 33; string description = 34; string format = 35; repeated NamedAny specification_extension = 36; } message SchemaOrReference { oneof oneof { Schema schema = 1; Reference reference = 2; } } message SchemasOrReferences { repeated NamedSchemaOrReference additional_properties = 1; } // Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object. Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information. When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object, only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request. message SecurityRequirement { repeated NamedStringArray additional_properties = 1; } // Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect. Please note that currently (2019) the implicit flow is about to be deprecated OAuth 2.0 Security Best Current Practice. Recommended for most use case is Authorization Code Grant flow with PKCE. message SecurityScheme { string type = 1; string description = 2; string name = 3; string in = 4; string scheme = 5; string bearer_format = 6; OauthFlows flows = 7; string open_id_connect_url = 8; repeated NamedAny specification_extension = 9; } message SecuritySchemeOrReference { oneof oneof { SecurityScheme security_scheme = 1; Reference reference = 2; } } message SecuritySchemesOrReferences { repeated NamedSecuritySchemeOrReference additional_properties = 1; } // An object representing a Server. message Server { string url = 1; string description = 2; ServerVariables variables = 3; repeated NamedAny specification_extension = 4; } // An object representing a Server Variable for server URL template substitution. message ServerVariable { repeated string enum = 1; string default = 2; string description = 3; repeated NamedAny specification_extension = 4; } message ServerVariables { repeated NamedServerVariable additional_properties = 1; } // Any property starting with x- is valid. message SpecificationExtension { oneof oneof { double number = 1; bool boolean = 2; string string = 3; } } message StringArray { repeated string value = 1; } message Strings { repeated NamedString additional_properties = 1; } // Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. message Tag { string name = 1; string description = 2; ExternalDocs external_docs = 3; repeated NamedAny specification_extension = 4; } // A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior. message Xml { string name = 1; string namespace = 2; string prefix = 3; bool attribute = 4; bool wrapped = 5; repeated NamedAny specification_extension = 6; } ================================================ FILE: service/order/third_party/validate/README.md ================================================ # protoc-gen-validate (PGV) * https://github.com/envoyproxy/protoc-gen-validate ================================================ FILE: service/order/third_party/validate/validate.proto ================================================ syntax = "proto2"; package validate; option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; option java_package = "io.envoyproxy.pgv.validate"; import "google/protobuf/descriptor.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; // Validation rules applied at the message level extend google.protobuf.MessageOptions { // Disabled nullifies any validation rules for this message, including any // message fields associated with it that do support validation. optional bool disabled = 1071; // Ignore skips generation of validation methods for this message. optional bool ignored = 1072; } // Validation rules applied at the oneof level extend google.protobuf.OneofOptions { // Required ensures that exactly one the field options in a oneof is set; // validation fails if no fields in the oneof are set. optional bool required = 1071; } // Validation rules applied at the field level extend google.protobuf.FieldOptions { // Rules specify the validations to be performed on this field. By default, // no validation is performed against a field. optional FieldRules rules = 1071; } // FieldRules encapsulates the rules for each type of field. Depending on the // field, the correct set should be used to ensure proper validations. message FieldRules { optional MessageRules message = 17; oneof type { // Scalar Field Types FloatRules float = 1; DoubleRules double = 2; Int32Rules int32 = 3; Int64Rules int64 = 4; UInt32Rules uint32 = 5; UInt64Rules uint64 = 6; SInt32Rules sint32 = 7; SInt64Rules sint64 = 8; Fixed32Rules fixed32 = 9; Fixed64Rules fixed64 = 10; SFixed32Rules sfixed32 = 11; SFixed64Rules sfixed64 = 12; BoolRules bool = 13; StringRules string = 14; BytesRules bytes = 15; // Complex Field Types EnumRules enum = 16; RepeatedRules repeated = 18; MapRules map = 19; // Well-Known Field Types AnyRules any = 20; DurationRules duration = 21; TimestampRules timestamp = 22; } } // FloatRules describes the constraints applied to `float` values message FloatRules { // Const specifies that this field must be exactly the specified value optional float const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional float lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional float lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional float gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional float gte = 5; // In specifies that this field must be equal to one of the specified // values repeated float in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated float not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // DoubleRules describes the constraints applied to `double` values message DoubleRules { // Const specifies that this field must be exactly the specified value optional double const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional double lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional double lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional double gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional double gte = 5; // In specifies that this field must be equal to one of the specified // values repeated double in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated double not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int32Rules describes the constraints applied to `int32` values message Int32Rules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int64Rules describes the constraints applied to `int64` values message Int64Rules { // Const specifies that this field must be exactly the specified value optional int64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt32Rules describes the constraints applied to `uint32` values message UInt32Rules { // Const specifies that this field must be exactly the specified value optional uint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt64Rules describes the constraints applied to `uint64` values message UInt64Rules { // Const specifies that this field must be exactly the specified value optional uint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt32Rules describes the constraints applied to `sint32` values message SInt32Rules { // Const specifies that this field must be exactly the specified value optional sint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt64Rules describes the constraints applied to `sint64` values message SInt64Rules { // Const specifies that this field must be exactly the specified value optional sint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed32Rules describes the constraints applied to `fixed32` values message Fixed32Rules { // Const specifies that this field must be exactly the specified value optional fixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed64Rules describes the constraints applied to `fixed64` values message Fixed64Rules { // Const specifies that this field must be exactly the specified value optional fixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed32Rules describes the constraints applied to `sfixed32` values message SFixed32Rules { // Const specifies that this field must be exactly the specified value optional sfixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed64Rules describes the constraints applied to `sfixed64` values message SFixed64Rules { // Const specifies that this field must be exactly the specified value optional sfixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // BoolRules describes the constraints applied to `bool` values message BoolRules { // Const specifies that this field must be exactly the specified value optional bool const = 1; } // StringRules describe the constraints applied to `string` values message StringRules { // Const specifies that this field must be exactly the specified value optional string const = 1; // Len specifies that this field must be the specified number of // characters (Unicode code points). Note that the number of // characters may differ from the number of bytes in the string. optional uint64 len = 19; // MinLen specifies that this field must be the specified number of // characters (Unicode code points) at a minimum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of // characters (Unicode code points) at a maximum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 max_len = 3; // LenBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 len_bytes = 20; // MinBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_bytes = 4; // MaxBytes specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_bytes = 5; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 6; // Prefix specifies that this field must have the specified substring at // the beginning of the string. optional string prefix = 7; // Suffix specifies that this field must have the specified substring at // the end of the string. optional string suffix = 8; // Contains specifies that this field must have the specified substring // anywhere in the string. optional string contains = 9; // NotContains specifies that this field cannot have the specified substring // anywhere in the string. optional string not_contains = 23; // In specifies that this field must be equal to one of the specified // values repeated string in = 10; // NotIn specifies that this field cannot be equal to one of the specified // values repeated string not_in = 11; // WellKnown rules provide advanced constraints against common string // patterns oneof well_known { // Email specifies that the field must be a valid email address as // defined by RFC 5322 bool email = 12; // Hostname specifies that the field must be a valid hostname as // defined by RFC 1034. This constraint does not support // internationalized domain names (IDNs). bool hostname = 13; // Ip specifies that the field must be a valid IP (v4 or v6) address. // Valid IPv6 addresses should not include surrounding square brackets. bool ip = 14; // Ipv4 specifies that the field must be a valid IPv4 address. bool ipv4 = 15; // Ipv6 specifies that the field must be a valid IPv6 address. Valid // IPv6 addresses should not include surrounding square brackets. bool ipv6 = 16; // Uri specifies that the field must be a valid, absolute URI as defined // by RFC 3986 bool uri = 17; // UriRef specifies that the field must be a valid URI as defined by RFC // 3986 and may be relative or absolute. bool uri_ref = 18; // Address specifies that the field must be either a valid hostname as // defined by RFC 1034 (which does not support internationalized domain // names or IDNs), or it can be a valid IP (v4 or v6). bool address = 21; // Uuid specifies that the field must be a valid UUID as defined by // RFC 4122 bool uuid = 22; // WellKnownRegex specifies a common well known pattern defined as a regex. KnownRegex well_known_regex = 24; } // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable // strict header validation. // By default, this is true, and HTTP header validations are RFC-compliant. // Setting to false will enable a looser validations that only disallows // \r\n\0 characters, which can be used to bypass header matching rules. optional bool strict = 25 [default = true]; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 26; } // WellKnownRegex contain some well-known patterns. enum KnownRegex { UNKNOWN = 0; // HTTP header name as defined by RFC 7230. HTTP_HEADER_NAME = 1; // HTTP header value as defined by RFC 7230. HTTP_HEADER_VALUE = 2; } // BytesRules describe the constraints applied to `bytes` values message BytesRules { // Const specifies that this field must be exactly the specified value optional bytes const = 1; // Len specifies that this field must be the specified number of bytes optional uint64 len = 13; // MinLen specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_len = 3; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 4; // Prefix specifies that this field must have the specified bytes at the // beginning of the string. optional bytes prefix = 5; // Suffix specifies that this field must have the specified bytes at the // end of the string. optional bytes suffix = 6; // Contains specifies that this field must have the specified bytes // anywhere in the string. optional bytes contains = 7; // In specifies that this field must be equal to one of the specified // values repeated bytes in = 8; // NotIn specifies that this field cannot be equal to one of the specified // values repeated bytes not_in = 9; // WellKnown rules provide advanced constraints against common byte // patterns oneof well_known { // Ip specifies that the field must be a valid IP (v4 or v6) address in // byte format bool ip = 10; // Ipv4 specifies that the field must be a valid IPv4 address in byte // format bool ipv4 = 11; // Ipv6 specifies that the field must be a valid IPv6 address in byte // format bool ipv6 = 12; } // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 14; } // EnumRules describe the constraints applied to enum values message EnumRules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // DefinedOnly specifies that this field must be only one of the defined // values for this enum, failing on any undefined value. optional bool defined_only = 2; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 3; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 4; } // MessageRules describe the constraints applied to embedded message values. // For message-type fields, validation is performed recursively. message MessageRules { // Skip specifies that the validation rules of this field should not be // evaluated optional bool skip = 1; // Required specifies that this field must be set optional bool required = 2; } // RepeatedRules describe the constraints applied to `repeated` values message RepeatedRules { // MinItems specifies that this field must have the specified number of // items at a minimum optional uint64 min_items = 1; // MaxItems specifies that this field must have the specified number of // items at a maximum optional uint64 max_items = 2; // Unique specifies that all elements in this field must be unique. This // contraint is only applicable to scalar and enum types (messages are not // supported). optional bool unique = 3; // Items specifies the contraints to be applied to each item in the field. // Repeated message fields will still execute validation against each item // unless skip is specified here. optional FieldRules items = 4; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 5; } // MapRules describe the constraints applied to `map` values message MapRules { // MinPairs specifies that this field must have the specified number of // KVs at a minimum optional uint64 min_pairs = 1; // MaxPairs specifies that this field must have the specified number of // KVs at a maximum optional uint64 max_pairs = 2; // NoSparse specifies values in this field cannot be unset. This only // applies to map's with message value types. optional bool no_sparse = 3; // Keys specifies the constraints to be applied to each key in the field. optional FieldRules keys = 4; // Values specifies the constraints to be applied to the value of each key // in the field. Message values will still have their validations evaluated // unless skip is specified here. optional FieldRules values = 5; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 6; } // AnyRules describe constraints applied exclusively to the // `google.protobuf.Any` well-known type message AnyRules { // Required specifies that this field must be set optional bool required = 1; // In specifies that this field's `type_url` must be equal to one of the // specified values. repeated string in = 2; // NotIn specifies that this field's `type_url` must not be equal to any of // the specified values. repeated string not_in = 3; } // DurationRules describe the constraints applied exclusively to the // `google.protobuf.Duration` well-known type message DurationRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Duration const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Duration lt = 3; // Lt specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Duration lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Duration gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Duration gte = 6; // In specifies that this field must be equal to one of the specified // values repeated google.protobuf.Duration in = 7; // NotIn specifies that this field cannot be equal to one of the specified // values repeated google.protobuf.Duration not_in = 8; } // TimestampRules describe the constraints applied exclusively to the // `google.protobuf.Timestamp` well-known type message TimestampRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Timestamp const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Timestamp lt = 3; // Lte specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Timestamp lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Timestamp gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Timestamp gte = 6; // LtNow specifies that this must be less than the current time. LtNow // can only be used with the Within rule. optional bool lt_now = 7; // GtNow specifies that this must be greater than the current time. GtNow // can only be used with the Within rule. optional bool gt_now = 8; // Within specifies that this field must be within this duration of the // current time. This constraint can be used alone or with the LtNow and // GtNow rules. optional google.protobuf.Duration within = 9; } ================================================ FILE: service/user/.gitignore ================================================ # Reference https://github.com/github/gitignore/blob/master/Go.gitignore # Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Dependency directories (remove the comment below to include it) vendor/ # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # OS General Thumbs.db .DS_Store # project *.cert *.key *.log bin/ # Develop tools .vscode/ .idea/ *.swp ================================================ FILE: service/user/Dockerfile ================================================ FROM golang:1.16 AS builder COPY . /src WORKDIR /src RUN GOPROXY=https://goproxy.cn make build FROM debian:stable-slim RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/ \ && apt-get autoremove -y && apt-get autoclean -y COPY --from=builder /src/bin /app WORKDIR /app EXPOSE 8000 EXPOSE 9000 VOLUME /data/conf CMD ["./server", "-conf", "/data/conf"] ================================================ FILE: service/user/LICENSE ================================================ MIT License Copyright (c) 2020 go-kratos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: service/user/Makefile ================================================ GOPATH:=$(shell go env GOPATH) VERSION=$(shell git describe --tags --always) INTERNAL_PROTO_FILES=$(shell find internal -name *.proto) API_PROTO_FILES=$(shell find api -name *.proto) .PHONY: init # init env init: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest go install github.com/go-kratos/kratos/cmd/kratos/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest go install github.com/google/gnostic/cmd/protoc-gen-openapi@v0.6.1 .PHONY: errors # generate errors code errors: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ --go-errors_out=paths=source_relative:. \ $(API_PROTO_FILES) .PHONY: config # generate internal proto config: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ $(INTERNAL_PROTO_FILES) .PHONY: api # generate api proto api: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ --go-http_out=paths=source_relative:. \ --go-grpc_out=paths=source_relative:. \ --openapi_out==paths=source_relative:. \ --validate_out=paths=source_relative,lang=go:. \ $(API_PROTO_FILES) .PHONY: build # build build: mkdir -p bin/ && go build -ldflags "-X main.Version=$(VERSION)" -o ./bin/ ./... .PHONY: generate # generate generate: go generate ./... # wire wire: cd cmd/user/ && wire .PHONY: test # 快速测试,运行repo以外的所有测试 test: ginkgo -r -cover -v . .PHONY: all # generate all all: make api; make errors; make config; make generate; # show help help: @echo '' @echo 'Usage:' @echo ' make [target]' @echo '' @echo 'Targets:' @awk '/^[a-zA-Z\-\_0-9]+:/ { \ helpMessage = match(lastLine, /^# (.*)/); \ if (helpMessage) { \ helpCommand = substr($$1, 0, index($$1, ":")-1); \ helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ } \ } \ { lastLine = $$0 }' $(MAKEFILE_LIST) .DEFAULT_GOAL := help ================================================ FILE: service/user/README.md ================================================ user service ================================================ FILE: service/user/api/user/v1/error_reason.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: api/user/v1/error_reason.proto package v1 import ( _ "github.com/go-kratos/kratos/v2/errors" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ErrorReason int32 const ( ErrorReason_USER_NOT_FOUND ErrorReason = 0 ErrorReason_CONTENT_MISSING ErrorReason = 1 ) // Enum value maps for ErrorReason. var ( ErrorReason_name = map[int32]string{ 0: "USER_NOT_FOUND", 1: "CONTENT_MISSING", } ErrorReason_value = map[string]int32{ "USER_NOT_FOUND": 0, "CONTENT_MISSING": 1, } ) func (x ErrorReason) Enum() *ErrorReason { p := new(ErrorReason) *p = x return p } func (x ErrorReason) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ErrorReason) Descriptor() protoreflect.EnumDescriptor { return file_api_user_v1_error_reason_proto_enumTypes[0].Descriptor() } func (ErrorReason) Type() protoreflect.EnumType { return &file_api_user_v1_error_reason_proto_enumTypes[0] } func (x ErrorReason) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ErrorReason.Descriptor instead. func (ErrorReason) EnumDescriptor() ([]byte, []int) { return file_api_user_v1_error_reason_proto_rawDescGZIP(), []int{0} } var File_api_user_v1_error_reason_proto protoreflect.FileDescriptor var file_api_user_v1_error_reason_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0x48, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x1a, 0x04, 0xa8, 0x45, 0x94, 0x03, 0x12, 0x19, 0x0a, 0x0f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x42, 0x25, 0x5a, 0x13, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0xa2, 0x02, 0x0d, 0x41, 0x50, 0x49, 0x55, 0x73, 0x65, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_api_user_v1_error_reason_proto_rawDescOnce sync.Once file_api_user_v1_error_reason_proto_rawDescData = file_api_user_v1_error_reason_proto_rawDesc ) func file_api_user_v1_error_reason_proto_rawDescGZIP() []byte { file_api_user_v1_error_reason_proto_rawDescOnce.Do(func() { file_api_user_v1_error_reason_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_user_v1_error_reason_proto_rawDescData) }) return file_api_user_v1_error_reason_proto_rawDescData } var file_api_user_v1_error_reason_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_api_user_v1_error_reason_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: user.v1.ErrorReason } var file_api_user_v1_error_reason_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_api_user_v1_error_reason_proto_init() } func file_api_user_v1_error_reason_proto_init() { if File_api_user_v1_error_reason_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_user_v1_error_reason_proto_rawDesc, NumEnums: 1, NumMessages: 0, NumExtensions: 0, NumServices: 0, }, GoTypes: file_api_user_v1_error_reason_proto_goTypes, DependencyIndexes: file_api_user_v1_error_reason_proto_depIdxs, EnumInfos: file_api_user_v1_error_reason_proto_enumTypes, }.Build() File_api_user_v1_error_reason_proto = out.File file_api_user_v1_error_reason_proto_rawDesc = nil file_api_user_v1_error_reason_proto_goTypes = nil file_api_user_v1_error_reason_proto_depIdxs = nil } ================================================ FILE: service/user/api/user/v1/error_reason.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: api/user/v1/error_reason.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) ================================================ FILE: service/user/api/user/v1/error_reason.proto ================================================ syntax = "proto3"; package user.v1; import "errors/errors.proto"; option go_package = "user/api/user/v1;v1"; option objc_class_prefix = "APIUserErrors"; enum ErrorReason { option (errors.default_code) = 500; USER_NOT_FOUND = 0 [(errors.code) = 404]; CONTENT_MISSING = 1 [(errors.code) = 400]; } ================================================ FILE: service/user/api/user/v1/error_reason_errors.pb.go ================================================ // Code generated by protoc-gen-go-errors. DO NOT EDIT. package v1 import ( fmt "fmt" errors "github.com/go-kratos/kratos/v2/errors" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the kratos package it is being compiled against. const _ = errors.SupportPackageIsVersion1 func IsUserNotFound(err error) bool { if err == nil { return false } e := errors.FromError(err) return e.Reason == ErrorReason_USER_NOT_FOUND.String() && e.Code == 404 } func ErrorUserNotFound(format string, args ...interface{}) *errors.Error { return errors.New(404, ErrorReason_USER_NOT_FOUND.String(), fmt.Sprintf(format, args...)) } func IsContentMissing(err error) bool { if err == nil { return false } e := errors.FromError(err) return e.Reason == ErrorReason_CONTENT_MISSING.String() && e.Code == 400 } func ErrorContentMissing(format string, args ...interface{}) *errors.Error { return errors.New(400, ErrorReason_CONTENT_MISSING.String(), fmt.Sprintf(format, args...)) } ================================================ FILE: service/user/api/user/v1/user.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 // source: api/user/v1/user.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ListAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *ListAddressReq) Reset() { *x = ListAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReq) ProtoMessage() {} func (x *ListAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_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 ListAddressReq.ProtoReflect.Descriptor instead. func (*ListAddressReq) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{0} } func (x *ListAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type AddressInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *AddressInfo) Reset() { *x = AddressInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressInfo) ProtoMessage() {} func (x *AddressInfo) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_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 AddressInfo.ProtoReflect.Descriptor instead. func (*AddressInfo) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{1} } func (x *AddressInfo) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressInfo) GetName() string { if x != nil { return x.Name } return "" } func (x *AddressInfo) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *AddressInfo) GetProvince() string { if x != nil { return x.Province } return "" } func (x *AddressInfo) GetCity() string { if x != nil { return x.City } return "" } func (x *AddressInfo) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *AddressInfo) GetAddress() string { if x != nil { return x.Address } return "" } func (x *AddressInfo) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *AddressInfo) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type ListAddressReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Results []*AddressInfo `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } func (x *ListAddressReply) Reset() { *x = ListAddressReply{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReply) ProtoMessage() {} func (x *ListAddressReply) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_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 ListAddressReply.ProtoReflect.Descriptor instead. func (*ListAddressReply) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{2} } func (x *ListAddressReply) GetResults() []*AddressInfo { if x != nil { return x.Results } return nil } type CreateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *CreateAddressReq) Reset() { *x = CreateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateAddressReq) ProtoMessage() {} func (x *CreateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_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 CreateAddressReq.ProtoReflect.Descriptor instead. func (*CreateAddressReq) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{3} } func (x *CreateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *CreateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *CreateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *CreateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *CreateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *CreateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *CreateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *CreateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *CreateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type UpdateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` Id int64 `protobuf:"varint,10,opt,name=id,proto3" json:"id,omitempty"` } func (x *UpdateAddressReq) Reset() { *x = UpdateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateAddressReq) ProtoMessage() {} func (x *UpdateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use UpdateAddressReq.ProtoReflect.Descriptor instead. func (*UpdateAddressReq) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{4} } func (x *UpdateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *UpdateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *UpdateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UpdateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *UpdateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *UpdateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *UpdateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *UpdateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *UpdateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } func (x *UpdateAddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } type AddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Uid int64 `protobuf:"varint,2,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *AddressReq) Reset() { *x = AddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressReq) ProtoMessage() {} func (x *AddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AddressReq.ProtoReflect.Descriptor instead. func (*AddressReq) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{5} } func (x *AddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type CheckResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } func (x *CheckResponse) Reset() { *x = CheckResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CheckResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CheckResponse) ProtoMessage() {} func (x *CheckResponse) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[6] 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 CheckResponse.ProtoReflect.Descriptor instead. func (*CheckResponse) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{6} } func (x *CheckResponse) GetSuccess() bool { if x != nil { return x.Success } return false } // 分页 type PageInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Pn uint32 `protobuf:"varint,1,opt,name=pn,proto3" json:"pn,omitempty"` PSize uint32 `protobuf:"varint,2,opt,name=pSize,proto3" json:"pSize,omitempty"` } func (x *PageInfo) Reset() { *x = PageInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PageInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*PageInfo) ProtoMessage() {} func (x *PageInfo) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[7] 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 PageInfo.ProtoReflect.Descriptor instead. func (*PageInfo) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{7} } func (x *PageInfo) GetPn() uint32 { if x != nil { return x.Pn } return 0 } func (x *PageInfo) GetPSize() uint32 { if x != nil { return x.PSize } return 0 } // 用户信息 type UserInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` NickName string `protobuf:"bytes,4,opt,name=nickName,proto3" json:"nickName,omitempty"` Birthday uint64 `protobuf:"varint,5,opt,name=birthday,proto3" json:"birthday,omitempty"` Gender string `protobuf:"bytes,6,opt,name=gender,proto3" json:"gender,omitempty"` Role int32 `protobuf:"varint,7,opt,name=role,proto3" json:"role,omitempty"` } func (x *UserInfoResponse) Reset() { *x = UserInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UserInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*UserInfoResponse) ProtoMessage() {} func (x *UserInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[8] 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 UserInfoResponse.ProtoReflect.Descriptor instead. func (*UserInfoResponse) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{8} } func (x *UserInfoResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UserInfoResponse) GetPassword() string { if x != nil { return x.Password } return "" } func (x *UserInfoResponse) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UserInfoResponse) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *UserInfoResponse) GetBirthday() uint64 { if x != nil { return x.Birthday } return 0 } func (x *UserInfoResponse) GetGender() string { if x != nil { return x.Gender } return "" } func (x *UserInfoResponse) GetRole() int32 { if x != nil { return x.Role } return 0 } // 用户列表 type UserListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Data []*UserInfoResponse `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` } func (x *UserListResponse) Reset() { *x = UserListResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UserListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*UserListResponse) ProtoMessage() {} func (x *UserListResponse) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[9] 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 UserListResponse.ProtoReflect.Descriptor instead. func (*UserListResponse) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{9} } func (x *UserListResponse) GetTotal() int32 { if x != nil { return x.Total } return 0 } func (x *UserListResponse) GetData() []*UserInfoResponse { if x != nil { return x.Data } return nil } type MobileRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"` } func (x *MobileRequest) Reset() { *x = MobileRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *MobileRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*MobileRequest) ProtoMessage() {} func (x *MobileRequest) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[10] 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 MobileRequest.ProtoReflect.Descriptor instead. func (*MobileRequest) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{10} } func (x *MobileRequest) GetMobile() string { if x != nil { return x.Mobile } return "" } type IdRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *IdRequest) Reset() { *x = IdRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *IdRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*IdRequest) ProtoMessage() {} func (x *IdRequest) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[11] 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 IdRequest.ProtoReflect.Descriptor instead. func (*IdRequest) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{11} } func (x *IdRequest) GetId() int64 { if x != nil { return x.Id } return 0 } // 创建用户 type CreateUserInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields NickName string `protobuf:"bytes,1,opt,name=nickName,proto3" json:"nickName,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` } func (x *CreateUserInfo) Reset() { *x = CreateUserInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateUserInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateUserInfo) ProtoMessage() {} func (x *CreateUserInfo) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[12] 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 CreateUserInfo.ProtoReflect.Descriptor instead. func (*CreateUserInfo) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{12} } func (x *CreateUserInfo) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *CreateUserInfo) GetPassword() string { if x != nil { return x.Password } return "" } func (x *CreateUserInfo) GetMobile() string { if x != nil { return x.Mobile } return "" } type UpdateUserInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` NickName string `protobuf:"bytes,2,opt,name=nickName,proto3" json:"nickName,omitempty"` Gender string `protobuf:"bytes,3,opt,name=gender,proto3" json:"gender,omitempty"` Birthday uint64 `protobuf:"varint,4,opt,name=birthday,proto3" json:"birthday,omitempty"` } func (x *UpdateUserInfo) Reset() { *x = UpdateUserInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateUserInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateUserInfo) ProtoMessage() {} func (x *UpdateUserInfo) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[13] 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 UpdateUserInfo.ProtoReflect.Descriptor instead. func (*UpdateUserInfo) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{13} } func (x *UpdateUserInfo) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UpdateUserInfo) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *UpdateUserInfo) GetGender() string { if x != nil { return x.Gender } return "" } func (x *UpdateUserInfo) GetBirthday() uint64 { if x != nil { return x.Birthday } return 0 } type PasswordCheckInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` EncryptedPassword string `protobuf:"bytes,2,opt,name=encryptedPassword,proto3" json:"encryptedPassword,omitempty"` } func (x *PasswordCheckInfo) Reset() { *x = PasswordCheckInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_user_v1_user_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PasswordCheckInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*PasswordCheckInfo) ProtoMessage() {} func (x *PasswordCheckInfo) ProtoReflect() protoreflect.Message { mi := &file_api_user_v1_user_proto_msgTypes[14] 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 PasswordCheckInfo.ProtoReflect.Descriptor instead. func (*PasswordCheckInfo) Descriptor() ([]byte, []int) { return file_api_user_v1_user_proto_rawDescGZIP(), []int{14} } func (x *PasswordCheckInfo) GetPassword() string { if x != nil { return x.Password } return "" } func (x *PasswordCheckInfo) GetEncryptedPassword() string { if x != nil { return x.EncryptedPassword } return "" } var File_api_user_v1_user_proto protoreflect.FileDescriptor var file_api_user_v1_user_proto_rawDesc = []byte{ 0x0a, 0x16, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x22, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0xed, 0x01, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x42, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xf4, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x84, 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x30, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x70, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xba, 0x01, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x57, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x27, 0x0a, 0x0d, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x22, 0x1b, 0x0a, 0x09, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x60, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x22, 0x70, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x22, 0x5d, 0x0a, 0x11, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0xa4, 0x06, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x12, 0x12, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x42, 0x15, 0x5a, 0x13, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_api_user_v1_user_proto_rawDescOnce sync.Once file_api_user_v1_user_proto_rawDescData = file_api_user_v1_user_proto_rawDesc ) func file_api_user_v1_user_proto_rawDescGZIP() []byte { file_api_user_v1_user_proto_rawDescOnce.Do(func() { file_api_user_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_user_v1_user_proto_rawDescData) }) return file_api_user_v1_user_proto_rawDescData } var file_api_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_api_user_v1_user_proto_goTypes = []interface{}{ (*ListAddressReq)(nil), // 0: user.v1.ListAddressReq (*AddressInfo)(nil), // 1: user.v1.AddressInfo (*ListAddressReply)(nil), // 2: user.v1.ListAddressReply (*CreateAddressReq)(nil), // 3: user.v1.CreateAddressReq (*UpdateAddressReq)(nil), // 4: user.v1.UpdateAddressReq (*AddressReq)(nil), // 5: user.v1.AddressReq (*CheckResponse)(nil), // 6: user.v1.CheckResponse (*PageInfo)(nil), // 7: user.v1.PageInfo (*UserInfoResponse)(nil), // 8: user.v1.UserInfoResponse (*UserListResponse)(nil), // 9: user.v1.UserListResponse (*MobileRequest)(nil), // 10: user.v1.MobileRequest (*IdRequest)(nil), // 11: user.v1.IdRequest (*CreateUserInfo)(nil), // 12: user.v1.CreateUserInfo (*UpdateUserInfo)(nil), // 13: user.v1.UpdateUserInfo (*PasswordCheckInfo)(nil), // 14: user.v1.PasswordCheckInfo (*emptypb.Empty)(nil), // 15: google.protobuf.Empty } var file_api_user_v1_user_proto_depIdxs = []int32{ 1, // 0: user.v1.ListAddressReply.results:type_name -> user.v1.AddressInfo 8, // 1: user.v1.UserListResponse.data:type_name -> user.v1.UserInfoResponse 7, // 2: user.v1.User.GetUserList:input_type -> user.v1.PageInfo 10, // 3: user.v1.User.GetUserByMobile:input_type -> user.v1.MobileRequest 11, // 4: user.v1.User.GetUserById:input_type -> user.v1.IdRequest 12, // 5: user.v1.User.CreateUser:input_type -> user.v1.CreateUserInfo 13, // 6: user.v1.User.UpdateUser:input_type -> user.v1.UpdateUserInfo 14, // 7: user.v1.User.CheckPassword:input_type -> user.v1.PasswordCheckInfo 0, // 8: user.v1.User.ListAddress:input_type -> user.v1.ListAddressReq 3, // 9: user.v1.User.CreateAddress:input_type -> user.v1.CreateAddressReq 4, // 10: user.v1.User.UpdateAddress:input_type -> user.v1.UpdateAddressReq 5, // 11: user.v1.User.DefaultAddress:input_type -> user.v1.AddressReq 5, // 12: user.v1.User.DeleteAddress:input_type -> user.v1.AddressReq 5, // 13: user.v1.User.GetAddress:input_type -> user.v1.AddressReq 9, // 14: user.v1.User.GetUserList:output_type -> user.v1.UserListResponse 8, // 15: user.v1.User.GetUserByMobile:output_type -> user.v1.UserInfoResponse 8, // 16: user.v1.User.GetUserById:output_type -> user.v1.UserInfoResponse 8, // 17: user.v1.User.CreateUser:output_type -> user.v1.UserInfoResponse 15, // 18: user.v1.User.UpdateUser:output_type -> google.protobuf.Empty 6, // 19: user.v1.User.CheckPassword:output_type -> user.v1.CheckResponse 2, // 20: user.v1.User.ListAddress:output_type -> user.v1.ListAddressReply 1, // 21: user.v1.User.CreateAddress:output_type -> user.v1.AddressInfo 6, // 22: user.v1.User.UpdateAddress:output_type -> user.v1.CheckResponse 6, // 23: user.v1.User.DefaultAddress:output_type -> user.v1.CheckResponse 6, // 24: user.v1.User.DeleteAddress:output_type -> user.v1.CheckResponse 1, // 25: user.v1.User.GetAddress:output_type -> user.v1.AddressInfo 14, // [14:26] is the sub-list for method output_type 2, // [2:14] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } func init() { file_api_user_v1_user_proto_init() } func file_api_user_v1_user_proto_init() { if File_api_user_v1_user_proto != nil { return } if !protoimpl.UnsafeEnabled { file_api_user_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PageInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MobileRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IdRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateUserInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateUserInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_user_v1_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PasswordCheckInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_user_v1_user_proto_rawDesc, NumEnums: 0, NumMessages: 15, NumExtensions: 0, NumServices: 1, }, GoTypes: file_api_user_v1_user_proto_goTypes, DependencyIndexes: file_api_user_v1_user_proto_depIdxs, MessageInfos: file_api_user_v1_user_proto_msgTypes, }.Build() File_api_user_v1_user_proto = out.File file_api_user_v1_user_proto_rawDesc = nil file_api_user_v1_user_proto_goTypes = nil file_api_user_v1_user_proto_depIdxs = nil } ================================================ FILE: service/user/api/user/v1/user.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: api/user/v1/user.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on ListAddressReq 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 *ListAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReq 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 ListAddressReqMultiError, // or nil if none found. func (m *ListAddressReq) ValidateAll() error { return m.validate(true) } func (m *ListAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid if len(errors) > 0 { return ListAddressReqMultiError(errors) } return nil } // ListAddressReqMultiError is an error wrapping multiple validation errors // returned by ListAddressReq.ValidateAll() if the designated constraints // aren't met. type ListAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReqMultiError) 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 ListAddressReqMultiError) AllErrors() []error { return m } // ListAddressReqValidationError is the validation error returned by // ListAddressReq.Validate if the designated constraints aren't met. type ListAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReqValidationError) ErrorName() string { return "ListAddressReqValidationError" } // Error satisfies the builtin error interface func (e ListAddressReqValidationError) 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 %sListAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReqValidationError{} // Validate checks the field values on AddressInfo 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 *AddressInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressInfo 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 AddressInfoMultiError, or // nil if none found. func (m *AddressInfo) ValidateAll() error { return m.validate(true) } func (m *AddressInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return AddressInfoMultiError(errors) } return nil } // AddressInfoMultiError is an error wrapping multiple validation errors // returned by AddressInfo.ValidateAll() if the designated constraints aren't met. type AddressInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressInfoMultiError) 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 AddressInfoMultiError) AllErrors() []error { return m } // AddressInfoValidationError is the validation error returned by // AddressInfo.Validate if the designated constraints aren't met. type AddressInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressInfoValidationError) ErrorName() string { return "AddressInfoValidationError" } // Error satisfies the builtin error interface func (e AddressInfoValidationError) 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 %sAddressInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressInfoValidationError{} // Validate checks the field values on ListAddressReply 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 *ListAddressReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReply 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 // ListAddressReplyMultiError, or nil if none found. func (m *ListAddressReply) ValidateAll() error { return m.validate(true) } func (m *ListAddressReply) validate(all bool) error { if m == nil { return nil } var errors []error for idx, item := range m.GetResults() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%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 ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return ListAddressReplyMultiError(errors) } return nil } // ListAddressReplyMultiError is an error wrapping multiple validation errors // returned by ListAddressReply.ValidateAll() if the designated constraints // aren't met. type ListAddressReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReplyMultiError) 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 ListAddressReplyMultiError) AllErrors() []error { return m } // ListAddressReplyValidationError is the validation error returned by // ListAddressReply.Validate if the designated constraints aren't met. type ListAddressReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReplyValidationError) ErrorName() string { return "ListAddressReplyValidationError" } // Error satisfies the builtin error interface func (e ListAddressReplyValidationError) 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 %sListAddressReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReplyValidationError{} // Validate checks the field values on CreateAddressReq 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 *CreateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateAddressReq 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 // CreateAddressReqMultiError, or nil if none found. func (m *CreateAddressReq) ValidateAll() error { return m.validate(true) } func (m *CreateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return CreateAddressReqMultiError(errors) } return nil } // CreateAddressReqMultiError is an error wrapping multiple validation errors // returned by CreateAddressReq.ValidateAll() if the designated constraints // aren't met. type CreateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateAddressReqMultiError) 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 CreateAddressReqMultiError) AllErrors() []error { return m } // CreateAddressReqValidationError is the validation error returned by // CreateAddressReq.Validate if the designated constraints aren't met. type CreateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateAddressReqValidationError) ErrorName() string { return "CreateAddressReqValidationError" } // Error satisfies the builtin error interface func (e CreateAddressReqValidationError) 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 %sCreateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateAddressReqValidationError{} // Validate checks the field values on UpdateAddressReq 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 *UpdateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateAddressReq 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 // UpdateAddressReqMultiError, or nil if none found. func (m *UpdateAddressReq) ValidateAll() error { return m.validate(true) } func (m *UpdateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault // no validation rules for Id if len(errors) > 0 { return UpdateAddressReqMultiError(errors) } return nil } // UpdateAddressReqMultiError is an error wrapping multiple validation errors // returned by UpdateAddressReq.ValidateAll() if the designated constraints // aren't met. type UpdateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateAddressReqMultiError) 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 UpdateAddressReqMultiError) AllErrors() []error { return m } // UpdateAddressReqValidationError is the validation error returned by // UpdateAddressReq.Validate if the designated constraints aren't met. type UpdateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateAddressReqValidationError) ErrorName() string { return "UpdateAddressReqValidationError" } // Error satisfies the builtin error interface func (e UpdateAddressReqValidationError) 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 %sUpdateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateAddressReqValidationError{} // Validate checks the field values on AddressReq 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 *AddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressReq 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 AddressReqMultiError, or // nil if none found. func (m *AddressReq) ValidateAll() error { return m.validate(true) } func (m *AddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Uid if len(errors) > 0 { return AddressReqMultiError(errors) } return nil } // AddressReqMultiError is an error wrapping multiple validation errors // returned by AddressReq.ValidateAll() if the designated constraints aren't met. type AddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressReqMultiError) 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 AddressReqMultiError) AllErrors() []error { return m } // AddressReqValidationError is the validation error returned by // AddressReq.Validate if the designated constraints aren't met. type AddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressReqValidationError) ErrorName() string { return "AddressReqValidationError" } // Error satisfies the builtin error interface func (e AddressReqValidationError) 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 %sAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressReqValidationError{} // Validate checks the field values on CheckResponse 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 *CheckResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CheckResponse 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 CheckResponseMultiError, or // nil if none found. func (m *CheckResponse) ValidateAll() error { return m.validate(true) } func (m *CheckResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Success if len(errors) > 0 { return CheckResponseMultiError(errors) } return nil } // CheckResponseMultiError is an error wrapping multiple validation errors // returned by CheckResponse.ValidateAll() if the designated constraints // aren't met. type CheckResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CheckResponseMultiError) 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 CheckResponseMultiError) AllErrors() []error { return m } // CheckResponseValidationError is the validation error returned by // CheckResponse.Validate if the designated constraints aren't met. type CheckResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CheckResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CheckResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CheckResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CheckResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CheckResponseValidationError) ErrorName() string { return "CheckResponseValidationError" } // Error satisfies the builtin error interface func (e CheckResponseValidationError) 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 %sCheckResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CheckResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CheckResponseValidationError{} // Validate checks the field values on PageInfo 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 *PageInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PageInfo 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 PageInfoMultiError, or nil // if none found. func (m *PageInfo) ValidateAll() error { return m.validate(true) } func (m *PageInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Pn // no validation rules for PSize if len(errors) > 0 { return PageInfoMultiError(errors) } return nil } // PageInfoMultiError is an error wrapping multiple validation errors returned // by PageInfo.ValidateAll() if the designated constraints aren't met. type PageInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PageInfoMultiError) 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 PageInfoMultiError) AllErrors() []error { return m } // PageInfoValidationError is the validation error returned by // PageInfo.Validate if the designated constraints aren't met. type PageInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PageInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PageInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PageInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PageInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PageInfoValidationError) ErrorName() string { return "PageInfoValidationError" } // Error satisfies the builtin error interface func (e PageInfoValidationError) 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 %sPageInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PageInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PageInfoValidationError{} // Validate checks the field values on UserInfoResponse 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 *UserInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UserInfoResponse 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 // UserInfoResponseMultiError, or nil if none found. func (m *UserInfoResponse) ValidateAll() error { return m.validate(true) } func (m *UserInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Password // no validation rules for Mobile // no validation rules for NickName // no validation rules for Birthday // no validation rules for Gender // no validation rules for Role if len(errors) > 0 { return UserInfoResponseMultiError(errors) } return nil } // UserInfoResponseMultiError is an error wrapping multiple validation errors // returned by UserInfoResponse.ValidateAll() if the designated constraints // aren't met. type UserInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UserInfoResponseMultiError) 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 UserInfoResponseMultiError) AllErrors() []error { return m } // UserInfoResponseValidationError is the validation error returned by // UserInfoResponse.Validate if the designated constraints aren't met. type UserInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UserInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UserInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UserInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UserInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UserInfoResponseValidationError) ErrorName() string { return "UserInfoResponseValidationError" } // Error satisfies the builtin error interface func (e UserInfoResponseValidationError) 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 %sUserInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UserInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UserInfoResponseValidationError{} // Validate checks the field values on UserListResponse 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 *UserListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UserListResponse 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 // UserListResponseMultiError, or nil if none found. func (m *UserListResponse) ValidateAll() error { return m.validate(true) } func (m *UserListResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Total for idx, item := range m.GetData() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, UserListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, UserListResponseValidationError{ field: fmt.Sprintf("Data[%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 UserListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return UserListResponseMultiError(errors) } return nil } // UserListResponseMultiError is an error wrapping multiple validation errors // returned by UserListResponse.ValidateAll() if the designated constraints // aren't met. type UserListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UserListResponseMultiError) 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 UserListResponseMultiError) AllErrors() []error { return m } // UserListResponseValidationError is the validation error returned by // UserListResponse.Validate if the designated constraints aren't met. type UserListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UserListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UserListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UserListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UserListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UserListResponseValidationError) ErrorName() string { return "UserListResponseValidationError" } // Error satisfies the builtin error interface func (e UserListResponseValidationError) 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 %sUserListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UserListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UserListResponseValidationError{} // Validate checks the field values on MobileRequest 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 *MobileRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on MobileRequest 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 MobileRequestMultiError, or // nil if none found. func (m *MobileRequest) ValidateAll() error { return m.validate(true) } func (m *MobileRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Mobile if len(errors) > 0 { return MobileRequestMultiError(errors) } return nil } // MobileRequestMultiError is an error wrapping multiple validation errors // returned by MobileRequest.ValidateAll() if the designated constraints // aren't met. type MobileRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m MobileRequestMultiError) 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 MobileRequestMultiError) AllErrors() []error { return m } // MobileRequestValidationError is the validation error returned by // MobileRequest.Validate if the designated constraints aren't met. type MobileRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e MobileRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e MobileRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e MobileRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e MobileRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e MobileRequestValidationError) ErrorName() string { return "MobileRequestValidationError" } // Error satisfies the builtin error interface func (e MobileRequestValidationError) 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 %sMobileRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = MobileRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = MobileRequestValidationError{} // Validate checks the field values on IdRequest 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 *IdRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on IdRequest 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 IdRequestMultiError, or nil // if none found. func (m *IdRequest) ValidateAll() error { return m.validate(true) } func (m *IdRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return IdRequestMultiError(errors) } return nil } // IdRequestMultiError is an error wrapping multiple validation errors returned // by IdRequest.ValidateAll() if the designated constraints aren't met. type IdRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m IdRequestMultiError) 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 IdRequestMultiError) AllErrors() []error { return m } // IdRequestValidationError is the validation error returned by // IdRequest.Validate if the designated constraints aren't met. type IdRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e IdRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e IdRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e IdRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e IdRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e IdRequestValidationError) ErrorName() string { return "IdRequestValidationError" } // Error satisfies the builtin error interface func (e IdRequestValidationError) 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 %sIdRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = IdRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = IdRequestValidationError{} // Validate checks the field values on CreateUserInfo 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 *CreateUserInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateUserInfo 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 CreateUserInfoMultiError, // or nil if none found. func (m *CreateUserInfo) ValidateAll() error { return m.validate(true) } func (m *CreateUserInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for NickName // no validation rules for Password // no validation rules for Mobile if len(errors) > 0 { return CreateUserInfoMultiError(errors) } return nil } // CreateUserInfoMultiError is an error wrapping multiple validation errors // returned by CreateUserInfo.ValidateAll() if the designated constraints // aren't met. type CreateUserInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateUserInfoMultiError) 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 CreateUserInfoMultiError) AllErrors() []error { return m } // CreateUserInfoValidationError is the validation error returned by // CreateUserInfo.Validate if the designated constraints aren't met. type CreateUserInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateUserInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateUserInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateUserInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateUserInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateUserInfoValidationError) ErrorName() string { return "CreateUserInfoValidationError" } // Error satisfies the builtin error interface func (e CreateUserInfoValidationError) 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 %sCreateUserInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateUserInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateUserInfoValidationError{} // Validate checks the field values on UpdateUserInfo 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 *UpdateUserInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateUserInfo 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 UpdateUserInfoMultiError, // or nil if none found. func (m *UpdateUserInfo) ValidateAll() error { return m.validate(true) } func (m *UpdateUserInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for NickName // no validation rules for Gender // no validation rules for Birthday if len(errors) > 0 { return UpdateUserInfoMultiError(errors) } return nil } // UpdateUserInfoMultiError is an error wrapping multiple validation errors // returned by UpdateUserInfo.ValidateAll() if the designated constraints // aren't met. type UpdateUserInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateUserInfoMultiError) 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 UpdateUserInfoMultiError) AllErrors() []error { return m } // UpdateUserInfoValidationError is the validation error returned by // UpdateUserInfo.Validate if the designated constraints aren't met. type UpdateUserInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateUserInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateUserInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateUserInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateUserInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateUserInfoValidationError) ErrorName() string { return "UpdateUserInfoValidationError" } // Error satisfies the builtin error interface func (e UpdateUserInfoValidationError) 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 %sUpdateUserInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateUserInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateUserInfoValidationError{} // Validate checks the field values on PasswordCheckInfo 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 *PasswordCheckInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PasswordCheckInfo 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 // PasswordCheckInfoMultiError, or nil if none found. func (m *PasswordCheckInfo) ValidateAll() error { return m.validate(true) } func (m *PasswordCheckInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Password // no validation rules for EncryptedPassword if len(errors) > 0 { return PasswordCheckInfoMultiError(errors) } return nil } // PasswordCheckInfoMultiError is an error wrapping multiple validation errors // returned by PasswordCheckInfo.ValidateAll() if the designated constraints // aren't met. type PasswordCheckInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PasswordCheckInfoMultiError) 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 PasswordCheckInfoMultiError) AllErrors() []error { return m } // PasswordCheckInfoValidationError is the validation error returned by // PasswordCheckInfo.Validate if the designated constraints aren't met. type PasswordCheckInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PasswordCheckInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PasswordCheckInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PasswordCheckInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PasswordCheckInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PasswordCheckInfoValidationError) ErrorName() string { return "PasswordCheckInfoValidationError" } // Error satisfies the builtin error interface func (e PasswordCheckInfoValidationError) 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 %sPasswordCheckInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PasswordCheckInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PasswordCheckInfoValidationError{} ================================================ FILE: service/user/api/user/v1/user.proto ================================================ syntax = "proto3"; package user.v1; import "google/protobuf/empty.proto"; option go_package = "user/api/user/v1;v1"; service User{ rpc GetUserList(PageInfo) returns (UserListResponse){}; // 用户列表 rpc GetUserByMobile(MobileRequest) returns (UserInfoResponse){}; // 通过 mobile 查询用户 rpc GetUserById(IdRequest) returns (UserInfoResponse){}; // 通过 Id 查询用户 rpc CreateUser(CreateUserInfo) returns (UserInfoResponse){}; // 创建用户 rpc UpdateUser(UpdateUserInfo) returns (google.protobuf.Empty){}; // 更新用户 rpc CheckPassword(PasswordCheckInfo) returns (CheckResponse){}; // 检查用户密码 // 收货地址 rpc ListAddress(ListAddressReq) returns (ListAddressReply) {} // 所有收货地址列表 rpc CreateAddress(CreateAddressReq) returns (AddressInfo) {} // 新增收货地址 rpc UpdateAddress(UpdateAddressReq) returns (CheckResponse) {} // 修改收货地址 rpc DefaultAddress(AddressReq) returns (CheckResponse) {} // 设置默认地址 rpc DeleteAddress(AddressReq) returns (CheckResponse) {} // 删除收货地址 rpc GetAddress(AddressReq) returns (AddressInfo) {} // 查询收货地址 } message ListAddressReq { int64 uid = 1; } message AddressInfo { int64 id = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; } message ListAddressReply { repeated AddressInfo results = 1; } message CreateAddressReq { int64 uid = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; } message UpdateAddressReq { int64 uid = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; int64 id = 10; } message AddressReq { int64 id = 1; int64 uid = 2; } message CheckResponse{ bool success = 1; } // 分页 message PageInfo{ uint32 pn = 1; uint32 pSize = 2; } // 用户信息 message UserInfoResponse{ int64 id = 1; string password = 2; string mobile = 3; string nickName = 4; uint64 birthday = 5; string gender = 6; int32 role = 7; } // 用户列表 message UserListResponse{ int32 total = 1; repeated UserInfoResponse data = 2; } message MobileRequest{ string mobile = 1; } message IdRequest{ int64 id = 1; } // 创建用户 message CreateUserInfo{ string nickName = 1; string password = 2; string mobile = 3; } message UpdateUserInfo{ int64 id = 1; string nickName = 2; string gender = 3; uint64 birthday = 4; } message PasswordCheckInfo{ string password = 1; string encryptedPassword = 2; } ================================================ FILE: service/user/api/user/v1/user_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 // source: api/user/v1/user.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // UserClient is the client API for User service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type UserClient interface { GetUserList(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*UserListResponse, error) GetUserByMobile(ctx context.Context, in *MobileRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) GetUserById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) CreateUser(ctx context.Context, in *CreateUserInfo, opts ...grpc.CallOption) (*UserInfoResponse, error) UpdateUser(ctx context.Context, in *UpdateUserInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) CheckPassword(ctx context.Context, in *PasswordCheckInfo, opts ...grpc.CallOption) (*CheckResponse, error) // 收货地址 ListAddress(ctx context.Context, in *ListAddressReq, opts ...grpc.CallOption) (*ListAddressReply, error) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) GetAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*AddressInfo, error) } type userClient struct { cc grpc.ClientConnInterface } func NewUserClient(cc grpc.ClientConnInterface) UserClient { return &userClient{cc} } func (c *userClient) GetUserList(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*UserListResponse, error) { out := new(UserListResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserList", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) GetUserByMobile(ctx context.Context, in *MobileRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserByMobile", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) GetUserById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserById", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CreateUser(ctx context.Context, in *CreateUserInfo, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/CreateUser", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) UpdateUser(ctx context.Context, in *UpdateUserInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/user.v1.User/UpdateUser", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CheckPassword(ctx context.Context, in *PasswordCheckInfo, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/CheckPassword", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) ListAddress(ctx context.Context, in *ListAddressReq, opts ...grpc.CallOption) (*ListAddressReply, error) { out := new(ListAddressReply) err := c.cc.Invoke(ctx, "/user.v1.User/ListAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) { out := new(AddressInfo) err := c.cc.Invoke(ctx, "/user.v1.User/CreateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/UpdateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/DefaultAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/DeleteAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) GetAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*AddressInfo, error) { out := new(AddressInfo) err := c.cc.Invoke(ctx, "/user.v1.User/GetAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } // UserServer is the server API for User service. // All implementations must embed UnimplementedUserServer // for forward compatibility type UserServer interface { GetUserList(context.Context, *PageInfo) (*UserListResponse, error) GetUserByMobile(context.Context, *MobileRequest) (*UserInfoResponse, error) GetUserById(context.Context, *IdRequest) (*UserInfoResponse, error) CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error) UpdateUser(context.Context, *UpdateUserInfo) (*emptypb.Empty, error) CheckPassword(context.Context, *PasswordCheckInfo) (*CheckResponse, error) // 收货地址 ListAddress(context.Context, *ListAddressReq) (*ListAddressReply, error) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) GetAddress(context.Context, *AddressReq) (*AddressInfo, error) mustEmbedUnimplementedUserServer() } // UnimplementedUserServer must be embedded to have forward compatible implementations. type UnimplementedUserServer struct { } func (UnimplementedUserServer) GetUserList(context.Context, *PageInfo) (*UserListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserList not implemented") } func (UnimplementedUserServer) GetUserByMobile(context.Context, *MobileRequest) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserByMobile not implemented") } func (UnimplementedUserServer) GetUserById(context.Context, *IdRequest) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserById not implemented") } func (UnimplementedUserServer) CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") } func (UnimplementedUserServer) UpdateUser(context.Context, *UpdateUserInfo) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") } func (UnimplementedUserServer) CheckPassword(context.Context, *PasswordCheckInfo) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CheckPassword not implemented") } func (UnimplementedUserServer) ListAddress(context.Context, *ListAddressReq) (*ListAddressReply, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAddress not implemented") } func (UnimplementedUserServer) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAddress not implemented") } func (UnimplementedUserServer) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateAddress not implemented") } func (UnimplementedUserServer) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DefaultAddress not implemented") } func (UnimplementedUserServer) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteAddress not implemented") } func (UnimplementedUserServer) GetAddress(context.Context, *AddressReq) (*AddressInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAddress not implemented") } func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {} // UnsafeUserServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to UserServer will // result in compilation errors. type UnsafeUserServer interface { mustEmbedUnimplementedUserServer() } func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer) { s.RegisterService(&User_ServiceDesc, srv) } func _User_GetUserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PageInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserList(ctx, req.(*PageInfo)) } return interceptor(ctx, in, info, handler) } func _User_GetUserByMobile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MobileRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserByMobile(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserByMobile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserByMobile(ctx, req.(*MobileRequest)) } return interceptor(ctx, in, info, handler) } func _User_GetUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserById(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserById", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserById(ctx, req.(*IdRequest)) } return interceptor(ctx, in, info, handler) } func _User_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateUserInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CreateUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CreateUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CreateUser(ctx, req.(*CreateUserInfo)) } return interceptor(ctx, in, info, handler) } func _User_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateUserInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).UpdateUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/UpdateUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).UpdateUser(ctx, req.(*UpdateUserInfo)) } return interceptor(ctx, in, info, handler) } func _User_CheckPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PasswordCheckInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CheckPassword(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CheckPassword", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CheckPassword(ctx, req.(*PasswordCheckInfo)) } return interceptor(ctx, in, info, handler) } func _User_ListAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).ListAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/ListAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).ListAddress(ctx, req.(*ListAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_CreateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CreateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CreateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CreateAddress(ctx, req.(*CreateAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_UpdateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).UpdateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/UpdateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).UpdateAddress(ctx, req.(*UpdateAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_DefaultAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).DefaultAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/DefaultAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).DefaultAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } func _User_DeleteAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).DeleteAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/DeleteAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).DeleteAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } func _User_GetAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } // User_ServiceDesc is the grpc.ServiceDesc for User service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.v1.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUserList", Handler: _User_GetUserList_Handler, }, { MethodName: "GetUserByMobile", Handler: _User_GetUserByMobile_Handler, }, { MethodName: "GetUserById", Handler: _User_GetUserById_Handler, }, { MethodName: "CreateUser", Handler: _User_CreateUser_Handler, }, { MethodName: "UpdateUser", Handler: _User_UpdateUser_Handler, }, { MethodName: "CheckPassword", Handler: _User_CheckPassword_Handler, }, { MethodName: "ListAddress", Handler: _User_ListAddress_Handler, }, { MethodName: "CreateAddress", Handler: _User_CreateAddress_Handler, }, { MethodName: "UpdateAddress", Handler: _User_UpdateAddress_Handler, }, { MethodName: "DefaultAddress", Handler: _User_DefaultAddress_Handler, }, { MethodName: "DeleteAddress", Handler: _User_DeleteAddress_Handler, }, { MethodName: "GetAddress", Handler: _User_GetAddress_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/user/v1/user.proto", } ================================================ FILE: service/user/cmd/user/main.go ================================================ package main import ( "flag" "github.com/go-kratos/kratos/v2/registry" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "os" "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/transport/grpc" "go.opentelemetry.io/otel/exporters/jaeger" "go.opentelemetry.io/otel/sdk/resource" tracesdk "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" "user/internal/conf" ) // go build -ldflags "-X main.Version=x.y.z" var ( // Name is the name of the compiled software. Name = "shop.user.service" // Version is the version of the compiled software. Version string // flagconf is the config flag. flagconf string id, _ = os.Hostname() ) func init() { flag.StringVar(&flagconf, "conf", "../../configs", "config path, eg: -conf config.yaml") } func newApp(logger log.Logger, gs *grpc.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.ID(id+"user service"), kratos.Name(Name), kratos.Version(Version), kratos.Metadata(map[string]string{}), kratos.Logger(logger), kratos.Server( gs, ), kratos.Registrar(rr), ) } // Set global trace provider func setTracerProvider(url string) error { // Create the Jaeger exporter exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url))) if err != nil { return err } tp := tracesdk.NewTracerProvider( // Set the sampling rate based on the parent span to 100% tracesdk.WithSampler(tracesdk.ParentBased(tracesdk.TraceIDRatioBased(1.0))), // Always be sure to batch in production. tracesdk.WithBatcher(exp), // Record information about this application in an Resource. tracesdk.WithResource(resource.NewSchemaless( semconv.ServiceNameKey.String(Name), attribute.String("env", "dev"), )), ) otel.SetTracerProvider(tp) return nil } func main() { flag.Parse() logger := log.With(log.NewStdLogger(os.Stdout), "ts", log.DefaultTimestamp, "caller", log.DefaultCaller, "service.id", id, "service.name", Name, "service.version", Version, "trace_id", tracing.TraceID(), "span_id", tracing.SpanID(), ) c := config.New( config.WithSource( file.NewSource(flagconf), ), ) defer c.Close() if err := c.Load(); err != nil { panic(err) } var bc conf.Bootstrap if err := c.Scan(&bc); err != nil { panic(err) } if err := setTracerProvider(bc.Trace.Endpoint); err != nil { panic(err) } var rc conf.Registry if err := c.Scan(&rc); err != nil { panic(err) } app, cleanup, err := initApp(bc.Server, &rc, bc.Data, logger) if err != nil { panic(err) } defer cleanup() // start and wait for stop signal if err := app.Run(); err != nil { panic(err) } } ================================================ FILE: service/user/cmd/user/wire.go ================================================ //go:build wireinject // +build wireinject // The build tag makes sure the stub is not built in the final build. package main import ( "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" "github.com/google/wire" "user/internal/biz" "user/internal/conf" "user/internal/data" "user/internal/server" "user/internal/service" ) // initApp init kratos application. func initApp(*conf.Server, *conf.Registry, *conf.Data, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } ================================================ FILE: service/user/cmd/user/wire_gen.go ================================================ // Code generated by Wire. DO NOT EDIT. //go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject package main import ( "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" "user/internal/biz" "user/internal/conf" "user/internal/data" "user/internal/server" "user/internal/service" ) // Injectors from wire.go: // initApp init kratos application. func initApp(confServer *conf.Server, registry *conf.Registry, confData *conf.Data, logger log.Logger) (*kratos.App, func(), error) { db := data.NewDB(confData) client := data.NewRedis(confData) dataData, cleanup, err := data.NewData(confData, logger, db, client) if err != nil { return nil, nil, err } userRepo := data.NewUserRepo(dataData, logger) userUsecase := biz.NewUserUsecase(userRepo, logger) addressRepo := data.NewAddressRepo(dataData, logger) addressUsecase := biz.NewAddressUsecase(addressRepo, logger) userService := service.NewUserService(userUsecase, addressUsecase, logger) grpcServer := server.NewGRPCServer(confServer, userService, logger) registrar := server.NewRegistrar(registry) app := newApp(logger, grpcServer, registrar) return app, func() { cleanup() }, nil } ================================================ FILE: service/user/configs/config.yaml ================================================ server: http: addr: 0.0.0.0:8000 timeout: 1s grpc: addr: 0.0.0.0:50051 timeout: 1s data: database: driver: mysql source: root:root@tcp(127.0.0.1:3306)/shop_user?charset=utf8mb4&parseTime=True&loc=Local redis: addr: 127.0.0.1:6379 dial_timeout: 1s read_timeout: 0.2s write_timeout: 0.2s trace: endpoint: http://127.0.0.1:14268/api/traces ================================================ FILE: service/user/configs/registry.yaml ================================================ consul: address: 127.0.0.1:8500 scheme: http ================================================ FILE: service/user/generate.go ================================================ package generate //go:generate kratos proto client api ================================================ FILE: service/user/go.mod ================================================ module user go 1.16 require ( github.com/anaskhan96/go-password-encoder v0.0.0-20201010210601-c765b799fd72 github.com/armon/go-metrics v0.3.10 // indirect github.com/fatih/color v1.13.0 // indirect github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220131005031-86b8b6c366b9 github.com/go-kratos/kratos/v2 v2.1.5 github.com/go-redis/redis/extra/redisotel v0.3.0 github.com/go-redis/redis/v8 v8.11.4 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.7 // indirect github.com/google/wire v0.5.0 github.com/hashicorp/consul/api v1.12.0 github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-hclog v1.0.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.0.0 // indirect github.com/mattn/go-colorable v0.1.11 // indirect github.com/mitchellh/mapstructure v1.4.2 // indirect github.com/onsi/ginkgo v1.16.5 github.com/onsi/ginkgo/v2 v2.1.3 // indirect github.com/onsi/gomega v1.18.1 github.com/ory/dockertest/v3 v3.8.1 github.com/pkg/errors v0.9.1 github.com/stretchr/objx v0.2.0 // indirect go.opentelemetry.io/otel v1.3.0 go.opentelemetry.io/otel/exporters/jaeger v1.3.0 go.opentelemetry.io/otel/sdk v1.3.0 golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 // indirect google.golang.org/grpc v1.43.0 google.golang.org/protobuf v1.27.1 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gorm.io/driver/mysql v1.2.3 gorm.io/gorm v1.22.5 ) ================================================ FILE: service/user/go.sum ================================================ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/anaskhan96/go-password-encoder v0.0.0-20201010210601-c765b799fd72 h1:a93gW7OBt55SksMQVibqPWdu4Ly73KM4d3zoIUUX3cs= github.com/anaskhan96/go-password-encoder v0.0.0-20201010210601-c765b799fd72/go.mod h1:PsJICrlruG9QcJDYuZ0dO/2KtMDALzRbony8NkxZ2nE= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/cli v20.10.11+incompatible h1:tXU1ezXcruZQRrMP8RN2z9N91h+6egZTS1gsPsKantc= github.com/docker/cli v20.10.11+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v20.10.7+incompatible h1:Z6O9Nhsjv+ayUEeI1IojKbYcsGdgYSNqxe1s2MYzUhQ= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kratos/aegis v0.1.1/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220131005031-86b8b6c366b9 h1:Fyt7/DhfAD8rXCjG2Osp7ifTf/2Bm7gWBEi5EA1oRCM= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220131005031-86b8b6c366b9/go.mod h1:gCxmEdB6yLypq2c14QMH6JgvbNxsF4eqxqHQTMogVKA= github.com/go-kratos/kratos/v2 v2.1.5 h1:q8kTXyY1KkNJS3tmhvGUJfysipM5AIuoJaXBEvDBnFI= github.com/go-kratos/kratos/v2 v2.1.5/go.mod h1:zMonCKAf8+He4b9NQ/QHr20tMznd4NO5XrNds36w/5k= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.1 h1:DX7uPQ4WgAWfoh+NGGlbJQswnYIVvz0SRlLS3rPZQDA= github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.0 h1:j4LrlVXgrbIWO83mmQUnK0Hi+YnbD+vzrE1z/EphbFE= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= github.com/go-redis/redis/extra/rediscmd v0.2.0 h1:A3bhCsCKsedClEH9/jYlcKqOuBoeeV+H0yDie5t+a6w= github.com/go-redis/redis/extra/rediscmd v0.2.0/go.mod h1:Z5bP1EHl9PvWhx/DupfCdZwB0JgOO3aVxWc/PFux+BE= github.com/go-redis/redis/extra/redisotel v0.3.0 h1:8rrizwFAUUeMgmelyiQi9KeFwmpQhay9E+/rE6qHsBM= github.com/go-redis/redis/extra/redisotel v0.3.0/go.mod h1:sGV3dQnPMBUuqzowEP2nZPhLXCMeh83nY64yaju249c= github.com/go-redis/redis/v8 v8.3.2/go.mod h1:jszGxBCez8QA1HWSmQxJO9Y82kNibbUmeYhKWrBejTU= github.com/go-redis/redis/v8 v8.5.0/go.mod h1:YmEcgBDttjnkbMzDAhDtQxY9yVA7jMN6PCR5HeMvqFE= github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.9.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= 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/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 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.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.0.0 h1:bkKf0BeBXcSYa7f5Fyi9gMuQ8gNsxeiNpZjR6VxNZeo= github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 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-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0 h1:8+567mCcFDnS5ADl7lrpxPMWiFCElyUEeW0gtj34fMA= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6 h1:uuEX1kLR6aoda1TBttmJQKDLZE1Ob7KN0NPdE7EtCDc= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.3/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHRmPYs= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/ory/dockertest/v3 v3.8.1 h1:vU/8d1We4qIad2YM0kOwRVtnyue7ExvacPiw1yDm17g= github.com/ory/dockertest/v3 v3.8.1/go.mod h1:wSRQ3wmkz+uSARYMk7kVJFDBGm8x5gSxIhI7NDc+BAQ= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.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 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA= go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s= go.opentelemetry.io/otel v1.3.0 h1:APxLf0eiBwLl+SOXiJJCVYzA1OOJNyAoV8C5RNRyy7Y= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel/exporters/jaeger v1.3.0 h1:HfydzioALdtcB26H5WHc4K47iTETJCdloL7VN579/L0= go.opentelemetry.io/otel/exporters/jaeger v1.3.0/go.mod h1:KoYHi1BtkUPncGSRtCe/eh1ijsnePhSkxwzz07vU0Fc= go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= go.opentelemetry.io/otel/sdk v1.3.0 h1:3278edCoH89MEJ0Ky8WQXVmDQv3FX4ZJ3Pp+9fJreAI= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= go.opentelemetry.io/otel/trace v1.3.0 h1:doy8Hzb1RJ+I3yFhtDmwNc7tIyw1tNMOIsyPzp1NOGY= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 h1:zzNejm+EgrbLfDZ6lu9Uud2IVvHySPl8vQzf04laR5Q= google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.2.3 h1:cZqzlOfg5Kf1VIdLC1D9hT6Cy9BgxhExLj/2tIgUe7Y= gorm.io/driver/mysql v1.2.3/go.mod h1:qsiz+XcAyMrS6QY+X3M9R6b/lKM1imKmcuK9kac5LTo= gorm.io/gorm v1.22.4/go.mod h1:1aeVC+pe9ZmvKZban/gW4QPra7PRoTEssyc922qCAkk= gorm.io/gorm v1.22.5 h1:lYREBgc02Be/5lSCTuysZZDb6ffL2qrat6fg9CFbvXU= gorm.io/gorm v1.22.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= ================================================ FILE: service/user/internal/biz/README.md ================================================ # Biz ================================================ FILE: service/user/internal/biz/address.go ================================================ package biz import ( "context" "github.com/go-kratos/kratos/v2/log" "user/internal/domain" ) //go:generate mockgen -destination=../mocks/mrepo/address.go -package=mrepo . AddressRepo type AddressRepo interface { CreateAddress(ctx context.Context, a *domain.Address) (*domain.Address, error) AddressListByUid(ctx context.Context, uid int64) ([]*domain.Address, error) UpdateAddress(ctx context.Context, a *domain.Address) error DefaultAddress(ctx context.Context, a *domain.Address) error DeleteAddress(ctx context.Context, a *domain.Address) error GetAddress(ctx context.Context, a *domain.Address) (*domain.Address, error) } type AddressUsecase struct { repo AddressRepo log *log.Helper } func NewAddressUsecase(repo AddressRepo, logger log.Logger) *AddressUsecase { return &AddressUsecase{repo: repo, log: log.NewHelper(logger)} } func (uc *AddressUsecase) AddAddress(ctx context.Context, a *domain.Address) (*domain.Address, error) { return uc.repo.CreateAddress(ctx, a) } func (uc *AddressUsecase) AddressListByUid(ctx context.Context, uid int64) ([]*domain.Address, error) { return uc.repo.AddressListByUid(ctx, uid) } func (uc *AddressUsecase) UpdateAddress(ctx context.Context, a *domain.Address) error { return uc.repo.UpdateAddress(ctx, a) } func (uc *AddressUsecase) DefaultAddress(ctx context.Context, a *domain.Address) error { return uc.repo.DefaultAddress(ctx, a) } func (uc *AddressUsecase) DeleteAddress(ctx context.Context, a *domain.Address) error { return uc.repo.DeleteAddress(ctx, a) } func (uc *AddressUsecase) GetAddress(ctx context.Context, a *domain.Address) (*domain.Address, error) { return uc.repo.GetAddress(ctx, a) } ================================================ FILE: service/user/internal/biz/address_test.go ================================================ package biz_test import ( "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "user/internal/biz" "user/internal/mocks/mrepo" "user/internal/testdata" ) var _ = Describe("AddressUsecase", func() { var addressCase *biz.AddressUsecase var mAddressRepo *mrepo.MockAddressRepo BeforeEach(func() { mAddressRepo = mrepo.NewMockAddressRepo(ctl) addressCase = biz.NewAddressUsecase(mAddressRepo, nil) }) It("Create", func() { info := testdata.Address() mAddressRepo.EXPECT().CreateAddress(ctx, gomock.Any()).Return(info, nil) l, err := addressCase.AddAddress(ctx, info) Ω(err).ShouldNot(HaveOccurred()) Ω(err).ToNot(HaveOccurred()) Ω(l.Mobile).To(Equal("13509876789")) }) It("List", func() { mAddressRepo.EXPECT().AddressListByUid(ctx, gomock.Any()).Return(nil, nil) _, err := addressCase.AddressListByUid(ctx, 1) Ω(err).ShouldNot(HaveOccurred()) Ω(err).ToNot(HaveOccurred()) }) It("Update", func() { mAddressRepo.EXPECT().UpdateAddress(ctx, gomock.Any()).Return(nil) err := addressCase.UpdateAddress(ctx, nil) Ω(err).ShouldNot(HaveOccurred()) Ω(err).ToNot(HaveOccurred()) }) }) ================================================ FILE: service/user/internal/biz/biz.go ================================================ package biz import ( "context" "github.com/google/wire" ) // ProviderSet is biz providers. var ProviderSet = wire.NewSet(NewUserUsecase, NewAddressUsecase) //go:generate mockgen -destination=../mocks/usecase/biz.go -package=usecase . Transaction type Transaction interface { ExecTx(context.Context, func(ctx context.Context) error) error } ================================================ FILE: service/user/internal/biz/biz_suite_test.go ================================================ package biz_test import ( "context" "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "testing" ) func TestBiz(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "biz user test") } var ctl *gomock.Controller var cleaner func() var ctx context.Context var _ = BeforeEach(func() { ctl = gomock.NewController(GinkgoT()) cleaner = ctl.Finish ctx = context.Background() }) var _ = AfterEach(func() { // remove any mocks cleaner() }) ================================================ FILE: service/user/internal/biz/user.go ================================================ package biz import ( "context" "github.com/go-kratos/kratos/v2/log" "gorm.io/gorm" "time" ) type User struct { ID int64 Mobile string Password string NickName string Birthday *time.Time Gender string Role int CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt IsDeletedAt bool } //go:generate mockgen -destination=../mocks/mrepo/user.go -package=mrepo . UserRepo type UserRepo interface { CreateUser(context.Context, *User) (*User, error) ListUser(ctx context.Context, pageNum, pageSize int) ([]*User, int, error) UserByMobile(ctx context.Context, mobile string) (*User, error) GetUserById(ctx context.Context, id int64) (*User, error) UpdateUser(context.Context, *User) (bool, error) CheckPassword(ctx context.Context, password, encryptedPassword string) (bool, error) } type UserUsecase struct { repo UserRepo log *log.Helper } func NewUserUsecase(repo UserRepo, logger log.Logger) *UserUsecase { return &UserUsecase{repo: repo, log: log.NewHelper(logger)} } func (uc *UserUsecase) Create(ctx context.Context, u *User) (*User, error) { return uc.repo.CreateUser(ctx, u) } func (uc *UserUsecase) List(ctx context.Context, pageNum, pageSize int) ([]*User, int, error) { return uc.repo.ListUser(ctx, pageNum, pageSize) } func (uc *UserUsecase) UserByMobile(ctx context.Context, mobile string) (*User, error) { return uc.repo.UserByMobile(ctx, mobile) } func (uc *UserUsecase) UpdateUser(ctx context.Context, user *User) (bool, error) { return uc.repo.UpdateUser(ctx, user) } func (uc *UserUsecase) CheckPassword(ctx context.Context, password, encryptedPassword string) (bool, error) { return uc.repo.CheckPassword(ctx, password, encryptedPassword) } func (uc *UserUsecase) UserById(ctx context.Context, id int64) (*User, error) { return uc.repo.GetUserById(ctx, id) } ================================================ FILE: service/user/internal/biz/user_test.go ================================================ package biz_test import ( "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "user/internal/biz" "user/internal/mocks/mrepo" "user/internal/testdata" ) var _ = Describe("UserUsecase", func() { var userCase *biz.UserUsecase var mUserRepo *mrepo.MockUserRepo BeforeEach(func() { mUserRepo = mrepo.NewMockUserRepo(ctl) userCase = biz.NewUserUsecase(mUserRepo, nil) }) FIt("Create", func() { info := testdata.User() mUserRepo.EXPECT().CreateUser(ctx, gomock.Any()).Return(info, nil) l, err := userCase.Create(ctx, info) Ω(err).ShouldNot(HaveOccurred()) Ω(err).ToNot(HaveOccurred()) Ω(l.ID).To(Equal(int64(1))) Ω(l.Mobile).To(Equal("13509876789")) }) It("List", func() { info := testdata.User() info1 := testdata.User() info1.ID = 2 info1.Mobile = "2323232323" u := []*biz.User{ info, info1, } mUserRepo.EXPECT().ListUser(ctx, 1, 1).Return(u, 2, nil) list, total, err := userCase.List(ctx, 1, 1) if err != nil { return } Ω(err).ToNot(HaveOccurred()) Ω(total).Should(Equal(2)) Ω(list).ShouldNot(BeEmpty()) Ω(list[0].ID).To(Equal(int64(1))) Ω(list[1].ID).To(Equal(int64(2))) Ω(list[0].Mobile).To(Equal("13509876789")) Ω(list[1].Mobile).To(Equal("2323232323")) }) }) ================================================ FILE: service/user/internal/conf/conf.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 // protoc v3.15.8 // source: internal/conf/conf.proto package conf import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Bootstrap struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=s,proto3" json:"s,omitempty"` Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Trace *Trace `protobuf:"bytes,3,opt,name=trace,proto3" json:"trace,omitempty"` } func (x *Bootstrap) Reset() { *x = Bootstrap{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Bootstrap) String() string { return protoimpl.X.MessageStringOf(x) } func (*Bootstrap) ProtoMessage() {} func (x *Bootstrap) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Bootstrap.ProtoReflect.Descriptor instead. func (*Bootstrap) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{0} } func (x *Bootstrap) GetServer() *Server { if x != nil { return x.Server } return nil } func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data } return nil } func (x *Bootstrap) GetTrace() *Trace { if x != nil { return x.Trace } return nil } type Server struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Http *Server_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` Grpc *Server_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` } func (x *Server) Reset() { *x = Server{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server) ProtoMessage() {} func (x *Server) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Server.ProtoReflect.Descriptor instead. func (*Server) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1} } func (x *Server) GetHttp() *Server_HTTP { if x != nil { return x.Http } return nil } func (x *Server) GetGrpc() *Server_GRPC { if x != nil { return x.Grpc } return nil } type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` } func (x *Data) Reset() { *x = Data{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data) ProtoMessage() {} func (x *Data) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Data.ProtoReflect.Descriptor instead. func (*Data) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2} } func (x *Data) GetDatabase() *Data_Database { if x != nil { return x.Database } return nil } func (x *Data) GetRedis() *Data_Redis { if x != nil { return x.Redis } return nil } type Registry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` } func (x *Registry) Reset() { *x = Registry{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry) ProtoMessage() {} func (x *Registry) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Registry.ProtoReflect.Descriptor instead. func (*Registry) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{3} } func (x *Registry) GetConsul() *Registry_Consul { if x != nil { return x.Consul } return nil } type Trace struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Trace) Reset() { *x = Trace{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Trace) String() string { return protoimpl.X.MessageStringOf(x) } func (*Trace) ProtoMessage() {} func (x *Trace) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Trace.ProtoReflect.Descriptor instead. func (*Trace) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{4} } func (x *Trace) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Server_HTTP struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_HTTP) Reset() { *x = Server_HTTP{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_HTTP) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_HTTP) ProtoMessage() {} func (x *Server_HTTP) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Server_HTTP.ProtoReflect.Descriptor instead. func (*Server_HTTP) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1, 0} } func (x *Server_HTTP) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_HTTP) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_HTTP) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Server_GRPC struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_GRPC) Reset() { *x = Server_GRPC{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_GRPC) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_GRPC) ProtoMessage() {} func (x *Server_GRPC) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[6] 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 Server_GRPC.ProtoReflect.Descriptor instead. func (*Server_GRPC) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1, 1} } func (x *Server_GRPC) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_GRPC) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_GRPC) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Data_Database struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` } func (x *Data_Database) Reset() { *x = Data_Database{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Database) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Database) ProtoMessage() {} func (x *Data_Database) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[7] 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 Data_Database.ProtoReflect.Descriptor instead. func (*Data_Database) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} } func (x *Data_Database) GetDriver() string { if x != nil { return x.Driver } return "" } func (x *Data_Database) GetSource() string { if x != nil { return x.Source } return "" } type Data_Redis struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` Db int32 `protobuf:"varint,4,opt,name=db,proto3" json:"db,omitempty"` DialTimeout *durationpb.Duration `protobuf:"bytes,5,opt,name=dial_timeout,json=dialTimeout,proto3" json:"dial_timeout,omitempty"` ReadTimeout *durationpb.Duration `protobuf:"bytes,6,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"` WriteTimeout *durationpb.Duration `protobuf:"bytes,7,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"` } func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Redis) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[8] 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 Data_Redis.ProtoReflect.Descriptor instead. func (*Data_Redis) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2, 1} } func (x *Data_Redis) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Data_Redis) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Data_Redis) GetPassword() string { if x != nil { return x.Password } return "" } func (x *Data_Redis) GetDb() int32 { if x != nil { return x.Db } return 0 } func (x *Data_Redis) GetDialTimeout() *durationpb.Duration { if x != nil { return x.DialTimeout } return nil } func (x *Data_Redis) GetReadTimeout() *durationpb.Duration { if x != nil { return x.ReadTimeout } return nil } func (x *Data_Redis) GetWriteTimeout() *durationpb.Duration { if x != nil { return x.WriteTimeout } return nil } type Registry_Consul struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` } func (x *Registry_Consul) Reset() { *x = Registry_Consul{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry_Consul) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry_Consul) ProtoMessage() {} func (x *Registry_Consul) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[9] 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 Registry_Consul.ProtoReflect.Descriptor instead. func (*Registry_Consul) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} } func (x *Registry_Consul) GetAddress() string { if x != nil { return x.Address } return "" } func (x *Registry_Consul) GetScheme() string { if x != nil { return x.Scheme } return "" } var File_internal_conf_conf_proto protoreflect.FileDescriptor var file_internal_conf_conf_proto_rawDesc = []byte{ 0x0a, 0x18, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x27, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x22, 0xb8, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x2b, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x69, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xc7, 0x03, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x1a, 0x3a, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x9d, 0x02, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x7b, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x33, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x23, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_internal_conf_conf_proto_rawDescOnce sync.Once file_internal_conf_conf_proto_rawDescData = file_internal_conf_conf_proto_rawDesc ) func file_internal_conf_conf_proto_rawDescGZIP() []byte { file_internal_conf_conf_proto_rawDescOnce.Do(func() { file_internal_conf_conf_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_conf_conf_proto_rawDescData) }) return file_internal_conf_conf_proto_rawDescData } var file_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_internal_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: kratos.api.Bootstrap (*Server)(nil), // 1: kratos.api.Server (*Data)(nil), // 2: kratos.api.Data (*Registry)(nil), // 3: kratos.api.Registry (*Trace)(nil), // 4: kratos.api.Trace (*Server_HTTP)(nil), // 5: kratos.api.Server.HTTP (*Server_GRPC)(nil), // 6: kratos.api.Server.GRPC (*Data_Database)(nil), // 7: kratos.api.Data.Database (*Data_Redis)(nil), // 8: kratos.api.Data.Redis (*Registry_Consul)(nil), // 9: kratos.api.Registry.Consul (*durationpb.Duration)(nil), // 10: google.protobuf.Duration } var file_internal_conf_conf_proto_depIdxs = []int32{ 1, // 0: kratos.api.Bootstrap.s:type_name -> kratos.api.Server 2, // 1: kratos.api.Bootstrap.data:type_name -> kratos.api.Data 4, // 2: kratos.api.Bootstrap.trace:type_name -> kratos.api.Trace 5, // 3: kratos.api.Server.http:type_name -> kratos.api.Server.HTTP 6, // 4: kratos.api.Server.grpc:type_name -> kratos.api.Server.GRPC 7, // 5: kratos.api.Data.database:type_name -> kratos.api.Data.Database 8, // 6: kratos.api.Data.redis:type_name -> kratos.api.Data.Redis 9, // 7: kratos.api.Registry.consul:type_name -> kratos.api.Registry.Consul 10, // 8: kratos.api.Server.HTTP.timeout:type_name -> google.protobuf.Duration 10, // 9: kratos.api.Server.GRPC.timeout:type_name -> google.protobuf.Duration 10, // 10: kratos.api.Data.Redis.dial_timeout:type_name -> google.protobuf.Duration 10, // 11: kratos.api.Data.Redis.read_timeout:type_name -> google.protobuf.Duration 10, // 12: kratos.api.Data.Redis.write_timeout:type_name -> google.protobuf.Duration 13, // [13:13] is the sub-list for method output_type 13, // [13:13] is the sub-list for method input_type 13, // [13:13] is the sub-list for extension type_name 13, // [13:13] is the sub-list for extension extendee 0, // [0:13] is the sub-list for field type_name } func init() { file_internal_conf_conf_proto_init() } func file_internal_conf_conf_proto_init() { if File_internal_conf_conf_proto != nil { return } if !protoimpl.UnsafeEnabled { file_internal_conf_conf_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Bootstrap); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Trace); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_HTTP); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_GRPC); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Database); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry_Consul); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_internal_conf_conf_proto_rawDesc, NumEnums: 0, NumMessages: 10, NumExtensions: 0, NumServices: 0, }, GoTypes: file_internal_conf_conf_proto_goTypes, DependencyIndexes: file_internal_conf_conf_proto_depIdxs, MessageInfos: file_internal_conf_conf_proto_msgTypes, }.Build() File_internal_conf_conf_proto = out.File file_internal_conf_conf_proto_rawDesc = nil file_internal_conf_conf_proto_goTypes = nil file_internal_conf_conf_proto_depIdxs = nil } ================================================ FILE: service/user/internal/conf/conf.proto ================================================ syntax = "proto3"; package kratos.api; option go_package = "user/internal/conf;conf"; import "google/protobuf/duration.proto"; message Bootstrap { Server server = 1; Data data = 2; Trace trace = 3; } message Server { message HTTP { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } message GRPC { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } HTTP http = 1; GRPC grpc = 2; } message Data { message Database { string driver = 1; string source = 2; } message Redis { string network = 1; string addr = 2; string password = 3; int32 db = 4; google.protobuf.Duration dial_timeout = 5; google.protobuf.Duration read_timeout = 6; google.protobuf.Duration write_timeout = 7; } Database database = 1; Redis redis = 2; } message Registry { message Consul { string address = 1; string scheme = 2; } Consul consul = 1; } message Trace { string endpoint = 1; } ================================================ FILE: service/user/internal/data/README.md ================================================ # Data ================================================ FILE: service/user/internal/data/address.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" "gorm.io/gorm" "time" "user/internal/biz" "user/internal/domain" ) type Address struct { ID int64 `gorm:"primarykey"` UserID int64 `gorm:"index:idx_user_id;column:user_id;default:1;type:bigint comment '关联用户ID'"` IsDefault int `gorm:"column:is_default;default:0;type:tinyint comment '是否是默认'"` Mobile string `gorm:"index:idx_mobile;type:varchar(11) comment '手机号码';not null"` Name string `gorm:"type:varchar(25) comment '收货用户名称'"` Province string `gorm:"type:varchar(25) comment '省'"` City string `gorm:"type:varchar(25) comment '市'"` Districts string `gorm:"type:varchar(25) comment '区县'"` Address string `gorm:"type:varchar(255) comment '收货详细地址'"` PostCode string `gorm:"type:varchar(25) comment '邮编'"` CreatedAt time.Time `gorm:"column:add_time"` UpdatedAt time.Time `gorm:"column:update_time"` DeletedAt gorm.DeletedAt } func (Address) TableName() string { return "user_addresses" } type adderessRepo struct { data *Data log *log.Helper } // NewAddressRepo . func NewAddressRepo(data *Data, logger log.Logger) biz.AddressRepo { return &adderessRepo{ data: data, log: log.NewHelper(logger), } } func (p *Address) ToDomain() *domain.Address { return &domain.Address{ ID: p.ID, UserID: p.UserID, IsDefault: p.IsDefault, Mobile: p.Mobile, Name: p.Name, Province: p.Province, City: p.City, Districts: p.Districts, Address: p.Address, PostCode: p.PostCode, } } func (a *adderessRepo) DeleteAddress(ctx context.Context, r *domain.Address) error { var address Address result := a.data.db.Where(&Address{ID: r.ID}).First(&address) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return errors.NotFound("ADDRESS_NOT_FOUND", "address not found") } if result.Error != nil { return result.Error } if address.UserID != r.UserID { return errors.NotFound("NOT_USER_ADDRESS_FOR_FOUND", "Is not the address of this user") } if err := a.data.db.Delete(&address).Error; err != nil { return errors.New(500, "DELETE_USER_ADDRESS_ERROR", "用户地址删除失败") } return nil } func (a *adderessRepo) DefaultAddress(ctx context.Context, r *domain.Address) error { var address, addressOld Address resCurrDefAdr := a.data.db.Where(&Address{UserID: r.UserID, IsDefault: 1}).First(&addressOld) if errors.Is(resCurrDefAdr.Error, gorm.ErrRecordNotFound) { return errors.NotFound("USER_ADDRESS_NOT_FOUND", "user address not found") } if resCurrDefAdr.Error == nil { addressOld.IsDefault = 0 addressOld.UpdatedAt = time.Now() if err := a.data.db.Save(&addressOld).Error; err != nil { return errors.NotFound("SET_ADDRESS_ERROR", "用户地址修改失败") } } result := a.data.db.Where(&Address{ID: r.ID, UserID: r.UserID}).First(&address) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return errors.NotFound("USER_ADDRESS_NOT_FOUND", "user address not found") } address.IsDefault = 1 address.UpdatedAt = time.Now() if err := a.data.db.Save(&address).Error; err != nil { return errors.NotFound("SET_ADDRESS_ERROR", "用户地址修改失败") } return nil } func (a *adderessRepo) UpdateAddress(ctx context.Context, r *domain.Address) error { var address Address //fmt.Println(r) result := a.data.db.Where(&Address{ID: r.ID}).Find(&address) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return errors.NotFound("USER_ADDRESS_NOT_FOUND", "user address not found") } if result.Error != nil { return errors.New(500, "UPDATE_USER_ADDRESS_ERROR", "用户地址更新失败") } if address.UserID != r.UserID { return errors.New(500, "UPDATE_USER_ADDRESS_ERROR", "用户 ID 参数有误") } address.Address = r.Address address.City = r.City address.Mobile = r.Mobile address.Name = r.Name address.IsDefault = r.IsDefault address.PostCode = r.PostCode address.Districts = r.Districts address.Province = r.Province address.UpdatedAt = time.Now() if err := a.data.db.Save(&address).Error; err != nil { return errors.New(500, "UPDATE_USER_ADDRESS_ERROR", "用户地址更新失败") } return nil } func (a *adderessRepo) AddressListByUid(ctx context.Context, uid int64) ([]*domain.Address, error) { var address []Address result := a.data.db.Where(&Address{UserID: uid}).Find(&address) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return nil, errors.NotFound("USER_ADDRESS_NOT_FOUND", "user address not found") } if result.Error != nil { return nil, errors.New(500, "USER_ADDRESS_LIST_ERROR", "查询用户地址列表失败") } if result.RowsAffected == 0 { return nil, errors.NotFound("USER_ADDRESS_NOT_FOUND", "user address not found") } var addressList []*domain.Address for _, v := range address { addressTmp := modelToBizResponse(v) addressList = append(addressList, addressTmp) } return addressList, nil } func (a *adderessRepo) CreateAddress(c context.Context, r *domain.Address) (*domain.Address, error) { addInfo := Address{ UserID: r.UserID, IsDefault: r.IsDefault, Mobile: r.Mobile, Name: r.Name, Province: r.Province, City: r.City, Districts: r.Districts, Address: r.Address, PostCode: r.PostCode, } result := a.data.db.Save(&addInfo) if result.Error != nil { return nil, errors.NotFound("CREATE_ADDRESS_NOT_FOUND", "创建用户地址失败") } return modelToBizResponse(addInfo), nil } func modelToBizResponse(addInfo Address) *domain.Address { return &domain.Address{ ID: addInfo.ID, UserID: addInfo.UserID, IsDefault: addInfo.IsDefault, Mobile: addInfo.Mobile, Name: addInfo.Name, Province: addInfo.Province, City: addInfo.City, Districts: addInfo.Districts, Address: addInfo.Address, PostCode: addInfo.PostCode, } } func (a *adderessRepo) GetAddress(ctx context.Context, r *domain.Address) (*domain.Address, error) { var address Address result := a.data.db.Where(&Address{ID: r.ID, UserID: r.UserID}).First(&address) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return nil, errors.NotFound("USER_ADDRESS_NOT_FOUND", "user address not found") } return address.ToDomain(), nil } ================================================ FILE: service/user/internal/data/address_test.go ================================================ package data_test import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "user/internal/biz" "user/internal/data" "user/internal/domain" "user/internal/testdata" ) var _ = Describe("UserAddresses", func() { //var ro biz.UserRepo //var uD *biz.User var ao biz.AddressRepo var aD *domain.Address BeforeEach(func() { ao = data.NewAddressRepo(Db, nil) aD = testdata.Address() }) It("CreateAddress", func() { a, err := ao.CreateAddress(ctx, aD) Ω(err).ShouldNot(HaveOccurred()) // 组装的数据 mobile 为 13509876789 Ω(a.Mobile).Should(Equal("13509876789")) // 手机号应该为创建的时候写入的手机号 }) }) ================================================ FILE: service/user/internal/data/data.go ================================================ package data import ( "context" slog "log" "os" "time" "user/internal/biz" "user/internal/conf" "github.com/go-kratos/kratos/v2/log" "github.com/go-redis/redis/extra/redisotel" "github.com/go-redis/redis/v8" "github.com/google/wire" "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger" "gorm.io/gorm/schema" ) // ProviderSet is data providers. var ProviderSet = wire.NewSet(NewData, NewDB, NewTransaction, NewRedis, NewUserRepo, NewAddressRepo) type Data struct { db *gorm.DB rdb *redis.Client } type contextTxKey struct{} // NewData . func NewData(c *conf.Data, logger log.Logger, db *gorm.DB, rdb *redis.Client) (*Data, func(), error) { cleanup := func() { log.NewHelper(logger).Info("closing the data resources") } return &Data{db: db, rdb: rdb}, cleanup, nil } func NewTransaction(d *Data) biz.Transaction { return d } func (d *Data) DB(ctx context.Context) *gorm.DB { tx, ok := ctx.Value(contextTxKey{}).(*gorm.DB) if ok { return tx } return d.db } func (d *Data) ExecTx(ctx context.Context, fn func(ctx context.Context) error) error { return d.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error { ctx = context.WithValue(ctx, contextTxKey{}, tx) return fn(ctx) }) } // NewDB . func NewDB(c *conf.Data) *gorm.DB { // 终端打印输入 sql 执行记录 newLogger := logger.New( slog.New(os.Stdout, "\r\n", slog.LstdFlags), // io writer logger.Config{ SlowThreshold: time.Second, // 慢查询 SQL 阈值 Colorful: true, // 禁用彩色打印 //IgnoreRecordNotFoundError: false, LogLevel: logger.Info, // Log lever }, ) log.Info("failed opening connection to ") db, err := gorm.Open(mysql.Open(c.Database.Source), &gorm.Config{ Logger: newLogger, DisableForeignKeyConstraintWhenMigrating: true, NamingStrategy: schema.NamingStrategy{ //SingularTable: true, // 表名是否加 s }, }) if err != nil { log.Errorf("failed opening connection to sqlite: %v", err) panic("failed to connect database") } return db } func NewRedis(c *conf.Data) *redis.Client { rdb := redis.NewClient(&redis.Options{ Addr: c.Redis.Addr, Password: c.Redis.Password, DB: int(c.Redis.Db), DialTimeout: c.Redis.DialTimeout.AsDuration(), WriteTimeout: c.Redis.WriteTimeout.AsDuration(), ReadTimeout: c.Redis.ReadTimeout.AsDuration(), }) rdb.AddHook(redisotel.TracingHook{}) if err := rdb.Close(); err != nil { log.Error(err) } return rdb } ================================================ FILE: service/user/internal/data/data_suite_test.go ================================================ package data_test import ( "context" "github.com/pkg/errors" "gorm.io/gorm" "testing" "user/internal/conf" "user/internal/data" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) // 测试 data 方法 func TestData(t *testing.T) { // Ginkgo 测试通过调用 Fail(description string) 功能来表示失败 // 使用 RegisterFailHandler 将此函数传递给 Gomega 。这是 Ginkgo 和 Gomega 之间的唯一连接点 RegisterFailHandler(Fail) // 通知 Ginkgo 启动测试套件。如果您的任何 specs 失败,Ginkgo 将自动使 testing.T 失败。 RunSpecs(t, "biz data test user") } var cleaner func() // 定义删除 mysql 容器的回调函数 var Db *data.Data // 用于测试的 data var ctx context.Context // 上下文 // initialize AutoMigrate gorm自动建表 func initialize(db *gorm.DB) error { err := db.AutoMigrate( &data.User{}, &data.Address{}, ) return errors.WithStack(err) } // ginkgo 使用 BeforeEach 为您的 Specs 设置状态 var _ = BeforeSuite(func() { // 执行测试数据库操作之前,链接之前 docker 容器创建的 mysql //con, f := data.DockerMysql("mysql", "latest") con, f := data.DockerMysql("mariadb", "latest") cleaner = f // 测试完成,关闭容器的回调方法 config := &conf.Data{Database: &conf.Data_Database{Driver: "mysql", Source: con}} db := data.NewDB(config) mySQLDb, _, err := data.NewData(config, nil, db, nil) if err != nil { return } if err != nil { return } Db = mySQLDb err = initialize(db) if err != nil { return } Expect(err).NotTo(HaveOccurred()) }) // 测试结束后 通过回调函数,关闭并删除 docker 创建的容器 var _ = AfterSuite(func() { cleaner() }) ================================================ FILE: service/user/internal/data/docker_mysql.go ================================================ package data import ( "database/sql" "fmt" "github.com/ory/dockertest/v3" "log" "time" ) func DockerMysql(img, version string) (string, func()) { return innerDockerMysql(img, version) } func innerDockerMysql(img, version string) (string, func()) { // uses a sensible default on windows (tcp/http) and linux/osx (socket) pool, err := dockertest.NewPool("") pool.MaxWait = time.Minute * 2 if err != nil { log.Fatalf("Could not connect to docker: %s", err) } //time.Sleep(time.Second * 20) // pulls an image, creates a container based on it and runs it resource, err := pool.Run(img, version, []string{"MYSQL_ROOT_PASSWORD=secret", "MYSQL_ROOT_HOST=%"}) if err != nil { log.Fatalf("Could not start resource: %s", err) } conStr := fmt.Sprintf("root:secret@(localhost:%s)/mysql?parseTime=true", resource.GetPort("3306/tcp")) // exponential backoff-retry, because the application in the container might not be ready to accept connections yet if err := pool.Retry(func() error { var err error db, err := sql.Open("mysql", conStr) if err != nil { return err } return db.Ping() }); err != nil { log.Fatalf("Could not connect to docker: %s", err) } // 关闭容器 return conStr, func() { if err = pool.Purge(resource); err != nil { log.Fatalf("Could not purge resource: %s", err) } } } ================================================ FILE: service/user/internal/data/entity/user.go ================================================ package main import ( "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger" "gorm.io/gorm/schema" "log" "os" "time" "user/internal/data" ) // 链接数据库 func main() { dsn := "root:root@tcp(127.0.0.1:3306)/shop_user?charset=utf8mb4&parseTime=True&loc=Local" newLogger := logger.New( log.New(os.Stdout, "\r\n", log.LstdFlags), // io writer logger.Config{ SlowThreshold: time.Second, // 慢 SQL 阈值 LogLevel: logger.Info, // Log level Colorful: true, // 禁用彩色打印 }, ) // 全局模式 db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{ NamingStrategy: schema.NamingStrategy{ //SingularTable: true, }, Logger: newLogger, }) if err != nil { panic(err) } _ = db.AutoMigrate(&data.User{}) _ = db.AutoMigrate(&data.Address{}) } ================================================ FILE: service/user/internal/data/user.go ================================================ package data import ( "context" "crypto/sha512" "fmt" "github.com/anaskhan96/go-password-encoder" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" "gorm.io/gorm" "strings" "time" "user/internal/biz" ) type User struct { ID int64 `gorm:"primarykey"` Mobile string `gorm:"index:idx_mobile;unique;type:varchar(11) comment '手机号码,用户唯一标识';not null"` Password string `gorm:"type:varchar(100);not null "` // 用户密码的保存需要注意是否加密 NickName string `gorm:"type:varchar(25) comment '用户昵称'"` Birthday *time.Time `gorm:"type:datetime comment '出生日日期'"` Gender string `gorm:"column:gender;default:male;type:varchar(16) comment 'female:女,male:男'"` Role int `gorm:"column:role;default:1;type:int comment '1:普通用户,2:管理员'"` CreatedAt time.Time `gorm:"column:add_time"` UpdatedAt time.Time `gorm:"column:update_time"` DeletedAt gorm.DeletedAt IsDeletedAt bool } func (User) TableName() string { return "users" } type userRepo struct { data *Data log *log.Helper } // NewUserRepo . func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo { return &userRepo{ data: data, log: log.NewHelper(logger), } } // CreateUser . func (r *userRepo) CreateUser(ctx context.Context, u *biz.User) (*biz.User, error) { // 验证是否已经创建 var user User result := r.data.db.Where(&User{Mobile: u.Mobile}).First(&user) if result.RowsAffected == 1 { return nil, errors.New(500, "USER_EXIST", "用户已存在"+u.Mobile) } user.Mobile = u.Mobile user.NickName = u.NickName user.Password = encrypt(u.Password) // 密码加密 res := r.data.db.Create(&user) if res.Error != nil { return nil, errors.New(500, "CREAT_USER_ERROR", "用户创建失败") } userInfoRes := modelToResponse(user) return &userInfoRes, nil } // Password encryption func encrypt(psd string) string { options := &password.Options{SaltLen: 16, Iterations: 10000, KeyLen: 32, HashFunction: sha512.New} salt, encodedPwd := password.Encode(psd, options) return fmt.Sprintf("$pbkdf2-sha512$%s$%s", salt, encodedPwd) } // ModelToResponse 转换 user 表中所有字段的值 func modelToResponse(user User) biz.User { userInfoRsp := biz.User{ ID: user.ID, Mobile: user.Mobile, Password: user.Password, NickName: user.NickName, Gender: user.Gender, Role: user.Role, Birthday: user.Birthday, CreatedAt: user.CreatedAt, } return userInfoRsp } // ListUser . func (r *userRepo) ListUser(ctx context.Context, pageNum, pageSize int) ([]*biz.User, int, error) { var users []User result := r.data.db.Find(&users) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return nil, 0, errors.NotFound("USER_NOT_FOUND", "user not found") } if result.Error != nil { return nil, 0, errors.New(500, "FIND_USER_ERROR", "find user error") } total := int(result.RowsAffected) r.data.db.Scopes(paginate(pageNum, pageSize)).Find(&users) rv := make([]*biz.User, 0) for _, u := range users { rv = append(rv, &biz.User{ ID: u.ID, Mobile: u.Mobile, Password: u.Password, NickName: u.NickName, Gender: u.Gender, Role: u.Role, Birthday: u.Birthday, }) } return rv, total, nil } // paginate 分页 func paginate(page, pageSize int) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { if page == 0 { page = 1 } switch { case pageSize > 100: pageSize = 100 case pageSize <= 0: pageSize = 10 } offset := (page - 1) * pageSize return db.Offset(offset).Limit(pageSize) } } // UserByMobile . func (r *userRepo) UserByMobile(ctx context.Context, mobile string) (*biz.User, error) { var user User result := r.data.db.Where(&User{Mobile: mobile}).First(&user) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return nil, errors.NotFound("USER_NOT_FOUND", "user not found") } if result.Error != nil { return nil, errors.New(500, "FIND_USER_ERROR", "find user error") } if result.RowsAffected == 0 { return nil, errors.NotFound("USER_NOT_FOUND", "user not found") } re := modelToResponse(user) return &re, nil } // UpdateUser . func (r *userRepo) UpdateUser(ctx context.Context, user *biz.User) (bool, error) { var userInfo User result := r.data.db.Where(&User{ID: user.ID}).First(&userInfo) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return false, errors.NotFound("USER_NOT_FOUND", "user not found") } if result.RowsAffected == 0 { return false, errors.NotFound("USER_NOT_FOUND", "用户不存在") } userInfo.NickName = user.NickName userInfo.Birthday = user.Birthday userInfo.Gender = user.Gender if err := r.data.db.Save(&userInfo).Error; err != nil { return false, errors.New(500, "USER_NOT_FOUND", err.Error()) } return true, nil } // GetUserById . func (r *userRepo) GetUserById(ctx context.Context, Id int64) (*biz.User, error) { var user User if err := r.data.db.Where(&User{ID: Id}).First(&user).Error; err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { return nil, errors.NotFound("USER_NOT_FOUND", "user not found") } return nil, errors.New(500, "USER_NOT_FOUND", err.Error()) } re := modelToResponse(user) return &re, nil } // CheckPassword . func (r *userRepo) CheckPassword(ctx context.Context, psd, encryptedPassword string) (bool, error) { options := &password.Options{SaltLen: 16, Iterations: 10000, KeyLen: 32, HashFunction: sha512.New} passwordInfo := strings.Split(encryptedPassword, "$") check := password.Verify(psd, passwordInfo[2], passwordInfo[3], options) return check, nil } ================================================ FILE: service/user/internal/data/user_test.go ================================================ package data_test import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "time" "user/internal/biz" "user/internal/data" "user/internal/testdata" ) var _ = Describe("User", func() { var ro biz.UserRepo var uD *biz.User BeforeEach(func() { ro = data.NewUserRepo(Db, nil) // 这里你可以不引入外部组装好的数据,可以在这里直接写 uD = testdata.User() }) // 设置 It 块来添加单个规格 It("CreateUser", func() { u, err := ro.CreateUser(ctx, uD) Ω(err).ShouldNot(HaveOccurred()) // 组装的数据 mobile 为 13509876789 Ω(u.Mobile).Should(Equal("13509876789")) // 手机号应该为创建的时候写入的手机号 }) // 设置 It 块来添加单个规格 It("ListUser", func() { user, total, err := ro.ListUser(ctx, 1, 10) Ω(err).ShouldNot(HaveOccurred()) // 获取列表不应该出现错误 Ω(user).ShouldNot(BeEmpty()) // 结果不应该为空 Ω(total).Should(Equal(1)) // 总数应该为 1,因为上面只创建了一条 Ω(len(user)).Should(Equal(1)) Ω(user[0].Mobile).Should(Equal("13509876789")) }) // 设置 It 块来添加单个规格 It("UpdateUser", func() { birthDay := time.Unix(int64(693646426), 0) uD.NickName = "gyl" uD.Birthday = &birthDay uD.Gender = "female" user, err := ro.UpdateUser(ctx, uD) Ω(err).ShouldNot(HaveOccurred()) // 更新不应该出现错误 Ω(user).Should(BeTrue()) // 结果应该为 true }) It("CheckPassword", func() { p1 := "admin" encryptedPassword := "$pbkdf2-sha512$5p7doUNIS9I5mvhA$b18171ff58b04c02ed70ea4f39bda036029c107294bce83301a02fb53a1bcae0" password, err := ro.CheckPassword(ctx, p1, encryptedPassword) Ω(err).ShouldNot(HaveOccurred()) // 密码验证通过 Ω(password).Should(BeTrue()) // 结果应该为true encryptedPassword1 := "$pbkdf2-sha512$5p7doUNIS9I5mvhA$b18171ff58b04c02ed70ea4f39" password1, err := ro.CheckPassword(ctx, p1, encryptedPassword1) if err != nil { return } Ω(err).ShouldNot(HaveOccurred()) Ω(password1).Should(BeFalse()) // 密码验证不通过 }) }) ================================================ FILE: service/user/internal/domain/address.go ================================================ package domain type Address struct { ID int64 UserID int64 IsDefault int Mobile string Name string Province string City string Districts string Address string PostCode string } ================================================ FILE: service/user/internal/mocks/mrepo/address.go ================================================ // Code generated by MockGen. DO NOT EDIT. // Source: user/internal/biz (interfaces: AddressRepo) // Package mrepo is a generated GoMock package. package mrepo import ( context "context" reflect "reflect" "user/internal/domain" gomock "github.com/golang/mock/gomock" ) // MockAddressRepo is a mock of AddressRepo interface. type MockAddressRepo struct { ctrl *gomock.Controller recorder *MockAddressRepoMockRecorder } // MockAddressRepoMockRecorder is the mock recorder for MockAddressRepo. type MockAddressRepoMockRecorder struct { mock *MockAddressRepo } // NewMockAddressRepo creates a new mock instance. func NewMockAddressRepo(ctrl *gomock.Controller) *MockAddressRepo { mock := &MockAddressRepo{ctrl: ctrl} mock.recorder = &MockAddressRepoMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. func (m *MockAddressRepo) EXPECT() *MockAddressRepoMockRecorder { return m.recorder } // AddressListByUid mocks base method. func (m *MockAddressRepo) AddressListByUid(arg0 context.Context, arg1 int64) ([]*domain.Address, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AddressListByUid", arg0, arg1) ret0, _ := ret[0].([]*domain.Address) ret1, _ := ret[1].(error) return ret0, ret1 } // AddressListByUid indicates an expected call of AddressListByUid. func (mr *MockAddressRepoMockRecorder) AddressListByUid(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddressListByUid", reflect.TypeOf((*MockAddressRepo)(nil).AddressListByUid), arg0, arg1) } // CreateAddress mocks base method. func (m *MockAddressRepo) CreateAddress(arg0 context.Context, arg1 *domain.Address) (*domain.Address, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateAddress", arg0, arg1) ret0, _ := ret[0].(*domain.Address) ret1, _ := ret[1].(error) return ret0, ret1 } // CreateAddress indicates an expected call of CreateAddress. func (mr *MockAddressRepoMockRecorder) CreateAddress(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAddress", reflect.TypeOf((*MockAddressRepo)(nil).CreateAddress), arg0, arg1) } // DefaultAddress mocks base method. func (m *MockAddressRepo) DefaultAddress(arg0 context.Context, arg1 *domain.Address) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DefaultAddress", arg0, arg1) ret0, _ := ret[0].(error) return ret0 } // DefaultAddress indicates an expected call of DefaultAddress. func (mr *MockAddressRepoMockRecorder) DefaultAddress(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultAddress", reflect.TypeOf((*MockAddressRepo)(nil).DefaultAddress), arg0, arg1) } // DeleteAddress mocks base method. func (m *MockAddressRepo) DeleteAddress(arg0 context.Context, arg1 *domain.Address) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAddress", arg0, arg1) ret0, _ := ret[0].(error) return ret0 } // DeleteAddress indicates an expected call of DeleteAddress. func (mr *MockAddressRepoMockRecorder) DeleteAddress(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAddress", reflect.TypeOf((*MockAddressRepo)(nil).DeleteAddress), arg0, arg1) } // UpdateAddress mocks base method. func (m *MockAddressRepo) UpdateAddress(arg0 context.Context, arg1 *domain.Address) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateAddress", arg0, arg1) ret0, _ := ret[0].(error) return ret0 } // UpdateAddress indicates an expected call of UpdateAddress. func (mr *MockAddressRepoMockRecorder) UpdateAddress(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAddress", reflect.TypeOf((*MockAddressRepo)(nil).UpdateAddress), arg0, arg1) } ================================================ FILE: service/user/internal/mocks/mrepo/user.go ================================================ // Code generated by MockGen. DO NOT EDIT. // Source: user/internal/biz (interfaces: UserRepo) // Package mrepo is a generated GoMock package. package mrepo import ( context "context" reflect "reflect" biz "user/internal/biz" gomock "github.com/golang/mock/gomock" ) // MockUserRepo is a mock of UserRepo interface. type MockUserRepo struct { ctrl *gomock.Controller recorder *MockUserRepoMockRecorder } // MockUserRepoMockRecorder is the mock recorder for MockUserRepo. type MockUserRepoMockRecorder struct { mock *MockUserRepo } // NewMockUserRepo creates a new mock instance. func NewMockUserRepo(ctrl *gomock.Controller) *MockUserRepo { mock := &MockUserRepo{ctrl: ctrl} mock.recorder = &MockUserRepoMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. func (m *MockUserRepo) EXPECT() *MockUserRepoMockRecorder { return m.recorder } // CheckPassword mocks base method. func (m *MockUserRepo) CheckPassword(arg0 context.Context, arg1, arg2 string) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CheckPassword", arg0, arg1, arg2) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } // CheckPassword indicates an expected call of CheckPassword. func (mr *MockUserRepoMockRecorder) CheckPassword(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckPassword", reflect.TypeOf((*MockUserRepo)(nil).CheckPassword), arg0, arg1, arg2) } // CreateUser mocks base method. func (m *MockUserRepo) CreateUser(arg0 context.Context, arg1 *biz.User) (*biz.User, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateUser", arg0, arg1) ret0, _ := ret[0].(*biz.User) ret1, _ := ret[1].(error) return ret0, ret1 } // CreateUser indicates an expected call of CreateUser. func (mr *MockUserRepoMockRecorder) CreateUser(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUser", reflect.TypeOf((*MockUserRepo)(nil).CreateUser), arg0, arg1) } // GetUserById mocks base method. func (m *MockUserRepo) GetUserById(arg0 context.Context, arg1 int64) (*biz.User, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetUserById", arg0, arg1) ret0, _ := ret[0].(*biz.User) ret1, _ := ret[1].(error) return ret0, ret1 } // GetUserById indicates an expected call of GetUserById. func (mr *MockUserRepoMockRecorder) GetUserById(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserById", reflect.TypeOf((*MockUserRepo)(nil).GetUserById), arg0, arg1) } // ListUser mocks base method. func (m *MockUserRepo) ListUser(arg0 context.Context, arg1, arg2 int) ([]*biz.User, int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListUser", arg0, arg1, arg2) ret0, _ := ret[0].([]*biz.User) ret1, _ := ret[1].(int) ret2, _ := ret[2].(error) return ret0, ret1, ret2 } // ListUser indicates an expected call of ListUser. func (mr *MockUserRepoMockRecorder) ListUser(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUser", reflect.TypeOf((*MockUserRepo)(nil).ListUser), arg0, arg1, arg2) } // UpdateUser mocks base method. func (m *MockUserRepo) UpdateUser(arg0 context.Context, arg1 *biz.User) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateUser", arg0, arg1) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } // UpdateUser indicates an expected call of UpdateUser. func (mr *MockUserRepoMockRecorder) UpdateUser(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUser", reflect.TypeOf((*MockUserRepo)(nil).UpdateUser), arg0, arg1) } // UserByMobile mocks base method. func (m *MockUserRepo) UserByMobile(arg0 context.Context, arg1 string) (*biz.User, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UserByMobile", arg0, arg1) ret0, _ := ret[0].(*biz.User) ret1, _ := ret[1].(error) return ret0, ret1 } // UserByMobile indicates an expected call of UserByMobile. func (mr *MockUserRepoMockRecorder) UserByMobile(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UserByMobile", reflect.TypeOf((*MockUserRepo)(nil).UserByMobile), arg0, arg1) } ================================================ FILE: service/user/internal/mocks/usecase/biz.go ================================================ // Code generated by MockGen. DO NOT EDIT. // Source: user/internal/biz (interfaces: Transaction) // Package usecase is a generated GoMock package. package usecase import ( context "context" reflect "reflect" gomock "github.com/golang/mock/gomock" ) // MockTransaction is a mock of Transaction interface. type MockTransaction struct { ctrl *gomock.Controller recorder *MockTransactionMockRecorder } // MockTransactionMockRecorder is the mock recorder for MockTransaction. type MockTransactionMockRecorder struct { mock *MockTransaction } // NewMockTransaction creates a new mock instance. func NewMockTransaction(ctrl *gomock.Controller) *MockTransaction { mock := &MockTransaction{ctrl: ctrl} mock.recorder = &MockTransactionMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. func (m *MockTransaction) EXPECT() *MockTransactionMockRecorder { return m.recorder } // ExecTx mocks base method. func (m *MockTransaction) ExecTx(arg0 context.Context, arg1 func(context.Context) error) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ExecTx", arg0, arg1) ret0, _ := ret[0].(error) return ret0 } // ExecTx indicates an expected call of ExecTx. func (mr *MockTransactionMockRecorder) ExecTx(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecTx", reflect.TypeOf((*MockTransaction)(nil).ExecTx), arg0, arg1) } ================================================ FILE: service/user/internal/server/grpc.go ================================================ package server import ( "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/logging" "github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/transport/grpc" v1 "user/api/user/v1" "user/internal/conf" "user/internal/service" ) // NewGRPCServer new a gRPC s. func NewGRPCServer(c *conf.Server, u *service.UserService, logger log.Logger) *grpc.Server { var opts = []grpc.ServerOption{ grpc.Middleware( recovery.Recovery(), tracing.Server(), logging.Server(logger), ), } if c.Grpc.Network != "" { opts = append(opts, grpc.Network(c.Grpc.Network)) } if c.Grpc.Addr != "" { opts = append(opts, grpc.Address(c.Grpc.Addr)) } if c.Grpc.Timeout != nil { opts = append(opts, grpc.Timeout(c.Grpc.Timeout.AsDuration())) } srv := grpc.NewServer(opts...) v1.RegisterUserServer(srv, u) return srv } ================================================ FILE: service/user/internal/server/server.go ================================================ package server import ( "github.com/go-kratos/kratos/v2/registry" "github.com/google/wire" "user/internal/conf" "github.com/go-kratos/kratos/contrib/registry/consul/v2" consulAPI "github.com/hashicorp/consul/api" ) // ProviderSet is s providers. var ProviderSet = wire.NewSet(NewGRPCServer, NewRegistrar) // NewRegistrar 引入 consul func NewRegistrar(conf *conf.Registry) registry.Registrar { c := consulAPI.DefaultConfig() c.Address = conf.Consul.Address c.Scheme = conf.Consul.Scheme cli, err := consulAPI.NewClient(c) if err != nil { panic(err) } r := consul.New(cli, consul.WithHealthCheck(false)) return r } ================================================ FILE: service/user/internal/service/README.md ================================================ # Service ================================================ FILE: service/user/internal/service/address.go ================================================ package service import ( "context" v1 "user/api/user/v1" "user/internal/domain" ) func (ua *UserService) DeleteAddress(ctx context.Context, req *v1.AddressReq) (*v1.CheckResponse, error) { err := ua.ac.DeleteAddress(ctx, &domain.Address{ ID: req.Id, UserID: req.Uid, }) if err != nil { return nil, err } return &v1.CheckResponse{Success: true}, nil } func (ua *UserService) DefaultAddress(ctx context.Context, req *v1.AddressReq) (*v1.CheckResponse, error) { err := ua.ac.DefaultAddress(ctx, &domain.Address{ ID: req.Id, UserID: req.Uid, }) if err != nil { return nil, err } return &v1.CheckResponse{Success: true}, nil } func (ua *UserService) UpdateAddress(ctx context.Context, req *v1.UpdateAddressReq) (*v1.CheckResponse, error) { err := ua.ac.UpdateAddress(ctx, &domain.Address{ ID: req.Id, UserID: req.Uid, IsDefault: int(req.IsDefault), Mobile: req.Mobile, Name: req.Name, Province: req.Province, City: req.City, Districts: req.Districts, Address: req.Address, PostCode: req.PostCode, }) if err != nil { return nil, err } return &v1.CheckResponse{Success: true}, nil } func (ua *UserService) ListAddress(ctx context.Context, req *v1.ListAddressReq) (*v1.ListAddressReply, error) { rv, err := ua.ac.AddressListByUid(ctx, req.Uid) if err != nil { return nil, err } res := &v1.ListAddressReply{} for _, v := range rv { address := v1.AddressInfo{ Id: v.ID, Name: v.Name, Mobile: v.Mobile, Province: v.Province, City: v.City, Districts: v.Districts, Address: v.Address, PostCode: v.PostCode, IsDefault: int32(v.IsDefault), } res.Results = append(res.Results, &address) } return res, nil } func (ua *UserService) CreateAddress(ctx context.Context, req *v1.CreateAddressReq) (*v1.AddressInfo, error) { // user is existing _, err := ua.uc.UserById(ctx, req.Uid) if err != nil { return nil, err } rv, err := ua.ac.AddAddress(ctx, &domain.Address{ UserID: req.Uid, IsDefault: int(req.IsDefault), Mobile: req.Mobile, Name: req.Name, Province: req.Province, City: req.City, Districts: req.Districts, Address: req.Address, PostCode: req.PostCode, }) if err != nil { return nil, err } return &v1.AddressInfo{ Id: rv.ID, Name: rv.Name, Mobile: rv.Mobile, Province: rv.Province, City: rv.City, Districts: rv.Districts, Address: rv.Address, PostCode: rv.PostCode, IsDefault: int32(rv.IsDefault), }, nil } func (ua *UserService) GetAddress(ctx context.Context, req *v1.AddressReq) (*v1.AddressInfo, error) { address, err := ua.ac.GetAddress(ctx, &domain.Address{ ID: req.Id, UserID: req.Uid, }) if err != nil { return nil, err } return &v1.AddressInfo{ Id: address.ID, Name: address.Name, Mobile: address.Mobile, Province: address.Province, City: address.City, Districts: address.Districts, Address: address.Address, PostCode: address.PostCode, IsDefault: int32(address.IsDefault), }, nil } ================================================ FILE: service/user/internal/service/service.go ================================================ package service import "github.com/google/wire" // ProviderSet is service providers. var ProviderSet = wire.NewSet(NewUserService) ================================================ FILE: service/user/internal/service/user.go ================================================ package service import ( "context" "time" v1 "user/api/user/v1" "user/internal/biz" "github.com/go-kratos/kratos/v2/log" "github.com/golang/protobuf/ptypes/empty" "go.opentelemetry.io/otel" "google.golang.org/protobuf/types/known/emptypb" ) type UserService struct { v1.UnimplementedUserServer uc *biz.UserUsecase ac *biz.AddressUsecase log *log.Helper } // NewUserService new a greeter service. func NewUserService(uc *biz.UserUsecase, ac *biz.AddressUsecase, logger log.Logger) *UserService { return &UserService{uc: uc, ac: ac, log: log.NewHelper(logger)} } // CreateUser create a user func (u *UserService) CreateUser(ctx context.Context, req *v1.CreateUserInfo) (*v1.UserInfoResponse, error) { user, err := u.uc.Create(ctx, &biz.User{ Mobile: req.Mobile, Password: req.Password, NickName: req.NickName, }) if err != nil { return nil, err } userInfoRsp := UserResponse(user) return &userInfoRsp, nil } // GetUserList . func (u *UserService) GetUserList(ctx context.Context, req *v1.PageInfo) (*v1.UserListResponse, error) { tr := otel.Tracer("service") ctx, span := tr.Start(ctx, "get user list") defer span.End() list, total, err := u.uc.List(ctx, int(req.Pn), int(req.PSize)) if err != nil { return nil, err } rsp := &v1.UserListResponse{} rsp.Total = int32(total) for _, user := range list { userInfoRsp := UserResponse(user) rsp.Data = append(rsp.Data, &userInfoRsp) } return rsp, nil } func UserResponse(user *biz.User) v1.UserInfoResponse { userInfoRsp := v1.UserInfoResponse{ Id: user.ID, Mobile: user.Mobile, Password: user.Password, NickName: user.NickName, Gender: user.Gender, Role: int32(user.Role), } if user.Birthday != nil { userInfoRsp.Birthday = uint64(user.Birthday.Unix()) } return userInfoRsp } // GetUserByMobile . func (u *UserService) GetUserByMobile(ctx context.Context, req *v1.MobileRequest) (*v1.UserInfoResponse, error) { tr := otel.Tracer("service") ctx, span := tr.Start(ctx, "get user list") defer span.End() user, err := u.uc.UserByMobile(ctx, req.Mobile) if err != nil { return nil, err } rsp := UserResponse(user) return &rsp, nil } // UpdateUser . func (u *UserService) UpdateUser(ctx context.Context, req *v1.UpdateUserInfo) (*emptypb.Empty, error) { birthDay := time.Unix(int64(req.Birthday), 0) user, err := u.uc.UpdateUser(ctx, &biz.User{ ID: req.Id, Gender: req.Gender, Birthday: &birthDay, NickName: req.NickName, }) if err != nil { return nil, err } if user == false { return nil, err } return &empty.Empty{}, nil } // CheckPassword . func (u *UserService) CheckPassword(ctx context.Context, req *v1.PasswordCheckInfo) (*v1.CheckResponse, error) { tr := otel.Tracer("service") ctx, span := tr.Start(ctx, "check user password") defer span.End() check, err := u.uc.CheckPassword(ctx, req.Password, req.EncryptedPassword) if err != nil { return nil, err } return &v1.CheckResponse{Success: check}, nil } // GetUserById . func (u *UserService) GetUserById(ctx context.Context, req *v1.IdRequest) (*v1.UserInfoResponse, error) { tr := otel.Tracer("service") ctx, span := tr.Start(ctx, "get user info by Id") defer span.End() user, err := u.uc.UserById(ctx, req.Id) if err != nil { return nil, err } rsp := UserResponse(user) return &rsp, nil } ================================================ FILE: service/user/internal/testdata/user.go ================================================ package testdata import ( "gorm.io/gorm" "time" "user/internal/biz" "user/internal/domain" ) func User(id ...int64) *biz.User { user := &biz.User{ ID: 1, Mobile: "13509876789", Password: "admin", NickName: "aliliin", Birthday: nil, Role: 0, CreatedAt: time.Time{}, UpdatedAt: time.Time{}, DeletedAt: gorm.DeletedAt{}, IsDeletedAt: false, } if len(id) > 0 { user.ID = id[1] } return user } func Address(id ...int64) *domain.Address { addressInfo := &domain.Address{ ID: 0, UserID: 0, IsDefault: 0, Mobile: "13509876789", Name: "gyl", Province: "北京市", City: "朝阳区", Districts: "", Address: "朝阳群众", PostCode: "10000", } if len(id) > 0 { addressInfo.ID = id[1] } return addressInfo } ================================================ FILE: service/user/openapi.yaml ================================================ # Generated with protoc-gen-openapi # https://github.com/google/gnostic/tree/master/apps/protoc-gen-openapi openapi: 3.0.3 info: title: "" version: 0.0.1 paths: {} components: schemas: {} ================================================ FILE: service/user/test/user.go ================================================ package main import ( "context" "fmt" "google.golang.org/grpc" v1 "user/api/user/v1" ) var userClient v1.UserClient var conn *grpc.ClientConn func main() { Init() //TestDeleteAddress() // 删除用户地址 //TestDefaultAddress() // 设置用户默认地址 //TestUpdateAddress() // 修改用户地址列表 TestGetUserAddressList() // 获取用户地址列表 //TestCreateAddress() // 创建用户地址 //TestGetUserList() // 获取用户列表 //TestCreateUser() // 创建用户 //TestUpdateUser() // 更新用户 //TestGetUserByMobile() // 根据手机获取用户 //TestGetUserById() // 根据ID 获取用户 conn.Close() } func TestDeleteAddress() { rsp, err := userClient.DeleteAddress(context.Background(), &v1.AddressReq{ Id: 4, Uid: 2, }) if err != nil { panic("grpc 删除用户地址失败" + err.Error()) } fmt.Println(rsp) } func TestDefaultAddress() { rsp, err := userClient.DefaultAddress(context.Background(), &v1.AddressReq{ Id: 2, Uid: 1, }) if err != nil { panic("grpc 设置默认地址失败" + err.Error()) } fmt.Println(rsp) } func TestUpdateAddress() { rsp, err := userClient.UpdateAddress(context.Background(), &v1.UpdateAddressReq{ Id: 1, Uid: 2, Name: "test1111", Mobile: "13161006666", Province: "北京市", City: "北京", Districts: "朝阳", Address: "十八里", PostCode: "00001", IsDefault: 0, }) if err != nil { panic("grpc 修改地址失败" + err.Error()) } fmt.Println(rsp) } func TestCreateAddress() { rsp, err := userClient.CreateAddress(context.Background(), &v1.CreateAddressReq{ Uid: 2, Name: "test666", Mobile: "13161006666", Province: "北京市", City: "北京", Districts: "朝阳", Address: "十八里", PostCode: "00001", IsDefault: 0, }) if err != nil { panic("grpc 创建地址失败" + err.Error()) } fmt.Println(rsp.Id) } func TestGetUserAddressList() { rsp, err := userClient.ListAddress(context.Background(), &v1.ListAddressReq{ Uid: 11, }) if err != nil { panic("grpc get user by ID err" + err.Error()) } fmt.Println(rsp) } // Init 初始化 grpc 链接 func Init() { var err error conn, err = grpc.Dial("127.0.0.1:50051", grpc.WithInsecure()) if err != nil { panic("grpc link err" + err.Error()) } userClient = v1.NewUserClient(conn) } func TestGetUserById() { rsp, err := userClient.GetUserById(context.Background(), &v1.IdRequest{ Id: 3, }) if err != nil { panic("grpc get user by ID err" + err.Error()) } fmt.Println(rsp) } func TestGetUserByMobile() { rsp, err := userClient.GetUserByMobile(context.Background(), &v1.MobileRequest{ Mobile: "13501167232", }) if err != nil { panic("grpc get user by mobile err" + err.Error()) } fmt.Println(rsp) } func TestUpdateUser() { rsp, err := userClient.UpdateUser(context.Background(), &v1.UpdateUserInfo{ Id: 9, Gender: "female", NickName: fmt.Sprintf("YWW%d", 233), }) if err != nil { panic("grpc update user err" + err.Error()) } fmt.Println(rsp) } // TestCreateUser 测试创建 10 个用户数据 func TestCreateUser() { for i := 0; i < 10; i++ { rsp, err := userClient.CreateUser(context.Background(), &v1.CreateUserInfo{ Mobile: fmt.Sprintf("1350116723%d", i), Password: "Gaofei123456", NickName: fmt.Sprintf("YW%d", i), }) if err != nil { panic("grpc 创建用户失败" + err.Error()) } fmt.Println(rsp.Id) } } func TestGetUserList() { r, err := userClient.GetUserList(context.Background(), &v1.PageInfo{ Pn: 1, PSize: 60, }) if err != nil { panic("grpc get err" + err.Error()) } for _, user := range r.Data { fmt.Println(user.Mobile, user.NickName, user.Password) if user.Mobile == "13501167242" { checkRsp, err := userClient.CheckPassword(context.Background(), &v1.PasswordCheckInfo{ Password: "1234567890", EncryptedPassword: user.Password, }) if err != nil { panic(" get check user psw err" + err.Error()) } fmt.Println(checkRsp.Success) } else { checkRsp, err := userClient.CheckPassword(context.Background(), &v1.PasswordCheckInfo{ Password: "admin", EncryptedPassword: user.Password, }) if err != nil { panic(" get check user psw err" + err.Error()) } fmt.Println(checkRsp.Success) } } fmt.Println(r.Total) } ================================================ FILE: service/user/third_party/README.md ================================================ # third_party ================================================ FILE: service/user/third_party/errors/errors.proto ================================================ syntax = "proto3"; package errors; option go_package = "github.com/go-kratos/kratos/v2/errors;errors"; option java_multiple_files = true; option java_package = "com.github.kratos.errors"; option objc_class_prefix = "KratosErrors"; import "google/protobuf/descriptor.proto"; extend google.protobuf.EnumOptions { int32 default_code = 1108; } extend google.protobuf.EnumValueOptions { int32 code = 1109; } ================================================ FILE: service/user/third_party/google/api/annotations.proto ================================================ // Copyright (c) 2015, Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/api/http.proto"; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "AnnotationsProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.MethodOptions { // See `HttpRule`. HttpRule http = 72295728; } ================================================ FILE: service/user/third_party/google/api/client.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "ClientProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.ServiceOptions { // The hostname for this service. // This should be specified with no prefix or protocol. // // Example: // // service Foo { // option (google.api.default_host) = "foo.googleapi.com"; // ... // } string default_host = 1049; // OAuth scopes needed for the client. // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform"; // ... // } // // If there is more than one scope, use a comma-separated string: // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform," // "https://www.googleapis.com/auth/monitoring"; // ... // } string oauth_scopes = 1050; } extend google.protobuf.MethodOptions { // A definition of a client library method signature. // // In client libraries, each proto RPC corresponds to one or more methods // which the end user is able to call, and calls the underlying RPC. // Normally, this method receives a single argument (a struct or instance // corresponding to the RPC request object). Defining this field will // add one or more overloads providing flattened or simpler method signatures // in some languages. // // The fields on the method signature are provided as a comma-separated // string. // // For example, the proto RPC and annotation: // // rpc CreateSubscription(CreateSubscriptionRequest) // returns (Subscription) { // option (google.api.method_signature) = "name,topic"; // } // // Would add the following Java overload (in addition to the method accepting // the request object): // // public final Subscription createSubscription(String name, String topic) // // The following backwards-compatibility guidelines apply: // // * Adding this annotation to an unannotated method is backwards // compatible. // * Adding this annotation to a method which already has existing // method signature annotations is backwards compatible if and only if // the new method signature annotation is last in the sequence. // * Modifying or removing an existing method signature annotation is // a breaking change. // * Re-ordering existing method signature annotations is a breaking // change. repeated string method_signature = 1051; } ================================================ FILE: service/user/third_party/google/api/field_behavior.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "FieldBehaviorProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // An indicator of the behavior of a given field (for example, that a field // is required in requests, or given as output but ignored as input). // This **does not** change the behavior in protocol buffers itself; it only // denotes the behavior and may affect how API tooling handles the field. // // Note: This enum **may** receive new values in the future. enum FieldBehavior { // Conventional default for enums. Do not use this. FIELD_BEHAVIOR_UNSPECIFIED = 0; // Specifically denotes a field as optional. // While all fields in protocol buffers are optional, this may be specified // for emphasis if appropriate. OPTIONAL = 1; // Denotes a field as required. // This indicates that the field **must** be provided as part of the request, // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). REQUIRED = 2; // Denotes a field as output only. // This indicates that the field is provided in responses, but including the // field in a request does nothing (the server *must* ignore it and // *must not* throw an error as a result of the field's presence). OUTPUT_ONLY = 3; // Denotes a field as input only. // This indicates that the field is provided in requests, and the // corresponding field is not included in output. INPUT_ONLY = 4; // Denotes a field as immutable. // This indicates that the field may be set once in a request to create a // resource, but may not be changed thereafter. IMMUTABLE = 5; } extend google.protobuf.FieldOptions { // A designation of a specific field behavior (required, output only, etc.) // in protobuf messages. // // Examples: // // string name = 1 [(google.api.field_behavior) = REQUIRED]; // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // google.protobuf.Duration ttl = 1 // [(google.api.field_behavior) = INPUT_ONLY]; // google.protobuf.Timestamp expire_time = 1 // [(google.api.field_behavior) = OUTPUT_ONLY, // (google.api.field_behavior) = IMMUTABLE]; repeated FieldBehavior field_behavior = 1052; } ================================================ FILE: service/user/third_party/google/api/http.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "HttpProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Defines the HTTP configuration for an API service. It contains a list of // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method // to one or more HTTP REST API methods. message Http { // A list of HTTP configuration rules that apply to individual API methods. // // **NOTE:** All service configuration rules follow "last one wins" order. repeated HttpRule rules = 1; // When set to true, URL path parameters will be fully URI-decoded except in // cases of single segment matches in reserved expansion, where "%2F" will be // left encoded. // // The default behavior is to not decode RFC 6570 reserved characters in multi // segment matches. bool fully_decode_reserved_expansion = 2; } // # gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service // that supports both gRPC APIs and REST APIs. Many systems, including [Google // APIs](https://github.com/googleapis/googleapis), // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC // Gateway](https://github.com/grpc-ecosystem/grpc-gateway), // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature // and use it for large scale production services. // // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies // how different portions of the gRPC request message are mapped to the URL // path, URL query parameters, and HTTP request body. It also controls how the // gRPC response message is mapped to the HTTP response body. `HttpRule` is // typically specified as an `google.api.http` annotation on the gRPC method. // // Each mapping specifies a URL path template and an HTTP method. The path // template may refer to one or more fields in the gRPC request message, as long // as each field is a non-repeated field with a primitive (non-message) type. // The path template controls how fields of the request message are mapped to // the URL path. // // Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/{name=messages/*}" // }; // } // } // message GetMessageRequest { // string name = 1; // Mapped to URL path. // } // message Message { // string text = 1; // The resource content. // } // // This enables an HTTP REST to gRPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. // For example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get:"/v1/messages/{message_id}" // }; // } // } // message GetMessageRequest { // message SubMessage { // string subfield = 1; // } // string message_id = 1; // Mapped to URL path. // int64 revision = 2; // Mapped to URL query parameter `revision`. // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. // } // // This enables a HTTP JSON to RPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: // "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. // In the case of a repeated type, the parameter can be repeated in the URL // as `...?param=A¶m=B`. In the case of a message type, each field of the // message is mapped to a separate parameter, such as // `...?foo.a=A&foo.b=B&foo.c=C`. // // For HTTP methods that allow a request body, the `body` field // specifies the mapping. Consider a REST update method on the // message resource collection: // // service Messaging { // rpc UpdateMessage(UpdateMessageRequest) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "message" // }; // } // } // message UpdateMessageRequest { // string message_id = 1; // mapped to the URL // Message message = 2; // mapped to the body // } // // The following HTTP JSON to RPC mapping is enabled, where the // representation of the JSON in the request body is determined by // protos JSON encoding: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the // request body. This enables the following alternative definition of // the update method: // // service Messaging { // rpc UpdateMessage(Message) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "*" // }; // } // } // message Message { // string message_id = 1; // string text = 2; // } // // // The following HTTP JSON to RPC mapping is enabled: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in // the body. This makes this option more rarely used in practice when // defining REST APIs. The common usage of `*` is in custom methods // which don't use the URL at all for transferring data. // // It is possible to define multiple HTTP methods for one RPC by using // the `additional_bindings` option. Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/messages/{message_id}" // additional_bindings { // get: "/v1/users/{user_id}/messages/{message_id}" // } // }; // } // } // message GetMessageRequest { // string message_id = 1; // string user_id = 2; // } // // This enables the following two alternative HTTP JSON to RPC mappings: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: // "123456")` // // ## Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: // - Fields referred by the path template. They are passed via the URL path. // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP // request body. // - All other fields are passed via the URL query parameters, and the // parameter name is the field path in the request message. A repeated // field can be represented as multiple query parameters under the same // name. // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields // are passed via URL path and HTTP request body. // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all // fields are passed via URL path and URL query parameters. // // ### Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; // Segment = "*" | "**" | LITERAL | Variable ; // Variable = "{" FieldPath [ "=" Segments ] "}" ; // FieldPath = IDENT { "." IDENT } ; // Verb = ":" LITERAL ; // // The syntax `*` matches a single URL path segment. The syntax `**` matches // zero or more URL path segments, which must be the last part of the URL path // except the `Verb`. // // The syntax `Variable` matches part of the URL path as specified by its // template. A variable template must not contain other variables. If a variable // matches a single path segment, its template may be omitted, e.g. `{var}` // is equivalent to `{var=*}`. // // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` // contains any reserved character, such characters should be percent-encoded // before the matching. // // If a variable contains exactly one path segment, such as `"{var}"` or // `"{var=*}"`, when such a variable is expanded into a URL path on the client // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The // server side does the reverse decoding. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{var}`. // // If a variable contains multiple path segments, such as `"{var=foo/*}"` // or `"{var=**}"`, when such a variable is expanded into a URL path on the // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. // The server side does the reverse decoding, except "%2F" and "%2f" are left // unchanged. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // // ## Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The // service config is simply the YAML representation of the `google.api.Service` // proto message. // // As an alternative to annotating your proto file, you can configure gRPC // transcoding in your service config YAML files. You do this by specifying a // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same // effect as the proto annotation. This can be particularly useful if you // have a proto that is reused in multiple services. Note that any transcoding // specified in the service config will override any matching transcoding // configuration in the proto. // // Example: // // http: // rules: // # Selects a gRPC method and applies HttpRule to it. // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // // ## Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 // specification](https://developers.google.com/protocol-buffers/docs/proto3#json). // // While the single segment variable follows the semantics of // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String // Expansion, the multi segment variable **does not** follow RFC 6570 Section // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion // does not expand special characters like `?` and `#`, which would lead // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding // for multi segment variables. // // The path variables **must not** refer to any repeated or mapped field, // because client libraries are not capable of handling such variable expansion. // // The path variables **must not** capture the leading "/" character. The reason // is that the most common use case "{var}" does not capture the leading "/" // character. For consistency, all path variables must share the same behavior. // // Repeated message fields must not be mapped to URL query parameters, because // no client library can support such complicated mapping. // // If an API needs to use a JSON array for request or response body, it can map // the request or response body to a repeated field. However, some gRPC // Transcoding implementations may not support this feature. message HttpRule { // Selects a method to which this rule applies. // // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. string selector = 1; // Determines the URL pattern is matched by this rules. This pattern can be // used with any of the {get|put|post|delete|patch} methods. A custom method // can be defined using the 'custom' field. oneof pattern { // Maps to HTTP GET. Used for listing and getting information about // resources. string get = 2; // Maps to HTTP PUT. Used for replacing a resource. string put = 3; // Maps to HTTP POST. Used for creating a resource or performing an action. string post = 4; // Maps to HTTP DELETE. Used for deleting a resource. string delete = 5; // Maps to HTTP PATCH. Used for updating a resource. string patch = 6; // The custom pattern is used for specifying an HTTP method that is not // included in the `pattern` field, such as HEAD, or "*" to leave the // HTTP method unspecified for this rule. The wild-card rule is useful // for services that provide content to Web (HTML) clients. CustomHttpPattern custom = 8; } // The name of the request field whose value is mapped to the HTTP request // body, or `*` for mapping all request fields not captured by the path // pattern to the HTTP body, or omitted for not having any HTTP request body. // // NOTE: the referred field must be present at the top-level of the request // message type. string body = 7; // Optional. The name of the response field whose value is mapped to the HTTP // response body. When omitted, the entire response message will be used // as the HTTP response body. // // NOTE: The referred field must be present at the top-level of the response // message type. string response_body = 12; // Additional HTTP bindings for the selector. Nested bindings must // not contain an `additional_bindings` field themselves (that is, // the nesting may only be one level deep). repeated HttpRule additional_bindings = 11; } // A custom pattern is used for defining custom HTTP verb. message CustomHttpPattern { // The name of this custom HTTP verb. string kind = 1; // The path matched by this custom verb. string path = 2; } ================================================ FILE: service/user/third_party/google/api/httpbody.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/any.proto"; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; option java_multiple_files = true; option java_outer_classname = "HttpBodyProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Message that represents an arbitrary HTTP body. It should only be used for // payload formats that can't be represented as JSON, such as raw binary or // an HTML page. // // // This message can be used both in streaming and non-streaming API methods in // the request as well as the response. // // It can be used as a top-level request field, which is convenient if one // wants to extract parameters from either the URL or HTTP template into the // request fields and also want access to the raw HTTP body. // // Example: // // message GetResourceRequest { // // A unique request id. // string request_id = 1; // // // The raw HTTP body is bound to this field. // google.api.HttpBody http_body = 2; // } // // service ResourceService { // rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); // rpc UpdateResource(google.api.HttpBody) returns // (google.protobuf.Empty); // } // // Example with streaming methods: // // service CaldavService { // rpc GetCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // rpc UpdateCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // } // // Use of this type only changes how the request and response bodies are // handled, all other features will continue to work unchanged. message HttpBody { // The HTTP Content-Type header value specifying the content type of the body. string content_type = 1; // The HTTP request/response body as raw binary. bytes data = 2; // Application specific response metadata. Must be set in the first response // for streaming APIs. repeated google.protobuf.Any extensions = 3; } ================================================ FILE: service/user/third_party/google/protobuf/any.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "google.golang.org/protobuf/types/known/anypb"; option java_package = "com.google.protobuf"; option java_outer_classname = "AnyProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // // Protobuf library provides support to pack/unpack Any values in the form // of utility functions or additional generated methods of the Any type. // // Example 1: Pack and unpack a message in C++. // // Foo foo = ...; // Any any; // any.PackFrom(foo); // ... // if (any.UnpackTo(&foo)) { // ... // } // // Example 2: Pack and unpack a message in Java. // // Foo foo = ...; // Any any = Any.pack(foo); // ... // if (any.is(Foo.class)) { // foo = any.unpack(Foo.class); // } // // Example 3: Pack and unpack a message in Python. // // foo = Foo(...) // any = Any() // any.Pack(foo) // ... // if any.Is(Foo.DESCRIPTOR): // any.Unpack(foo) // ... // // Example 4: Pack and unpack a message in Go // // foo := &pb.Foo{...} // any, err := anypb.New(foo) // if err != nil { // ... // } // ... // foo := &pb.Foo{} // if err := any.UnmarshalTo(foo); err != nil { // ... // } // // The pack methods provided by protobuf library will by default use // 'type.googleapis.com/full.type.name' as the type URL and the unpack // methods only use the fully qualified type name after the last '/' // in the type URL, for example "foo.bar.com/x/y.z" will yield type // name "y.z". // // // JSON // // The JSON representation of an `Any` value uses the regular // representation of the deserialized, embedded message, with an // additional field `@type` which contains the type URL. Example: // // package google.profile; // message Person { // string first_name = 1; // string last_name = 2; // } // // { // "@type": "type.googleapis.com/google.profile.Person", // "firstName": , // "lastName": // } // // If the embedded message type is well-known and has a custom JSON // representation, that representation will be embedded adding a field // `value` which holds the custom JSON in addition to the `@type` // field. Example (for message [google.protobuf.Duration][]): // // { // "@type": "type.googleapis.com/google.protobuf.Duration", // "value": "1.212s" // } // message Any { // A URL/resource name that uniquely identifies the type of the serialized // protocol buffer message. This string must contain at least // one "/" character. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). // // In practice, teams usually precompile into the binary all types that they // expect it to use in the context of Any. However, for URLs which use the // scheme `http`, `https`, or no scheme, one can optionally set up a type // server that maps type URLs to message definitions as follows: // // * If no scheme is provided, `https` is assumed. // * An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // * Applications are allowed to cache lookup results based on the // URL, or have them precompiled into a binary to avoid any // lookup. Therefore, binary compatibility needs to be preserved // on changes to types. (Use versioned type names to manage // breaking changes.) // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with // type.googleapis.com. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. // string type_url = 1; // Must be a valid serialized protocol buffer of the above specified type. bytes value = 2; } ================================================ FILE: service/user/third_party/google/protobuf/api.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; import "google/protobuf/source_context.proto"; import "google/protobuf/type.proto"; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "ApiProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/apipb"; // Api is a light-weight descriptor for an API Interface. // // Interfaces are also described as "protocol buffer services" in some contexts, // such as by the "service" keyword in a .proto file, but they are different // from API Services, which represent a concrete implementation of an interface // as opposed to simply a description of methods and bindings. They are also // sometimes simply referred to as "APIs" in other contexts, such as the name of // this message itself. See https://cloud.google.com/apis/design/glossary for // detailed terminology. message Api { // The fully qualified name of this interface, including package name // followed by the interface's simple name. string name = 1; // The methods of this interface, in unspecified order. repeated Method methods = 2; // Any metadata attached to the interface. repeated Option options = 3; // A version string for this interface. If specified, must have the form // `major-version.minor-version`, as in `1.10`. If the minor version is // omitted, it defaults to zero. If the entire version field is empty, the // major version is derived from the package name, as outlined below. If the // field is not empty, the version in the package name will be verified to be // consistent with what is provided here. // // The versioning schema uses [semantic // versioning](http://semver.org) where the major version number // indicates a breaking change and the minor version an additive, // non-breaking change. Both version numbers are signals to users // what to expect from different versions, and should be carefully // chosen based on the product plan. // // The major version is also reflected in the package name of the // interface, which must end in `v`, as in // `google.feature.v1`. For major versions 0 and 1, the suffix can // be omitted. Zero major versions must only be used for // experimental, non-GA interfaces. // // string version = 4; // Source context for the protocol buffer service represented by this // message. SourceContext source_context = 5; // Included interfaces. See [Mixin][]. repeated Mixin mixins = 6; // The source syntax of the service. Syntax syntax = 7; } // Method represents a method of an API interface. message Method { // The simple name of this method. string name = 1; // A URL of the input message type. string request_type_url = 2; // If true, the request is streamed. bool request_streaming = 3; // The URL of the output message type. string response_type_url = 4; // If true, the response is streamed. bool response_streaming = 5; // Any metadata attached to the method. repeated Option options = 6; // The source syntax of this method. Syntax syntax = 7; } // Declares an API Interface to be included in this interface. The including // interface must redeclare all the methods from the included interface, but // documentation and options are inherited as follows: // // - If after comment and whitespace stripping, the documentation // string of the redeclared method is empty, it will be inherited // from the original method. // // - Each annotation belonging to the service config (http, // visibility) which is not set in the redeclared method will be // inherited. // // - If an http annotation is inherited, the path pattern will be // modified as follows. Any version prefix will be replaced by the // version of the including interface plus the [root][] path if // specified. // // Example of a simple mixin: // // package google.acl.v1; // service AccessControl { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v1/{resource=**}:getAcl"; // } // } // // package google.storage.v2; // service Storage { // rpc GetAcl(GetAclRequest) returns (Acl); // // // Get a data record. // rpc GetData(GetDataRequest) returns (Data) { // option (google.api.http).get = "/v2/{resource=**}"; // } // } // // Example of a mixin configuration: // // apis: // - name: google.storage.v2.Storage // mixins: // - name: google.acl.v1.AccessControl // // The mixin construct implies that all methods in `AccessControl` are // also declared with same name and request/response types in // `Storage`. A documentation generator or annotation processor will // see the effective `Storage.GetAcl` method after inheriting // documentation and annotations as follows: // // service Storage { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v2/{resource=**}:getAcl"; // } // ... // } // // Note how the version in the path pattern changed from `v1` to `v2`. // // If the `root` field in the mixin is specified, it should be a // relative path under which inherited HTTP paths are placed. Example: // // apis: // - name: google.storage.v2.Storage // mixins: // - name: google.acl.v1.AccessControl // root: acls // // This implies the following inherited HTTP annotation: // // service Storage { // // Get the underlying ACL object. // rpc GetAcl(GetAclRequest) returns (Acl) { // option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; // } // ... // } message Mixin { // The fully qualified name of the interface which is included. string name = 1; // If non-empty specifies a path under which inherited HTTP paths // are rooted. string root = 2; } ================================================ FILE: service/user/third_party/google/protobuf/compiler/plugin.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // // WARNING: The plugin interface is currently EXPERIMENTAL and is subject to // change. // // protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is // just a program that reads a CodeGeneratorRequest from stdin and writes a // CodeGeneratorResponse to stdout. // // Plugins written using C++ can use google/protobuf/compiler/plugin.h instead // of dealing with the raw protocol defined here. // // A plugin executable needs only to be placed somewhere in the path. The // plugin should be named "protoc-gen-$NAME", and will then be used when the // flag "--${NAME}_out" is passed to protoc. syntax = "proto2"; package google.protobuf.compiler; option java_package = "com.google.protobuf.compiler"; option java_outer_classname = "PluginProtos"; option go_package = "google.golang.org/protobuf/types/pluginpb"; import "google/protobuf/descriptor.proto"; // The version number of protocol compiler. message Version { optional int32 major = 1; optional int32 minor = 2; optional int32 patch = 3; // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should // be empty for mainline stable releases. optional string suffix = 4; } // An encoded CodeGeneratorRequest is written to the plugin's stdin. message CodeGeneratorRequest { // The .proto files that were explicitly listed on the command-line. The // code generator should generate code only for these files. Each file's // descriptor will be included in proto_file, below. repeated string file_to_generate = 1; // The generator parameter passed on the command-line. optional string parameter = 2; // FileDescriptorProtos for all files in files_to_generate and everything // they import. The files will appear in topological order, so each file // appears before any file that imports it. // // protoc guarantees that all proto_files will be written after // the fields above, even though this is not technically guaranteed by the // protobuf wire format. This theoretically could allow a plugin to stream // in the FileDescriptorProtos and handle them one by one rather than read // the entire set into memory at once. However, as of this writing, this // is not similarly optimized on protoc's end -- it will store all fields in // memory at once before sending them to the plugin. // // Type names of fields and extensions in the FileDescriptorProto are always // fully qualified. repeated FileDescriptorProto proto_file = 15; // The version number of protocol compiler. optional Version compiler_version = 3; } // The plugin writes an encoded CodeGeneratorResponse to stdout. message CodeGeneratorResponse { // Error message. If non-empty, code generation failed. The plugin process // should exit with status code zero even if it reports an error in this way. // // This should be used to indicate errors in .proto files which prevent the // code generator from generating correct code. Errors which indicate a // problem in protoc itself -- such as the input CodeGeneratorRequest being // unparseable -- should be reported by writing a message to stderr and // exiting with a non-zero status code. optional string error = 1; // A bitmask of supported features that the code generator supports. // This is a bitwise "or" of values from the Feature enum. optional uint64 supported_features = 2; // Sync with code_generator.h. enum Feature { FEATURE_NONE = 0; FEATURE_PROTO3_OPTIONAL = 1; } // Represents a single generated file. message File { // The file name, relative to the output directory. The name must not // contain "." or ".." components and must be relative, not be absolute (so, // the file cannot lie outside the output directory). "/" must be used as // the path separator, not "\". // // If the name is omitted, the content will be appended to the previous // file. This allows the generator to break large files into small chunks, // and allows the generated text to be streamed back to protoc so that large // files need not reside completely in memory at one time. Note that as of // this writing protoc does not optimize for this -- it will read the entire // CodeGeneratorResponse before writing files to disk. optional string name = 1; // If non-empty, indicates that the named file should already exist, and the // content here is to be inserted into that file at a defined insertion // point. This feature allows a code generator to extend the output // produced by another code generator. The original generator may provide // insertion points by placing special annotations in the file that look // like: // @@protoc_insertion_point(NAME) // The annotation can have arbitrary text before and after it on the line, // which allows it to be placed in a comment. NAME should be replaced with // an identifier naming the point -- this is what other generators will use // as the insertion_point. Code inserted at this point will be placed // immediately above the line containing the insertion point (thus multiple // insertions to the same point will come out in the order they were added). // The double-@ is intended to make it unlikely that the generated code // could contain things that look like insertion points by accident. // // For example, the C++ code generator places the following line in the // .pb.h files that it generates: // // @@protoc_insertion_point(namespace_scope) // This line appears within the scope of the file's package namespace, but // outside of any particular class. Another plugin can then specify the // insertion_point "namespace_scope" to generate additional classes or // other declarations that should be placed in this scope. // // Note that if the line containing the insertion point begins with // whitespace, the same whitespace will be added to every line of the // inserted text. This is useful for languages like Python, where // indentation matters. In these languages, the insertion point comment // should be indented the same amount as any inserted code will need to be // in order to work correctly in that context. // // The code generator that generates the initial file and the one which // inserts into it must both run as part of a single invocation of protoc. // Code generators are executed in the order in which they appear on the // command line. // // If |insertion_point| is present, |name| must also be present. optional string insertion_point = 2; // The file contents. optional string content = 15; // Information describing the file content being inserted. If an insertion // point is used, this information will be appropriately offset and inserted // into the code generation metadata for the generated files. optional GeneratedCodeInfo generated_code_info = 16; } repeated File file = 15; } ================================================ FILE: service/user/third_party/google/protobuf/descriptor.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. // // The messages in this file describe the definitions found in .proto files. // A valid .proto file can be translated directly to a FileDescriptorProto // without any other information (e.g. without reading its imports). syntax = "proto2"; package google.protobuf; option go_package = "google.golang.org/protobuf/types/descriptorpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; option csharp_namespace = "Google.Protobuf.Reflection"; option objc_class_prefix = "GPB"; option cc_enable_arenas = true; // descriptor.proto must be optimized for speed because reflection-based // algorithms don't work during bootstrapping. option optimize_for = SPEED; // The protocol compiler can output a FileDescriptorSet containing the .proto // files it parses. message FileDescriptorSet { repeated FileDescriptorProto file = 1; } // Describes a complete .proto file. message FileDescriptorProto { optional string name = 1; // file name, relative to root of source tree optional string package = 2; // e.g. "foo", "foo.bar", etc. // Names of files imported by this file. repeated string dependency = 3; // Indexes of the public imported files in the dependency list above. repeated int32 public_dependency = 10; // Indexes of the weak imported files in the dependency list. // For Google-internal migration only. Do not use. repeated int32 weak_dependency = 11; // All top-level definitions in this file. repeated DescriptorProto message_type = 4; repeated EnumDescriptorProto enum_type = 5; repeated ServiceDescriptorProto service = 6; repeated FieldDescriptorProto extension = 7; optional FileOptions options = 8; // This field contains optional information about the original source code. // You may safely remove this entire field without harming runtime // functionality of the descriptors -- the information is needed only by // development tools. optional SourceCodeInfo source_code_info = 9; // The syntax of the proto file. // The supported values are "proto2" and "proto3". optional string syntax = 12; } // Describes a message type. message DescriptorProto { optional string name = 1; repeated FieldDescriptorProto field = 2; repeated FieldDescriptorProto extension = 6; repeated DescriptorProto nested_type = 3; repeated EnumDescriptorProto enum_type = 4; message ExtensionRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. optional ExtensionRangeOptions options = 3; } repeated ExtensionRange extension_range = 5; repeated OneofDescriptorProto oneof_decl = 8; optional MessageOptions options = 7; // Range of reserved tag numbers. Reserved tag numbers may not be used by // fields or extension ranges in the same message. Reserved ranges may // not overlap. message ReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. } repeated ReservedRange reserved_range = 9; // Reserved field names, which may not be used by fields in the same message. // A given name may only be reserved once. repeated string reserved_name = 10; } message ExtensionRangeOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // Describes a field within a message. message FieldDescriptorProto { enum Type { // 0 is reserved for errors. // Order is weird for historical reasons. TYPE_DOUBLE = 1; TYPE_FLOAT = 2; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. TYPE_INT64 = 3; TYPE_UINT64 = 4; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. TYPE_INT32 = 5; TYPE_FIXED64 = 6; TYPE_FIXED32 = 7; TYPE_BOOL = 8; TYPE_STRING = 9; // Tag-delimited aggregate. // Group type is deprecated and not supported in proto3. However, Proto3 // implementations should still be able to parse the group wire format and // treat group fields as unknown fields. TYPE_GROUP = 10; TYPE_MESSAGE = 11; // Length-delimited aggregate. // New in version 2. TYPE_BYTES = 12; TYPE_UINT32 = 13; TYPE_ENUM = 14; TYPE_SFIXED32 = 15; TYPE_SFIXED64 = 16; TYPE_SINT32 = 17; // Uses ZigZag encoding. TYPE_SINT64 = 18; // Uses ZigZag encoding. } enum Label { // 0 is reserved for errors LABEL_OPTIONAL = 1; LABEL_REQUIRED = 2; LABEL_REPEATED = 3; } optional string name = 1; optional int32 number = 3; optional Label label = 4; // If type_name is set, this need not be set. If both this and type_name // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. optional Type type = 5; // For message and enum types, this is the name of the type. If the name // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping // rules are used to find the type (i.e. first the nested types within this // message are searched, then within the parent, on up to the root // namespace). optional string type_name = 6; // For extensions, this is the name of the type being extended. It is // resolved in the same manner as type_name. optional string extendee = 2; // For numeric types, contains the original text representation of the value. // For booleans, "true" or "false". // For strings, contains the default text contents (not escaped in any way). // For bytes, contains the C escaped value. All bytes >= 128 are escaped. optional string default_value = 7; // If set, gives the index of a oneof in the containing type's oneof_decl // list. This field is a member of that oneof. optional int32 oneof_index = 9; // JSON name of this field. The value is set by protocol compiler. If the // user has set a "json_name" option on this field, that option's value // will be used. Otherwise, it's deduced from the field's name by converting // it to camelCase. optional string json_name = 10; optional FieldOptions options = 8; // If true, this is a proto3 "optional". When a proto3 field is optional, it // tracks presence regardless of field type. // // When proto3_optional is true, this field must be belong to a oneof to // signal to old proto3 clients that presence is tracked for this field. This // oneof is known as a "synthetic" oneof, and this field must be its sole // member (each proto3 optional field gets its own synthetic oneof). Synthetic // oneofs exist in the descriptor only, and do not generate any API. Synthetic // oneofs must be ordered after all "real" oneofs. // // For message fields, proto3_optional doesn't create any semantic change, // since non-repeated message fields always track presence. However it still // indicates the semantic detail of whether the user wrote "optional" or not. // This can be useful for round-tripping the .proto file. For consistency we // give message fields a synthetic oneof also, even though it is not required // to track presence. This is especially important because the parser can't // tell if a field is a message or an enum, so it must always create a // synthetic oneof. // // Proto2 optional fields do not set this flag, because they already indicate // optional with `LABEL_OPTIONAL`. optional bool proto3_optional = 17; } // Describes a oneof. message OneofDescriptorProto { optional string name = 1; optional OneofOptions options = 2; } // Describes an enum type. message EnumDescriptorProto { optional string name = 1; repeated EnumValueDescriptorProto value = 2; optional EnumOptions options = 3; // Range of reserved numeric values. Reserved values may not be used by // entries in the same enum. Reserved ranges may not overlap. // // Note that this is distinct from DescriptorProto.ReservedRange in that it // is inclusive such that it can appropriately represent the entire int32 // domain. message EnumReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Inclusive. } // Range of reserved numeric values. Reserved numeric values may not be used // by enum values in the same enum declaration. Reserved ranges may not // overlap. repeated EnumReservedRange reserved_range = 4; // Reserved enum value names, which may not be reused. A given name may only // be reserved once. repeated string reserved_name = 5; } // Describes a value within an enum. message EnumValueDescriptorProto { optional string name = 1; optional int32 number = 2; optional EnumValueOptions options = 3; } // Describes a service. message ServiceDescriptorProto { optional string name = 1; repeated MethodDescriptorProto method = 2; optional ServiceOptions options = 3; } // Describes a method of a service. message MethodDescriptorProto { optional string name = 1; // Input and output type names. These are resolved in the same way as // FieldDescriptorProto.type_name, but must refer to a message type. optional string input_type = 2; optional string output_type = 3; optional MethodOptions options = 4; // Identifies if client streams multiple client messages optional bool client_streaming = 5 [default = false]; // Identifies if server streams multiple server messages optional bool server_streaming = 6 [default = false]; } // =================================================================== // Options // Each of the definitions above may have "options" attached. These are // just annotations which may cause code to be generated slightly differently // or may contain hints for code that manipulates protocol messages. // // Clients may define custom options as extensions of the *Options messages. // These extensions may not yet be known at parsing time, so the parser cannot // store the values in them. Instead it stores them in a field in the *Options // message called uninterpreted_option. This field must have the same name // across all *Options messages. We then use this field to populate the // extensions when we build a descriptor, at which point all protos have been // parsed and so all extensions are known. // // Extension numbers for custom options may be chosen as follows: // * For options which will only be used within a single application or // organization, or for experimental options, use field numbers 50000 // through 99999. It is up to you to ensure that you do not use the // same number for multiple options. // * For options which will be published and used publicly by multiple // independent entities, e-mail protobuf-global-extension-registry@google.com // to reserve extension numbers. Simply provide your project name (e.g. // Objective-C plugin) and your project website (if available) -- there's no // need to explain how you intend to use them. Usually you only need one // extension number. You can declare multiple options with only one extension // number by putting them in a sub-message. See the Custom Options section of // the docs for examples: // https://developers.google.com/protocol-buffers/docs/proto#options // If this turns out to be popular, a web service will be set up // to automatically assign option numbers. message FileOptions { // Sets the Java package where classes generated from this .proto will be // placed. By default, the proto package is used, but this is often // inappropriate because proto packages do not normally start with backwards // domain names. optional string java_package = 1; // Controls the name of the wrapper Java class generated for the .proto file. // That class will always contain the .proto file's getDescriptor() method as // well as any top-level extensions defined in the .proto file. // If java_multiple_files is disabled, then all the other classes from the // .proto file will be nested inside the single wrapper outer class. optional string java_outer_classname = 8; // If enabled, then the Java code generator will generate a separate .java // file for each top-level message, enum, and service defined in the .proto // file. Thus, these types will *not* be nested inside the wrapper class // named by java_outer_classname. However, the wrapper class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. optional bool java_multiple_files = 10 [default = false]; // This option does nothing. optional bool java_generate_equals_and_hash = 20 [deprecated=true]; // If set true, then the Java2 code generator will generate code that // throws an exception whenever an attempt is made to assign a non-UTF-8 // byte sequence to a string field. // Message reflection will do the same. // However, an extension field still accepts non-UTF-8 byte sequences. // This option has no effect on when used with the lite runtime. optional bool java_string_check_utf8 = 27 [default = false]; // Generated classes can be optimized for speed or code size. enum OptimizeMode { SPEED = 1; // Generate complete code for parsing, serialization, // etc. CODE_SIZE = 2; // Use ReflectionOps to implement these methods. LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. } optional OptimizeMode optimize_for = 9 [default = SPEED]; // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: // - The basename of the package import path, if provided. // - Otherwise, the package statement in the .proto file, if present. // - Otherwise, the basename of the .proto file, without extension. optional string go_package = 11; // Should generic services be generated in each language? "Generic" services // are not specific to any particular RPC system. They are generated by the // main code generators in each language (without additional plugins). // Generic services were the only kind of service generation supported by // early versions of google.protobuf. // // Generic services are now considered deprecated in favor of using plugins // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. optional bool cc_generic_services = 16 [default = false]; optional bool java_generic_services = 17 [default = false]; optional bool py_generic_services = 18 [default = false]; optional bool php_generic_services = 42 [default = false]; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. optional bool deprecated = 23 [default = false]; // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. optional bool cc_enable_arenas = 31 [default = true]; // Sets the objective c class prefix which is prepended to all objective c // generated classes from this .proto. There is no default. optional string objc_class_prefix = 36; // Namespace for generated classes; defaults to the package. optional string csharp_namespace = 37; // By default Swift generators will take the proto package and CamelCase it // replacing '.' with underscore and use that to prefix the types/symbols // defined. When this options is provided, they will use this value instead // to prefix the types/symbols defined. optional string swift_prefix = 39; // Sets the php class prefix which is prepended to all php generated classes // from this .proto. Default is empty. optional string php_class_prefix = 40; // Use this option to change the namespace of php generated classes. Default // is empty. When this option is empty, the package name will be used for // determining the namespace. optional string php_namespace = 41; // Use this option to change the namespace of php generated metadata classes. // Default is empty. When this option is empty, the proto file name will be // used for determining the namespace. optional string php_metadata_namespace = 44; // Use this option to change the package of ruby generated classes. Default // is empty. When this option is not set, the package name will be used for // determining the ruby package. optional string ruby_package = 45; // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. // See the documentation for the "Options" section above. extensions 1000 to max; reserved 38; } message MessageOptions { // Set true to use the old proto1 MessageSet wire format for extensions. // This is provided for backwards-compatibility with the MessageSet wire // format. You should not use this for any other reason: It's less // efficient, has fewer features, and is more complicated. // // The message must be defined exactly as follows: // message Foo { // option message_set_wire_format = true; // extensions 4 to max; // } // Note that the message cannot have any defined fields; MessageSets only // have extensions. // // All extensions of your type must be singular messages; e.g. they cannot // be int32s, enums, or repeated messages. // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. optional bool message_set_wire_format = 1 [default = false]; // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". optional bool no_standard_descriptor_accessor = 2 [default = false]; // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. optional bool deprecated = 3 [default = false]; reserved 4, 5, 6; // Whether the message is an automatically generated map entry type for the // maps field. // // For maps fields: // map map_field = 1; // The parsed descriptor looks like: // message MapFieldEntry { // option map_entry = true; // optional KeyType key = 1; // optional ValueType value = 2; // } // repeated MapFieldEntry map_field = 1; // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax // instead. The option should only be implicitly set by the proto compiler // parser. optional bool map_entry = 7; reserved 8; // javalite_serializable reserved 9; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message FieldOptions { // The ctype option instructs the C++ code generator to use a different // representation of the field than it normally would. See the specific // options below. This option is not yet implemented in the open source // release -- sorry, we'll try to include it in a future version! optional CType ctype = 1 [default = STRING]; enum CType { // Default mode. STRING = 0; CORD = 1; STRING_PIECE = 2; } // The packed option can be enabled for repeated primitive fields to enable // a more efficient representation on the wire. Rather than repeatedly // writing the tag and type for each element, the entire array is encoded as // a single length-delimited blob. In proto3, only explicit setting it to // false will avoid using packed encoding. optional bool packed = 2; // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING // is represented as JavaScript string, which avoids loss of precision that // can happen when a large value is converted to a floating point JavaScript. // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to // use the JavaScript "number" type. The behavior of the default option // JS_NORMAL is implementation dependent. // // This option is an enum to permit additional types to be added, e.g. // goog.math.Integer. optional JSType jstype = 6 [default = JS_NORMAL]; enum JSType { // Use the default type. JS_NORMAL = 0; // Use JavaScript strings. JS_STRING = 1; // Use JavaScript numbers. JS_NUMBER = 2; } // Should this field be parsed lazily? Lazy applies only to message-type // fields. It means that when the outer message is initially parsed, the // inner message's contents will not be parsed but instead stored in encoded // form. The inner message will actually be parsed when it is first accessed. // // This is only a hint. Implementations are free to choose whether to use // eager or lazy parsing regardless of the value of this option. However, // setting this option true suggests that the protocol author believes that // using lazy parsing on this field is worth the additional bookkeeping // overhead typically needed to implement it. // // This option does not affect the public interface of any generated code; // all method signatures remain the same. Furthermore, thread-safety of the // interface is not affected by this option; const methods remain safe to // call from multiple threads concurrently, while non-const methods continue // to require exclusive access. // // // Note that implementations may choose not to check required fields within // a lazy sub-message. That is, calling IsInitialized() on the outer message // may return true even if the inner message has missing required fields. // This is necessary because otherwise the inner message would have to be // parsed in order to perform the check, defeating the purpose of lazy // parsing. An implementation which chooses not to check required fields // must be consistent about it. That is, for any particular sub-message, the // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. // // As of 2021, lazy does no correctness checks on the byte stream during // parsing. This may lead to crashes if and when an invalid byte stream is // finally parsed upon access. // // TODO(b/211906113): Enable validation on lazy fields. optional bool lazy = 5 [default = false]; // unverified_lazy does no correctness checks on the byte stream. This should // only be used where lazy with verification is prohibitive for performance // reasons. optional bool unverified_lazy = 15 [default = false]; // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. optional bool deprecated = 3 [default = false]; // For Google-internal migration only. Do not use. optional bool weak = 10 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; reserved 4; // removed jtype } message OneofOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumOptions { // Set this option to true to allow mapping different tag names to the same // value. optional bool allow_alias = 2; // Is this enum deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. optional bool deprecated = 3 [default = false]; reserved 5; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumValueOptions { // Is this enum value deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. optional bool deprecated = 1 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message ServiceOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this service deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. optional bool deprecated = 33 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message MethodOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this method deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. optional bool deprecated = 33 [default = false]; // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, // or neither? HTTP based RPC implementation may choose GET verb for safe // methods, and PUT verb for idempotent methods instead of the default POST. enum IdempotencyLevel { IDEMPOTENCY_UNKNOWN = 0; NO_SIDE_EFFECTS = 1; // implies idempotent IDEMPOTENT = 2; // idempotent, but may have side effects } optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // A message representing a option the parser does not recognize. This only // appears in options protos created by the compiler::Parser class. // DescriptorPool resolves these when building Descriptor objects. Therefore, // options protos in descriptor objects (e.g. returned by Descriptor::options(), // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions // in them. message UninterpretedOption { // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents // "foo.(bar.baz).qux". message NamePart { required string name_part = 1; required bool is_extension = 2; } repeated NamePart name = 2; // The value of the uninterpreted option, in whatever type the tokenizer // identified it as during parsing. Exactly one of these should be set. optional string identifier_value = 3; optional uint64 positive_int_value = 4; optional int64 negative_int_value = 5; optional double double_value = 6; optional bytes string_value = 7; optional string aggregate_value = 8; } // =================================================================== // Optional source code info // Encapsulates information about the original source file from which a // FileDescriptorProto was generated. message SourceCodeInfo { // A Location identifies a piece of source code in a .proto file which // corresponds to a particular definition. This information is intended // to be useful to IDEs, code indexers, documentation generators, and similar // tools. // // For example, say we have a file like: // message Foo { // optional string foo = 1; // } // Let's look at just the field definition: // optional string foo = 1; // ^ ^^ ^^ ^ ^^^ // a bc de f ghi // We have the following locations: // span path represents // [a,i) [ 4, 0, 2, 0 ] The whole field definition. // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). // // Notes: // - A location may refer to a repeated field itself (i.e. not to any // particular index within it). This is used whenever a set of elements are // logically enclosed in a single code segment. For example, an entire // extend block (possibly containing multiple extension definitions) will // have an outer location whose path refers to the "extensions" repeated // field without an index. // - Multiple locations may have the same path. This happens when a single // logical declaration is spread out across multiple places. The most // obvious example is the "extend" block again -- there may be multiple // extend blocks in the same scope, each of which will have the same path. // - A location's span is not always a subset of its parent's span. For // example, the "extendee" of an extension declaration appears at the // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span // does not mean that it is a descendant. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to // ignore those that it doesn't understand, as more types of locations could // be recorded in the future. repeated Location location = 1; message Location { // Identifies which part of the FileDescriptorProto was defined at this // location. // // Each element is a field number or an index. They form a path from // the root FileDescriptorProto to the place where the definition occurs. // For example, this path: // [ 4, 3, 2, 7, 1 ] // refers to: // file.message_type(3) // 4, 3 // .field(7) // 2, 7 // .name() // 1 // This is because FileDescriptorProto.message_type has field number 4: // repeated DescriptorProto message_type = 4; // and DescriptorProto.field has field number 2: // repeated FieldDescriptorProto field = 2; // and FieldDescriptorProto.name has field number 1: // optional string name = 1; // // Thus, the above path gives the location of a field name. If we removed // the last element: // [ 4, 3, 2, 7 ] // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). repeated int32 path = 1 [packed = true]; // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. repeated int32 span = 2 [packed = true]; // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be // attached to the declaration. // // A series of line comments appearing on consecutive lines, with no other // tokens appearing on those lines, will be treated as a single comment. // // leading_detached_comments will keep paragraphs of comments that appear // before (but not connected to) the current element. Each paragraph, // separated by empty lines, will be one comment element in the repeated // field. // // Only the comment content is provided; comment markers (e.g. //) are // stripped out. For block comments, leading whitespace and an asterisk // will be stripped from the beginning of each line other than the first. // Newlines are included in the output. // // Examples: // // optional int32 foo = 1; // Comment attached to foo. // // Comment attached to bar. // optional int32 bar = 2; // // optional string baz = 3; // // Comment attached to baz. // // Another line attached to baz. // // // Comment attached to qux. // // // // Another line attached to qux. // optional double qux = 4; // // // Detached comment for corge. This is not leading or trailing comments // // to qux or corge because there are blank lines separating it from // // both. // // // Detached comment for corge paragraph 2. // // optional string corge = 5; // /* Block comment attached // * to corge. Leading asterisks // * will be removed. */ // /* Block comment attached to // * grault. */ // optional int32 grault = 6; // // // ignored detached comments. optional string leading_comments = 3; optional string trailing_comments = 4; repeated string leading_detached_comments = 6; } } // Describes the relationship between generated code and its original source // file. A GeneratedCodeInfo message is associated with only one generated // source file, but may contain references to different source .proto files. message GeneratedCodeInfo { // An Annotation connects some span of text in generated code to an element // of its generating .proto file. repeated Annotation annotation = 1; message Annotation { // Identifies the element in the original source .proto file. This field // is formatted the same as SourceCodeInfo.Location.path. repeated int32 path = 1 [packed = true]; // Identifies the filesystem path to the original source .proto. optional string source_file = 2; // Identifies the starting offset in bytes in the generated code // that relates to the identified object. optional int32 begin = 3; // Identifies the ending offset in bytes in the generated code that // relates to the identified offset. The end offset should be one past // the last relevant byte (so the length of the text = end - begin). optional int32 end = 4; } } ================================================ FILE: service/user/third_party/google/protobuf/duration.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/durationpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DurationProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Duration represents a signed, fixed-length span of time represented // as a count of seconds and fractions of seconds at nanosecond // resolution. It is independent of any calendar and concepts like "day" // or "month". It is related to Timestamp in that the difference between // two Timestamp values is a Duration and it can be added or subtracted // from a Timestamp. Range is approximately +-10,000 years. // // # Examples // // Example 1: Compute Duration from two Timestamps in pseudo code. // // Timestamp start = ...; // Timestamp end = ...; // Duration duration = ...; // // duration.seconds = end.seconds - start.seconds; // duration.nanos = end.nanos - start.nanos; // // if (duration.seconds < 0 && duration.nanos > 0) { // duration.seconds += 1; // duration.nanos -= 1000000000; // } else if (duration.seconds > 0 && duration.nanos < 0) { // duration.seconds -= 1; // duration.nanos += 1000000000; // } // // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. // // Timestamp start = ...; // Duration duration = ...; // Timestamp end = ...; // // end.seconds = start.seconds + duration.seconds; // end.nanos = start.nanos + duration.nanos; // // if (end.nanos < 0) { // end.seconds -= 1; // end.nanos += 1000000000; // } else if (end.nanos >= 1000000000) { // end.seconds += 1; // end.nanos -= 1000000000; // } // // Example 3: Compute Duration from datetime.timedelta in Python. // // td = datetime.timedelta(days=3, minutes=10) // duration = Duration() // duration.FromTimedelta(td) // // # JSON Mapping // // In JSON format, the Duration type is encoded as a string rather than an // object, where the string ends in the suffix "s" (indicating seconds) and // is preceded by the number of seconds, with nanoseconds expressed as // fractional seconds. For example, 3 seconds with 0 nanoseconds should be // encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should // be expressed in JSON format as "3.000000001s", and 3 seconds and 1 // microsecond should be expressed in JSON format as "3.000001s". // // message Duration { // Signed seconds of the span of time. Must be from -315,576,000,000 // to +315,576,000,000 inclusive. Note: these bounds are computed from: // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years int64 seconds = 1; // Signed fractions of a second at nanosecond resolution of the span // of time. Durations less than one second are represented with a 0 // `seconds` field and a positive or negative `nanos` field. For durations // of one second or more, a non-zero value for the `nanos` field must be // of the same sign as the `seconds` field. Must be from -999,999,999 // to +999,999,999 inclusive. int32 nanos = 2; } ================================================ FILE: service/user/third_party/google/protobuf/empty.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "google.golang.org/protobuf/types/known/emptypb"; option java_package = "com.google.protobuf"; option java_outer_classname = "EmptyProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option cc_enable_arenas = true; // A generic empty message that you can re-use to avoid defining duplicated // empty messages in your APIs. A typical example is to use it as the request // or the response type of an API method. For instance: // // service Foo { // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); // } // // The JSON representation for `Empty` is empty JSON object `{}`. message Empty {} ================================================ FILE: service/user/third_party/google/protobuf/field_mask.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "FieldMaskProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; option cc_enable_arenas = true; // `FieldMask` represents a set of symbolic field paths, for example: // // paths: "f.a" // paths: "f.b.d" // // Here `f` represents a field in some root message, `a` and `b` // fields in the message found in `f`, and `d` a field found in the // message in `f.b`. // // Field masks are used to specify a subset of fields that should be // returned by a get operation or modified by an update operation. // Field masks also have a custom JSON encoding (see below). // // # Field Masks in Projections // // When used in the context of a projection, a response message or // sub-message is filtered by the API to only contain those fields as // specified in the mask. For example, if the mask in the previous // example is applied to a response message as follows: // // f { // a : 22 // b { // d : 1 // x : 2 // } // y : 13 // } // z: 8 // // The result will not contain specific values for fields x,y and z // (their value will be set to the default, and omitted in proto text // output): // // // f { // a : 22 // b { // d : 1 // } // } // // A repeated field is not allowed except at the last position of a // paths string. // // If a FieldMask object is not present in a get operation, the // operation applies to all fields (as if a FieldMask of all fields // had been specified). // // Note that a field mask does not necessarily apply to the // top-level response message. In case of a REST get operation, the // field mask applies directly to the response, but in case of a REST // list operation, the mask instead applies to each individual message // in the returned resource list. In case of a REST custom method, // other definitions may be used. Where the mask applies will be // clearly documented together with its declaration in the API. In // any case, the effect on the returned resource/resources is required // behavior for APIs. // // # Field Masks in Update Operations // // A field mask in update operations specifies which fields of the // targeted resource are going to be updated. The API is required // to only change the values of the fields as specified in the mask // and leave the others untouched. If a resource is passed in to // describe the updated values, the API ignores the values of all // fields not covered by the mask. // // If a repeated field is specified for an update operation, new values will // be appended to the existing repeated field in the target resource. Note that // a repeated field is only allowed in the last position of a `paths` string. // // If a sub-message is specified in the last position of the field mask for an // update operation, then new value will be merged into the existing sub-message // in the target resource. // // For example, given the target message: // // f { // b { // d: 1 // x: 2 // } // c: [1] // } // // And an update message: // // f { // b { // d: 10 // } // c: [2] // } // // then if the field mask is: // // paths: ["f.b", "f.c"] // // then the result will be: // // f { // b { // d: 10 // x: 2 // } // c: [1, 2] // } // // An implementation may provide options to override this default behavior for // repeated and message fields. // // In order to reset a field's value to the default, the field must // be in the mask and set to the default value in the provided resource. // Hence, in order to reset all fields of a resource, provide a default // instance of the resource and set all fields in the mask, or do // not provide a mask as described below. // // If a field mask is not present on update, the operation applies to // all fields (as if a field mask of all fields has been specified). // Note that in the presence of schema evolution, this may mean that // fields the client does not know and has therefore not filled into // the request will be reset to their default. If this is unwanted // behavior, a specific service may require a client to always specify // a field mask, producing an error if not. // // As with get operations, the location of the resource which // describes the updated values in the request message depends on the // operation kind. In any case, the effect of the field mask is // required to be honored by the API. // // ## Considerations for HTTP REST // // The HTTP kind of an update operation which uses a field mask must // be set to PATCH instead of PUT in order to satisfy HTTP semantics // (PUT must only be used for full updates). // // # JSON Encoding of Field Masks // // In JSON, a field mask is encoded as a single string where paths are // separated by a comma. Fields name in each path are converted // to/from lower-camel naming conventions. // // As an example, consider the following message declarations: // // message Profile { // User user = 1; // Photo photo = 2; // } // message User { // string display_name = 1; // string address = 2; // } // // In proto a field mask for `Profile` may look as such: // // mask { // paths: "user.display_name" // paths: "photo" // } // // In JSON, the same mask is represented as below: // // { // mask: "user.displayName,photo" // } // // # Field Masks and Oneof Fields // // Field masks treat fields in oneofs just as regular fields. Consider the // following message: // // message SampleMessage { // oneof test_oneof { // string name = 4; // SubMessage sub_message = 9; // } // } // // The field mask can be: // // mask { // paths: "name" // } // // Or: // // mask { // paths: "sub_message" // } // // Note that oneof type names ("test_oneof" in this case) cannot be used in // paths. // // ## Field Mask Verification // // The implementation of any API method which has a FieldMask type field in the // request should verify the included field paths, and return an // `INVALID_ARGUMENT` error if any path is unmappable. message FieldMask { // The set of field mask paths. repeated string paths = 1; } ================================================ FILE: service/user/third_party/google/protobuf/source_context.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option java_package = "com.google.protobuf"; option java_outer_classname = "SourceContextProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; // `SourceContext` represents information about the source of a // protobuf element, like the file in which it is defined. message SourceContext { // The path-qualified name of the .proto file that contained the associated // protobuf element. For example: `"google/protobuf/source_context.proto"`. string file_name = 1; } ================================================ FILE: service/user/third_party/google/protobuf/struct.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/structpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "StructProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // `Struct` represents a structured data value, consisting of fields // which map to dynamically typed values. In some languages, `Struct` // might be supported by a native representation. For example, in // scripting languages like JS a struct is represented as an // object. The details of that representation are described together // with the proto support for the language. // // The JSON representation for `Struct` is JSON object. message Struct { // Unordered map of dynamically typed values. map fields = 1; } // `Value` represents a dynamically typed value which can be either // null, a number, a string, a boolean, a recursive struct value, or a // list of values. A producer of value is expected to set one of these // variants. Absence of any variant indicates an error. // // The JSON representation for `Value` is JSON value. message Value { // The kind of value. oneof kind { // Represents a null value. NullValue null_value = 1; // Represents a double value. double number_value = 2; // Represents a string value. string string_value = 3; // Represents a boolean value. bool bool_value = 4; // Represents a structured value. Struct struct_value = 5; // Represents a repeated `Value`. ListValue list_value = 6; } } // `NullValue` is a singleton enumeration to represent the null value for the // `Value` type union. // // The JSON representation for `NullValue` is JSON `null`. enum NullValue { // Null value. NULL_VALUE = 0; } // `ListValue` is a wrapper around a repeated field of values. // // The JSON representation for `ListValue` is JSON array. message ListValue { // Repeated field of dynamically typed values. repeated Value values = 1; } ================================================ FILE: service/user/third_party/google/protobuf/timestamp.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/timestamppb"; option java_package = "com.google.protobuf"; option java_outer_classname = "TimestampProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Timestamp represents a point in time independent of any time zone or local // calendar, encoded as a count of seconds and fractions of seconds at // nanosecond resolution. The count is relative to an epoch at UTC midnight on // January 1, 1970, in the proleptic Gregorian calendar which extends the // Gregorian calendar backwards to year one. // // All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap // second table is needed for interpretation, using a [24-hour linear // smear](https://developers.google.com/time/smear). // // The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By // restricting to that range, we ensure that we can convert to and from [RFC // 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. // // # Examples // // Example 1: Compute Timestamp from POSIX `time()`. // // Timestamp timestamp; // timestamp.set_seconds(time(NULL)); // timestamp.set_nanos(0); // // Example 2: Compute Timestamp from POSIX `gettimeofday()`. // // struct timeval tv; // gettimeofday(&tv, NULL); // // Timestamp timestamp; // timestamp.set_seconds(tv.tv_sec); // timestamp.set_nanos(tv.tv_usec * 1000); // // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. // // FILETIME ft; // GetSystemTimeAsFileTime(&ft); // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. // Timestamp timestamp; // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); // // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. // // long millis = System.currentTimeMillis(); // // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) // .setNanos((int) ((millis % 1000) * 1000000)).build(); // // // Example 5: Compute Timestamp from Java `Instant.now()`. // // Instant now = Instant.now(); // // Timestamp timestamp = // Timestamp.newBuilder().setSeconds(now.getEpochSecond()) // .setNanos(now.getNano()).build(); // // // Example 6: Compute Timestamp from current time in Python. // // timestamp = Timestamp() // timestamp.GetCurrentTime() // // # JSON Mapping // // In JSON format, the Timestamp type is encoded as a string in the // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" // where {year} is always expressed using four digits while {month}, {day}, // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone // is required. A proto3 JSON serializer should always use UTC (as indicated by // "Z") when printing the Timestamp type and a proto3 JSON parser should be // able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. // // In JavaScript, one can convert a Date object to this format using the // standard // [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) // method. In Python, a standard `datetime.datetime` object can be converted // to this format using // [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with // the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use // the Joda Time's [`ISODateTimeFormat.dateTime()`]( // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D // ) to obtain a formatter capable of generating timestamps in this format. // // message Timestamp { // Represents seconds of UTC time since Unix epoch // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to // 9999-12-31T23:59:59Z inclusive. int64 seconds = 1; // Non-negative fractions of a second at nanosecond resolution. Negative // second values with fractions must still have non-negative nanos values // that count forward in time. Must be from 0 to 999,999,999 // inclusive. int32 nanos = 2; } ================================================ FILE: service/user/third_party/google/protobuf/type.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; import "google/protobuf/any.proto"; import "google/protobuf/source_context.proto"; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option java_package = "com.google.protobuf"; option java_outer_classname = "TypeProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; option go_package = "google.golang.org/protobuf/types/known/typepb"; // A protocol buffer message type. message Type { // The fully qualified message name. string name = 1; // The list of fields. repeated Field fields = 2; // The list of types appearing in `oneof` definitions in this type. repeated string oneofs = 3; // The protocol buffer options. repeated Option options = 4; // The source context. SourceContext source_context = 5; // The source syntax. Syntax syntax = 6; } // A single field of a message type. message Field { // Basic field types. enum Kind { // Field type unknown. TYPE_UNKNOWN = 0; // Field type double. TYPE_DOUBLE = 1; // Field type float. TYPE_FLOAT = 2; // Field type int64. TYPE_INT64 = 3; // Field type uint64. TYPE_UINT64 = 4; // Field type int32. TYPE_INT32 = 5; // Field type fixed64. TYPE_FIXED64 = 6; // Field type fixed32. TYPE_FIXED32 = 7; // Field type bool. TYPE_BOOL = 8; // Field type string. TYPE_STRING = 9; // Field type group. Proto2 syntax only, and deprecated. TYPE_GROUP = 10; // Field type message. TYPE_MESSAGE = 11; // Field type bytes. TYPE_BYTES = 12; // Field type uint32. TYPE_UINT32 = 13; // Field type enum. TYPE_ENUM = 14; // Field type sfixed32. TYPE_SFIXED32 = 15; // Field type sfixed64. TYPE_SFIXED64 = 16; // Field type sint32. TYPE_SINT32 = 17; // Field type sint64. TYPE_SINT64 = 18; } // Whether a field is optional, required, or repeated. enum Cardinality { // For fields with unknown cardinality. CARDINALITY_UNKNOWN = 0; // For optional fields. CARDINALITY_OPTIONAL = 1; // For required fields. Proto2 syntax only. CARDINALITY_REQUIRED = 2; // For repeated fields. CARDINALITY_REPEATED = 3; } // The field type. Kind kind = 1; // The field cardinality. Cardinality cardinality = 2; // The field number. int32 number = 3; // The field name. string name = 4; // The field type URL, without the scheme, for message or enumeration // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. string type_url = 6; // The index of the field type in `Type.oneofs`, for message or enumeration // types. The first type has index 1; zero means the type is not in the list. int32 oneof_index = 7; // Whether to use alternative packed wire representation. bool packed = 8; // The protocol buffer options. repeated Option options = 9; // The field JSON name. string json_name = 10; // The string value of the default value of this field. Proto2 syntax only. string default_value = 11; } // Enum type definition. message Enum { // Enum type name. string name = 1; // Enum value definitions. repeated EnumValue enumvalue = 2; // Protocol buffer options. repeated Option options = 3; // The source context. SourceContext source_context = 4; // The source syntax. Syntax syntax = 5; } // Enum value definition. message EnumValue { // Enum value name. string name = 1; // Enum value number. int32 number = 2; // Protocol buffer options. repeated Option options = 3; } // A protocol buffer option, which can be attached to a message, field, // enumeration, etc. message Option { // The option's name. For protobuf built-in options (options defined in // descriptor.proto), this is the short name. For example, `"map_entry"`. // For custom options, it should be the fully-qualified name. For example, // `"google.api.http"`. string name = 1; // The option's value packed in an Any message. If the value is a primitive, // the corresponding wrapper type defined in google/protobuf/wrappers.proto // should be used. If the value is an enum, it should be stored as an int32 // value using the google.protobuf.Int32Value type. Any value = 2; } // The syntax in which a protocol buffer element is defined. enum Syntax { // Syntax `proto2`. SYNTAX_PROTO2 = 0; // Syntax `proto3`. SYNTAX_PROTO3 = 1; } ================================================ FILE: service/user/third_party/google/protobuf/wrappers.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Wrappers for primitive (non-message) types. These types are useful // for embedding primitives in the `google.protobuf.Any` type and for places // where we need to distinguish between the absence of a primitive // typed field and its default value. // // These wrappers have no meaningful use within repeated fields as they lack // the ability to detect presence on individual elements. // These wrappers have no meaningful use within a map or a oneof since // individual entries of a map or fields of a oneof can already detect presence. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; option java_package = "com.google.protobuf"; option java_outer_classname = "WrappersProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // Wrapper message for `double`. // // The JSON representation for `DoubleValue` is JSON number. message DoubleValue { // The double value. double value = 1; } // Wrapper message for `float`. // // The JSON representation for `FloatValue` is JSON number. message FloatValue { // The float value. float value = 1; } // Wrapper message for `int64`. // // The JSON representation for `Int64Value` is JSON string. message Int64Value { // The int64 value. int64 value = 1; } // Wrapper message for `uint64`. // // The JSON representation for `UInt64Value` is JSON string. message UInt64Value { // The uint64 value. uint64 value = 1; } // Wrapper message for `int32`. // // The JSON representation for `Int32Value` is JSON number. message Int32Value { // The int32 value. int32 value = 1; } // Wrapper message for `uint32`. // // The JSON representation for `UInt32Value` is JSON number. message UInt32Value { // The uint32 value. uint32 value = 1; } // Wrapper message for `bool`. // // The JSON representation for `BoolValue` is JSON `true` and `false`. message BoolValue { // The bool value. bool value = 1; } // Wrapper message for `string`. // // The JSON representation for `StringValue` is JSON string. message StringValue { // The string value. string value = 1; } // Wrapper message for `bytes`. // // The JSON representation for `BytesValue` is JSON string. message BytesValue { // The bytes value. bytes value = 1; } ================================================ FILE: service/user/third_party/openapi/v3/annotations.proto ================================================ // Copyright 2022 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package openapi.v3; import "openapiv3/OpenAPIv3.proto"; import "google/protobuf/descriptor.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "AnnotationsProto"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapi_v3"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; // The Go package name. option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; extend google.protobuf.FileOptions { Document document = 1143; } extend google.protobuf.MethodOptions { Operation operation = 1143; } extend google.protobuf.MessageOptions { Schema schema = 1143; } extend google.protobuf.FieldOptions { Schema property = 1143; } ================================================ FILE: service/user/third_party/openapi/v3/openapi.proto ================================================ // Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // THIS FILE IS AUTOMATICALLY GENERATED. syntax = "proto3"; package openapi.v3; import "google/protobuf/any.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "OpenAPIProto"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapi_v3"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; // The Go package name. option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; message AdditionalPropertiesItem { oneof oneof { SchemaOrReference schema_or_reference = 1; bool boolean = 2; } } message Any { google.protobuf.Any value = 1; string yaml = 2; } message AnyOrExpression { oneof oneof { Any any = 1; Expression expression = 2; } } // A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation. message Callback { repeated NamedPathItem path = 1; repeated NamedAny specification_extension = 2; } message CallbackOrReference { oneof oneof { Callback callback = 1; Reference reference = 2; } } message CallbacksOrReferences { repeated NamedCallbackOrReference additional_properties = 1; } // Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. message Components { SchemasOrReferences schemas = 1; ResponsesOrReferences responses = 2; ParametersOrReferences parameters = 3; ExamplesOrReferences examples = 4; RequestBodiesOrReferences request_bodies = 5; HeadersOrReferences headers = 6; SecuritySchemesOrReferences security_schemes = 7; LinksOrReferences links = 8; CallbacksOrReferences callbacks = 9; repeated NamedAny specification_extension = 10; } // Contact information for the exposed API. message Contact { string name = 1; string url = 2; string email = 3; repeated NamedAny specification_extension = 4; } message DefaultType { oneof oneof { double number = 1; bool boolean = 2; string string = 3; } } // When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it. When using the discriminator, _inline_ schemas will not be considered. message Discriminator { string property_name = 1; Strings mapping = 2; repeated NamedAny specification_extension = 3; } message Document { string openapi = 1; Info info = 2; repeated Server servers = 3; Paths paths = 4; Components components = 5; repeated SecurityRequirement security = 6; repeated Tag tags = 7; ExternalDocs external_docs = 8; repeated NamedAny specification_extension = 9; } // A single encoding definition applied to a single schema property. message Encoding { string content_type = 1; HeadersOrReferences headers = 2; string style = 3; bool explode = 4; bool allow_reserved = 5; repeated NamedAny specification_extension = 6; } message Encodings { repeated NamedEncoding additional_properties = 1; } message Example { string summary = 1; string description = 2; Any value = 3; string external_value = 4; repeated NamedAny specification_extension = 5; } message ExampleOrReference { oneof oneof { Example example = 1; Reference reference = 2; } } message ExamplesOrReferences { repeated NamedExampleOrReference additional_properties = 1; } message Expression { repeated NamedAny additional_properties = 1; } // Allows referencing an external resource for extended documentation. message ExternalDocs { string description = 1; string url = 2; repeated NamedAny specification_extension = 3; } // The Header Object follows the structure of the Parameter Object with the following changes: 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map. 1. `in` MUST NOT be specified, it is implicitly in `header`. 1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, `style`). message Header { string description = 1; bool required = 2; bool deprecated = 3; bool allow_empty_value = 4; string style = 5; bool explode = 6; bool allow_reserved = 7; SchemaOrReference schema = 8; Any example = 9; ExamplesOrReferences examples = 10; MediaTypes content = 11; repeated NamedAny specification_extension = 12; } message HeaderOrReference { oneof oneof { Header header = 1; Reference reference = 2; } } message HeadersOrReferences { repeated NamedHeaderOrReference additional_properties = 1; } // The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. message Info { string title = 1; string description = 2; string terms_of_service = 3; Contact contact = 4; License license = 5; string version = 6; repeated NamedAny specification_extension = 7; string summary = 8; } message ItemsItem { repeated SchemaOrReference schema_or_reference = 1; } // License information for the exposed API. message License { string name = 1; string url = 2; repeated NamedAny specification_extension = 3; } // The `Link object` represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations. Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response. For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation. message Link { string operation_ref = 1; string operation_id = 2; AnyOrExpression parameters = 3; AnyOrExpression request_body = 4; string description = 5; Server server = 6; repeated NamedAny specification_extension = 7; } message LinkOrReference { oneof oneof { Link link = 1; Reference reference = 2; } } message LinksOrReferences { repeated NamedLinkOrReference additional_properties = 1; } // Each Media Type Object provides schema and examples for the media type identified by its key. message MediaType { SchemaOrReference schema = 1; Any example = 2; ExamplesOrReferences examples = 3; Encodings encoding = 4; repeated NamedAny specification_extension = 5; } message MediaTypes { repeated NamedMediaType additional_properties = 1; } // Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. message NamedAny { // Map key string name = 1; // Mapped value Any value = 2; } // Automatically-generated message used to represent maps of CallbackOrReference as ordered (name,value) pairs. message NamedCallbackOrReference { // Map key string name = 1; // Mapped value CallbackOrReference value = 2; } // Automatically-generated message used to represent maps of Encoding as ordered (name,value) pairs. message NamedEncoding { // Map key string name = 1; // Mapped value Encoding value = 2; } // Automatically-generated message used to represent maps of ExampleOrReference as ordered (name,value) pairs. message NamedExampleOrReference { // Map key string name = 1; // Mapped value ExampleOrReference value = 2; } // Automatically-generated message used to represent maps of HeaderOrReference as ordered (name,value) pairs. message NamedHeaderOrReference { // Map key string name = 1; // Mapped value HeaderOrReference value = 2; } // Automatically-generated message used to represent maps of LinkOrReference as ordered (name,value) pairs. message NamedLinkOrReference { // Map key string name = 1; // Mapped value LinkOrReference value = 2; } // Automatically-generated message used to represent maps of MediaType as ordered (name,value) pairs. message NamedMediaType { // Map key string name = 1; // Mapped value MediaType value = 2; } // Automatically-generated message used to represent maps of ParameterOrReference as ordered (name,value) pairs. message NamedParameterOrReference { // Map key string name = 1; // Mapped value ParameterOrReference value = 2; } // Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. message NamedPathItem { // Map key string name = 1; // Mapped value PathItem value = 2; } // Automatically-generated message used to represent maps of RequestBodyOrReference as ordered (name,value) pairs. message NamedRequestBodyOrReference { // Map key string name = 1; // Mapped value RequestBodyOrReference value = 2; } // Automatically-generated message used to represent maps of ResponseOrReference as ordered (name,value) pairs. message NamedResponseOrReference { // Map key string name = 1; // Mapped value ResponseOrReference value = 2; } // Automatically-generated message used to represent maps of SchemaOrReference as ordered (name,value) pairs. message NamedSchemaOrReference { // Map key string name = 1; // Mapped value SchemaOrReference value = 2; } // Automatically-generated message used to represent maps of SecuritySchemeOrReference as ordered (name,value) pairs. message NamedSecuritySchemeOrReference { // Map key string name = 1; // Mapped value SecuritySchemeOrReference value = 2; } // Automatically-generated message used to represent maps of ServerVariable as ordered (name,value) pairs. message NamedServerVariable { // Map key string name = 1; // Mapped value ServerVariable value = 2; } // Automatically-generated message used to represent maps of string as ordered (name,value) pairs. message NamedString { // Map key string name = 1; // Mapped value string value = 2; } // Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. message NamedStringArray { // Map key string name = 1; // Mapped value StringArray value = 2; } // Configuration details for a supported OAuth Flow message OauthFlow { string authorization_url = 1; string token_url = 2; string refresh_url = 3; Strings scopes = 4; repeated NamedAny specification_extension = 5; } // Allows configuration of the supported OAuth Flows. message OauthFlows { OauthFlow implicit = 1; OauthFlow password = 2; OauthFlow client_credentials = 3; OauthFlow authorization_code = 4; repeated NamedAny specification_extension = 5; } message Object { repeated NamedAny additional_properties = 1; } // Describes a single API operation on a path. message Operation { repeated string tags = 1; string summary = 2; string description = 3; ExternalDocs external_docs = 4; string operation_id = 5; repeated ParameterOrReference parameters = 6; RequestBodyOrReference request_body = 7; Responses responses = 8; CallbacksOrReferences callbacks = 9; bool deprecated = 10; repeated SecurityRequirement security = 11; repeated Server servers = 12; repeated NamedAny specification_extension = 13; } // Describes a single operation parameter. A unique parameter is defined by a combination of a name and location. message Parameter { string name = 1; string in = 2; string description = 3; bool required = 4; bool deprecated = 5; bool allow_empty_value = 6; string style = 7; bool explode = 8; bool allow_reserved = 9; SchemaOrReference schema = 10; Any example = 11; ExamplesOrReferences examples = 12; MediaTypes content = 13; repeated NamedAny specification_extension = 14; } message ParameterOrReference { oneof oneof { Parameter parameter = 1; Reference reference = 2; } } message ParametersOrReferences { repeated NamedParameterOrReference additional_properties = 1; } // Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available. message PathItem { string _ref = 1; string summary = 2; string description = 3; Operation get = 4; Operation put = 5; Operation post = 6; Operation delete = 7; Operation options = 8; Operation head = 9; Operation patch = 10; Operation trace = 11; repeated Server servers = 12; repeated ParameterOrReference parameters = 13; repeated NamedAny specification_extension = 14; } // Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the `Server Object` in order to construct the full URL. The Paths MAY be empty, due to ACL constraints. message Paths { repeated NamedPathItem path = 1; repeated NamedAny specification_extension = 2; } message Properties { repeated NamedSchemaOrReference additional_properties = 1; } // A simple object to allow referencing other components in the specification, internally and externally. The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification. message Reference { string _ref = 1; string summary = 2; string description = 3; } message RequestBodiesOrReferences { repeated NamedRequestBodyOrReference additional_properties = 1; } // Describes a single request body. message RequestBody { string description = 1; MediaTypes content = 2; bool required = 3; repeated NamedAny specification_extension = 4; } message RequestBodyOrReference { oneof oneof { RequestBody request_body = 1; Reference reference = 2; } } // Describes a single response from an API Operation, including design-time, static `links` to operations based on the response. message Response { string description = 1; HeadersOrReferences headers = 2; MediaTypes content = 3; LinksOrReferences links = 4; repeated NamedAny specification_extension = 5; } message ResponseOrReference { oneof oneof { Response response = 1; Reference reference = 2; } } // A container for the expected responses of an operation. The container maps a HTTP response code to the expected response. The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors. The `default` MAY be used as a default response object for all HTTP codes that are not covered individually by the specification. The `Responses Object` MUST contain at least one response code, and it SHOULD be the response for a successful operation call. message Responses { ResponseOrReference default = 1; repeated NamedResponseOrReference response_or_reference = 2; repeated NamedAny specification_extension = 3; } message ResponsesOrReferences { repeated NamedResponseOrReference additional_properties = 1; } // The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the JSON Schema Specification Wright Draft 00. For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema. message Schema { bool nullable = 1; Discriminator discriminator = 2; bool read_only = 3; bool write_only = 4; Xml xml = 5; ExternalDocs external_docs = 6; Any example = 7; bool deprecated = 8; string title = 9; double multiple_of = 10; double maximum = 11; bool exclusive_maximum = 12; double minimum = 13; bool exclusive_minimum = 14; int64 max_length = 15; int64 min_length = 16; string pattern = 17; int64 max_items = 18; int64 min_items = 19; bool unique_items = 20; int64 max_properties = 21; int64 min_properties = 22; repeated string required = 23; repeated Any enum = 24; string type = 25; repeated SchemaOrReference all_of = 26; repeated SchemaOrReference one_of = 27; repeated SchemaOrReference any_of = 28; Schema not = 29; ItemsItem items = 30; Properties properties = 31; AdditionalPropertiesItem additional_properties = 32; DefaultType default = 33; string description = 34; string format = 35; repeated NamedAny specification_extension = 36; } message SchemaOrReference { oneof oneof { Schema schema = 1; Reference reference = 2; } } message SchemasOrReferences { repeated NamedSchemaOrReference additional_properties = 1; } // Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object. Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information. When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object, only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request. message SecurityRequirement { repeated NamedStringArray additional_properties = 1; } // Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect. Please note that currently (2019) the implicit flow is about to be deprecated OAuth 2.0 Security Best Current Practice. Recommended for most use case is Authorization Code Grant flow with PKCE. message SecurityScheme { string type = 1; string description = 2; string name = 3; string in = 4; string scheme = 5; string bearer_format = 6; OauthFlows flows = 7; string open_id_connect_url = 8; repeated NamedAny specification_extension = 9; } message SecuritySchemeOrReference { oneof oneof { SecurityScheme security_scheme = 1; Reference reference = 2; } } message SecuritySchemesOrReferences { repeated NamedSecuritySchemeOrReference additional_properties = 1; } // An object representing a Server. message Server { string url = 1; string description = 2; ServerVariables variables = 3; repeated NamedAny specification_extension = 4; } // An object representing a Server Variable for server URL template substitution. message ServerVariable { repeated string enum = 1; string default = 2; string description = 3; repeated NamedAny specification_extension = 4; } message ServerVariables { repeated NamedServerVariable additional_properties = 1; } // Any property starting with x- is valid. message SpecificationExtension { oneof oneof { double number = 1; bool boolean = 2; string string = 3; } } message StringArray { repeated string value = 1; } message Strings { repeated NamedString additional_properties = 1; } // Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. message Tag { string name = 1; string description = 2; ExternalDocs external_docs = 3; repeated NamedAny specification_extension = 4; } // A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior. message Xml { string name = 1; string namespace = 2; string prefix = 3; bool attribute = 4; bool wrapped = 5; repeated NamedAny specification_extension = 6; } ================================================ FILE: service/user/third_party/validate/README.md ================================================ # protoc-gen-validate (PGV) * https://github.com/envoyproxy/protoc-gen-validate ================================================ FILE: service/user/third_party/validate/validate.proto ================================================ syntax = "proto2"; package validate; option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; option java_package = "io.envoyproxy.pgv.validate"; import "google/protobuf/descriptor.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; // Validation rules applied at the message level extend google.protobuf.MessageOptions { // Disabled nullifies any validation rules for this message, including any // message fields associated with it that do support validation. optional bool disabled = 1071; // Ignore skips generation of validation methods for this message. optional bool ignored = 1072; } // Validation rules applied at the oneof level extend google.protobuf.OneofOptions { // Required ensures that exactly one the field options in a oneof is set; // validation fails if no fields in the oneof are set. optional bool required = 1071; } // Validation rules applied at the field level extend google.protobuf.FieldOptions { // Rules specify the validations to be performed on this field. By default, // no validation is performed against a field. optional FieldRules rules = 1071; } // FieldRules encapsulates the rules for each type of field. Depending on the // field, the correct set should be used to ensure proper validations. message FieldRules { optional MessageRules message = 17; oneof type { // Scalar Field Types FloatRules float = 1; DoubleRules double = 2; Int32Rules int32 = 3; Int64Rules int64 = 4; UInt32Rules uint32 = 5; UInt64Rules uint64 = 6; SInt32Rules sint32 = 7; SInt64Rules sint64 = 8; Fixed32Rules fixed32 = 9; Fixed64Rules fixed64 = 10; SFixed32Rules sfixed32 = 11; SFixed64Rules sfixed64 = 12; BoolRules bool = 13; StringRules string = 14; BytesRules bytes = 15; // Complex Field Types EnumRules enum = 16; RepeatedRules repeated = 18; MapRules map = 19; // Well-Known Field Types AnyRules any = 20; DurationRules duration = 21; TimestampRules timestamp = 22; } } // FloatRules describes the constraints applied to `float` values message FloatRules { // Const specifies that this field must be exactly the specified value optional float const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional float lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional float lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional float gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional float gte = 5; // In specifies that this field must be equal to one of the specified // values repeated float in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated float not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // DoubleRules describes the constraints applied to `double` values message DoubleRules { // Const specifies that this field must be exactly the specified value optional double const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional double lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional double lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional double gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional double gte = 5; // In specifies that this field must be equal to one of the specified // values repeated double in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated double not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int32Rules describes the constraints applied to `int32` values message Int32Rules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int64Rules describes the constraints applied to `int64` values message Int64Rules { // Const specifies that this field must be exactly the specified value optional int64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt32Rules describes the constraints applied to `uint32` values message UInt32Rules { // Const specifies that this field must be exactly the specified value optional uint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt64Rules describes the constraints applied to `uint64` values message UInt64Rules { // Const specifies that this field must be exactly the specified value optional uint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt32Rules describes the constraints applied to `sint32` values message SInt32Rules { // Const specifies that this field must be exactly the specified value optional sint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt64Rules describes the constraints applied to `sint64` values message SInt64Rules { // Const specifies that this field must be exactly the specified value optional sint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed32Rules describes the constraints applied to `fixed32` values message Fixed32Rules { // Const specifies that this field must be exactly the specified value optional fixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed64Rules describes the constraints applied to `fixed64` values message Fixed64Rules { // Const specifies that this field must be exactly the specified value optional fixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed32Rules describes the constraints applied to `sfixed32` values message SFixed32Rules { // Const specifies that this field must be exactly the specified value optional sfixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed64Rules describes the constraints applied to `sfixed64` values message SFixed64Rules { // Const specifies that this field must be exactly the specified value optional sfixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // BoolRules describes the constraints applied to `bool` values message BoolRules { // Const specifies that this field must be exactly the specified value optional bool const = 1; } // StringRules describe the constraints applied to `string` values message StringRules { // Const specifies that this field must be exactly the specified value optional string const = 1; // Len specifies that this field must be the specified number of // characters (Unicode code points). Note that the number of // characters may differ from the number of bytes in the string. optional uint64 len = 19; // MinLen specifies that this field must be the specified number of // characters (Unicode code points) at a minimum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of // characters (Unicode code points) at a maximum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 max_len = 3; // LenBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 len_bytes = 20; // MinBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_bytes = 4; // MaxBytes specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_bytes = 5; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 6; // Prefix specifies that this field must have the specified substring at // the beginning of the string. optional string prefix = 7; // Suffix specifies that this field must have the specified substring at // the end of the string. optional string suffix = 8; // Contains specifies that this field must have the specified substring // anywhere in the string. optional string contains = 9; // NotContains specifies that this field cannot have the specified substring // anywhere in the string. optional string not_contains = 23; // In specifies that this field must be equal to one of the specified // values repeated string in = 10; // NotIn specifies that this field cannot be equal to one of the specified // values repeated string not_in = 11; // WellKnown rules provide advanced constraints against common string // patterns oneof well_known { // Email specifies that the field must be a valid email address as // defined by RFC 5322 bool email = 12; // Hostname specifies that the field must be a valid hostname as // defined by RFC 1034. This constraint does not support // internationalized domain names (IDNs). bool hostname = 13; // Ip specifies that the field must be a valid IP (v4 or v6) address. // Valid IPv6 addresses should not include surrounding square brackets. bool ip = 14; // Ipv4 specifies that the field must be a valid IPv4 address. bool ipv4 = 15; // Ipv6 specifies that the field must be a valid IPv6 address. Valid // IPv6 addresses should not include surrounding square brackets. bool ipv6 = 16; // Uri specifies that the field must be a valid, absolute URI as defined // by RFC 3986 bool uri = 17; // UriRef specifies that the field must be a valid URI as defined by RFC // 3986 and may be relative or absolute. bool uri_ref = 18; // Address specifies that the field must be either a valid hostname as // defined by RFC 1034 (which does not support internationalized domain // names or IDNs), or it can be a valid IP (v4 or v6). bool address = 21; // Uuid specifies that the field must be a valid UUID as defined by // RFC 4122 bool uuid = 22; // WellKnownRegex specifies a common well known pattern defined as a regex. KnownRegex well_known_regex = 24; } // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable // strict header validation. // By default, this is true, and HTTP header validations are RFC-compliant. // Setting to false will enable a looser validations that only disallows // \r\n\0 characters, which can be used to bypass header matching rules. optional bool strict = 25 [default = true]; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 26; } // WellKnownRegex contain some well-known patterns. enum KnownRegex { UNKNOWN = 0; // HTTP header name as defined by RFC 7230. HTTP_HEADER_NAME = 1; // HTTP header value as defined by RFC 7230. HTTP_HEADER_VALUE = 2; } // BytesRules describe the constraints applied to `bytes` values message BytesRules { // Const specifies that this field must be exactly the specified value optional bytes const = 1; // Len specifies that this field must be the specified number of bytes optional uint64 len = 13; // MinLen specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_len = 3; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 4; // Prefix specifies that this field must have the specified bytes at the // beginning of the string. optional bytes prefix = 5; // Suffix specifies that this field must have the specified bytes at the // end of the string. optional bytes suffix = 6; // Contains specifies that this field must have the specified bytes // anywhere in the string. optional bytes contains = 7; // In specifies that this field must be equal to one of the specified // values repeated bytes in = 8; // NotIn specifies that this field cannot be equal to one of the specified // values repeated bytes not_in = 9; // WellKnown rules provide advanced constraints against common byte // patterns oneof well_known { // Ip specifies that the field must be a valid IP (v4 or v6) address in // byte format bool ip = 10; // Ipv4 specifies that the field must be a valid IPv4 address in byte // format bool ipv4 = 11; // Ipv6 specifies that the field must be a valid IPv6 address in byte // format bool ipv6 = 12; } // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 14; } // EnumRules describe the constraints applied to enum values message EnumRules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // DefinedOnly specifies that this field must be only one of the defined // values for this enum, failing on any undefined value. optional bool defined_only = 2; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 3; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 4; } // MessageRules describe the constraints applied to embedded message values. // For message-type fields, validation is performed recursively. message MessageRules { // Skip specifies that the validation rules of this field should not be // evaluated optional bool skip = 1; // Required specifies that this field must be set optional bool required = 2; } // RepeatedRules describe the constraints applied to `repeated` values message RepeatedRules { // MinItems specifies that this field must have the specified number of // items at a minimum optional uint64 min_items = 1; // MaxItems specifies that this field must have the specified number of // items at a maximum optional uint64 max_items = 2; // Unique specifies that all elements in this field must be unique. This // contraint is only applicable to scalar and enum types (messages are not // supported). optional bool unique = 3; // Items specifies the contraints to be applied to each item in the field. // Repeated message fields will still execute validation against each item // unless skip is specified here. optional FieldRules items = 4; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 5; } // MapRules describe the constraints applied to `map` values message MapRules { // MinPairs specifies that this field must have the specified number of // KVs at a minimum optional uint64 min_pairs = 1; // MaxPairs specifies that this field must have the specified number of // KVs at a maximum optional uint64 max_pairs = 2; // NoSparse specifies values in this field cannot be unset. This only // applies to map's with message value types. optional bool no_sparse = 3; // Keys specifies the constraints to be applied to each key in the field. optional FieldRules keys = 4; // Values specifies the constraints to be applied to the value of each key // in the field. Message values will still have their validations evaluated // unless skip is specified here. optional FieldRules values = 5; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 6; } // AnyRules describe constraints applied exclusively to the // `google.protobuf.Any` well-known type message AnyRules { // Required specifies that this field must be set optional bool required = 1; // In specifies that this field's `type_url` must be equal to one of the // specified values. repeated string in = 2; // NotIn specifies that this field's `type_url` must not be equal to any of // the specified values. repeated string not_in = 3; } // DurationRules describe the constraints applied exclusively to the // `google.protobuf.Duration` well-known type message DurationRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Duration const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Duration lt = 3; // Lt specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Duration lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Duration gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Duration gte = 6; // In specifies that this field must be equal to one of the specified // values repeated google.protobuf.Duration in = 7; // NotIn specifies that this field cannot be equal to one of the specified // values repeated google.protobuf.Duration not_in = 8; } // TimestampRules describe the constraints applied exclusively to the // `google.protobuf.Timestamp` well-known type message TimestampRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Timestamp const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Timestamp lt = 3; // Lte specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Timestamp lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Timestamp gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Timestamp gte = 6; // LtNow specifies that this must be less than the current time. LtNow // can only be used with the Within rule. optional bool lt_now = 7; // GtNow specifies that this must be greater than the current time. GtNow // can only be used with the Within rule. optional bool gt_now = 8; // Within specifies that this field must be within this duration of the // current time. This constraint can be used alone or with the LtNow and // GtNow rules. optional google.protobuf.Duration within = 9; } ================================================ FILE: shop/.gitignore ================================================ # Reference https://github.com/github/gitignore/blob/master/Go.gitignore # Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Dependency directories (remove the comment below to include it) vendor/ # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # OS General Thumbs.db .DS_Store # project *.cert *.key *.log bin/ # Develop tools .vscode/ .idea/ *.swp ================================================ FILE: shop/Dockerfile ================================================ FROM golang:1.16 AS builder COPY . /src WORKDIR /src RUN GOPROXY=https://goproxy.cn make build FROM debian:stable-slim RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/ \ && apt-get autoremove -y && apt-get autoclean -y COPY --from=builder /src/bin /app WORKDIR /app EXPOSE 8000 EXPOSE 9000 VOLUME /data/conf CMD ["./server", "-conf", "/data/conf"] ================================================ FILE: shop/LICENSE ================================================ MIT License Copyright (c) 2020 go-kratos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: shop/Makefile ================================================ GOPATH:=$(shell go env GOPATH) VERSION=$(shell git describe --tags --always) INTERNAL_PROTO_FILES=$(shell find internal -name *.proto) API_PROTO_FILES=$(shell find api -name *.proto) .PHONY: init # init env init: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest go install github.com/go-kratos/kratos/cmd/kratos/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest go install github.com/google/gnostic/cmd/protoc-gen-openapi@v0.6.1 .PHONY: errors # generate errors code errors: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ --go-errors_out=paths=source_relative:. \ $(API_PROTO_FILES) .PHONY: config # generate internal proto config: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ $(INTERNAL_PROTO_FILES) .PHONY: api # generate api proto api: protoc --proto_path=. \ --proto_path=./third_party \ --go_out=paths=source_relative:. \ --go-http_out=paths=source_relative:. \ --go-grpc_out=paths=source_relative:. \ --openapi_out==paths=source_relative:. \ --validate_out=paths=source_relative,lang=go:. \ $(API_PROTO_FILES) .PHONY: build # build build: mkdir -p bin/ && go build -ldflags "-X main.Version=$(VERSION)" -o ./bin/ ./... .PHONY: generate # generate generate: go generate ./... # wire wire: cd cmd/shop/ && wire .PHONY: test # 快速测试,运行repo以外的所有测试 test: ginkgo -r -cover -v . .PHONY: all # generate all all: make api; make errors; make config; make generate; # show help help: @echo '' @echo 'Usage:' @echo ' make [target]' @echo '' @echo 'Targets:' @awk '/^[a-zA-Z\-\_0-9]+:/ { \ helpMessage = match(lastLine, /^# (.*)/); \ if (helpMessage) { \ helpCommand = substr($$1, 0, index($$1, ":")-1); \ helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ } \ } \ { lastLine = $$0 }' $(MAKEFILE_LIST) .DEFAULT_GOAL := help ================================================ FILE: shop/README.md ================================================ # Kratos Project Template ## Install Kratos ``` go install github.com/go-kratos/kratos/cmd/kratos/v2@latest ``` ## Create a service ``` # Create a template project kratos new server cd server # Add a proto template kratos proto add api/server/server.proto # Generate the proto code kratos proto client api/server/server.proto # Generate the source code of service by proto file kratos proto server api/server/server.proto -t internal/service go generate ./... go build -o ./bin/ ./... ./bin/server -conf ./configs ``` ## Generate other auxiliary files by Makefile ``` # Download and update dependencies make init # Generate API files (include: pb.go, http, grpc, validate, swagger) by proto file make api # Generate all files make all ``` ## Automated Initialization (wire) ``` # install wire go get github.com/google/wire/cmd/wire # generate wire cd cmd/server wire ``` ## Docker ```bash # build docker build -t . # run docker run --rm -p 8000:8000 -p 9000:9000 -v :/data/conf ``` ================================================ FILE: shop/api/service/user/v1/user.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.17.3 // source: api/service/user/v1/user.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ListAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *ListAddressReq) Reset() { *x = ListAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReq) ProtoMessage() {} func (x *ListAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_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 ListAddressReq.ProtoReflect.Descriptor instead. func (*ListAddressReq) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{0} } func (x *ListAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type AddressInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *AddressInfo) Reset() { *x = AddressInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressInfo) ProtoMessage() {} func (x *AddressInfo) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_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 AddressInfo.ProtoReflect.Descriptor instead. func (*AddressInfo) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{1} } func (x *AddressInfo) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressInfo) GetName() string { if x != nil { return x.Name } return "" } func (x *AddressInfo) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *AddressInfo) GetProvince() string { if x != nil { return x.Province } return "" } func (x *AddressInfo) GetCity() string { if x != nil { return x.City } return "" } func (x *AddressInfo) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *AddressInfo) GetAddress() string { if x != nil { return x.Address } return "" } func (x *AddressInfo) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *AddressInfo) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type ListAddressReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Results []*AddressInfo `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } func (x *ListAddressReply) Reset() { *x = ListAddressReply{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReply) ProtoMessage() {} func (x *ListAddressReply) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_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 ListAddressReply.ProtoReflect.Descriptor instead. func (*ListAddressReply) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{2} } func (x *ListAddressReply) GetResults() []*AddressInfo { if x != nil { return x.Results } return nil } type CreateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *CreateAddressReq) Reset() { *x = CreateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateAddressReq) ProtoMessage() {} func (x *CreateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_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 CreateAddressReq.ProtoReflect.Descriptor instead. func (*CreateAddressReq) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{3} } func (x *CreateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *CreateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *CreateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *CreateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *CreateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *CreateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *CreateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *CreateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *CreateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type UpdateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` Id int64 `protobuf:"varint,10,opt,name=id,proto3" json:"id,omitempty"` } func (x *UpdateAddressReq) Reset() { *x = UpdateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateAddressReq) ProtoMessage() {} func (x *UpdateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use UpdateAddressReq.ProtoReflect.Descriptor instead. func (*UpdateAddressReq) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{4} } func (x *UpdateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *UpdateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *UpdateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UpdateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *UpdateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *UpdateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *UpdateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *UpdateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *UpdateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } func (x *UpdateAddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } type AddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Uid int64 `protobuf:"varint,2,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *AddressReq) Reset() { *x = AddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressReq) ProtoMessage() {} func (x *AddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AddressReq.ProtoReflect.Descriptor instead. func (*AddressReq) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{5} } func (x *AddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type CheckResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } func (x *CheckResponse) Reset() { *x = CheckResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CheckResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CheckResponse) ProtoMessage() {} func (x *CheckResponse) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[6] 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 CheckResponse.ProtoReflect.Descriptor instead. func (*CheckResponse) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{6} } func (x *CheckResponse) GetSuccess() bool { if x != nil { return x.Success } return false } // 分页 type PageInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Pn uint32 `protobuf:"varint,1,opt,name=pn,proto3" json:"pn,omitempty"` PSize uint32 `protobuf:"varint,2,opt,name=pSize,proto3" json:"pSize,omitempty"` } func (x *PageInfo) Reset() { *x = PageInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PageInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*PageInfo) ProtoMessage() {} func (x *PageInfo) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[7] 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 PageInfo.ProtoReflect.Descriptor instead. func (*PageInfo) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{7} } func (x *PageInfo) GetPn() uint32 { if x != nil { return x.Pn } return 0 } func (x *PageInfo) GetPSize() uint32 { if x != nil { return x.PSize } return 0 } // 用户信息 type UserInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` NickName string `protobuf:"bytes,4,opt,name=nickName,proto3" json:"nickName,omitempty"` Birthday uint64 `protobuf:"varint,5,opt,name=birthday,proto3" json:"birthday,omitempty"` Gender string `protobuf:"bytes,6,opt,name=gender,proto3" json:"gender,omitempty"` Role int32 `protobuf:"varint,7,opt,name=role,proto3" json:"role,omitempty"` } func (x *UserInfoResponse) Reset() { *x = UserInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UserInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*UserInfoResponse) ProtoMessage() {} func (x *UserInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[8] 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 UserInfoResponse.ProtoReflect.Descriptor instead. func (*UserInfoResponse) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{8} } func (x *UserInfoResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UserInfoResponse) GetPassword() string { if x != nil { return x.Password } return "" } func (x *UserInfoResponse) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UserInfoResponse) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *UserInfoResponse) GetBirthday() uint64 { if x != nil { return x.Birthday } return 0 } func (x *UserInfoResponse) GetGender() string { if x != nil { return x.Gender } return "" } func (x *UserInfoResponse) GetRole() int32 { if x != nil { return x.Role } return 0 } // 用户列表 type UserListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Data []*UserInfoResponse `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` } func (x *UserListResponse) Reset() { *x = UserListResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UserListResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*UserListResponse) ProtoMessage() {} func (x *UserListResponse) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[9] 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 UserListResponse.ProtoReflect.Descriptor instead. func (*UserListResponse) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{9} } func (x *UserListResponse) GetTotal() int32 { if x != nil { return x.Total } return 0 } func (x *UserListResponse) GetData() []*UserInfoResponse { if x != nil { return x.Data } return nil } type MobileRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"` } func (x *MobileRequest) Reset() { *x = MobileRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *MobileRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*MobileRequest) ProtoMessage() {} func (x *MobileRequest) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[10] 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 MobileRequest.ProtoReflect.Descriptor instead. func (*MobileRequest) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{10} } func (x *MobileRequest) GetMobile() string { if x != nil { return x.Mobile } return "" } type IdRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *IdRequest) Reset() { *x = IdRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *IdRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*IdRequest) ProtoMessage() {} func (x *IdRequest) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[11] 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 IdRequest.ProtoReflect.Descriptor instead. func (*IdRequest) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{11} } func (x *IdRequest) GetId() int64 { if x != nil { return x.Id } return 0 } // 创建用户 type CreateUserInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields NickName string `protobuf:"bytes,1,opt,name=nickName,proto3" json:"nickName,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` } func (x *CreateUserInfo) Reset() { *x = CreateUserInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateUserInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateUserInfo) ProtoMessage() {} func (x *CreateUserInfo) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[12] 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 CreateUserInfo.ProtoReflect.Descriptor instead. func (*CreateUserInfo) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{12} } func (x *CreateUserInfo) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *CreateUserInfo) GetPassword() string { if x != nil { return x.Password } return "" } func (x *CreateUserInfo) GetMobile() string { if x != nil { return x.Mobile } return "" } type UpdateUserInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` NickName string `protobuf:"bytes,2,opt,name=nickName,proto3" json:"nickName,omitempty"` Gender string `protobuf:"bytes,3,opt,name=gender,proto3" json:"gender,omitempty"` Birthday uint64 `protobuf:"varint,4,opt,name=birthday,proto3" json:"birthday,omitempty"` } func (x *UpdateUserInfo) Reset() { *x = UpdateUserInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateUserInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateUserInfo) ProtoMessage() {} func (x *UpdateUserInfo) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[13] 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 UpdateUserInfo.ProtoReflect.Descriptor instead. func (*UpdateUserInfo) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{13} } func (x *UpdateUserInfo) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UpdateUserInfo) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *UpdateUserInfo) GetGender() string { if x != nil { return x.Gender } return "" } func (x *UpdateUserInfo) GetBirthday() uint64 { if x != nil { return x.Birthday } return 0 } type PasswordCheckInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` EncryptedPassword string `protobuf:"bytes,2,opt,name=encryptedPassword,proto3" json:"encryptedPassword,omitempty"` } func (x *PasswordCheckInfo) Reset() { *x = PasswordCheckInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_service_user_v1_user_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PasswordCheckInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*PasswordCheckInfo) ProtoMessage() {} func (x *PasswordCheckInfo) ProtoReflect() protoreflect.Message { mi := &file_api_service_user_v1_user_proto_msgTypes[14] 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 PasswordCheckInfo.ProtoReflect.Descriptor instead. func (*PasswordCheckInfo) Descriptor() ([]byte, []int) { return file_api_service_user_v1_user_proto_rawDescGZIP(), []int{14} } func (x *PasswordCheckInfo) GetPassword() string { if x != nil { return x.Password } return "" } func (x *PasswordCheckInfo) GetEncryptedPassword() string { if x != nil { return x.EncryptedPassword } return "" } var File_api_service_user_v1_user_proto protoreflect.FileDescriptor var file_api_service_user_v1_user_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x22, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0xed, 0x01, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x42, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xf4, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x84, 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x30, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x70, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xba, 0x01, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x57, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x27, 0x0a, 0x0d, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x22, 0x1b, 0x0a, 0x09, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x60, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x22, 0x70, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x22, 0x5d, 0x0a, 0x11, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0xe9, 0x05, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x12, 0x12, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x15, 0x5a, 0x13, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_api_service_user_v1_user_proto_rawDescOnce sync.Once file_api_service_user_v1_user_proto_rawDescData = file_api_service_user_v1_user_proto_rawDesc ) func file_api_service_user_v1_user_proto_rawDescGZIP() []byte { file_api_service_user_v1_user_proto_rawDescOnce.Do(func() { file_api_service_user_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_service_user_v1_user_proto_rawDescData) }) return file_api_service_user_v1_user_proto_rawDescData } var file_api_service_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_api_service_user_v1_user_proto_goTypes = []interface{}{ (*ListAddressReq)(nil), // 0: user.v1.ListAddressReq (*AddressInfo)(nil), // 1: user.v1.AddressInfo (*ListAddressReply)(nil), // 2: user.v1.ListAddressReply (*CreateAddressReq)(nil), // 3: user.v1.CreateAddressReq (*UpdateAddressReq)(nil), // 4: user.v1.UpdateAddressReq (*AddressReq)(nil), // 5: user.v1.AddressReq (*CheckResponse)(nil), // 6: user.v1.CheckResponse (*PageInfo)(nil), // 7: user.v1.PageInfo (*UserInfoResponse)(nil), // 8: user.v1.UserInfoResponse (*UserListResponse)(nil), // 9: user.v1.UserListResponse (*MobileRequest)(nil), // 10: user.v1.MobileRequest (*IdRequest)(nil), // 11: user.v1.IdRequest (*CreateUserInfo)(nil), // 12: user.v1.CreateUserInfo (*UpdateUserInfo)(nil), // 13: user.v1.UpdateUserInfo (*PasswordCheckInfo)(nil), // 14: user.v1.PasswordCheckInfo (*emptypb.Empty)(nil), // 15: google.protobuf.Empty } var file_api_service_user_v1_user_proto_depIdxs = []int32{ 1, // 0: user.v1.ListAddressReply.results:type_name -> user.v1.AddressInfo 8, // 1: user.v1.UserListResponse.data:type_name -> user.v1.UserInfoResponse 7, // 2: user.v1.User.GetUserList:input_type -> user.v1.PageInfo 10, // 3: user.v1.User.GetUserByMobile:input_type -> user.v1.MobileRequest 11, // 4: user.v1.User.GetUserById:input_type -> user.v1.IdRequest 12, // 5: user.v1.User.CreateUser:input_type -> user.v1.CreateUserInfo 13, // 6: user.v1.User.UpdateUser:input_type -> user.v1.UpdateUserInfo 14, // 7: user.v1.User.CheckPassword:input_type -> user.v1.PasswordCheckInfo 0, // 8: user.v1.User.ListAddress:input_type -> user.v1.ListAddressReq 3, // 9: user.v1.User.CreateAddress:input_type -> user.v1.CreateAddressReq 4, // 10: user.v1.User.UpdateAddress:input_type -> user.v1.UpdateAddressReq 5, // 11: user.v1.User.DefaultAddress:input_type -> user.v1.AddressReq 5, // 12: user.v1.User.DeleteAddress:input_type -> user.v1.AddressReq 9, // 13: user.v1.User.GetUserList:output_type -> user.v1.UserListResponse 8, // 14: user.v1.User.GetUserByMobile:output_type -> user.v1.UserInfoResponse 8, // 15: user.v1.User.GetUserById:output_type -> user.v1.UserInfoResponse 8, // 16: user.v1.User.CreateUser:output_type -> user.v1.UserInfoResponse 15, // 17: user.v1.User.UpdateUser:output_type -> google.protobuf.Empty 6, // 18: user.v1.User.CheckPassword:output_type -> user.v1.CheckResponse 2, // 19: user.v1.User.ListAddress:output_type -> user.v1.ListAddressReply 1, // 20: user.v1.User.CreateAddress:output_type -> user.v1.AddressInfo 6, // 21: user.v1.User.UpdateAddress:output_type -> user.v1.CheckResponse 6, // 22: user.v1.User.DefaultAddress:output_type -> user.v1.CheckResponse 6, // 23: user.v1.User.DeleteAddress:output_type -> user.v1.CheckResponse 13, // [13:24] is the sub-list for method output_type 2, // [2:13] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } func init() { file_api_service_user_v1_user_proto_init() } func file_api_service_user_v1_user_proto_init() { if File_api_service_user_v1_user_proto != nil { return } if !protoimpl.UnsafeEnabled { file_api_service_user_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PageInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserInfoResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserListResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MobileRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IdRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateUserInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateUserInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_service_user_v1_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PasswordCheckInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_service_user_v1_user_proto_rawDesc, NumEnums: 0, NumMessages: 15, NumExtensions: 0, NumServices: 1, }, GoTypes: file_api_service_user_v1_user_proto_goTypes, DependencyIndexes: file_api_service_user_v1_user_proto_depIdxs, MessageInfos: file_api_service_user_v1_user_proto_msgTypes, }.Build() File_api_service_user_v1_user_proto = out.File file_api_service_user_v1_user_proto_rawDesc = nil file_api_service_user_v1_user_proto_goTypes = nil file_api_service_user_v1_user_proto_depIdxs = nil } ================================================ FILE: shop/api/service/user/v1/user.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: api/service/user/v1/user.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on ListAddressReq 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 *ListAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReq 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 ListAddressReqMultiError, // or nil if none found. func (m *ListAddressReq) ValidateAll() error { return m.validate(true) } func (m *ListAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid if len(errors) > 0 { return ListAddressReqMultiError(errors) } return nil } // ListAddressReqMultiError is an error wrapping multiple validation errors // returned by ListAddressReq.ValidateAll() if the designated constraints // aren't met. type ListAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReqMultiError) 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 ListAddressReqMultiError) AllErrors() []error { return m } // ListAddressReqValidationError is the validation error returned by // ListAddressReq.Validate if the designated constraints aren't met. type ListAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReqValidationError) ErrorName() string { return "ListAddressReqValidationError" } // Error satisfies the builtin error interface func (e ListAddressReqValidationError) 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 %sListAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReqValidationError{} // Validate checks the field values on AddressInfo 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 *AddressInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressInfo 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 AddressInfoMultiError, or // nil if none found. func (m *AddressInfo) ValidateAll() error { return m.validate(true) } func (m *AddressInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return AddressInfoMultiError(errors) } return nil } // AddressInfoMultiError is an error wrapping multiple validation errors // returned by AddressInfo.ValidateAll() if the designated constraints aren't met. type AddressInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressInfoMultiError) 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 AddressInfoMultiError) AllErrors() []error { return m } // AddressInfoValidationError is the validation error returned by // AddressInfo.Validate if the designated constraints aren't met. type AddressInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressInfoValidationError) ErrorName() string { return "AddressInfoValidationError" } // Error satisfies the builtin error interface func (e AddressInfoValidationError) 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 %sAddressInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressInfoValidationError{} // Validate checks the field values on ListAddressReply 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 *ListAddressReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReply 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 // ListAddressReplyMultiError, or nil if none found. func (m *ListAddressReply) ValidateAll() error { return m.validate(true) } func (m *ListAddressReply) validate(all bool) error { if m == nil { return nil } var errors []error for idx, item := range m.GetResults() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%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 ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return ListAddressReplyMultiError(errors) } return nil } // ListAddressReplyMultiError is an error wrapping multiple validation errors // returned by ListAddressReply.ValidateAll() if the designated constraints // aren't met. type ListAddressReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReplyMultiError) 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 ListAddressReplyMultiError) AllErrors() []error { return m } // ListAddressReplyValidationError is the validation error returned by // ListAddressReply.Validate if the designated constraints aren't met. type ListAddressReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReplyValidationError) ErrorName() string { return "ListAddressReplyValidationError" } // Error satisfies the builtin error interface func (e ListAddressReplyValidationError) 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 %sListAddressReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReplyValidationError{} // Validate checks the field values on CreateAddressReq 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 *CreateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateAddressReq 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 // CreateAddressReqMultiError, or nil if none found. func (m *CreateAddressReq) ValidateAll() error { return m.validate(true) } func (m *CreateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return CreateAddressReqMultiError(errors) } return nil } // CreateAddressReqMultiError is an error wrapping multiple validation errors // returned by CreateAddressReq.ValidateAll() if the designated constraints // aren't met. type CreateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateAddressReqMultiError) 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 CreateAddressReqMultiError) AllErrors() []error { return m } // CreateAddressReqValidationError is the validation error returned by // CreateAddressReq.Validate if the designated constraints aren't met. type CreateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateAddressReqValidationError) ErrorName() string { return "CreateAddressReqValidationError" } // Error satisfies the builtin error interface func (e CreateAddressReqValidationError) 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 %sCreateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateAddressReqValidationError{} // Validate checks the field values on UpdateAddressReq 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 *UpdateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateAddressReq 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 // UpdateAddressReqMultiError, or nil if none found. func (m *UpdateAddressReq) ValidateAll() error { return m.validate(true) } func (m *UpdateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid // no validation rules for Name // no validation rules for Mobile // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault // no validation rules for Id if len(errors) > 0 { return UpdateAddressReqMultiError(errors) } return nil } // UpdateAddressReqMultiError is an error wrapping multiple validation errors // returned by UpdateAddressReq.ValidateAll() if the designated constraints // aren't met. type UpdateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateAddressReqMultiError) 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 UpdateAddressReqMultiError) AllErrors() []error { return m } // UpdateAddressReqValidationError is the validation error returned by // UpdateAddressReq.Validate if the designated constraints aren't met. type UpdateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateAddressReqValidationError) ErrorName() string { return "UpdateAddressReqValidationError" } // Error satisfies the builtin error interface func (e UpdateAddressReqValidationError) 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 %sUpdateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateAddressReqValidationError{} // Validate checks the field values on AddressReq 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 *AddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressReq 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 AddressReqMultiError, or // nil if none found. func (m *AddressReq) ValidateAll() error { return m.validate(true) } func (m *AddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Uid if len(errors) > 0 { return AddressReqMultiError(errors) } return nil } // AddressReqMultiError is an error wrapping multiple validation errors // returned by AddressReq.ValidateAll() if the designated constraints aren't met. type AddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressReqMultiError) 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 AddressReqMultiError) AllErrors() []error { return m } // AddressReqValidationError is the validation error returned by // AddressReq.Validate if the designated constraints aren't met. type AddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressReqValidationError) ErrorName() string { return "AddressReqValidationError" } // Error satisfies the builtin error interface func (e AddressReqValidationError) 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 %sAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressReqValidationError{} // Validate checks the field values on CheckResponse 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 *CheckResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CheckResponse 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 CheckResponseMultiError, or // nil if none found. func (m *CheckResponse) ValidateAll() error { return m.validate(true) } func (m *CheckResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Success if len(errors) > 0 { return CheckResponseMultiError(errors) } return nil } // CheckResponseMultiError is an error wrapping multiple validation errors // returned by CheckResponse.ValidateAll() if the designated constraints // aren't met. type CheckResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CheckResponseMultiError) 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 CheckResponseMultiError) AllErrors() []error { return m } // CheckResponseValidationError is the validation error returned by // CheckResponse.Validate if the designated constraints aren't met. type CheckResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CheckResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CheckResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CheckResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CheckResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CheckResponseValidationError) ErrorName() string { return "CheckResponseValidationError" } // Error satisfies the builtin error interface func (e CheckResponseValidationError) 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 %sCheckResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CheckResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CheckResponseValidationError{} // Validate checks the field values on PageInfo 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 *PageInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PageInfo 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 PageInfoMultiError, or nil // if none found. func (m *PageInfo) ValidateAll() error { return m.validate(true) } func (m *PageInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Pn // no validation rules for PSize if len(errors) > 0 { return PageInfoMultiError(errors) } return nil } // PageInfoMultiError is an error wrapping multiple validation errors returned // by PageInfo.ValidateAll() if the designated constraints aren't met. type PageInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PageInfoMultiError) 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 PageInfoMultiError) AllErrors() []error { return m } // PageInfoValidationError is the validation error returned by // PageInfo.Validate if the designated constraints aren't met. type PageInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PageInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PageInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PageInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PageInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PageInfoValidationError) ErrorName() string { return "PageInfoValidationError" } // Error satisfies the builtin error interface func (e PageInfoValidationError) 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 %sPageInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PageInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PageInfoValidationError{} // Validate checks the field values on UserInfoResponse 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 *UserInfoResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UserInfoResponse 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 // UserInfoResponseMultiError, or nil if none found. func (m *UserInfoResponse) ValidateAll() error { return m.validate(true) } func (m *UserInfoResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Password // no validation rules for Mobile // no validation rules for NickName // no validation rules for Birthday // no validation rules for Gender // no validation rules for Role if len(errors) > 0 { return UserInfoResponseMultiError(errors) } return nil } // UserInfoResponseMultiError is an error wrapping multiple validation errors // returned by UserInfoResponse.ValidateAll() if the designated constraints // aren't met. type UserInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UserInfoResponseMultiError) 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 UserInfoResponseMultiError) AllErrors() []error { return m } // UserInfoResponseValidationError is the validation error returned by // UserInfoResponse.Validate if the designated constraints aren't met. type UserInfoResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UserInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UserInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UserInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UserInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UserInfoResponseValidationError) ErrorName() string { return "UserInfoResponseValidationError" } // Error satisfies the builtin error interface func (e UserInfoResponseValidationError) 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 %sUserInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UserInfoResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UserInfoResponseValidationError{} // Validate checks the field values on UserListResponse 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 *UserListResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UserListResponse 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 // UserListResponseMultiError, or nil if none found. func (m *UserListResponse) ValidateAll() error { return m.validate(true) } func (m *UserListResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Total for idx, item := range m.GetData() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, UserListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, UserListResponseValidationError{ field: fmt.Sprintf("Data[%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 UserListResponseValidationError{ field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return UserListResponseMultiError(errors) } return nil } // UserListResponseMultiError is an error wrapping multiple validation errors // returned by UserListResponse.ValidateAll() if the designated constraints // aren't met. type UserListResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UserListResponseMultiError) 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 UserListResponseMultiError) AllErrors() []error { return m } // UserListResponseValidationError is the validation error returned by // UserListResponse.Validate if the designated constraints aren't met. type UserListResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UserListResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UserListResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UserListResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UserListResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UserListResponseValidationError) ErrorName() string { return "UserListResponseValidationError" } // Error satisfies the builtin error interface func (e UserListResponseValidationError) 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 %sUserListResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UserListResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UserListResponseValidationError{} // Validate checks the field values on MobileRequest 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 *MobileRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on MobileRequest 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 MobileRequestMultiError, or // nil if none found. func (m *MobileRequest) ValidateAll() error { return m.validate(true) } func (m *MobileRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Mobile if len(errors) > 0 { return MobileRequestMultiError(errors) } return nil } // MobileRequestMultiError is an error wrapping multiple validation errors // returned by MobileRequest.ValidateAll() if the designated constraints // aren't met. type MobileRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m MobileRequestMultiError) 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 MobileRequestMultiError) AllErrors() []error { return m } // MobileRequestValidationError is the validation error returned by // MobileRequest.Validate if the designated constraints aren't met. type MobileRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e MobileRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e MobileRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e MobileRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e MobileRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e MobileRequestValidationError) ErrorName() string { return "MobileRequestValidationError" } // Error satisfies the builtin error interface func (e MobileRequestValidationError) 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 %sMobileRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = MobileRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = MobileRequestValidationError{} // Validate checks the field values on IdRequest 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 *IdRequest) Validate() error { return m.validate(false) } // ValidateAll checks the field values on IdRequest 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 IdRequestMultiError, or nil // if none found. func (m *IdRequest) ValidateAll() error { return m.validate(true) } func (m *IdRequest) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return IdRequestMultiError(errors) } return nil } // IdRequestMultiError is an error wrapping multiple validation errors returned // by IdRequest.ValidateAll() if the designated constraints aren't met. type IdRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m IdRequestMultiError) 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 IdRequestMultiError) AllErrors() []error { return m } // IdRequestValidationError is the validation error returned by // IdRequest.Validate if the designated constraints aren't met. type IdRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e IdRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e IdRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e IdRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e IdRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e IdRequestValidationError) ErrorName() string { return "IdRequestValidationError" } // Error satisfies the builtin error interface func (e IdRequestValidationError) 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 %sIdRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = IdRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = IdRequestValidationError{} // Validate checks the field values on CreateUserInfo 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 *CreateUserInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateUserInfo 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 CreateUserInfoMultiError, // or nil if none found. func (m *CreateUserInfo) ValidateAll() error { return m.validate(true) } func (m *CreateUserInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for NickName // no validation rules for Password // no validation rules for Mobile if len(errors) > 0 { return CreateUserInfoMultiError(errors) } return nil } // CreateUserInfoMultiError is an error wrapping multiple validation errors // returned by CreateUserInfo.ValidateAll() if the designated constraints // aren't met. type CreateUserInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateUserInfoMultiError) 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 CreateUserInfoMultiError) AllErrors() []error { return m } // CreateUserInfoValidationError is the validation error returned by // CreateUserInfo.Validate if the designated constraints aren't met. type CreateUserInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateUserInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateUserInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateUserInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateUserInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateUserInfoValidationError) ErrorName() string { return "CreateUserInfoValidationError" } // Error satisfies the builtin error interface func (e CreateUserInfoValidationError) 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 %sCreateUserInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateUserInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateUserInfoValidationError{} // Validate checks the field values on UpdateUserInfo 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 *UpdateUserInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateUserInfo 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 UpdateUserInfoMultiError, // or nil if none found. func (m *UpdateUserInfo) ValidateAll() error { return m.validate(true) } func (m *UpdateUserInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for NickName // no validation rules for Gender // no validation rules for Birthday if len(errors) > 0 { return UpdateUserInfoMultiError(errors) } return nil } // UpdateUserInfoMultiError is an error wrapping multiple validation errors // returned by UpdateUserInfo.ValidateAll() if the designated constraints // aren't met. type UpdateUserInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateUserInfoMultiError) 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 UpdateUserInfoMultiError) AllErrors() []error { return m } // UpdateUserInfoValidationError is the validation error returned by // UpdateUserInfo.Validate if the designated constraints aren't met. type UpdateUserInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateUserInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateUserInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateUserInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateUserInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateUserInfoValidationError) ErrorName() string { return "UpdateUserInfoValidationError" } // Error satisfies the builtin error interface func (e UpdateUserInfoValidationError) 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 %sUpdateUserInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateUserInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateUserInfoValidationError{} // Validate checks the field values on PasswordCheckInfo 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 *PasswordCheckInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PasswordCheckInfo 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 // PasswordCheckInfoMultiError, or nil if none found. func (m *PasswordCheckInfo) ValidateAll() error { return m.validate(true) } func (m *PasswordCheckInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Password // no validation rules for EncryptedPassword if len(errors) > 0 { return PasswordCheckInfoMultiError(errors) } return nil } // PasswordCheckInfoMultiError is an error wrapping multiple validation errors // returned by PasswordCheckInfo.ValidateAll() if the designated constraints // aren't met. type PasswordCheckInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PasswordCheckInfoMultiError) 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 PasswordCheckInfoMultiError) AllErrors() []error { return m } // PasswordCheckInfoValidationError is the validation error returned by // PasswordCheckInfo.Validate if the designated constraints aren't met. type PasswordCheckInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PasswordCheckInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PasswordCheckInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PasswordCheckInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PasswordCheckInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PasswordCheckInfoValidationError) ErrorName() string { return "PasswordCheckInfoValidationError" } // Error satisfies the builtin error interface func (e PasswordCheckInfoValidationError) 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 %sPasswordCheckInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PasswordCheckInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PasswordCheckInfoValidationError{} ================================================ FILE: shop/api/service/user/v1/user.proto ================================================ syntax = "proto3"; package user.v1; import "google/protobuf/empty.proto"; option go_package = "user/api/user/v1;v1"; service User{ rpc GetUserList(PageInfo) returns (UserListResponse){}; // 用户列表 rpc GetUserByMobile(MobileRequest) returns (UserInfoResponse){}; // 通过 mobile 查询用户 rpc GetUserById(IdRequest) returns (UserInfoResponse){}; // 通过 Id 查询用户 rpc CreateUser(CreateUserInfo) returns (UserInfoResponse){}; // 创建用户 rpc UpdateUser(UpdateUserInfo) returns (google.protobuf.Empty){}; // 更新用户 rpc CheckPassword(PasswordCheckInfo) returns (CheckResponse){}; // 检查用户密码 // 收货地址 rpc ListAddress(ListAddressReq) returns (ListAddressReply) {} // 所有收货地址列表 rpc CreateAddress(CreateAddressReq) returns (AddressInfo) {} // 新增收货地址 rpc UpdateAddress(UpdateAddressReq) returns (CheckResponse) {} // 修改收货地址 rpc DefaultAddress(AddressReq) returns (CheckResponse) {} // 设置默认地址 rpc DeleteAddress(AddressReq) returns (CheckResponse) {} // 删除收货地址 } message ListAddressReq { int64 uid = 1; } message AddressInfo { int64 id = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; } message ListAddressReply { repeated AddressInfo results = 1; } message CreateAddressReq { int64 uid = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; } message UpdateAddressReq { int64 uid = 1; string name = 2; string mobile = 3; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; int64 id = 10; } message AddressReq { int64 id = 1; int64 uid = 2; } message CheckResponse{ bool success = 1; } // 分页 message PageInfo{ uint32 pn = 1; uint32 pSize = 2; } // 用户信息 message UserInfoResponse{ int64 id = 1; string password = 2; string mobile = 3; string nickName = 4; uint64 birthday = 5; string gender = 6; int32 role = 7; } // 用户列表 message UserListResponse{ int32 total = 1; repeated UserInfoResponse data = 2; } message MobileRequest{ string mobile = 1; } message IdRequest{ int64 id = 1; } // 创建用户 message CreateUserInfo{ string nickName = 1; string password = 2; string mobile = 3; } message UpdateUserInfo{ int64 id = 1; string nickName = 2; string gender = 3; uint64 birthday = 4; } message PasswordCheckInfo{ string password = 1; string encryptedPassword = 2; } ================================================ FILE: shop/api/service/user/v1/user_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.17.3 // source: api/service/user/v1/user.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // UserClient is the client API for User service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type UserClient interface { GetUserList(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*UserListResponse, error) GetUserByMobile(ctx context.Context, in *MobileRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) GetUserById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) CreateUser(ctx context.Context, in *CreateUserInfo, opts ...grpc.CallOption) (*UserInfoResponse, error) UpdateUser(ctx context.Context, in *UpdateUserInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) CheckPassword(ctx context.Context, in *PasswordCheckInfo, opts ...grpc.CallOption) (*CheckResponse, error) // 收货地址 ListAddress(ctx context.Context, in *ListAddressReq, opts ...grpc.CallOption) (*ListAddressReply, error) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) } type userClient struct { cc grpc.ClientConnInterface } func NewUserClient(cc grpc.ClientConnInterface) UserClient { return &userClient{cc} } func (c *userClient) GetUserList(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*UserListResponse, error) { out := new(UserListResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserList", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) GetUserByMobile(ctx context.Context, in *MobileRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserByMobile", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) GetUserById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/GetUserById", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CreateUser(ctx context.Context, in *CreateUserInfo, opts ...grpc.CallOption) (*UserInfoResponse, error) { out := new(UserInfoResponse) err := c.cc.Invoke(ctx, "/user.v1.User/CreateUser", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) UpdateUser(ctx context.Context, in *UpdateUserInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/user.v1.User/UpdateUser", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CheckPassword(ctx context.Context, in *PasswordCheckInfo, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/CheckPassword", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) ListAddress(ctx context.Context, in *ListAddressReq, opts ...grpc.CallOption) (*ListAddressReply, error) { out := new(ListAddressReply) err := c.cc.Invoke(ctx, "/user.v1.User/ListAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) { out := new(AddressInfo) err := c.cc.Invoke(ctx, "/user.v1.User/CreateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/UpdateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/DefaultAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *userClient) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/user.v1.User/DeleteAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } // UserServer is the server API for User service. // All implementations must embed UnimplementedUserServer // for forward compatibility type UserServer interface { GetUserList(context.Context, *PageInfo) (*UserListResponse, error) GetUserByMobile(context.Context, *MobileRequest) (*UserInfoResponse, error) GetUserById(context.Context, *IdRequest) (*UserInfoResponse, error) CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error) UpdateUser(context.Context, *UpdateUserInfo) (*emptypb.Empty, error) CheckPassword(context.Context, *PasswordCheckInfo) (*CheckResponse, error) // 收货地址 ListAddress(context.Context, *ListAddressReq) (*ListAddressReply, error) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) mustEmbedUnimplementedUserServer() } // UnimplementedUserServer must be embedded to have forward compatible implementations. type UnimplementedUserServer struct { } func (UnimplementedUserServer) GetUserList(context.Context, *PageInfo) (*UserListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserList not implemented") } func (UnimplementedUserServer) GetUserByMobile(context.Context, *MobileRequest) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserByMobile not implemented") } func (UnimplementedUserServer) GetUserById(context.Context, *IdRequest) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserById not implemented") } func (UnimplementedUserServer) CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") } func (UnimplementedUserServer) UpdateUser(context.Context, *UpdateUserInfo) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") } func (UnimplementedUserServer) CheckPassword(context.Context, *PasswordCheckInfo) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CheckPassword not implemented") } func (UnimplementedUserServer) ListAddress(context.Context, *ListAddressReq) (*ListAddressReply, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAddress not implemented") } func (UnimplementedUserServer) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAddress not implemented") } func (UnimplementedUserServer) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateAddress not implemented") } func (UnimplementedUserServer) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DefaultAddress not implemented") } func (UnimplementedUserServer) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteAddress not implemented") } func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {} // UnsafeUserServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to UserServer will // result in compilation errors. type UnsafeUserServer interface { mustEmbedUnimplementedUserServer() } func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer) { s.RegisterService(&User_ServiceDesc, srv) } func _User_GetUserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PageInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserList(ctx, req.(*PageInfo)) } return interceptor(ctx, in, info, handler) } func _User_GetUserByMobile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MobileRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserByMobile(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserByMobile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserByMobile(ctx, req.(*MobileRequest)) } return interceptor(ctx, in, info, handler) } func _User_GetUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).GetUserById(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/GetUserById", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).GetUserById(ctx, req.(*IdRequest)) } return interceptor(ctx, in, info, handler) } func _User_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateUserInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CreateUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CreateUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CreateUser(ctx, req.(*CreateUserInfo)) } return interceptor(ctx, in, info, handler) } func _User_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateUserInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).UpdateUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/UpdateUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).UpdateUser(ctx, req.(*UpdateUserInfo)) } return interceptor(ctx, in, info, handler) } func _User_CheckPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PasswordCheckInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CheckPassword(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CheckPassword", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CheckPassword(ctx, req.(*PasswordCheckInfo)) } return interceptor(ctx, in, info, handler) } func _User_ListAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).ListAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/ListAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).ListAddress(ctx, req.(*ListAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_CreateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).CreateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/CreateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).CreateAddress(ctx, req.(*CreateAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_UpdateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).UpdateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/UpdateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).UpdateAddress(ctx, req.(*UpdateAddressReq)) } return interceptor(ctx, in, info, handler) } func _User_DefaultAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).DefaultAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/DefaultAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).DefaultAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } func _User_DeleteAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServer).DeleteAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/user.v1.User/DeleteAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServer).DeleteAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } // User_ServiceDesc is the grpc.ServiceDesc for User service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.v1.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUserList", Handler: _User_GetUserList_Handler, }, { MethodName: "GetUserByMobile", Handler: _User_GetUserByMobile_Handler, }, { MethodName: "GetUserById", Handler: _User_GetUserById_Handler, }, { MethodName: "CreateUser", Handler: _User_CreateUser_Handler, }, { MethodName: "UpdateUser", Handler: _User_UpdateUser_Handler, }, { MethodName: "CheckPassword", Handler: _User_CheckPassword_Handler, }, { MethodName: "ListAddress", Handler: _User_ListAddress_Handler, }, { MethodName: "CreateAddress", Handler: _User_CreateAddress_Handler, }, { MethodName: "UpdateAddress", Handler: _User_UpdateAddress_Handler, }, { MethodName: "DefaultAddress", Handler: _User_DefaultAddress_Handler, }, { MethodName: "DeleteAddress", Handler: _User_DeleteAddress_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/service/user/v1/user.proto", } ================================================ FILE: shop/api/shop/v1/error_reason.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.17.3 // source: api/shop/v1/error_reason.proto package v1 import ( _ "github.com/go-kratos/kratos/v2/errors" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ErrorReason int32 const ( ErrorReason_USER_NOT_FOUND ErrorReason = 0 ErrorReason_CONTENT_MISSING ErrorReason = 1 ) // Enum value maps for ErrorReason. var ( ErrorReason_name = map[int32]string{ 0: "USER_NOT_FOUND", 1: "CONTENT_MISSING", } ErrorReason_value = map[string]int32{ "USER_NOT_FOUND": 0, "CONTENT_MISSING": 1, } ) func (x ErrorReason) Enum() *ErrorReason { p := new(ErrorReason) *p = x return p } func (x ErrorReason) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ErrorReason) Descriptor() protoreflect.EnumDescriptor { return file_api_shop_v1_error_reason_proto_enumTypes[0].Descriptor() } func (ErrorReason) Type() protoreflect.EnumType { return &file_api_shop_v1_error_reason_proto_enumTypes[0] } func (x ErrorReason) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ErrorReason.Descriptor instead. func (ErrorReason) EnumDescriptor() ([]byte, []int) { return file_api_shop_v1_error_reason_proto_rawDescGZIP(), []int{0} } var File_api_shop_v1_error_reason_proto protoreflect.FileDescriptor var file_api_shop_v1_error_reason_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0x48, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x1a, 0x04, 0xa8, 0x45, 0x94, 0x03, 0x12, 0x19, 0x0a, 0x0f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x42, 0x3d, 0x0a, 0x0e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x50, 0x01, 0x5a, 0x13, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0xa2, 0x02, 0x13, 0x41, 0x50, 0x49, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_api_shop_v1_error_reason_proto_rawDescOnce sync.Once file_api_shop_v1_error_reason_proto_rawDescData = file_api_shop_v1_error_reason_proto_rawDesc ) func file_api_shop_v1_error_reason_proto_rawDescGZIP() []byte { file_api_shop_v1_error_reason_proto_rawDescOnce.Do(func() { file_api_shop_v1_error_reason_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_shop_v1_error_reason_proto_rawDescData) }) return file_api_shop_v1_error_reason_proto_rawDescData } var file_api_shop_v1_error_reason_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_api_shop_v1_error_reason_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: helloworld.v1.ErrorReason } var file_api_shop_v1_error_reason_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_api_shop_v1_error_reason_proto_init() } func file_api_shop_v1_error_reason_proto_init() { if File_api_shop_v1_error_reason_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_shop_v1_error_reason_proto_rawDesc, NumEnums: 1, NumMessages: 0, NumExtensions: 0, NumServices: 0, }, GoTypes: file_api_shop_v1_error_reason_proto_goTypes, DependencyIndexes: file_api_shop_v1_error_reason_proto_depIdxs, EnumInfos: file_api_shop_v1_error_reason_proto_enumTypes, }.Build() File_api_shop_v1_error_reason_proto = out.File file_api_shop_v1_error_reason_proto_rawDesc = nil file_api_shop_v1_error_reason_proto_goTypes = nil file_api_shop_v1_error_reason_proto_depIdxs = nil } ================================================ FILE: shop/api/shop/v1/error_reason.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: api/shop/v1/error_reason.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) ================================================ FILE: shop/api/shop/v1/error_reason.proto ================================================ syntax = "proto3"; package helloworld.v1; import "errors/errors.proto"; option go_package = "shop/api/shop/v1;v1"; option java_multiple_files = true; option java_package = "shop.v1.errors"; option objc_class_prefix = "APIHelloworldErrors"; enum ErrorReason { option (errors.default_code) = 500; USER_NOT_FOUND = 0 [(errors.code) = 404]; CONTENT_MISSING = 1 [(errors.code) = 400]; } ================================================ FILE: shop/api/shop/v1/error_reason_errors.pb.go ================================================ // Code generated by protoc-gen-go-errors. DO NOT EDIT. package v1 import ( fmt "fmt" errors "github.com/go-kratos/kratos/v2/errors" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the kratos package it is being compiled against. const _ = errors.SupportPackageIsVersion1 func IsUserNotFound(err error) bool { e := errors.FromError(err) return e.Reason == ErrorReason_USER_NOT_FOUND.String() && e.Code == 404 } func ErrorUserNotFound(format string, args ...interface{}) *errors.Error { return errors.New(404, ErrorReason_USER_NOT_FOUND.String(), fmt.Sprintf(format, args...)) } func IsContentMissing(err error) bool { e := errors.FromError(err) return e.Reason == ErrorReason_CONTENT_MISSING.String() && e.Code == 400 } func ErrorContentMissing(format string, args ...interface{}) *errors.Error { return errors.New(400, ErrorReason_CONTENT_MISSING.String(), fmt.Sprintf(format, args...)) } ================================================ FILE: shop/api/shop/v1/shop.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.17.3 // source: api/shop/v1/shop.proto package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type CreateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *CreateAddressReq) Reset() { *x = CreateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CreateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*CreateAddressReq) ProtoMessage() {} func (x *CreateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_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 CreateAddressReq.ProtoReflect.Descriptor instead. func (*CreateAddressReq) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{0} } func (x *CreateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *CreateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *CreateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *CreateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *CreateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *CreateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *CreateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *CreateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *CreateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type UpdateAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` Id int64 `protobuf:"varint,10,opt,name=id,proto3" json:"id,omitempty"` } func (x *UpdateAddressReq) Reset() { *x = UpdateAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UpdateAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*UpdateAddressReq) ProtoMessage() {} func (x *UpdateAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_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 UpdateAddressReq.ProtoReflect.Descriptor instead. func (*UpdateAddressReq) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{1} } func (x *UpdateAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } func (x *UpdateAddressReq) GetName() string { if x != nil { return x.Name } return "" } func (x *UpdateAddressReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UpdateAddressReq) GetProvince() string { if x != nil { return x.Province } return "" } func (x *UpdateAddressReq) GetCity() string { if x != nil { return x.City } return "" } func (x *UpdateAddressReq) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *UpdateAddressReq) GetAddress() string { if x != nil { return x.Address } return "" } func (x *UpdateAddressReq) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *UpdateAddressReq) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } func (x *UpdateAddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } type AddressInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Province string `protobuf:"bytes,4,opt,name=Province,proto3" json:"Province,omitempty"` City string `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"` Districts string `protobuf:"bytes,6,opt,name=Districts,proto3" json:"Districts,omitempty"` Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` PostCode string `protobuf:"bytes,8,opt,name=post_code,json=postCode,proto3" json:"post_code,omitempty"` IsDefault int32 `protobuf:"varint,9,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` } func (x *AddressInfo) Reset() { *x = AddressInfo{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressInfo) ProtoMessage() {} func (x *AddressInfo) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_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 AddressInfo.ProtoReflect.Descriptor instead. func (*AddressInfo) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{2} } func (x *AddressInfo) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressInfo) GetName() string { if x != nil { return x.Name } return "" } func (x *AddressInfo) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *AddressInfo) GetProvince() string { if x != nil { return x.Province } return "" } func (x *AddressInfo) GetCity() string { if x != nil { return x.City } return "" } func (x *AddressInfo) GetDistricts() string { if x != nil { return x.Districts } return "" } func (x *AddressInfo) GetAddress() string { if x != nil { return x.Address } return "" } func (x *AddressInfo) GetPostCode() string { if x != nil { return x.PostCode } return "" } func (x *AddressInfo) GetIsDefault() int32 { if x != nil { return x.IsDefault } return 0 } type ListAddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *ListAddressReq) Reset() { *x = ListAddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReq) ProtoMessage() {} func (x *ListAddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_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 ListAddressReq.ProtoReflect.Descriptor instead. func (*ListAddressReq) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{3} } func (x *ListAddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type ListAddressReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Results []*AddressInfo `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } func (x *ListAddressReply) Reset() { *x = ListAddressReply{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ListAddressReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*ListAddressReply) ProtoMessage() {} func (x *ListAddressReply) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ListAddressReply.ProtoReflect.Descriptor instead. func (*ListAddressReply) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{4} } func (x *ListAddressReply) GetResults() []*AddressInfo { if x != nil { return x.Results } return nil } type AddressReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Uid int64 `protobuf:"varint,2,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *AddressReq) Reset() { *x = AddressReq{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AddressReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*AddressReq) ProtoMessage() {} func (x *AddressReq) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AddressReq.ProtoReflect.Descriptor instead. func (*AddressReq) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{5} } func (x *AddressReq) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *AddressReq) GetUid() int64 { if x != nil { return x.Uid } return 0 } type CheckResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } func (x *CheckResponse) Reset() { *x = CheckResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CheckResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*CheckResponse) ProtoMessage() {} func (x *CheckResponse) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_proto_msgTypes[6] 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 CheckResponse.ProtoReflect.Descriptor instead. func (*CheckResponse) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{6} } func (x *CheckResponse) GetSuccess() bool { if x != nil { return x.Success } return false } // Data returned by registration and login type RegisterReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` ExpiredAt int64 `protobuf:"varint,6,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"` } func (x *RegisterReply) Reset() { *x = RegisterReply{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *RegisterReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*RegisterReply) ProtoMessage() {} func (x *RegisterReply) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_proto_msgTypes[7] 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 RegisterReply.ProtoReflect.Descriptor instead. func (*RegisterReply) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{7} } func (x *RegisterReply) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *RegisterReply) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *RegisterReply) GetUsername() string { if x != nil { return x.Username } return "" } func (x *RegisterReply) GetToken() string { if x != nil { return x.Token } return "" } func (x *RegisterReply) GetExpiredAt() int64 { if x != nil { return x.ExpiredAt } return 0 } type RegisterReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` } func (x *RegisterReq) Reset() { *x = RegisterReq{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *RegisterReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*RegisterReq) ProtoMessage() {} func (x *RegisterReq) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_proto_msgTypes[8] 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 RegisterReq.ProtoReflect.Descriptor instead. func (*RegisterReq) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{8} } func (x *RegisterReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *RegisterReq) GetUsername() string { if x != nil { return x.Username } return "" } func (x *RegisterReq) GetPassword() string { if x != nil { return x.Password } return "" } type LoginReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Captcha string `protobuf:"bytes,3,opt,name=captcha,proto3" json:"captcha,omitempty"` CaptchaId string `protobuf:"bytes,4,opt,name=captchaId,proto3" json:"captchaId,omitempty"` } func (x *LoginReq) Reset() { *x = LoginReq{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *LoginReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*LoginReq) ProtoMessage() {} func (x *LoginReq) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_proto_msgTypes[9] 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 LoginReq.ProtoReflect.Descriptor instead. func (*LoginReq) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{9} } func (x *LoginReq) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *LoginReq) GetPassword() string { if x != nil { return x.Password } return "" } func (x *LoginReq) GetCaptcha() string { if x != nil { return x.Captcha } return "" } func (x *LoginReq) GetCaptchaId() string { if x != nil { return x.CaptchaId } return "" } // user Detail returned type UserDetailResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Mobile string `protobuf:"bytes,2,opt,name=mobile,proto3" json:"mobile,omitempty"` NickName string `protobuf:"bytes,3,opt,name=nickName,proto3" json:"nickName,omitempty"` Birthday int64 `protobuf:"varint,4,opt,name=birthday,proto3" json:"birthday,omitempty"` Gender string `protobuf:"bytes,5,opt,name=gender,proto3" json:"gender,omitempty"` Role int32 `protobuf:"varint,6,opt,name=role,proto3" json:"role,omitempty"` } func (x *UserDetailResponse) Reset() { *x = UserDetailResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *UserDetailResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*UserDetailResponse) ProtoMessage() {} func (x *UserDetailResponse) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_proto_msgTypes[10] 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 UserDetailResponse.ProtoReflect.Descriptor instead. func (*UserDetailResponse) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{10} } func (x *UserDetailResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *UserDetailResponse) GetMobile() string { if x != nil { return x.Mobile } return "" } func (x *UserDetailResponse) GetNickName() string { if x != nil { return x.NickName } return "" } func (x *UserDetailResponse) GetBirthday() int64 { if x != nil { return x.Birthday } return 0 } func (x *UserDetailResponse) GetGender() string { if x != nil { return x.Gender } return "" } func (x *UserDetailResponse) GetRole() int32 { if x != nil { return x.Role } return 0 } type CaptchaReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields CaptchaId string `protobuf:"bytes,1,opt,name=captchaId,proto3" json:"captchaId,omitempty"` PicPath string `protobuf:"bytes,2,opt,name=picPath,proto3" json:"picPath,omitempty"` } func (x *CaptchaReply) Reset() { *x = CaptchaReply{} if protoimpl.UnsafeEnabled { mi := &file_api_shop_v1_shop_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CaptchaReply) String() string { return protoimpl.X.MessageStringOf(x) } func (*CaptchaReply) ProtoMessage() {} func (x *CaptchaReply) ProtoReflect() protoreflect.Message { mi := &file_api_shop_v1_shop_proto_msgTypes[11] 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 CaptchaReply.ProtoReflect.Descriptor instead. func (*CaptchaReply) Descriptor() ([]byte, []int) { return file_api_shop_v1_shop_proto_rawDescGZIP(), []int{11} } func (x *CaptchaReply) GetCaptchaId() string { if x != nil { return x.CaptchaId } return "" } func (x *CaptchaReply) GetPicPath() string { if x != nil { return x.PicPath } return "" } var File_api_shop_v1_shop_proto protoreflect.FileDescriptor var file_api_shop_v1_shop_proto_rawDesc = []byte{ 0x0a, 0x16, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0xab, 0x02, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 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, 0x20, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x0b, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x25, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0xbb, 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x0b, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x25, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x80, 0x02, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 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, 0x20, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x0b, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x22, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x47, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x33, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x37, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x87, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x22, 0x7b, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x0b, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x03, 0x18, 0x0f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x08, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x9d, 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x0b, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x08, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x23, 0x0a, 0x07, 0x63, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x05, 0x18, 0x05, 0x52, 0x07, 0x63, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x12, 0x25, 0x0a, 0x09, 0x63, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x63, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x49, 0x64, 0x22, 0xa0, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x46, 0x0a, 0x0c, 0x43, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x69, 0x63, 0x50, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x69, 0x63, 0x50, 0x61, 0x74, 0x68, 0x32, 0x93, 0x07, 0x0a, 0x04, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x62, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x59, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x3a, 0x01, 0x2a, 0x12, 0x59, 0x0a, 0x07, 0x43, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x61, 0x70, 0x74, 0x63, 0x68, 0x61, 0x12, 0x5d, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x20, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x6a, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x69, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x55, 0x69, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x75, 0x69, 0x64, 0x12, 0x6c, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x1a, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x68, 0x0a, 0x0e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x1a, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x63, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x2a, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x15, 0x5a, 0x13, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_api_shop_v1_shop_proto_rawDescOnce sync.Once file_api_shop_v1_shop_proto_rawDescData = file_api_shop_v1_shop_proto_rawDesc ) func file_api_shop_v1_shop_proto_rawDescGZIP() []byte { file_api_shop_v1_shop_proto_rawDescOnce.Do(func() { file_api_shop_v1_shop_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_shop_v1_shop_proto_rawDescData) }) return file_api_shop_v1_shop_proto_rawDescData } var file_api_shop_v1_shop_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_api_shop_v1_shop_proto_goTypes = []interface{}{ (*CreateAddressReq)(nil), // 0: shop.shop.v1.CreateAddressReq (*UpdateAddressReq)(nil), // 1: shop.shop.v1.UpdateAddressReq (*AddressInfo)(nil), // 2: shop.shop.v1.AddressInfo (*ListAddressReq)(nil), // 3: shop.shop.v1.ListAddressReq (*ListAddressReply)(nil), // 4: shop.shop.v1.ListAddressReply (*AddressReq)(nil), // 5: shop.shop.v1.AddressReq (*CheckResponse)(nil), // 6: shop.shop.v1.CheckResponse (*RegisterReply)(nil), // 7: shop.shop.v1.RegisterReply (*RegisterReq)(nil), // 8: shop.shop.v1.RegisterReq (*LoginReq)(nil), // 9: shop.shop.v1.LoginReq (*UserDetailResponse)(nil), // 10: shop.shop.v1.UserDetailResponse (*CaptchaReply)(nil), // 11: shop.shop.v1.CaptchaReply (*emptypb.Empty)(nil), // 12: google.protobuf.Empty } var file_api_shop_v1_shop_proto_depIdxs = []int32{ 2, // 0: shop.shop.v1.ListAddressReply.results:type_name -> shop.shop.v1.AddressInfo 8, // 1: shop.shop.v1.Shop.Register:input_type -> shop.shop.v1.RegisterReq 9, // 2: shop.shop.v1.Shop.Login:input_type -> shop.shop.v1.LoginReq 12, // 3: shop.shop.v1.Shop.Captcha:input_type -> google.protobuf.Empty 12, // 4: shop.shop.v1.Shop.Detail:input_type -> google.protobuf.Empty 0, // 5: shop.shop.v1.Shop.CreateAddress:input_type -> shop.shop.v1.CreateAddressReq 12, // 6: shop.shop.v1.Shop.AddressListByUid:input_type -> google.protobuf.Empty 1, // 7: shop.shop.v1.Shop.UpdateAddress:input_type -> shop.shop.v1.UpdateAddressReq 5, // 8: shop.shop.v1.Shop.DefaultAddress:input_type -> shop.shop.v1.AddressReq 5, // 9: shop.shop.v1.Shop.DeleteAddress:input_type -> shop.shop.v1.AddressReq 7, // 10: shop.shop.v1.Shop.Register:output_type -> shop.shop.v1.RegisterReply 7, // 11: shop.shop.v1.Shop.Login:output_type -> shop.shop.v1.RegisterReply 11, // 12: shop.shop.v1.Shop.Captcha:output_type -> shop.shop.v1.CaptchaReply 10, // 13: shop.shop.v1.Shop.Detail:output_type -> shop.shop.v1.UserDetailResponse 2, // 14: shop.shop.v1.Shop.CreateAddress:output_type -> shop.shop.v1.AddressInfo 4, // 15: shop.shop.v1.Shop.AddressListByUid:output_type -> shop.shop.v1.ListAddressReply 6, // 16: shop.shop.v1.Shop.UpdateAddress:output_type -> shop.shop.v1.CheckResponse 6, // 17: shop.shop.v1.Shop.DefaultAddress:output_type -> shop.shop.v1.CheckResponse 6, // 18: shop.shop.v1.Shop.DeleteAddress:output_type -> shop.shop.v1.CheckResponse 10, // [10:19] is the sub-list for method output_type 1, // [1:10] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name } func init() { file_api_shop_v1_shop_proto_init() } func file_api_shop_v1_shop_proto_init() { if File_api_shop_v1_shop_proto != nil { return } if !protoimpl.UnsafeEnabled { file_api_shop_v1_shop_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAddressReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoginReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserDetailResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_api_shop_v1_shop_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CaptchaReply); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_shop_v1_shop_proto_rawDesc, NumEnums: 0, NumMessages: 12, NumExtensions: 0, NumServices: 1, }, GoTypes: file_api_shop_v1_shop_proto_goTypes, DependencyIndexes: file_api_shop_v1_shop_proto_depIdxs, MessageInfos: file_api_shop_v1_shop_proto_msgTypes, }.Build() File_api_shop_v1_shop_proto = out.File file_api_shop_v1_shop_proto_rawDesc = nil file_api_shop_v1_shop_proto_goTypes = nil file_api_shop_v1_shop_proto_depIdxs = nil } ================================================ FILE: shop/api/shop/v1/shop.pb.validate.go ================================================ // Code generated by protoc-gen-validate. DO NOT EDIT. // source: api/shop/v1/shop.proto package v1 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on CreateAddressReq 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 *CreateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CreateAddressReq 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 // CreateAddressReqMultiError, or nil if none found. func (m *CreateAddressReq) ValidateAll() error { return m.validate(true) } func (m *CreateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid if utf8.RuneCountInString(m.GetName()) < 1 { err := CreateAddressReqValidationError{ field: "Name", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetMobile()) != 11 { err := CreateAddressReqValidationError{ field: "Mobile", reason: "value length must be 11 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetProvince()) < 1 { err := CreateAddressReqValidationError{ field: "Province", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetCity()) < 1 { err := CreateAddressReqValidationError{ field: "City", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetDistricts()) < 1 { err := CreateAddressReqValidationError{ field: "Districts", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetAddress()) < 1 { err := CreateAddressReqValidationError{ field: "Address", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return CreateAddressReqMultiError(errors) } return nil } // CreateAddressReqMultiError is an error wrapping multiple validation errors // returned by CreateAddressReq.ValidateAll() if the designated constraints // aren't met. type CreateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CreateAddressReqMultiError) 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 CreateAddressReqMultiError) AllErrors() []error { return m } // CreateAddressReqValidationError is the validation error returned by // CreateAddressReq.Validate if the designated constraints aren't met. type CreateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CreateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CreateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CreateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CreateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CreateAddressReqValidationError) ErrorName() string { return "CreateAddressReqValidationError" } // Error satisfies the builtin error interface func (e CreateAddressReqValidationError) 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 %sCreateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CreateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CreateAddressReqValidationError{} // Validate checks the field values on UpdateAddressReq 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 *UpdateAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UpdateAddressReq 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 // UpdateAddressReqMultiError, or nil if none found. func (m *UpdateAddressReq) ValidateAll() error { return m.validate(true) } func (m *UpdateAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid // no validation rules for Name if utf8.RuneCountInString(m.GetMobile()) != 11 { err := UpdateAddressReqValidationError{ field: "Mobile", reason: "value length must be 11 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetProvince()) < 1 { err := UpdateAddressReqValidationError{ field: "Province", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetCity()) < 1 { err := UpdateAddressReqValidationError{ field: "City", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetDistricts()) < 1 { err := UpdateAddressReqValidationError{ field: "Districts", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetAddress()) < 1 { err := UpdateAddressReqValidationError{ field: "Address", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for PostCode // no validation rules for IsDefault if m.GetId() < 1 { err := UpdateAddressReqValidationError{ field: "Id", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return UpdateAddressReqMultiError(errors) } return nil } // UpdateAddressReqMultiError is an error wrapping multiple validation errors // returned by UpdateAddressReq.ValidateAll() if the designated constraints // aren't met. type UpdateAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UpdateAddressReqMultiError) 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 UpdateAddressReqMultiError) AllErrors() []error { return m } // UpdateAddressReqValidationError is the validation error returned by // UpdateAddressReq.Validate if the designated constraints aren't met. type UpdateAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UpdateAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UpdateAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UpdateAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UpdateAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UpdateAddressReqValidationError) ErrorName() string { return "UpdateAddressReqValidationError" } // Error satisfies the builtin error interface func (e UpdateAddressReqValidationError) 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 %sUpdateAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UpdateAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UpdateAddressReqValidationError{} // Validate checks the field values on AddressInfo 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 *AddressInfo) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressInfo 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 AddressInfoMultiError, or // nil if none found. func (m *AddressInfo) ValidateAll() error { return m.validate(true) } func (m *AddressInfo) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if utf8.RuneCountInString(m.GetName()) < 1 { err := AddressInfoValidationError{ field: "Name", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetMobile()) != 11 { err := AddressInfoValidationError{ field: "Mobile", reason: "value length must be 11 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Province // no validation rules for City // no validation rules for Districts // no validation rules for Address // no validation rules for PostCode // no validation rules for IsDefault if len(errors) > 0 { return AddressInfoMultiError(errors) } return nil } // AddressInfoMultiError is an error wrapping multiple validation errors // returned by AddressInfo.ValidateAll() if the designated constraints aren't met. type AddressInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressInfoMultiError) 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 AddressInfoMultiError) AllErrors() []error { return m } // AddressInfoValidationError is the validation error returned by // AddressInfo.Validate if the designated constraints aren't met. type AddressInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressInfoValidationError) ErrorName() string { return "AddressInfoValidationError" } // Error satisfies the builtin error interface func (e AddressInfoValidationError) 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 %sAddressInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressInfoValidationError{} // Validate checks the field values on ListAddressReq 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 *ListAddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReq 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 ListAddressReqMultiError, // or nil if none found. func (m *ListAddressReq) ValidateAll() error { return m.validate(true) } func (m *ListAddressReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Uid if len(errors) > 0 { return ListAddressReqMultiError(errors) } return nil } // ListAddressReqMultiError is an error wrapping multiple validation errors // returned by ListAddressReq.ValidateAll() if the designated constraints // aren't met. type ListAddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReqMultiError) 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 ListAddressReqMultiError) AllErrors() []error { return m } // ListAddressReqValidationError is the validation error returned by // ListAddressReq.Validate if the designated constraints aren't met. type ListAddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReqValidationError) ErrorName() string { return "ListAddressReqValidationError" } // Error satisfies the builtin error interface func (e ListAddressReqValidationError) 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 %sListAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReqValidationError{} // Validate checks the field values on ListAddressReply 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 *ListAddressReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ListAddressReply 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 // ListAddressReplyMultiError, or nil if none found. func (m *ListAddressReply) ValidateAll() error { return m.validate(true) } func (m *ListAddressReply) validate(all bool) error { if m == nil { return nil } var errors []error for idx, item := range m.GetResults() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%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 ListAddressReplyValidationError{ field: fmt.Sprintf("Results[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return ListAddressReplyMultiError(errors) } return nil } // ListAddressReplyMultiError is an error wrapping multiple validation errors // returned by ListAddressReply.ValidateAll() if the designated constraints // aren't met. type ListAddressReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ListAddressReplyMultiError) 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 ListAddressReplyMultiError) AllErrors() []error { return m } // ListAddressReplyValidationError is the validation error returned by // ListAddressReply.Validate if the designated constraints aren't met. type ListAddressReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ListAddressReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ListAddressReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ListAddressReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ListAddressReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ListAddressReplyValidationError) ErrorName() string { return "ListAddressReplyValidationError" } // Error satisfies the builtin error interface func (e ListAddressReplyValidationError) 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 %sListAddressReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ListAddressReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ListAddressReplyValidationError{} // Validate checks the field values on AddressReq 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 *AddressReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AddressReq 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 AddressReqMultiError, or // nil if none found. func (m *AddressReq) ValidateAll() error { return m.validate(true) } func (m *AddressReq) validate(all bool) error { if m == nil { return nil } var errors []error if m.GetId() < 1 { err := AddressReqValidationError{ field: "Id", reason: "value must be greater than or equal to 1", } if !all { return err } errors = append(errors, err) } // no validation rules for Uid if len(errors) > 0 { return AddressReqMultiError(errors) } return nil } // AddressReqMultiError is an error wrapping multiple validation errors // returned by AddressReq.ValidateAll() if the designated constraints aren't met. type AddressReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AddressReqMultiError) 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 AddressReqMultiError) AllErrors() []error { return m } // AddressReqValidationError is the validation error returned by // AddressReq.Validate if the designated constraints aren't met. type AddressReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AddressReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AddressReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AddressReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AddressReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AddressReqValidationError) ErrorName() string { return "AddressReqValidationError" } // Error satisfies the builtin error interface func (e AddressReqValidationError) 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 %sAddressReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AddressReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AddressReqValidationError{} // Validate checks the field values on CheckResponse 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 *CheckResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CheckResponse 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 CheckResponseMultiError, or // nil if none found. func (m *CheckResponse) ValidateAll() error { return m.validate(true) } func (m *CheckResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Success if len(errors) > 0 { return CheckResponseMultiError(errors) } return nil } // CheckResponseMultiError is an error wrapping multiple validation errors // returned by CheckResponse.ValidateAll() if the designated constraints // aren't met. type CheckResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CheckResponseMultiError) 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 CheckResponseMultiError) AllErrors() []error { return m } // CheckResponseValidationError is the validation error returned by // CheckResponse.Validate if the designated constraints aren't met. type CheckResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CheckResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CheckResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CheckResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CheckResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CheckResponseValidationError) ErrorName() string { return "CheckResponseValidationError" } // Error satisfies the builtin error interface func (e CheckResponseValidationError) 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 %sCheckResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CheckResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CheckResponseValidationError{} // Validate checks the field values on RegisterReply 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 *RegisterReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on RegisterReply 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 RegisterReplyMultiError, or // nil if none found. func (m *RegisterReply) ValidateAll() error { return m.validate(true) } func (m *RegisterReply) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Mobile // no validation rules for Username // no validation rules for Token // no validation rules for ExpiredAt if len(errors) > 0 { return RegisterReplyMultiError(errors) } return nil } // RegisterReplyMultiError is an error wrapping multiple validation errors // returned by RegisterReply.ValidateAll() if the designated constraints // aren't met. type RegisterReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m RegisterReplyMultiError) 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 RegisterReplyMultiError) AllErrors() []error { return m } // RegisterReplyValidationError is the validation error returned by // RegisterReply.Validate if the designated constraints aren't met. type RegisterReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e RegisterReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e RegisterReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e RegisterReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e RegisterReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e RegisterReplyValidationError) ErrorName() string { return "RegisterReplyValidationError" } // Error satisfies the builtin error interface func (e RegisterReplyValidationError) 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 %sRegisterReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = RegisterReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = RegisterReplyValidationError{} // Validate checks the field values on RegisterReq 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 *RegisterReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on RegisterReq 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 RegisterReqMultiError, or // nil if none found. func (m *RegisterReq) ValidateAll() error { return m.validate(true) } func (m *RegisterReq) validate(all bool) error { if m == nil { return nil } var errors []error if utf8.RuneCountInString(m.GetMobile()) != 11 { err := RegisterReqValidationError{ field: "Mobile", reason: "value length must be 11 runes", } if !all { return err } errors = append(errors, err) } if l := utf8.RuneCountInString(m.GetUsername()); l < 3 || l > 15 { err := RegisterReqValidationError{ field: "Username", reason: "value length must be between 3 and 15 runes, inclusive", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetPassword()) < 8 { err := RegisterReqValidationError{ field: "Password", reason: "value length must be at least 8 runes", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return RegisterReqMultiError(errors) } return nil } // RegisterReqMultiError is an error wrapping multiple validation errors // returned by RegisterReq.ValidateAll() if the designated constraints aren't met. type RegisterReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m RegisterReqMultiError) 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 RegisterReqMultiError) AllErrors() []error { return m } // RegisterReqValidationError is the validation error returned by // RegisterReq.Validate if the designated constraints aren't met. type RegisterReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e RegisterReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e RegisterReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e RegisterReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e RegisterReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e RegisterReqValidationError) ErrorName() string { return "RegisterReqValidationError" } // Error satisfies the builtin error interface func (e RegisterReqValidationError) 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 %sRegisterReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = RegisterReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = RegisterReqValidationError{} // Validate checks the field values on LoginReq 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 *LoginReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on LoginReq 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 LoginReqMultiError, or nil // if none found. func (m *LoginReq) ValidateAll() error { return m.validate(true) } func (m *LoginReq) validate(all bool) error { if m == nil { return nil } var errors []error if utf8.RuneCountInString(m.GetMobile()) != 11 { err := LoginReqValidationError{ field: "Mobile", reason: "value length must be 11 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetPassword()) < 8 { err := LoginReqValidationError{ field: "Password", reason: "value length must be at least 8 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetCaptcha()) != 5 { err := LoginReqValidationError{ field: "Captcha", reason: "value length must be 5 runes", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetCaptchaId()) < 1 { err := LoginReqValidationError{ field: "CaptchaId", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } if len(errors) > 0 { return LoginReqMultiError(errors) } return nil } // LoginReqMultiError is an error wrapping multiple validation errors returned // by LoginReq.ValidateAll() if the designated constraints aren't met. type LoginReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m LoginReqMultiError) 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 LoginReqMultiError) AllErrors() []error { return m } // LoginReqValidationError is the validation error returned by // LoginReq.Validate if the designated constraints aren't met. type LoginReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e LoginReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e LoginReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e LoginReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e LoginReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e LoginReqValidationError) ErrorName() string { return "LoginReqValidationError" } // Error satisfies the builtin error interface func (e LoginReqValidationError) 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 %sLoginReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = LoginReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = LoginReqValidationError{} // Validate checks the field values on UserDetailResponse 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 *UserDetailResponse) Validate() error { return m.validate(false) } // ValidateAll checks the field values on UserDetailResponse 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 // UserDetailResponseMultiError, or nil if none found. func (m *UserDetailResponse) ValidateAll() error { return m.validate(true) } func (m *UserDetailResponse) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Mobile // no validation rules for NickName // no validation rules for Birthday // no validation rules for Gender // no validation rules for Role if len(errors) > 0 { return UserDetailResponseMultiError(errors) } return nil } // UserDetailResponseMultiError is an error wrapping multiple validation errors // returned by UserDetailResponse.ValidateAll() if the designated constraints // aren't met. type UserDetailResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m UserDetailResponseMultiError) 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 UserDetailResponseMultiError) AllErrors() []error { return m } // UserDetailResponseValidationError is the validation error returned by // UserDetailResponse.Validate if the designated constraints aren't met. type UserDetailResponseValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UserDetailResponseValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UserDetailResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UserDetailResponseValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UserDetailResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UserDetailResponseValidationError) ErrorName() string { return "UserDetailResponseValidationError" } // Error satisfies the builtin error interface func (e UserDetailResponseValidationError) 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 %sUserDetailResponse.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UserDetailResponseValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UserDetailResponseValidationError{} // Validate checks the field values on CaptchaReply 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 *CaptchaReply) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CaptchaReply 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 CaptchaReplyMultiError, or // nil if none found. func (m *CaptchaReply) ValidateAll() error { return m.validate(true) } func (m *CaptchaReply) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for CaptchaId // no validation rules for PicPath if len(errors) > 0 { return CaptchaReplyMultiError(errors) } return nil } // CaptchaReplyMultiError is an error wrapping multiple validation errors // returned by CaptchaReply.ValidateAll() if the designated constraints aren't met. type CaptchaReplyMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CaptchaReplyMultiError) 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 CaptchaReplyMultiError) AllErrors() []error { return m } // CaptchaReplyValidationError is the validation error returned by // CaptchaReply.Validate if the designated constraints aren't met. type CaptchaReplyValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CaptchaReplyValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CaptchaReplyValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CaptchaReplyValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CaptchaReplyValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CaptchaReplyValidationError) ErrorName() string { return "CaptchaReplyValidationError" } // Error satisfies the builtin error interface func (e CaptchaReplyValidationError) 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 %sCaptchaReply.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CaptchaReplyValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CaptchaReplyValidationError{} ================================================ FILE: shop/api/shop/v1/shop.proto ================================================ syntax = "proto3"; package shop.shop.v1; // 这里可以把 proto 文件下载下来,放到项目的 third_party 目录下 import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "validate/validate.proto"; option go_package = "shop/api/shop/v1;v1"; // The Shop service definition. service Shop { rpc Register (RegisterReq) returns (RegisterReply) { option (google.api.http) = { post: "/api/users/register", body: "*", }; } rpc Login (LoginReq) returns (RegisterReply) { option (google.api.http) = { post: "/api/users/login", body: "*", }; } rpc Captcha (google.protobuf.Empty) returns (CaptchaReply) { option (google.api.http) = { get: "/api/users/captcha", }; } rpc Detail (google.protobuf.Empty) returns (UserDetailResponse) { option (google.api.http) = { get: "/api/users/detail", }; } rpc CreateAddress (CreateAddressReq) returns (AddressInfo) { option (google.api.http) = { post: "/api/address/create", body: "*", }; } rpc AddressListByUid (google.protobuf.Empty) returns (ListAddressReply) { option (google.api.http) = { get: "/api/address/list/uid", }; } rpc UpdateAddress (UpdateAddressReq) returns (CheckResponse) { option (google.api.http) = { put: "/api/address/update", body: "*", }; } rpc DefaultAddress (AddressReq) returns (CheckResponse) { option (google.api.http) = { put: "/api/address/default", body: "*", }; } rpc DeleteAddress (AddressReq) returns (CheckResponse) { option (google.api.http) = { delete: "/api/address/delete", }; } } message CreateAddressReq { int64 uid = 1; string name = 2 [(validate.rules).string ={min_len: 1}]; string mobile = 3 [(validate.rules).string.len = 11]; string Province = 4 [(validate.rules).string ={min_len: 1}]; string City = 5 [(validate.rules).string ={min_len: 1}]; string Districts = 6 [(validate.rules).string ={min_len: 1}]; string address = 7 [(validate.rules).string ={min_len: 1}]; string post_code = 8; int32 is_default = 9; } message UpdateAddressReq { int64 uid = 1; string name = 2; string mobile = 3 [(validate.rules).string.len = 11]; string Province = 4 [(validate.rules).string ={min_len: 1}]; string City = 5 [(validate.rules).string ={min_len: 1}]; string Districts = 6 [(validate.rules).string ={min_len: 1}]; string address = 7 [(validate.rules).string ={min_len: 1}]; string post_code = 8; int32 is_default = 9; int64 id = 10 [(validate.rules).int64.gte = 1]; } message AddressInfo { int64 id = 1; string name = 2 [(validate.rules).string ={min_len: 1}]; string mobile = 3 [(validate.rules).string.len = 11]; string Province = 4; string City = 5; string Districts = 6; string address = 7; string post_code = 8; int32 is_default = 9; } message ListAddressReq { int64 uid = 1; } message ListAddressReply { repeated AddressInfo results = 1; } message AddressReq { int64 id = 1 [(validate.rules).int64.gte = 1]; int64 uid = 2; } message CheckResponse{ bool success = 1; } // Data returned by registration and login message RegisterReply { int64 id = 1; string mobile = 3; string username = 4; string token = 5; int64 expiredAt = 6; } message RegisterReq { string mobile = 1 [(validate.rules).string.len = 11]; string username = 2 [(validate.rules).string = {min_len: 3, max_len: 15}]; string password = 3 [(validate.rules).string = {min_len: 8}]; } message LoginReq { string mobile = 1 [(validate.rules).string.len = 11]; string password = 2 [(validate.rules).string = {min_len: 8}]; string captcha = 3 [(validate.rules).string = {min_len: 5,max_len:5}]; string captchaId = 4 [(validate.rules).string ={min_len: 1}]; } // user Detail returned message UserDetailResponse{ int64 id = 1; string mobile = 2; string nickName = 3; int64 birthday = 4; string gender = 5; int32 role = 6; } message CaptchaReply{ string captchaId = 1; string picPath = 2; } ================================================ FILE: shop/api/shop/v1/shop_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.17.3 // source: api/shop/v1/shop.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // ShopClient is the client API for Shop service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ShopClient interface { Register(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*RegisterReply, error) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*RegisterReply, error) Captcha(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CaptchaReply, error) Detail(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserDetailResponse, error) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) AddressListByUid(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListAddressReply, error) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) } type shopClient struct { cc grpc.ClientConnInterface } func NewShopClient(cc grpc.ClientConnInterface) ShopClient { return &shopClient{cc} } func (c *shopClient) Register(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*RegisterReply, error) { out := new(RegisterReply) err := c.cc.Invoke(ctx, "/shop.shop.v1.Shop/Register", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *shopClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*RegisterReply, error) { out := new(RegisterReply) err := c.cc.Invoke(ctx, "/shop.shop.v1.Shop/Login", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *shopClient) Captcha(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CaptchaReply, error) { out := new(CaptchaReply) err := c.cc.Invoke(ctx, "/shop.shop.v1.Shop/Captcha", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *shopClient) Detail(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserDetailResponse, error) { out := new(UserDetailResponse) err := c.cc.Invoke(ctx, "/shop.shop.v1.Shop/Detail", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *shopClient) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...grpc.CallOption) (*AddressInfo, error) { out := new(AddressInfo) err := c.cc.Invoke(ctx, "/shop.shop.v1.Shop/CreateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *shopClient) AddressListByUid(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListAddressReply, error) { out := new(ListAddressReply) err := c.cc.Invoke(ctx, "/shop.shop.v1.Shop/AddressListByUid", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *shopClient) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/shop.shop.v1.Shop/UpdateAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *shopClient) DefaultAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/shop.shop.v1.Shop/DefaultAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *shopClient) DeleteAddress(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/shop.shop.v1.Shop/DeleteAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } // ShopServer is the server API for Shop service. // All implementations must embed UnimplementedShopServer // for forward compatibility type ShopServer interface { Register(context.Context, *RegisterReq) (*RegisterReply, error) Login(context.Context, *LoginReq) (*RegisterReply, error) Captcha(context.Context, *emptypb.Empty) (*CaptchaReply, error) Detail(context.Context, *emptypb.Empty) (*UserDetailResponse, error) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) AddressListByUid(context.Context, *emptypb.Empty) (*ListAddressReply, error) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) mustEmbedUnimplementedShopServer() } // UnimplementedShopServer must be embedded to have forward compatible implementations. type UnimplementedShopServer struct { } func (UnimplementedShopServer) Register(context.Context, *RegisterReq) (*RegisterReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") } func (UnimplementedShopServer) Login(context.Context, *LoginReq) (*RegisterReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") } func (UnimplementedShopServer) Captcha(context.Context, *emptypb.Empty) (*CaptchaReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Captcha not implemented") } func (UnimplementedShopServer) Detail(context.Context, *emptypb.Empty) (*UserDetailResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Detail not implemented") } func (UnimplementedShopServer) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAddress not implemented") } func (UnimplementedShopServer) AddressListByUid(context.Context, *emptypb.Empty) (*ListAddressReply, error) { return nil, status.Errorf(codes.Unimplemented, "method AddressListByUid not implemented") } func (UnimplementedShopServer) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateAddress not implemented") } func (UnimplementedShopServer) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DefaultAddress not implemented") } func (UnimplementedShopServer) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteAddress not implemented") } func (UnimplementedShopServer) mustEmbedUnimplementedShopServer() {} // UnsafeShopServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ShopServer will // result in compilation errors. type UnsafeShopServer interface { mustEmbedUnimplementedShopServer() } func RegisterShopServer(s grpc.ServiceRegistrar, srv ShopServer) { s.RegisterService(&Shop_ServiceDesc, srv) } func _Shop_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RegisterReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShopServer).Register(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/shop.shop.v1.Shop/Register", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShopServer).Register(ctx, req.(*RegisterReq)) } return interceptor(ctx, in, info, handler) } func _Shop_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LoginReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShopServer).Login(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/shop.shop.v1.Shop/Login", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShopServer).Login(ctx, req.(*LoginReq)) } return interceptor(ctx, in, info, handler) } func _Shop_Captcha_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShopServer).Captcha(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/shop.shop.v1.Shop/Captcha", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShopServer).Captcha(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _Shop_Detail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShopServer).Detail(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/shop.shop.v1.Shop/Detail", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShopServer).Detail(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _Shop_CreateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShopServer).CreateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/shop.shop.v1.Shop/CreateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShopServer).CreateAddress(ctx, req.(*CreateAddressReq)) } return interceptor(ctx, in, info, handler) } func _Shop_AddressListByUid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShopServer).AddressListByUid(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/shop.shop.v1.Shop/AddressListByUid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShopServer).AddressListByUid(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _Shop_UpdateAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateAddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShopServer).UpdateAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/shop.shop.v1.Shop/UpdateAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShopServer).UpdateAddress(ctx, req.(*UpdateAddressReq)) } return interceptor(ctx, in, info, handler) } func _Shop_DefaultAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShopServer).DefaultAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/shop.shop.v1.Shop/DefaultAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShopServer).DefaultAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } func _Shop_DeleteAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddressReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShopServer).DeleteAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/shop.shop.v1.Shop/DeleteAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShopServer).DeleteAddress(ctx, req.(*AddressReq)) } return interceptor(ctx, in, info, handler) } // Shop_ServiceDesc is the grpc.ServiceDesc for Shop service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Shop_ServiceDesc = grpc.ServiceDesc{ ServiceName: "shop.shop.v1.Shop", HandlerType: (*ShopServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _Shop_Register_Handler, }, { MethodName: "Login", Handler: _Shop_Login_Handler, }, { MethodName: "Captcha", Handler: _Shop_Captcha_Handler, }, { MethodName: "Detail", Handler: _Shop_Detail_Handler, }, { MethodName: "CreateAddress", Handler: _Shop_CreateAddress_Handler, }, { MethodName: "AddressListByUid", Handler: _Shop_AddressListByUid_Handler, }, { MethodName: "UpdateAddress", Handler: _Shop_UpdateAddress_Handler, }, { MethodName: "DefaultAddress", Handler: _Shop_DefaultAddress_Handler, }, { MethodName: "DeleteAddress", Handler: _Shop_DeleteAddress_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/shop/v1/shop.proto", } ================================================ FILE: shop/api/shop/v1/shop_http.pb.go ================================================ // Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: // protoc-gen-go-http v2.2.1 package v1 import ( context "context" http "github.com/go-kratos/kratos/v2/transport/http" binding "github.com/go-kratos/kratos/v2/transport/http/binding" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the kratos package it is being compiled against. var _ = new(context.Context) var _ = binding.EncodeURL const _ = http.SupportPackageIsVersion1 type ShopHTTPServer interface { AddressListByUid(context.Context, *emptypb.Empty) (*ListAddressReply, error) Captcha(context.Context, *emptypb.Empty) (*CaptchaReply, error) CreateAddress(context.Context, *CreateAddressReq) (*AddressInfo, error) DefaultAddress(context.Context, *AddressReq) (*CheckResponse, error) DeleteAddress(context.Context, *AddressReq) (*CheckResponse, error) Detail(context.Context, *emptypb.Empty) (*UserDetailResponse, error) Login(context.Context, *LoginReq) (*RegisterReply, error) Register(context.Context, *RegisterReq) (*RegisterReply, error) UpdateAddress(context.Context, *UpdateAddressReq) (*CheckResponse, error) } func RegisterShopHTTPServer(s *http.Server, srv ShopHTTPServer) { r := s.Route("/") r.POST("/api/users/register", _Shop_Register0_HTTP_Handler(srv)) r.POST("/api/users/login", _Shop_Login0_HTTP_Handler(srv)) r.GET("/api/users/captcha", _Shop_Captcha0_HTTP_Handler(srv)) r.GET("/api/users/detail", _Shop_Detail0_HTTP_Handler(srv)) r.POST("/api/address/create", _Shop_CreateAddress0_HTTP_Handler(srv)) r.GET("/api/address/list/uid", _Shop_AddressListByUid0_HTTP_Handler(srv)) r.PUT("/api/address/update", _Shop_UpdateAddress0_HTTP_Handler(srv)) r.PUT("/api/address/default", _Shop_DefaultAddress0_HTTP_Handler(srv)) r.DELETE("/api/address/delete", _Shop_DeleteAddress0_HTTP_Handler(srv)) } func _Shop_Register0_HTTP_Handler(srv ShopHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in RegisterReq if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, "/shop.shop.v1.Shop/Register") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Register(ctx, req.(*RegisterReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*RegisterReply) return ctx.Result(200, reply) } } func _Shop_Login0_HTTP_Handler(srv ShopHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in LoginReq if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, "/shop.shop.v1.Shop/Login") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Login(ctx, req.(*LoginReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*RegisterReply) return ctx.Result(200, reply) } } func _Shop_Captcha0_HTTP_Handler(srv ShopHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in emptypb.Empty if err := ctx.BindQuery(&in); err != nil { return err } http.SetOperation(ctx, "/shop.shop.v1.Shop/Captcha") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Captcha(ctx, req.(*emptypb.Empty)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CaptchaReply) return ctx.Result(200, reply) } } func _Shop_Detail0_HTTP_Handler(srv ShopHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in emptypb.Empty if err := ctx.BindQuery(&in); err != nil { return err } http.SetOperation(ctx, "/shop.shop.v1.Shop/Detail") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Detail(ctx, req.(*emptypb.Empty)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*UserDetailResponse) return ctx.Result(200, reply) } } func _Shop_CreateAddress0_HTTP_Handler(srv ShopHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in CreateAddressReq if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, "/shop.shop.v1.Shop/CreateAddress") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.CreateAddress(ctx, req.(*CreateAddressReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*AddressInfo) return ctx.Result(200, reply) } } func _Shop_AddressListByUid0_HTTP_Handler(srv ShopHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in emptypb.Empty if err := ctx.BindQuery(&in); err != nil { return err } http.SetOperation(ctx, "/shop.shop.v1.Shop/AddressListByUid") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.AddressListByUid(ctx, req.(*emptypb.Empty)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*ListAddressReply) return ctx.Result(200, reply) } } func _Shop_UpdateAddress0_HTTP_Handler(srv ShopHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in UpdateAddressReq if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, "/shop.shop.v1.Shop/UpdateAddress") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.UpdateAddress(ctx, req.(*UpdateAddressReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CheckResponse) return ctx.Result(200, reply) } } func _Shop_DefaultAddress0_HTTP_Handler(srv ShopHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in AddressReq if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, "/shop.shop.v1.Shop/DefaultAddress") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.DefaultAddress(ctx, req.(*AddressReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CheckResponse) return ctx.Result(200, reply) } } func _Shop_DeleteAddress0_HTTP_Handler(srv ShopHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in AddressReq if err := ctx.BindQuery(&in); err != nil { return err } http.SetOperation(ctx, "/shop.shop.v1.Shop/DeleteAddress") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.DeleteAddress(ctx, req.(*AddressReq)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CheckResponse) return ctx.Result(200, reply) } } type ShopHTTPClient interface { AddressListByUid(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *ListAddressReply, err error) Captcha(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *CaptchaReply, err error) CreateAddress(ctx context.Context, req *CreateAddressReq, opts ...http.CallOption) (rsp *AddressInfo, err error) DefaultAddress(ctx context.Context, req *AddressReq, opts ...http.CallOption) (rsp *CheckResponse, err error) DeleteAddress(ctx context.Context, req *AddressReq, opts ...http.CallOption) (rsp *CheckResponse, err error) Detail(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *UserDetailResponse, err error) Login(ctx context.Context, req *LoginReq, opts ...http.CallOption) (rsp *RegisterReply, err error) Register(ctx context.Context, req *RegisterReq, opts ...http.CallOption) (rsp *RegisterReply, err error) UpdateAddress(ctx context.Context, req *UpdateAddressReq, opts ...http.CallOption) (rsp *CheckResponse, err error) } type ShopHTTPClientImpl struct { cc *http.Client } func NewShopHTTPClient(client *http.Client) ShopHTTPClient { return &ShopHTTPClientImpl{client} } func (c *ShopHTTPClientImpl) AddressListByUid(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*ListAddressReply, error) { var out ListAddressReply pattern := "/api/address/list/uid" path := binding.EncodeURL(pattern, in, true) opts = append(opts, http.Operation("/shop.shop.v1.Shop/AddressListByUid")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *ShopHTTPClientImpl) Captcha(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*CaptchaReply, error) { var out CaptchaReply pattern := "/api/users/captcha" path := binding.EncodeURL(pattern, in, true) opts = append(opts, http.Operation("/shop.shop.v1.Shop/Captcha")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *ShopHTTPClientImpl) CreateAddress(ctx context.Context, in *CreateAddressReq, opts ...http.CallOption) (*AddressInfo, error) { var out AddressInfo pattern := "/api/address/create" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/shop.shop.v1.Shop/CreateAddress")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *ShopHTTPClientImpl) DefaultAddress(ctx context.Context, in *AddressReq, opts ...http.CallOption) (*CheckResponse, error) { var out CheckResponse pattern := "/api/address/default" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/shop.shop.v1.Shop/DefaultAddress")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "PUT", path, in, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *ShopHTTPClientImpl) DeleteAddress(ctx context.Context, in *AddressReq, opts ...http.CallOption) (*CheckResponse, error) { var out CheckResponse pattern := "/api/address/delete" path := binding.EncodeURL(pattern, in, true) opts = append(opts, http.Operation("/shop.shop.v1.Shop/DeleteAddress")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *ShopHTTPClientImpl) Detail(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*UserDetailResponse, error) { var out UserDetailResponse pattern := "/api/users/detail" path := binding.EncodeURL(pattern, in, true) opts = append(opts, http.Operation("/shop.shop.v1.Shop/Detail")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *ShopHTTPClientImpl) Login(ctx context.Context, in *LoginReq, opts ...http.CallOption) (*RegisterReply, error) { var out RegisterReply pattern := "/api/users/login" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/shop.shop.v1.Shop/Login")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *ShopHTTPClientImpl) Register(ctx context.Context, in *RegisterReq, opts ...http.CallOption) (*RegisterReply, error) { var out RegisterReply pattern := "/api/users/register" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/shop.shop.v1.Shop/Register")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) if err != nil { return nil, err } return &out, err } func (c *ShopHTTPClientImpl) UpdateAddress(ctx context.Context, in *UpdateAddressReq, opts ...http.CallOption) (*CheckResponse, error) { var out CheckResponse pattern := "/api/address/update" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/shop.shop.v1.Shop/UpdateAddress")) opts = append(opts, http.PathTemplate(pattern)) err := c.cc.Invoke(ctx, "PUT", path, in, &out, opts...) if err != nil { return nil, err } return &out, err } ================================================ FILE: shop/cmd/shop/main.go ================================================ package main import ( "flag" "os" "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/go-kratos/kratos/v2/transport/http" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/exporters/jaeger" "go.opentelemetry.io/otel/sdk/resource" tracesdk "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.7.0" "shop/internal/conf" ) // go build -ldflags "-X main.Version=x.y.z" var ( // Name is the name of the compiled software. Name = "shop.api" // Version is the version of the compiled software. Version = "shop.api.v1" // flagconf is the config flag. flagconf string id, _ = os.Hostname() ) func init() { flag.StringVar(&flagconf, "conf", "../../configs", "config path, eg: -conf config.yaml") } func newApp(logger log.Logger, hs *http.Server, gs *grpc.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.ID(id+"shop.api"), kratos.Name(Name), kratos.Version(Version), kratos.Metadata(map[string]string{}), kratos.Logger(logger), kratos.Server( hs, //gs, ), kratos.Registrar(rr), ) } func main() { flag.Parse() logger := log.With(log.NewStdLogger(os.Stdout), "ts", log.DefaultTimestamp, "caller", log.DefaultCaller, "service.id", id, "service.name", Name, "service.version", Version, "trace_id", tracing.TraceID(), "span_id", tracing.SpanID(), ) c := config.New( config.WithSource( file.NewSource(flagconf), ), ) defer c.Close() if err := c.Load(); err != nil { panic(err) } var bc conf.Bootstrap if err := c.Scan(&bc); err != nil { panic(err) } var rc conf.Registry if err := c.Scan(&rc); err != nil { panic(err) } err := setTracerProvider(bc.Trace.Endpoint) if err != nil { panic(err) } app, cleanup, err := initApp(bc.Server, bc.Data, bc.Auth, bc.Service, &rc, logger) if err != nil { panic(err) } defer cleanup() // start and wait for stop signal if err := app.Run(); err != nil { panic(err) } } func setTracerProvider(url string) error { // Create the Jaeger exporter exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url))) if err != nil { return err } tp := tracesdk.NewTracerProvider( // Set the sampling rate based on the parent span to 100% tracesdk.WithSampler(tracesdk.ParentBased(tracesdk.TraceIDRatioBased(1.0))), // Always be sure to batch in production. tracesdk.WithBatcher(exp), // Record information about this application in an Resource. tracesdk.WithResource(resource.NewSchemaless( semconv.ServiceNameKey.String(Name), attribute.String("env", "dev"), )), ) otel.SetTracerProvider(tp) return nil } ================================================ FILE: shop/cmd/shop/wire.go ================================================ //go:build wireinject // +build wireinject // The build tag makes sure the stub is not built in the final build. package main import ( "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" "github.com/google/wire" "shop/internal/biz" "shop/internal/conf" "shop/internal/data" "shop/internal/server" "shop/internal/service" ) // initApp init shop application. func initApp(*conf.Server, *conf.Data, *conf.Auth, *conf.Service, *conf.Registry, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } ================================================ FILE: shop/cmd/shop/wire_gen.go ================================================ // Code generated by Wire. DO NOT EDIT. //go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject package main import ( "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/log" "shop/internal/biz" "shop/internal/conf" "shop/internal/data" "shop/internal/server" "shop/internal/service" ) // Injectors from wire.go: // initApp init shop application. func initApp(confServer *conf.Server, confData *conf.Data, auth *conf.Auth, confService *conf.Service, registry *conf.Registry, logger log.Logger) (*kratos.App, func(), error) { discovery := data.NewDiscovery(registry) userClient := data.NewUserServiceClient(auth, confService, discovery) dataData, err := data.NewData(confData, userClient, logger) if err != nil { return nil, nil, err } userRepo := data.NewUserRepo(dataData, logger) userUsecase := biz.NewUserUsecase(userRepo, logger, auth) addressRepo := data.NewAddressRepo(dataData, logger) addressUsecase := biz.NewAddressUsecase(userRepo, addressRepo, logger, auth) shopService := service.NewShopService(userUsecase, addressUsecase, logger) httpServer := server.NewHTTPServer(confServer, auth, shopService, logger) grpcServer := server.NewGRPCServer(confServer, shopService, logger) registrar := data.NewRegistrar(registry) app := newApp(logger, httpServer, grpcServer, registrar) return app, func() { }, nil } ================================================ FILE: shop/configs/config.yaml ================================================ name: shop.api server: http: addr: 0.0.0.0:8097 timeout: 1s grpc: addr: 0.0.0.0:9001 timeout: 1s data: database: driver: mysql source: root:root@tcp(127.0.0.1:3306)/test redis: addr: 127.0.0.1:6379 read_timeout: 0.2s write_timeout: 0.2s trace: endpoint: http://127.0.0.1:14268/api/traces auth: jwt_key: hqFr%3ddt32DGlSTOI5cO6@TH#fFwYnP$S service: user: endpoint: discovery:///shop.user.service goods: endpoint: discovery:///shop.goods.service ================================================ FILE: shop/configs/registry.yaml ================================================ consul: address: 127.0.0.1:8500 scheme: http ================================================ FILE: shop/generate.go ================================================ package generate //go:generate kratos proto client api ================================================ FILE: shop/go.mod ================================================ module shop go 1.16 require ( github.com/envoyproxy/protoc-gen-validate v0.6.3 github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220209030627-9662ef3c213d github.com/go-kratos/kratos/v2 v2.1.5 github.com/golang-jwt/jwt/v4 v4.0.0 github.com/google/wire v0.5.0 github.com/gorilla/handlers v1.5.1 github.com/hashicorp/consul/api v1.12.0 github.com/mojocn/base64Captcha v1.3.5 go.opentelemetry.io/otel v1.4.0 go.opentelemetry.io/otel/exporters/jaeger v1.4.0 go.opentelemetry.io/otel/sdk v1.4.0 google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb google.golang.org/grpc v1.43.0 google.golang.org/protobuf v1.27.1 gopkg.in/yaml.v2 v2.4.0 // indirect ) ================================================ FILE: shop/go.sum ================================================ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.3 h1:HkntewfZJ9RofA/FX38zBCeIAqlLDFLbAI6eTpZqFJw= github.com/envoyproxy/protoc-gen-validate v0.6.3/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kratos/aegis v0.1.1/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220209030627-9662ef3c213d h1:UHNb0QKaftYtQhvcD3o7xlZbMIQs5SPB9NPKZsoqUtU= github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20220209030627-9662ef3c213d/go.mod h1:gCxmEdB6yLypq2c14QMH6JgvbNxsF4eqxqHQTMogVKA= github.com/go-kratos/kratos/v2 v2.1.5 h1:q8kTXyY1KkNJS3tmhvGUJfysipM5AIuoJaXBEvDBnFI= github.com/go-kratos/kratos/v2 v2.1.5/go.mod h1:zMonCKAf8+He4b9NQ/QHr20tMznd4NO5XrNds36w/5k= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.9.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= 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/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 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-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0 h1:8+567mCcFDnS5ADl7lrpxPMWiFCElyUEeW0gtj34fMA= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6 h1:uuEX1kLR6aoda1TBttmJQKDLZE1Ob7KN0NPdE7EtCDc= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mojocn/base64Captcha v1.3.5 h1:Qeilr7Ta6eDtG4S+tQuZ5+hO+QHbiGAJdi4PfoagaA0= github.com/mojocn/base64Captcha v1.3.5/go.mod h1:/tTTXn4WTpX9CfrmipqRytCpJ27Uw3G6I7NcP2WwcmY= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 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 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel v1.4.0 h1:7ESuKPq6zpjRaY5nvVDGiuwK7VAJ8MwkKnmNJ9whNZ4= go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= go.opentelemetry.io/otel/exporters/jaeger v1.4.0 h1:EX/spHhVkHbobTeSozT1zpbuc3oO70CISkw+dspgR9M= go.opentelemetry.io/otel/exporters/jaeger v1.4.0/go.mod h1:C4UfuVfyi7qAk/PAz6QodaEkES7RnLNHeAAj6QOu2gI= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/sdk v1.4.0 h1:LJE4SW3jd4lQTESnlpQZcBhQ3oci0U2MLR5uhicfTHQ= go.opentelemetry.io/otel/sdk v1.4.0/go.mod h1:71GJPNJh4Qju6zJuYl1CrYtXbrgfau/M9UAggqiy1UE= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/otel/trace v1.4.0 h1:4OOUrPZdVFQkbzl/JSdvGCWIdw5ONXXxzHlaLlWppmo= go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/image v0.0.0-20190501045829-6d32002ffd75 h1:TbGuee8sSq15Iguxu4deQ7+Bqq/d2rsQejGcEtADAMQ= golang.org/x/image v0.0.0-20190501045829-6d32002ffd75/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 h1:uCLL3g5wH2xjxVREVuAbP9JM5PPKjRbXKRa6IBjkzmU= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb h1:ZrsicilzPCS/Xr8qtBZZLpy4P9TYXAfl49ctG1/5tgw= google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= ================================================ FILE: shop/internal/biz/README.md ================================================ # Biz ================================================ FILE: shop/internal/biz/address.go ================================================ package biz import ( "context" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/auth/jwt" jwt2 "github.com/golang-jwt/jwt/v4" v1 "shop/api/shop/v1" "shop/internal/conf" ) type Address struct { ID int64 UserID int64 IsDefault int32 Mobile string Name string Province string City string Districts string Address string PostCode string } type AddressRepo interface { CreateAddress(ctx context.Context, a *Address) (*Address, error) AddressListByUid(ctx context.Context, uid int64) ([]*Address, error) UpdateAddress(ctx context.Context, a *Address) error DefaultAddress(ctx context.Context, a *Address) error DeleteAddress(ctx context.Context, a *Address) error } type AddressUsecase struct { uRepo UserRepo aRepo AddressRepo log *log.Helper signingKey string } func NewAddressUsecase(repo UserRepo, arepo AddressRepo, logger log.Logger, conf *conf.Auth) *AddressUsecase { helper := log.NewHelper(log.With(logger, "module", "usecase/shop")) return &AddressUsecase{ uRepo: repo, aRepo: arepo, log: helper, signingKey: conf.JwtKey} } func (ua *AddressUsecase) CreateAddress(ctx context.Context, r *v1.CreateAddressReq) (*v1.AddressInfo, error) { // 在上下文 context 中取出 claims 对象 uId, err := getUid(ctx) if err != nil { return nil, err } req := Address{ UserID: uId, IsDefault: 0, Mobile: r.Mobile, Name: r.Name, Province: r.Province, City: r.City, Districts: r.Districts, Address: r.Address, PostCode: r.PostCode, } res, err := ua.aRepo.CreateAddress(ctx, &req) if err != nil { return nil, err } result := &v1.AddressInfo{ Id: res.ID, Name: res.Name, Mobile: res.Mobile, Province: res.Province, City: res.City, Districts: res.Districts, Address: res.Address, PostCode: res.PostCode, IsDefault: int32(res.IsDefault), } return result, nil } func (ua *AddressUsecase) AddressListByUid(ctx context.Context) (*v1.ListAddressReply, error) { // 在上下文 context 中取出 claims 对象 uId, err := getUid(ctx) if err != nil { return nil, err } addressList, err := ua.aRepo.AddressListByUid(ctx, uId) var res v1.ListAddressReply for _, v := range addressList { addressInfoTmp := &v1.AddressInfo{ Id: v.ID, Name: v.Name, Mobile: v.Mobile, Province: v.Province, City: v.City, Districts: v.Districts, Address: v.Address, PostCode: v.PostCode, IsDefault: v.IsDefault, } res.Results = append(res.Results, addressInfoTmp) } return &res, err } func (ua *AddressUsecase) UpdateAddress(ctx context.Context, a *Address) (bool, error) { uId, err := getUid(ctx) if err != nil { return false, err } a.UserID = uId if err := ua.aRepo.UpdateAddress(ctx, a); err != nil { return false, err } return true, nil } func getUid(ctx context.Context) (int64, error) { // 在上下文 context 中取出 claims 对象 var uId int64 if claims, ok := jwt.FromContext(ctx); ok { c := claims.(jwt2.MapClaims) v, ok := c["ID"] if !ok { return 0, ErrAuthFailed } uId = int64(v.(float64)) } return uId, nil } func (ua *AddressUsecase) DefaultAddress(ctx context.Context, a *Address) (bool, error) { uId, err := getUid(ctx) if err != nil { return false, err } a.UserID = uId if err := ua.aRepo.DefaultAddress(ctx, a); err != nil { return false, err } return true, nil } func (ua *AddressUsecase) DeleteAddress(ctx context.Context, a *Address) (bool, error) { uId, err := getUid(ctx) if err != nil { return false, err } a.UserID = uId if err := ua.aRepo.DeleteAddress(ctx, a); err != nil { return false, err } return true, nil } ================================================ FILE: shop/internal/biz/biz.go ================================================ package biz import "github.com/google/wire" // ProviderSet is biz providers. var ProviderSet = wire.NewSet(NewUserUsecase, NewAddressUsecase) ================================================ FILE: shop/internal/biz/user.go ================================================ package biz import ( "context" "errors" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/auth/jwt" jwt2 "github.com/golang-jwt/jwt/v4" v1 "shop/api/shop/v1" "shop/internal/conf" "shop/internal/pkg/captcha" "shop/internal/pkg/middleware/auth" "time" ) var ( ErrPasswordInvalid = errors.New("password invalid") ErrUsernameInvalid = errors.New("username invalid") ErrCaptchaInvalid = errors.New("verification code error") ErrMobileInvalid = errors.New("mobile invalid") ErrUserNotFound = errors.New("user not found") ErrLoginFailed = errors.New("login failed") ErrGenerateTokenFailed = errors.New("generate token failed") ErrAuthFailed = errors.New("authentication failed") ) type User struct { ID int64 Mobile string Password string NickName string Birthday int64 Gender string Role int CreatedAt time.Time } type UserRepo interface { CreateUser(c context.Context, u *User) (*User, error) UserByMobile(ctx context.Context, mobile string) (*User, error) UserById(ctx context.Context, Id int64) (*User, error) CheckPassword(ctx context.Context, password, encryptedPassword string) (bool, error) //ListUser(ctx context.Context, pageNum, pageSize int) ([]*User, int, error) //UpdateUser(context.Context, *User) (bool, error) } type UserUsecase struct { uRepo UserRepo log *log.Helper signingKey string } func NewUserUsecase(repo UserRepo, logger log.Logger, conf *conf.Auth) *UserUsecase { helper := log.NewHelper(log.With(logger, "module", "usecase/shop")) return &UserUsecase{uRepo: repo, log: helper, signingKey: conf.JwtKey} } // GetCaptcha 验证码 func (uc *UserUsecase) GetCaptcha(ctx context.Context) (*v1.CaptchaReply, error) { captchaInfo, err := captcha.GetCaptcha(ctx) if err != nil { return nil, err } return &v1.CaptchaReply{ CaptchaId: captchaInfo.CaptchaId, PicPath: captchaInfo.PicPath, }, nil } func (uc *UserUsecase) UserDetailByID(ctx context.Context) (*v1.UserDetailResponse, error) { // 在上下文 context 中取出 claims 对象 var uId int64 if claims, ok := jwt.FromContext(ctx); ok { c := claims.(jwt2.MapClaims) i, ok := c["ID"].(float64) if !ok { return nil, ErrAuthFailed } uId = int64(i) } user, err := uc.uRepo.UserById(ctx, uId) if err != nil { return nil, err } return &v1.UserDetailResponse{ Id: user.ID, NickName: user.NickName, Mobile: user.Mobile, }, nil } func (uc *UserUsecase) PassWordLogin(ctx context.Context, req *v1.LoginReq) (*v1.RegisterReply, error) { // 表单验证 if len(req.Mobile) <= 0 { return nil, ErrMobileInvalid } if len(req.Password) <= 0 { return nil, ErrUsernameInvalid } // 验证验证码是否正确 if !captcha.Store.Verify(req.CaptchaId, req.Captcha, true) { return nil, ErrCaptchaInvalid } if user, err := uc.uRepo.UserByMobile(ctx, req.Mobile); err != nil { return nil, ErrUserNotFound } else { // 用户存在检查密码 if passRsp, pasErr := uc.uRepo.CheckPassword(ctx, req.Password, user.Password); pasErr != nil { return nil, ErrPasswordInvalid } else { if passRsp { claims := auth.CustomClaims{ ID: user.ID, NickName: user.NickName, AuthorityId: user.Role, StandardClaims: jwt2.StandardClaims{ NotBefore: time.Now().Unix(), // 签名的生效时间 ExpiresAt: time.Now().Unix() + 60*60*24*30, // 30天过期 Issuer: "Gyl", }, } token, err := auth.CreateToken(claims, uc.signingKey) if err != nil { return nil, ErrGenerateTokenFailed } return &v1.RegisterReply{ Id: user.ID, Mobile: user.Mobile, Username: user.NickName, Token: token, ExpiredAt: time.Now().Unix() + 60*60*24*30, }, nil } else { return nil, ErrLoginFailed } } } } func (uc *UserUsecase) CreateUser(ctx context.Context, req *v1.RegisterReq) (*v1.RegisterReply, error) { newUser, err := NewUser(req.Mobile, req.Username, req.Password) if err != nil { return nil, err } createUser, err := uc.uRepo.CreateUser(ctx, &newUser) claims := auth.CustomClaims{ ID: createUser.ID, NickName: createUser.NickName, AuthorityId: createUser.Role, StandardClaims: jwt2.StandardClaims{ NotBefore: time.Now().Unix(), // 签名的生效时间 ExpiresAt: time.Now().Unix() + 60*60*24*30, // 30天过期 Issuer: "Gyl", }, } token, err := auth.CreateToken(claims, uc.signingKey) if err != nil { return nil, err } return &v1.RegisterReply{ Id: createUser.ID, Mobile: createUser.Mobile, Username: createUser.NickName, Token: token, ExpiredAt: time.Now().Unix() + 60*60*24*30, }, nil } func NewUser(mobile, username, password string) (User, error) { // check mobile if len(mobile) <= 0 { return User{}, ErrMobileInvalid } // check username if len(username) <= 0 { return User{}, ErrUsernameInvalid } // check password if len(password) <= 0 { return User{}, ErrPasswordInvalid } return User{ Mobile: mobile, NickName: username, Password: password, }, nil } ================================================ FILE: shop/internal/conf/conf.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 // protoc v3.17.3 // source: internal/conf/conf.proto package conf import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Bootstrap struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=s,proto3" json:"s,omitempty"` Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Trace *Trace `protobuf:"bytes,3,opt,name=trace,proto3" json:"trace,omitempty"` Auth *Auth `protobuf:"bytes,4,opt,name=auth,proto3" json:"auth,omitempty"` Service *Service `protobuf:"bytes,5,opt,name=service,proto3" json:"service,omitempty"` } func (x *Bootstrap) Reset() { *x = Bootstrap{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Bootstrap) String() string { return protoimpl.X.MessageStringOf(x) } func (*Bootstrap) ProtoMessage() {} func (x *Bootstrap) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Bootstrap.ProtoReflect.Descriptor instead. func (*Bootstrap) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{0} } func (x *Bootstrap) GetServer() *Server { if x != nil { return x.Server } return nil } func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data } return nil } func (x *Bootstrap) GetTrace() *Trace { if x != nil { return x.Trace } return nil } func (x *Bootstrap) GetAuth() *Auth { if x != nil { return x.Auth } return nil } func (x *Bootstrap) GetService() *Service { if x != nil { return x.Service } return nil } type Server struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Http *Server_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` Grpc *Server_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` } func (x *Server) Reset() { *x = Server{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server) ProtoMessage() {} func (x *Server) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Server.ProtoReflect.Descriptor instead. func (*Server) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1} } func (x *Server) GetHttp() *Server_HTTP { if x != nil { return x.Http } return nil } func (x *Server) GetGrpc() *Server_GRPC { if x != nil { return x.Grpc } return nil } type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` } func (x *Data) Reset() { *x = Data{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data) ProtoMessage() {} func (x *Data) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Data.ProtoReflect.Descriptor instead. func (*Data) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2} } func (x *Data) GetDatabase() *Data_Database { if x != nil { return x.Database } return nil } func (x *Data) GetRedis() *Data_Redis { if x != nil { return x.Redis } return nil } type Service struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields User *Service_User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Goods *Service_Goods `protobuf:"bytes,2,opt,name=goods,proto3" json:"goods,omitempty"` } func (x *Service) Reset() { *x = Service{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Service) String() string { return protoimpl.X.MessageStringOf(x) } func (*Service) ProtoMessage() {} func (x *Service) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_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 Service.ProtoReflect.Descriptor instead. func (*Service) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{3} } func (x *Service) GetUser() *Service_User { if x != nil { return x.User } return nil } func (x *Service) GetGoods() *Service_Goods { if x != nil { return x.Goods } return nil } type Trace struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Trace) Reset() { *x = Trace{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Trace) String() string { return protoimpl.X.MessageStringOf(x) } func (*Trace) ProtoMessage() {} func (x *Trace) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Trace.ProtoReflect.Descriptor instead. func (*Trace) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{4} } func (x *Trace) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Registry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` } func (x *Registry) Reset() { *x = Registry{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry) ProtoMessage() {} func (x *Registry) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Registry.ProtoReflect.Descriptor instead. func (*Registry) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{5} } func (x *Registry) GetConsul() *Registry_Consul { if x != nil { return x.Consul } return nil } type Auth struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields JwtKey string `protobuf:"bytes,1,opt,name=jwt_key,json=jwtKey,proto3" json:"jwt_key,omitempty"` } func (x *Auth) Reset() { *x = Auth{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Auth) String() string { return protoimpl.X.MessageStringOf(x) } func (*Auth) ProtoMessage() {} func (x *Auth) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[6] 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 Auth.ProtoReflect.Descriptor instead. func (*Auth) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{6} } func (x *Auth) GetJwtKey() string { if x != nil { return x.JwtKey } return "" } type Server_HTTP struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_HTTP) Reset() { *x = Server_HTTP{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_HTTP) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_HTTP) ProtoMessage() {} func (x *Server_HTTP) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[7] 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 Server_HTTP.ProtoReflect.Descriptor instead. func (*Server_HTTP) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1, 0} } func (x *Server_HTTP) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_HTTP) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_HTTP) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Server_GRPC struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (x *Server_GRPC) Reset() { *x = Server_GRPC{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Server_GRPC) String() string { return protoimpl.X.MessageStringOf(x) } func (*Server_GRPC) ProtoMessage() {} func (x *Server_GRPC) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[8] 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 Server_GRPC.ProtoReflect.Descriptor instead. func (*Server_GRPC) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{1, 1} } func (x *Server_GRPC) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Server_GRPC) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Server_GRPC) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type Data_Database struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` } func (x *Data_Database) Reset() { *x = Data_Database{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Database) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Database) ProtoMessage() {} func (x *Data_Database) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[9] 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 Data_Database.ProtoReflect.Descriptor instead. func (*Data_Database) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} } func (x *Data_Database) GetDriver() string { if x != nil { return x.Driver } return "" } func (x *Data_Database) GetSource() string { if x != nil { return x.Source } return "" } type Data_Redis struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` ReadTimeout *durationpb.Duration `protobuf:"bytes,3,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"` WriteTimeout *durationpb.Duration `protobuf:"bytes,4,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"` } func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data_Redis) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[10] 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 Data_Redis.ProtoReflect.Descriptor instead. func (*Data_Redis) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{2, 1} } func (x *Data_Redis) GetNetwork() string { if x != nil { return x.Network } return "" } func (x *Data_Redis) GetAddr() string { if x != nil { return x.Addr } return "" } func (x *Data_Redis) GetReadTimeout() *durationpb.Duration { if x != nil { return x.ReadTimeout } return nil } func (x *Data_Redis) GetWriteTimeout() *durationpb.Duration { if x != nil { return x.WriteTimeout } return nil } type Service_User struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Service_User) Reset() { *x = Service_User{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Service_User) String() string { return protoimpl.X.MessageStringOf(x) } func (*Service_User) ProtoMessage() {} func (x *Service_User) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[11] 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 Service_User.ProtoReflect.Descriptor instead. func (*Service_User) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} } func (x *Service_User) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Service_Goods struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *Service_Goods) Reset() { *x = Service_Goods{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Service_Goods) String() string { return protoimpl.X.MessageStringOf(x) } func (*Service_Goods) ProtoMessage() {} func (x *Service_Goods) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[12] 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 Service_Goods.ProtoReflect.Descriptor instead. func (*Service_Goods) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{3, 1} } func (x *Service_Goods) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } type Registry_Consul struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` } func (x *Registry_Consul) Reset() { *x = Registry_Consul{} if protoimpl.UnsafeEnabled { mi := &file_internal_conf_conf_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Registry_Consul) String() string { return protoimpl.X.MessageStringOf(x) } func (*Registry_Consul) ProtoMessage() {} func (x *Registry_Consul) ProtoReflect() protoreflect.Message { mi := &file_internal_conf_conf_proto_msgTypes[13] 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 Registry_Consul.ProtoReflect.Descriptor instead. func (*Registry_Consul) Descriptor() ([]byte, []int) { return file_internal_conf_conf_proto_rawDescGZIP(), []int{5, 0} } func (x *Registry_Consul) GetAddress() string { if x != nil { return x.Address } return "" } func (x *Registry_Consul) GetScheme() string { if x != nil { return x.Scheme } return "" } var File_internal_conf_conf_proto protoreflect.FileDescriptor var file_internal_conf_conf_proto_rawDesc = []byte{ 0x0a, 0x18, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd1, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x28, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x2b, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xb4, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x29, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x69, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xd9, 0x02, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x33, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x1a, 0x3a, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0xb3, 0x01, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xad, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x1a, 0x22, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x1a, 0x23, 0x0a, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x23, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x79, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x1f, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x77, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6a, 0x77, 0x74, 0x4b, 0x65, 0x79, 0x42, 0x19, 0x5a, 0x17, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_internal_conf_conf_proto_rawDescOnce sync.Once file_internal_conf_conf_proto_rawDescData = file_internal_conf_conf_proto_rawDesc ) func file_internal_conf_conf_proto_rawDescGZIP() []byte { file_internal_conf_conf_proto_rawDescOnce.Do(func() { file_internal_conf_conf_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_conf_conf_proto_rawDescData) }) return file_internal_conf_conf_proto_rawDescData } var file_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_internal_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: shop.api.Bootstrap (*Server)(nil), // 1: shop.api.Server (*Data)(nil), // 2: shop.api.Data (*Service)(nil), // 3: shop.api.Service (*Trace)(nil), // 4: shop.api.Trace (*Registry)(nil), // 5: shop.api.Registry (*Auth)(nil), // 6: shop.api.Auth (*Server_HTTP)(nil), // 7: shop.api.Server.HTTP (*Server_GRPC)(nil), // 8: shop.api.Server.GRPC (*Data_Database)(nil), // 9: shop.api.Data.Database (*Data_Redis)(nil), // 10: shop.api.Data.Redis (*Service_User)(nil), // 11: shop.api.Service.User (*Service_Goods)(nil), // 12: shop.api.Service.Goods (*Registry_Consul)(nil), // 13: shop.api.Registry.Consul (*durationpb.Duration)(nil), // 14: google.protobuf.Duration } var file_internal_conf_conf_proto_depIdxs = []int32{ 1, // 0: shop.api.Bootstrap.s:type_name -> shop.api.Server 2, // 1: shop.api.Bootstrap.data:type_name -> shop.api.Data 4, // 2: shop.api.Bootstrap.trace:type_name -> shop.api.Trace 6, // 3: shop.api.Bootstrap.auth:type_name -> shop.api.Auth 3, // 4: shop.api.Bootstrap.service:type_name -> shop.api.Service 7, // 5: shop.api.Server.http:type_name -> shop.api.Server.HTTP 8, // 6: shop.api.Server.grpc:type_name -> shop.api.Server.GRPC 9, // 7: shop.api.Data.database:type_name -> shop.api.Data.Database 10, // 8: shop.api.Data.redis:type_name -> shop.api.Data.Redis 11, // 9: shop.api.Service.user:type_name -> shop.api.Service.User 12, // 10: shop.api.Service.goods:type_name -> shop.api.Service.Goods 13, // 11: shop.api.Registry.consul:type_name -> shop.api.Registry.Consul 14, // 12: shop.api.Server.HTTP.timeout:type_name -> google.protobuf.Duration 14, // 13: shop.api.Server.GRPC.timeout:type_name -> google.protobuf.Duration 14, // 14: shop.api.Data.Redis.read_timeout:type_name -> google.protobuf.Duration 14, // 15: shop.api.Data.Redis.write_timeout:type_name -> google.protobuf.Duration 16, // [16:16] is the sub-list for method output_type 16, // [16:16] is the sub-list for method input_type 16, // [16:16] is the sub-list for extension type_name 16, // [16:16] is the sub-list for extension extendee 0, // [0:16] is the sub-list for field type_name } func init() { file_internal_conf_conf_proto_init() } func file_internal_conf_conf_proto_init() { if File_internal_conf_conf_proto != nil { return } if !protoimpl.UnsafeEnabled { file_internal_conf_conf_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Bootstrap); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Trace); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Auth); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_HTTP); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server_GRPC); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Database); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service_User); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service_Goods); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_internal_conf_conf_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Registry_Consul); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_internal_conf_conf_proto_rawDesc, NumEnums: 0, NumMessages: 14, NumExtensions: 0, NumServices: 0, }, GoTypes: file_internal_conf_conf_proto_goTypes, DependencyIndexes: file_internal_conf_conf_proto_depIdxs, MessageInfos: file_internal_conf_conf_proto_msgTypes, }.Build() File_internal_conf_conf_proto = out.File file_internal_conf_conf_proto_rawDesc = nil file_internal_conf_conf_proto_goTypes = nil file_internal_conf_conf_proto_depIdxs = nil } ================================================ FILE: shop/internal/conf/conf.proto ================================================ syntax = "proto3"; package shop.api; option go_package = "shop/internal/conf;conf"; import "google/protobuf/duration.proto"; message Bootstrap { Server server = 1; Data data = 2; Trace trace = 3; Auth auth = 4; Service service = 5; } message Server { message HTTP { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } message GRPC { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; } HTTP http = 1; GRPC grpc = 2; } message Data { message Database { string driver = 1; string source = 2; } message Redis { string network = 1; string addr = 2; google.protobuf.Duration read_timeout = 3; google.protobuf.Duration write_timeout = 4; } Database database = 1; Redis redis = 2; } message Service { message User { string endpoint = 1; } message Goods { string endpoint = 1; } User user = 1; Goods goods = 2; } message Trace { string endpoint = 1; } message Registry { message Consul { string address = 1; string scheme = 2; } Consul consul = 1; } message Auth { string jwt_key = 1; } ================================================ FILE: shop/internal/data/README.md ================================================ # Data ================================================ FILE: shop/internal/data/address.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/v2/log" addressService "shop/api/service/user/v1" "shop/internal/biz" ) type addressRepo struct { data *Data log *log.Helper } func NewAddressRepo(data *Data, logger log.Logger) biz.AddressRepo { return &addressRepo{ data: data, log: log.NewHelper(log.With(logger, "module", "repo/address")), } } func (a *addressRepo) CreateAddress(c context.Context, address *biz.Address) (*biz.Address, error) { createAddress, err := a.data.uc.CreateAddress(c, &addressService.CreateAddressReq{ Uid: address.UserID, Name: address.Name, Mobile: address.Mobile, Province: address.Province, City: address.City, Districts: address.Districts, Address: address.Address, PostCode: address.PostCode, IsDefault: int32(address.IsDefault), }) if err != nil { return nil, err } res := &biz.Address{ ID: createAddress.Id, IsDefault: createAddress.IsDefault, Mobile: createAddress.Mobile, Name: createAddress.Name, Province: createAddress.Province, City: createAddress.City, Districts: createAddress.Districts, Address: createAddress.Address, PostCode: createAddress.PostCode, } return res, nil } func (a *addressRepo) DeleteAddress(ctx context.Context, address *biz.Address) error { _, err := a.data.uc.DeleteAddress(ctx, &addressService.AddressReq{ Id: address.ID, Uid: address.UserID, }) if err != nil { return err } return nil } func (a *addressRepo) DefaultAddress(ctx context.Context, address *biz.Address) error { _, err := a.data.uc.DefaultAddress(ctx, &addressService.AddressReq{ Id: address.ID, Uid: address.UserID, }) if err != nil { return err } return nil } func (a *addressRepo) UpdateAddress(c context.Context, address *biz.Address) error { _, err := a.data.uc.UpdateAddress(c, &addressService.UpdateAddressReq{ Id: address.ID, Uid: address.UserID, Name: address.Name, Mobile: address.Mobile, Province: address.Province, City: address.City, Districts: address.Districts, Address: address.Address, PostCode: address.PostCode, IsDefault: int32(address.IsDefault), }) if err != nil { return err } return nil } func (a *addressRepo) AddressListByUid(ctx context.Context, uid int64) ([]*biz.Address, error) { addressList, err := a.data.uc.ListAddress(ctx, &addressService.ListAddressReq{ Uid: uid, }) if err != nil { return nil, err } var res []*biz.Address for _, v := range addressList.Results { addressTmp := &biz.Address{ ID: v.Id, UserID: uid, IsDefault: v.IsDefault, Mobile: v.Mobile, Name: v.Name, Province: v.Province, City: v.City, Districts: v.Districts, Address: v.Address, PostCode: v.PostCode, } res = append(res, addressTmp) } return res, nil } ================================================ FILE: shop/internal/data/data.go ================================================ package data import ( "context" consul "github.com/go-kratos/kratos/contrib/registry/consul/v2" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/google/wire" consulAPI "github.com/hashicorp/consul/api" grpcx "google.golang.org/grpc" userV1 "shop/api/service/user/v1" "shop/internal/conf" "time" ) // ProviderSet is data providers. var ProviderSet = wire.NewSet(NewData, NewUserRepo, NewAddressRepo, NewUserServiceClient, NewRegistrar, NewDiscovery) // Data . type Data struct { log *log.Helper uc userV1.UserClient } // NewData . func NewData(c *conf.Data, uc userV1.UserClient, logger log.Logger) (*Data, error) { l := log.NewHelper(log.With(logger, "module", "data")) return &Data{log: l, uc: uc}, nil } // NewUserServiceClient 链接用户服务 grpc func NewUserServiceClient(ac *conf.Auth, sr *conf.Service, rr registry.Discovery) userV1.UserClient { conn, err := grpc.DialInsecure( context.Background(), grpc.WithEndpoint(sr.User.Endpoint), grpc.WithDiscovery(rr), grpc.WithMiddleware( tracing.Client(), recovery.Recovery(), ), grpc.WithTimeout(2*time.Second), grpc.WithOptions(grpcx.WithStatsHandler(&tracing.ClientHandler{})), ) if err != nil { panic(err) } c := userV1.NewUserClient(conn) return c } // NewRegistrar add consul func NewRegistrar(conf *conf.Registry) registry.Registrar { c := consulAPI.DefaultConfig() c.Address = conf.Consul.Address c.Scheme = conf.Consul.Scheme cli, err := consulAPI.NewClient(c) if err != nil { panic(err) } r := consul.New(cli, consul.WithHealthCheck(false)) return r } func NewDiscovery(conf *conf.Registry) registry.Discovery { c := consulAPI.DefaultConfig() c.Address = conf.Consul.Address c.Scheme = conf.Consul.Scheme cli, err := consulAPI.NewClient(c) if err != nil { panic(err) } r := consul.New(cli, consul.WithHealthCheck(false)) return r } ================================================ FILE: shop/internal/data/user.go ================================================ package data import ( "context" "github.com/go-kratos/kratos/v2/log" userService "shop/api/service/user/v1" "shop/internal/biz" ) type userRepo struct { data *Data log *log.Helper } // NewUserRepo . func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo { return &userRepo{ data: data, log: log.NewHelper(log.With(logger, "module", "repo/user")), } } func (u *userRepo) CreateUser(c context.Context, user *biz.User) (*biz.User, error) { createUser, err := u.data.uc.CreateUser(c, &userService.CreateUserInfo{ NickName: user.NickName, Password: user.Password, Mobile: user.Mobile, }) if err != nil { return nil, err } return &biz.User{ ID: createUser.Id, Mobile: createUser.Mobile, NickName: createUser.NickName, }, nil } func (u *userRepo) UserByMobile(c context.Context, mobile string) (*biz.User, error) { byMobile, err := u.data.uc.GetUserByMobile(c, &userService.MobileRequest{Mobile: mobile}) if err != nil { return nil, err } return &biz.User{ Mobile: byMobile.Mobile, ID: byMobile.Id, Password: byMobile.Password, NickName: byMobile.NickName, }, nil } func (u *userRepo) CheckPassword(c context.Context, password, encryptedPassword string) (bool, error) { if byMobile, err := u.data.uc.CheckPassword(c, &userService.PasswordCheckInfo{Password: password, EncryptedPassword: encryptedPassword}); err != nil { return false, err } else { return byMobile.Success, nil } } func (u *userRepo) UserById(c context.Context, id int64) (*biz.User, error) { user, err := u.data.uc.GetUserById(c, &userService.IdRequest{Id: id}) if err != nil { return nil, err } return &biz.User{ ID: user.Id, Mobile: user.Mobile, NickName: user.NickName, Gender: user.Gender, Role: int(user.Role), Birthday: int64(user.Birthday), }, nil } ================================================ FILE: shop/internal/pkg/captcha/captcha.go ================================================ package captcha import ( "context" "github.com/mojocn/base64Captcha" ) var Store = base64Captcha.DefaultMemStore type CaptchaInfo struct { CaptchaId string PicPath string } // GetCaptcha 生成验证码 func GetCaptcha(ctx context.Context) (*CaptchaInfo, error) { driver := base64Captcha.NewDriverDigit(80, 250, 5, 0.7, 80) cp := base64Captcha.NewCaptcha(driver, Store) id, b64s, err := cp.Generate() if err != nil { return nil, err } return &CaptchaInfo{ CaptchaId: id, PicPath: b64s, }, nil } ================================================ FILE: shop/internal/pkg/middleware/auth/auth.go ================================================ package auth import ( "errors" "github.com/golang-jwt/jwt/v4" ) type CustomClaims struct { ID int64 NickName string AuthorityId int jwt.StandardClaims } // CreateToken generate token func CreateToken(c CustomClaims, key string) (string, error) { claims := jwt.NewWithClaims(jwt.SigningMethodHS256, c) signedString, err := claims.SignedString([]byte(key)) if err != nil { return "", errors.New("generate token failed" + err.Error()) } return signedString, nil } ================================================ FILE: shop/internal/server/grpc.go ================================================ package server import ( "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/transport/grpc" v1 "shop/api/shop/v1" "shop/internal/conf" "shop/internal/service" ) // NewGRPCServer new a gRPC s. func NewGRPCServer(c *conf.Server, s *service.ShopService, logger log.Logger) *grpc.Server { var opts = []grpc.ServerOption{ grpc.Middleware( recovery.Recovery(), ), } if c.Grpc.Network != "" { opts = append(opts, grpc.Network(c.Grpc.Network)) } if c.Grpc.Addr != "" { opts = append(opts, grpc.Address(c.Grpc.Addr)) } if c.Grpc.Timeout != nil { opts = append(opts, grpc.Timeout(c.Grpc.Timeout.AsDuration())) } srv := grpc.NewServer(opts...) v1.RegisterShopServer(srv, s) return srv } ================================================ FILE: shop/internal/server/http.go ================================================ package server import ( "context" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/auth/jwt" "github.com/go-kratos/kratos/v2/middleware/logging" "github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/selector" "github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/middleware/validate" "github.com/go-kratos/kratos/v2/transport/http" jwt2 "github.com/golang-jwt/jwt/v4" "github.com/gorilla/handlers" v1 "shop/api/shop/v1" "shop/internal/conf" "shop/internal/service" ) // NewHTTPServer new an HTTP s. func NewHTTPServer(c *conf.Server, ac *conf.Auth, s *service.ShopService, logger log.Logger) *http.Server { var opts = []http.ServerOption{ http.Middleware( recovery.Recovery(), validate.Validator(), tracing.Server(), selector.Server( jwt.Server(func(token *jwt2.Token) (interface{}, error) { return []byte(ac.JwtKey), nil }, jwt.WithSigningMethod(jwt2.SigningMethodHS256)), ).Match(NewWhiteListMatcher()).Build(), logging.Server(logger), ), http.Filter(handlers.CORS( handlers.AllowedHeaders([]string{"X-Requested-With", "Content-Type", "Authorization"}), handlers.AllowedMethods([]string{"GET", "POST", "PUT", "HEAD", "OPTIONS"}), handlers.AllowedOrigins([]string{"*"}), )), } if c.Http.Network != "" { opts = append(opts, http.Network(c.Http.Network)) } if c.Http.Addr != "" { opts = append(opts, http.Address(c.Http.Addr)) } if c.Http.Timeout != nil { opts = append(opts, http.Timeout(c.Http.Timeout.AsDuration())) } srv := http.NewServer(opts...) v1.RegisterShopHTTPServer(srv, s) return srv } // NewWhiteListMatcher 白名单不需要token验证的接口 func NewWhiteListMatcher() selector.MatchFunc { whiteList := make(map[string]struct{}) whiteList["/shop.shop.v1.Shop/Captcha"] = struct{}{} whiteList["/shop.shop.v1.Shop/Login"] = struct{}{} whiteList["/shop.shop.v1.Shop/Register"] = struct{}{} return func(ctx context.Context, operation string) bool { if _, ok := whiteList[operation]; ok { return false } return true } } ================================================ FILE: shop/internal/server/server.go ================================================ package server import ( "github.com/google/wire" ) // ProviderSet is s providers. var ProviderSet = wire.NewSet(NewHTTPServer, NewGRPCServer) ================================================ FILE: shop/internal/service/README.md ================================================ # Service ================================================ FILE: shop/internal/service/service.go ================================================ package service import ( "github.com/go-kratos/kratos/v2/log" "github.com/google/wire" v1 "shop/api/shop/v1" "shop/internal/biz" ) // ProviderSet is service providers. var ProviderSet = wire.NewSet(NewShopService) // ShopService is a shop service. type ShopService struct { v1.UnimplementedShopServer uc *biz.UserUsecase ua *biz.AddressUsecase log *log.Helper } // NewShopService new a shop service. func NewShopService(uc *biz.UserUsecase, ua *biz.AddressUsecase, logger log.Logger) *ShopService { return &ShopService{ uc: uc, ua: ua, log: log.NewHelper(log.With(logger, "module", "service/shop")), } } ================================================ FILE: shop/internal/service/user.go ================================================ package service import ( "context" "go.opentelemetry.io/otel" "google.golang.org/protobuf/types/known/emptypb" "shop/internal/biz" v1 "shop/api/shop/v1" ) func (s *ShopService) Register(ctx context.Context, req *v1.RegisterReq) (*v1.RegisterReply, error) { // add trace tr := otel.Tracer("service") ctx, span := tr.Start(ctx, "get user info by mobile") span.SpanContext() defer span.End() return s.uc.CreateUser(ctx, req) } func (s *ShopService) Login(ctx context.Context, req *v1.LoginReq) (*v1.RegisterReply, error) { return s.uc.PassWordLogin(ctx, req) } func (s *ShopService) Captcha(ctx context.Context, r *emptypb.Empty) (*v1.CaptchaReply, error) { return s.uc.GetCaptcha(ctx) } func (s *ShopService) Detail(ctx context.Context, r *emptypb.Empty) (*v1.UserDetailResponse, error) { return s.uc.UserDetailByID(ctx) } func (s *ShopService) CreateAddress(ctx context.Context, r *v1.CreateAddressReq) (*v1.AddressInfo, error) { return s.ua.CreateAddress(ctx, r) } func (s *ShopService) AddressListByUid(ctx context.Context, empty *emptypb.Empty) (*v1.ListAddressReply, error) { return s.ua.AddressListByUid(ctx) } func (s *ShopService) UpdateAddress(ctx context.Context, r *v1.UpdateAddressReq) (*v1.CheckResponse, error) { req := toBizAddress(r) address, err := s.ua.UpdateAddress(ctx, req) if err != nil { return nil, err } return &v1.CheckResponse{Success: address}, nil } func toBizAddress(r *v1.UpdateAddressReq) *biz.Address { return &biz.Address{ ID: r.Id, IsDefault: r.IsDefault, Mobile: r.Mobile, Name: r.Name, Province: r.Province, City: r.City, Districts: r.Districts, Address: r.Address, PostCode: r.PostCode, } } func (s *ShopService) DefaultAddress(ctx context.Context, r *v1.AddressReq) (*v1.CheckResponse, error) { address, err := s.ua.DefaultAddress(ctx, &biz.Address{ ID: r.Id, }) if err != nil { return nil, err } return &v1.CheckResponse{Success: address}, nil } func (s *ShopService) DeleteAddress(ctx context.Context, r *v1.AddressReq) (*v1.CheckResponse, error) { address, err := s.ua.DeleteAddress(ctx, &biz.Address{ ID: r.Id, }) if err != nil { return nil, err } return &v1.CheckResponse{Success: address}, nil } ================================================ FILE: shop/openapi.yaml ================================================ # Generated with protoc-gen-openapi # https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi openapi: 3.0.3 info: title: Shop API description: The Shop service definition. version: 0.0.1 paths: /api/address/create: post: tags: - Shop operationId: Shop_CreateAddress requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateAddressReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/AddressInfo' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' /api/address/default: put: tags: - Shop operationId: Shop_DefaultAddress requestBody: content: application/json: schema: $ref: '#/components/schemas/AddressReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/CheckResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' /api/address/delete: delete: tags: - Shop operationId: Shop_DeleteAddress parameters: - name: id in: query schema: type: integer format: int64 - name: uid in: query schema: type: integer format: int64 responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/CheckResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' /api/address/list/uid: get: tags: - Shop operationId: Shop_AddressListByUid responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ListAddressReply' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' /api/address/update: put: tags: - Shop operationId: Shop_UpdateAddress requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateAddressReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/CheckResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' /api/users/captcha: get: tags: - Shop operationId: Shop_Captcha responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/CaptchaReply' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' /api/users/detail: get: tags: - Shop operationId: Shop_Detail responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/UserDetailResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' /api/users/login: post: tags: - Shop operationId: Shop_Login requestBody: content: application/json: schema: $ref: '#/components/schemas/LoginReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/RegisterReply' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' /api/users/register: post: tags: - Shop operationId: Shop_Register requestBody: content: application/json: schema: $ref: '#/components/schemas/RegisterReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/RegisterReply' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' components: schemas: AddressInfo: type: object properties: id: type: integer format: int64 name: type: string mobile: type: string Province: type: string City: type: string Districts: type: string address: type: string postCode: type: string isDefault: type: integer format: int32 AddressReq: type: object properties: id: type: integer format: int64 uid: type: integer format: int64 CaptchaReply: type: object properties: captchaId: type: string picPath: type: string CheckResponse: type: object properties: success: type: boolean CreateAddressReq: type: object properties: uid: type: integer format: int64 name: type: string mobile: type: string Province: type: string City: type: string Districts: type: string address: type: string postCode: type: string isDefault: type: integer format: int32 GoogleProtobufAny: type: object properties: '@type': type: string description: The type of the serialized message. additionalProperties: true description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. ListAddressReply: type: object properties: results: type: array items: $ref: '#/components/schemas/AddressInfo' LoginReq: type: object properties: mobile: type: string password: type: string captcha: type: string captchaId: type: string RegisterReply: type: object properties: id: type: integer format: int64 mobile: type: string username: type: string token: type: string expiredAt: type: integer format: int64 description: Data returned by registration and login RegisterReq: type: object properties: mobile: type: string username: type: string password: type: string Status: type: object properties: code: type: integer description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. format: int32 message: type: string description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. details: type: array items: $ref: '#/components/schemas/GoogleProtobufAny' description: A list of messages that carry the error details. There is a common set of message types for APIs to use. description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).' UpdateAddressReq: type: object properties: uid: type: integer format: int64 name: type: string mobile: type: string Province: type: string City: type: string Districts: type: string address: type: string postCode: type: string isDefault: type: integer format: int32 id: type: integer format: int64 UserDetailResponse: type: object properties: id: type: integer format: int64 mobile: type: string nickName: type: string birthday: type: integer format: int64 gender: type: string role: type: integer format: int32 description: user Detail returned tags: - name: Shop ================================================ FILE: shop/third_party/README.md ================================================ # third_party ================================================ FILE: shop/third_party/errors/errors.proto ================================================ syntax = "proto3"; package errors; option go_package = "github.com/go-kratos/kratos/v2/errors;errors"; option java_multiple_files = true; option java_package = "com.github.kratos.errors"; option objc_class_prefix = "KratosErrors"; import "google/protobuf/descriptor.proto"; extend google.protobuf.EnumOptions { int32 default_code = 1108; } extend google.protobuf.EnumValueOptions { int32 code = 1109; } ================================================ FILE: shop/third_party/google/api/annotations.proto ================================================ // Copyright (c) 2015, Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/api/http.proto"; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "AnnotationsProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.MethodOptions { // See `HttpRule`. HttpRule http = 72295728; } ================================================ FILE: shop/third_party/google/api/client.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "ClientProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.ServiceOptions { // The hostname for this service. // This should be specified with no prefix or protocol. // // Example: // // service Foo { // option (google.api.default_host) = "foo.googleapi.com"; // ... // } string default_host = 1049; // OAuth scopes needed for the client. // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform"; // ... // } // // If there is more than one scope, use a comma-separated string: // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform," // "https://www.googleapis.com/auth/monitoring"; // ... // } string oauth_scopes = 1050; } extend google.protobuf.MethodOptions { // A definition of a client library method signature. // // In client libraries, each proto RPC corresponds to one or more methods // which the end user is able to call, and calls the underlying RPC. // Normally, this method receives a single argument (a struct or instance // corresponding to the RPC request object). Defining this field will // add one or more overloads providing flattened or simpler method signatures // in some languages. // // The fields on the method signature are provided as a comma-separated // string. // // For example, the proto RPC and annotation: // // rpc CreateSubscription(CreateSubscriptionRequest) // returns (Subscription) { // option (google.api.method_signature) = "name,topic"; // } // // Would add the following Java overload (in addition to the method accepting // the request object): // // public final Subscription createSubscription(String name, String topic) // // The following backwards-compatibility guidelines apply: // // * Adding this annotation to an unannotated method is backwards // compatible. // * Adding this annotation to a method which already has existing // method signature annotations is backwards compatible if and only if // the new method signature annotation is last in the sequence. // * Modifying or removing an existing method signature annotation is // a breaking change. // * Re-ordering existing method signature annotations is a breaking // change. repeated string method_signature = 1051; } ================================================ FILE: shop/third_party/google/api/field_behavior.proto ================================================ // Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "FieldBehaviorProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // An indicator of the behavior of a given field (for example, that a field // is required in requests, or given as output but ignored as input). // This **does not** change the behavior in protocol buffers itself; it only // denotes the behavior and may affect how API tooling handles the field. // // Note: This enum **may** receive new values in the future. enum FieldBehavior { // Conventional default for enums. Do not use this. FIELD_BEHAVIOR_UNSPECIFIED = 0; // Specifically denotes a field as optional. // While all fields in protocol buffers are optional, this may be specified // for emphasis if appropriate. OPTIONAL = 1; // Denotes a field as required. // This indicates that the field **must** be provided as part of the request, // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). REQUIRED = 2; // Denotes a field as output only. // This indicates that the field is provided in responses, but including the // field in a request does nothing (the server *must* ignore it and // *must not* throw an error as a result of the field's presence). OUTPUT_ONLY = 3; // Denotes a field as input only. // This indicates that the field is provided in requests, and the // corresponding field is not included in output. INPUT_ONLY = 4; // Denotes a field as immutable. // This indicates that the field may be set once in a request to create a // resource, but may not be changed thereafter. IMMUTABLE = 5; } extend google.protobuf.FieldOptions { // A designation of a specific field behavior (required, output only, etc.) // in protobuf messages. // // Examples: // // string name = 1 [(google.api.field_behavior) = REQUIRED]; // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // google.protobuf.Duration ttl = 1 // [(google.api.field_behavior) = INPUT_ONLY]; // google.protobuf.Timestamp expire_time = 1 // [(google.api.field_behavior) = OUTPUT_ONLY, // (google.api.field_behavior) = IMMUTABLE]; repeated FieldBehavior field_behavior = 1052; } ================================================ FILE: shop/third_party/google/api/http.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; option java_multiple_files = true; option java_outer_classname = "HttpProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Defines the HTTP configuration for an API service. It contains a list of // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method // to one or more HTTP REST API methods. message Http { // A list of HTTP configuration rules that apply to individual API methods. // // **NOTE:** All service configuration rules follow "last one wins" order. repeated HttpRule rules = 1; // When set to true, URL path parameters will be fully URI-decoded except in // cases of single segment matches in reserved expansion, where "%2F" will be // left encoded. // // The default behavior is to not decode RFC 6570 reserved characters in multi // segment matches. bool fully_decode_reserved_expansion = 2; } // # gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service // that supports both gRPC APIs and REST APIs. Many systems, including [Google // APIs](https://github.com/googleapis/googleapis), // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC // Gateway](https://github.com/grpc-ecosystem/grpc-gateway), // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature // and use it for large scale production services. // // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies // how different portions of the gRPC request message are mapped to the URL // path, URL query parameters, and HTTP request body. It also controls how the // gRPC response message is mapped to the HTTP response body. `HttpRule` is // typically specified as an `google.api.http` annotation on the gRPC method. // // Each mapping specifies a URL path template and an HTTP method. The path // template may refer to one or more fields in the gRPC request message, as long // as each field is a non-repeated field with a primitive (non-message) type. // The path template controls how fields of the request message are mapped to // the URL path. // // Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/{name=messages/*}" // }; // } // } // message GetMessageRequest { // string name = 1; // Mapped to URL path. // } // message Message { // string text = 1; // The resource content. // } // // This enables an HTTP REST to gRPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. // For example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get:"/v1/messages/{message_id}" // }; // } // } // message GetMessageRequest { // message SubMessage { // string subfield = 1; // } // string message_id = 1; // Mapped to URL path. // int64 revision = 2; // Mapped to URL query parameter `revision`. // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. // } // // This enables a HTTP JSON to RPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: // "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. // In the case of a repeated type, the parameter can be repeated in the URL // as `...?param=A¶m=B`. In the case of a message type, each field of the // message is mapped to a separate parameter, such as // `...?foo.a=A&foo.b=B&foo.c=C`. // // For HTTP methods that allow a request body, the `body` field // specifies the mapping. Consider a REST update method on the // message resource collection: // // service Messaging { // rpc UpdateMessage(UpdateMessageRequest) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "message" // }; // } // } // message UpdateMessageRequest { // string message_id = 1; // mapped to the URL // Message message = 2; // mapped to the body // } // // The following HTTP JSON to RPC mapping is enabled, where the // representation of the JSON in the request body is determined by // protos JSON encoding: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the // request body. This enables the following alternative definition of // the update method: // // service Messaging { // rpc UpdateMessage(Message) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "*" // }; // } // } // message Message { // string message_id = 1; // string text = 2; // } // // // The following HTTP JSON to RPC mapping is enabled: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in // the body. This makes this option more rarely used in practice when // defining REST APIs. The common usage of `*` is in custom methods // which don't use the URL at all for transferring data. // // It is possible to define multiple HTTP methods for one RPC by using // the `additional_bindings` option. Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/messages/{message_id}" // additional_bindings { // get: "/v1/users/{user_id}/messages/{message_id}" // } // }; // } // } // message GetMessageRequest { // string message_id = 1; // string user_id = 2; // } // // This enables the following two alternative HTTP JSON to RPC mappings: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: // "123456")` // // ## Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: // - Fields referred by the path template. They are passed via the URL path. // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP // request body. // - All other fields are passed via the URL query parameters, and the // parameter name is the field path in the request message. A repeated // field can be represented as multiple query parameters under the same // name. // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields // are passed via URL path and HTTP request body. // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all // fields are passed via URL path and URL query parameters. // // ### Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; // Segment = "*" | "**" | LITERAL | Variable ; // Variable = "{" FieldPath [ "=" Segments ] "}" ; // FieldPath = IDENT { "." IDENT } ; // Verb = ":" LITERAL ; // // The syntax `*` matches a single URL path segment. The syntax `**` matches // zero or more URL path segments, which must be the last part of the URL path // except the `Verb`. // // The syntax `Variable` matches part of the URL path as specified by its // template. A variable template must not contain other variables. If a variable // matches a single path segment, its template may be omitted, e.g. `{var}` // is equivalent to `{var=*}`. // // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` // contains any reserved character, such characters should be percent-encoded // before the matching. // // If a variable contains exactly one path segment, such as `"{var}"` or // `"{var=*}"`, when such a variable is expanded into a URL path on the client // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The // server side does the reverse decoding. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{var}`. // // If a variable contains multiple path segments, such as `"{var=foo/*}"` // or `"{var=**}"`, when such a variable is expanded into a URL path on the // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. // The server side does the reverse decoding, except "%2F" and "%2f" are left // unchanged. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // // ## Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The // service config is simply the YAML representation of the `google.api.Service` // proto message. // // As an alternative to annotating your proto file, you can configure gRPC // transcoding in your service config YAML files. You do this by specifying a // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same // effect as the proto annotation. This can be particularly useful if you // have a proto that is reused in multiple services. Note that any transcoding // specified in the service config will override any matching transcoding // configuration in the proto. // // Example: // // http: // rules: // # Selects a gRPC method and applies HttpRule to it. // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // // ## Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 // specification](https://developers.google.com/protocol-buffers/docs/proto3#json). // // While the single segment variable follows the semantics of // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String // Expansion, the multi segment variable **does not** follow RFC 6570 Section // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion // does not expand special characters like `?` and `#`, which would lead // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding // for multi segment variables. // // The path variables **must not** refer to any repeated or mapped field, // because client libraries are not capable of handling such variable expansion. // // The path variables **must not** capture the leading "/" character. The reason // is that the most common use case "{var}" does not capture the leading "/" // character. For consistency, all path variables must share the same behavior. // // Repeated message fields must not be mapped to URL query parameters, because // no client library can support such complicated mapping. // // If an API needs to use a JSON array for request or response body, it can map // the request or response body to a repeated field. However, some gRPC // Transcoding implementations may not support this feature. message HttpRule { // Selects a method to which this rule applies. // // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. string selector = 1; // Determines the URL pattern is matched by this rules. This pattern can be // used with any of the {get|put|post|delete|patch} methods. A custom method // can be defined using the 'custom' field. oneof pattern { // Maps to HTTP GET. Used for listing and getting information about // resources. string get = 2; // Maps to HTTP PUT. Used for replacing a resource. string put = 3; // Maps to HTTP POST. Used for creating a resource or performing an action. string post = 4; // Maps to HTTP DELETE. Used for deleting a resource. string delete = 5; // Maps to HTTP PATCH. Used for updating a resource. string patch = 6; // The custom pattern is used for specifying an HTTP method that is not // included in the `pattern` field, such as HEAD, or "*" to leave the // HTTP method unspecified for this rule. The wild-card rule is useful // for services that provide content to Web (HTML) clients. CustomHttpPattern custom = 8; } // The name of the request field whose value is mapped to the HTTP request // body, or `*` for mapping all request fields not captured by the path // pattern to the HTTP body, or omitted for not having any HTTP request body. // // NOTE: the referred field must be present at the top-level of the request // message type. string body = 7; // Optional. The name of the response field whose value is mapped to the HTTP // response body. When omitted, the entire response message will be used // as the HTTP response body. // // NOTE: The referred field must be present at the top-level of the response // message type. string response_body = 12; // Additional HTTP bindings for the selector. Nested bindings must // not contain an `additional_bindings` field themselves (that is, // the nesting may only be one level deep). repeated HttpRule additional_bindings = 11; } // A custom pattern is used for defining custom HTTP verb. message CustomHttpPattern { // The name of this custom HTTP verb. string kind = 1; // The path matched by this custom verb. string path = 2; } ================================================ FILE: shop/third_party/google/api/httpbody.proto ================================================ // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.api; import "google/protobuf/any.proto"; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; option java_multiple_files = true; option java_outer_classname = "HttpBodyProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Message that represents an arbitrary HTTP body. It should only be used for // payload formats that can't be represented as JSON, such as raw binary or // an HTML page. // // // This message can be used both in streaming and non-streaming API methods in // the request as well as the response. // // It can be used as a top-level request field, which is convenient if one // wants to extract parameters from either the URL or HTTP template into the // request fields and also want access to the raw HTTP body. // // Example: // // message GetResourceRequest { // // A unique request id. // string request_id = 1; // // // The raw HTTP body is bound to this field. // google.api.HttpBody http_body = 2; // } // // service ResourceService { // rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); // rpc UpdateResource(google.api.HttpBody) returns // (google.protobuf.Empty); // } // // Example with streaming methods: // // service CaldavService { // rpc GetCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // rpc UpdateCalendar(stream google.api.HttpBody) // returns (stream google.api.HttpBody); // } // // Use of this type only changes how the request and response bodies are // handled, all other features will continue to work unchanged. message HttpBody { // The HTTP Content-Type header value specifying the content type of the body. string content_type = 1; // The HTTP request/response body as raw binary. bytes data = 2; // Application specific response metadata. Must be set in the first response // for streaming APIs. repeated google.protobuf.Any extensions = 3; } ================================================ FILE: shop/third_party/google/protobuf/descriptor.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. // // The messages in this file describe the definitions found in .proto files. // A valid .proto file can be translated directly to a FileDescriptorProto // without any other information (e.g. without reading its imports). syntax = "proto2"; package google.protobuf; option go_package = "google.golang.org/protobuf/types/descriptorpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; option csharp_namespace = "Google.Protobuf.Reflection"; option objc_class_prefix = "GPB"; option cc_enable_arenas = true; // descriptor.proto must be optimized for speed because reflection-based // algorithms don't work during bootstrapping. option optimize_for = SPEED; // The protocol compiler can output a FileDescriptorSet containing the .proto // files it parses. message FileDescriptorSet { repeated FileDescriptorProto file = 1; } // Describes a complete .proto file. message FileDescriptorProto { optional string name = 1; // file name, relative to root of source tree optional string package = 2; // e.g. "foo", "foo.bar", etc. // Names of files imported by this file. repeated string dependency = 3; // Indexes of the public imported files in the dependency list above. repeated int32 public_dependency = 10; // Indexes of the weak imported files in the dependency list. // For Google-internal migration only. Do not use. repeated int32 weak_dependency = 11; // All top-level definitions in this file. repeated DescriptorProto message_type = 4; repeated EnumDescriptorProto enum_type = 5; repeated ServiceDescriptorProto service = 6; repeated FieldDescriptorProto extension = 7; optional FileOptions options = 8; // This field contains optional information about the original source code. // You may safely remove this entire field without harming runtime // functionality of the descriptors -- the information is needed only by // development tools. optional SourceCodeInfo source_code_info = 9; // The syntax of the proto file. // The supported values are "proto2" and "proto3". optional string syntax = 12; } // Describes a message type. message DescriptorProto { optional string name = 1; repeated FieldDescriptorProto field = 2; repeated FieldDescriptorProto extension = 6; repeated DescriptorProto nested_type = 3; repeated EnumDescriptorProto enum_type = 4; message ExtensionRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. optional ExtensionRangeOptions options = 3; } repeated ExtensionRange extension_range = 5; repeated OneofDescriptorProto oneof_decl = 8; optional MessageOptions options = 7; // Range of reserved tag numbers. Reserved tag numbers may not be used by // fields or extension ranges in the same message. Reserved ranges may // not overlap. message ReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Exclusive. } repeated ReservedRange reserved_range = 9; // Reserved field names, which may not be used by fields in the same message. // A given name may only be reserved once. repeated string reserved_name = 10; } message ExtensionRangeOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // Describes a field within a message. message FieldDescriptorProto { enum Type { // 0 is reserved for errors. // Order is weird for historical reasons. TYPE_DOUBLE = 1; TYPE_FLOAT = 2; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. TYPE_INT64 = 3; TYPE_UINT64 = 4; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. TYPE_INT32 = 5; TYPE_FIXED64 = 6; TYPE_FIXED32 = 7; TYPE_BOOL = 8; TYPE_STRING = 9; // Tag-delimited aggregate. // Group type is deprecated and not supported in proto3. However, Proto3 // implementations should still be able to parse the group wire format and // treat group fields as unknown fields. TYPE_GROUP = 10; TYPE_MESSAGE = 11; // Length-delimited aggregate. // New in version 2. TYPE_BYTES = 12; TYPE_UINT32 = 13; TYPE_ENUM = 14; TYPE_SFIXED32 = 15; TYPE_SFIXED64 = 16; TYPE_SINT32 = 17; // Uses ZigZag encoding. TYPE_SINT64 = 18; // Uses ZigZag encoding. } enum Label { // 0 is reserved for errors LABEL_OPTIONAL = 1; LABEL_REQUIRED = 2; LABEL_REPEATED = 3; } optional string name = 1; optional int32 number = 3; optional Label label = 4; // If type_name is set, this need not be set. If both this and type_name // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. optional Type type = 5; // For message and enum types, this is the name of the type. If the name // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping // rules are used to find the type (i.e. first the nested types within this // message are searched, then within the parent, on up to the root // namespace). optional string type_name = 6; // For extensions, this is the name of the type being extended. It is // resolved in the same manner as type_name. optional string extendee = 2; // For numeric types, contains the original text representation of the value. // For booleans, "true" or "false". // For strings, contains the default text contents (not escaped in any way). // For bytes, contains the C escaped value. All bytes >= 128 are escaped. // TODO(kenton): Base-64 encode? optional string default_value = 7; // If set, gives the index of a oneof in the containing type's oneof_decl // list. This field is a member of that oneof. optional int32 oneof_index = 9; // JSON name of this field. The value is set by protocol compiler. If the // user has set a "json_name" option on this field, that option's value // will be used. Otherwise, it's deduced from the field's name by converting // it to camelCase. optional string json_name = 10; optional FieldOptions options = 8; // If true, this is a proto3 "optional". When a proto3 field is optional, it // tracks presence regardless of field type. // // When proto3_optional is true, this field must be belong to a oneof to // signal to old proto3 clients that presence is tracked for this field. This // oneof is known as a "synthetic" oneof, and this field must be its sole // member (each proto3 optional field gets its own synthetic oneof). Synthetic // oneofs exist in the descriptor only, and do not generate any API. Synthetic // oneofs must be ordered after all "real" oneofs. // // For message fields, proto3_optional doesn't create any semantic change, // since non-repeated message fields always track presence. However it still // indicates the semantic detail of whether the user wrote "optional" or not. // This can be useful for round-tripping the .proto file. For consistency we // give message fields a synthetic oneof also, even though it is not required // to track presence. This is especially important because the parser can't // tell if a field is a message or an enum, so it must always create a // synthetic oneof. // // Proto2 optional fields do not set this flag, because they already indicate // optional with `LABEL_OPTIONAL`. optional bool proto3_optional = 17; } // Describes a oneof. message OneofDescriptorProto { optional string name = 1; optional OneofOptions options = 2; } // Describes an enum type. message EnumDescriptorProto { optional string name = 1; repeated EnumValueDescriptorProto value = 2; optional EnumOptions options = 3; // Range of reserved numeric values. Reserved values may not be used by // entries in the same enum. Reserved ranges may not overlap. // // Note that this is distinct from DescriptorProto.ReservedRange in that it // is inclusive such that it can appropriately represent the entire int32 // domain. message EnumReservedRange { optional int32 start = 1; // Inclusive. optional int32 end = 2; // Inclusive. } // Range of reserved numeric values. Reserved numeric values may not be used // by enum values in the same enum declaration. Reserved ranges may not // overlap. repeated EnumReservedRange reserved_range = 4; // Reserved enum value names, which may not be reused. A given name may only // be reserved once. repeated string reserved_name = 5; } // Describes a value within an enum. message EnumValueDescriptorProto { optional string name = 1; optional int32 number = 2; optional EnumValueOptions options = 3; } // Describes a service. message ServiceDescriptorProto { optional string name = 1; repeated MethodDescriptorProto method = 2; optional ServiceOptions options = 3; } // Describes a method of a service. message MethodDescriptorProto { optional string name = 1; // Input and output type names. These are resolved in the same way as // FieldDescriptorProto.type_name, but must refer to a message type. optional string input_type = 2; optional string output_type = 3; optional MethodOptions options = 4; // Identifies if client streams multiple client messages optional bool client_streaming = 5 [default = false]; // Identifies if server streams multiple server messages optional bool server_streaming = 6 [default = false]; } // =================================================================== // Options // Each of the definitions above may have "options" attached. These are // just annotations which may cause code to be generated slightly differently // or may contain hints for code that manipulates protocol messages. // // Clients may define custom options as extensions of the *Options messages. // These extensions may not yet be known at parsing time, so the parser cannot // store the values in them. Instead it stores them in a field in the *Options // message called uninterpreted_option. This field must have the same name // across all *Options messages. We then use this field to populate the // extensions when we build a descriptor, at which point all protos have been // parsed and so all extensions are known. // // Extension numbers for custom options may be chosen as follows: // * For options which will only be used within a single application or // organization, or for experimental options, use field numbers 50000 // through 99999. It is up to you to ensure that you do not use the // same number for multiple options. // * For options which will be published and used publicly by multiple // independent entities, e-mail protobuf-global-extension-registry@google.com // to reserve extension numbers. Simply provide your project name (e.g. // Objective-C plugin) and your project website (if available) -- there's no // need to explain how you intend to use them. Usually you only need one // extension number. You can declare multiple options with only one extension // number by putting them in a sub-message. See the Custom Options section of // the docs for examples: // https://developers.google.com/protocol-buffers/docs/proto#options // If this turns out to be popular, a web service will be set up // to automatically assign option numbers. message FileOptions { // Sets the Java package where classes generated from this .proto will be // placed. By default, the proto package is used, but this is often // inappropriate because proto packages do not normally start with backwards // domain names. optional string java_package = 1; // Controls the name of the wrapper Java class generated for the .proto file. // That class will always contain the .proto file's getDescriptor() method as // well as any top-level extensions defined in the .proto file. // If java_multiple_files is disabled, then all the other classes from the // .proto file will be nested inside the single wrapper outer class. optional string java_outer_classname = 8; // If enabled, then the Java code generator will generate a separate .java // file for each top-level message, enum, and service defined in the .proto // file. Thus, these types will *not* be nested inside the wrapper class // named by java_outer_classname. However, the wrapper class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. optional bool java_multiple_files = 10 [default = false]; // This option does nothing. optional bool java_generate_equals_and_hash = 20 [deprecated=true]; // If set true, then the Java2 code generator will generate code that // throws an exception whenever an attempt is made to assign a non-UTF-8 // byte sequence to a string field. // Message reflection will do the same. // However, an extension field still accepts non-UTF-8 byte sequences. // This option has no effect on when used with the lite runtime. optional bool java_string_check_utf8 = 27 [default = false]; // Generated classes can be optimized for speed or code size. enum OptimizeMode { SPEED = 1; // Generate complete code for parsing, serialization, // etc. CODE_SIZE = 2; // Use ReflectionOps to implement these methods. LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. } optional OptimizeMode optimize_for = 9 [default = SPEED]; // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: // - The basename of the package import path, if provided. // - Otherwise, the package statement in the .proto file, if present. // - Otherwise, the basename of the .proto file, without extension. optional string go_package = 11; // Should generic services be generated in each language? "Generic" services // are not specific to any particular RPC system. They are generated by the // main code generators in each language (without additional plugins). // Generic services were the only kind of service generation supported by // early versions of google.protobuf. // // Generic services are now considered deprecated in favor of using plugins // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. optional bool cc_generic_services = 16 [default = false]; optional bool java_generic_services = 17 [default = false]; optional bool py_generic_services = 18 [default = false]; optional bool php_generic_services = 42 [default = false]; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. optional bool deprecated = 23 [default = false]; // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. optional bool cc_enable_arenas = 31 [default = true]; // Sets the objective c class prefix which is prepended to all objective c // generated classes from this .proto. There is no default. optional string objc_class_prefix = 36; // Namespace for generated classes; defaults to the package. optional string csharp_namespace = 37; // By default Swift generators will take the proto package and CamelCase it // replacing '.' with underscore and use that to prefix the types/symbols // defined. When this options is provided, they will use this value instead // to prefix the types/symbols defined. optional string swift_prefix = 39; // Sets the php class prefix which is prepended to all php generated classes // from this .proto. Default is empty. optional string php_class_prefix = 40; // Use this option to change the namespace of php generated classes. Default // is empty. When this option is empty, the package name will be used for // determining the namespace. optional string php_namespace = 41; // Use this option to change the namespace of php generated metadata classes. // Default is empty. When this option is empty, the proto file name will be // used for determining the namespace. optional string php_metadata_namespace = 44; // Use this option to change the package of ruby generated classes. Default // is empty. When this option is not set, the package name will be used for // determining the ruby package. optional string ruby_package = 45; // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. // See the documentation for the "Options" section above. extensions 1000 to max; reserved 38; } message MessageOptions { // Set true to use the old proto1 MessageSet wire format for extensions. // This is provided for backwards-compatibility with the MessageSet wire // format. You should not use this for any other reason: It's less // efficient, has fewer features, and is more complicated. // // The message must be defined exactly as follows: // message Foo { // option message_set_wire_format = true; // extensions 4 to max; // } // Note that the message cannot have any defined fields; MessageSets only // have extensions. // // All extensions of your type must be singular messages; e.g. they cannot // be int32s, enums, or repeated messages. // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. optional bool message_set_wire_format = 1 [default = false]; // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". optional bool no_standard_descriptor_accessor = 2 [default = false]; // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. optional bool deprecated = 3 [default = false]; reserved 4, 5, 6; // Whether the message is an automatically generated map entry type for the // maps field. // // For maps fields: // map map_field = 1; // The parsed descriptor looks like: // message MapFieldEntry { // option map_entry = true; // optional KeyType key = 1; // optional ValueType value = 2; // } // repeated MapFieldEntry map_field = 1; // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax // instead. The option should only be implicitly set by the proto compiler // parser. optional bool map_entry = 7; reserved 8; // javalite_serializable reserved 9; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message FieldOptions { // The ctype option instructs the C++ code generator to use a different // representation of the field than it normally would. See the specific // options below. This option is not yet implemented in the open source // release -- sorry, we'll try to include it in a future version! optional CType ctype = 1 [default = STRING]; enum CType { // Default mode. STRING = 0; CORD = 1; STRING_PIECE = 2; } // The packed option can be enabled for repeated primitive fields to enable // a more efficient representation on the wire. Rather than repeatedly // writing the tag and type for each element, the entire array is encoded as // a single length-delimited blob. In proto3, only explicit setting it to // false will avoid using packed encoding. optional bool packed = 2; // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING // is represented as JavaScript string, which avoids loss of precision that // can happen when a large value is converted to a floating point JavaScript. // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to // use the JavaScript "number" type. The behavior of the default option // JS_NORMAL is implementation dependent. // // This option is an enum to permit additional types to be added, e.g. // goog.math.Integer. optional JSType jstype = 6 [default = JS_NORMAL]; enum JSType { // Use the default type. JS_NORMAL = 0; // Use JavaScript strings. JS_STRING = 1; // Use JavaScript numbers. JS_NUMBER = 2; } // Should this field be parsed lazily? Lazy applies only to message-type // fields. It means that when the outer message is initially parsed, the // inner message's contents will not be parsed but instead stored in encoded // form. The inner message will actually be parsed when it is first accessed. // // This is only a hint. Implementations are free to choose whether to use // eager or lazy parsing regardless of the value of this option. However, // setting this option true suggests that the protocol author believes that // using lazy parsing on this field is worth the additional bookkeeping // overhead typically needed to implement it. // // This option does not affect the public interface of any generated code; // all method signatures remain the same. Furthermore, thread-safety of the // interface is not affected by this option; const methods remain safe to // call from multiple threads concurrently, while non-const methods continue // to require exclusive access. // // // Note that implementations may choose not to check required fields within // a lazy sub-message. That is, calling IsInitialized() on the outer message // may return true even if the inner message has missing required fields. // This is necessary because otherwise the inner message would have to be // parsed in order to perform the check, defeating the purpose of lazy // parsing. An implementation which chooses not to check required fields // must be consistent about it. That is, for any particular sub-message, the // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. optional bool lazy = 5 [default = false]; // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. optional bool deprecated = 3 [default = false]; // For Google-internal migration only. Do not use. optional bool weak = 10 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; reserved 4; // removed jtype } message OneofOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumOptions { // Set this option to true to allow mapping different tag names to the same // value. optional bool allow_alias = 2; // Is this enum deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. optional bool deprecated = 3 [default = false]; reserved 5; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message EnumValueOptions { // Is this enum value deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. optional bool deprecated = 1 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message ServiceOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this service deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. optional bool deprecated = 33 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } message MethodOptions { // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol // Buffers. // Is this method deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. optional bool deprecated = 33 [default = false]; // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, // or neither? HTTP based RPC implementation may choose GET verb for safe // methods, and PUT verb for idempotent methods instead of the default POST. enum IdempotencyLevel { IDEMPOTENCY_UNKNOWN = 0; NO_SIDE_EFFECTS = 1; // implies idempotent IDEMPOTENT = 2; // idempotent, but may have side effects } optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; } // A message representing a option the parser does not recognize. This only // appears in options protos created by the compiler::Parser class. // DescriptorPool resolves these when building Descriptor objects. Therefore, // options protos in descriptor objects (e.g. returned by Descriptor::options(), // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions // in them. message UninterpretedOption { // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents // "foo.(bar.baz).qux". message NamePart { required string name_part = 1; required bool is_extension = 2; } repeated NamePart name = 2; // The value of the uninterpreted option, in whatever type the tokenizer // identified it as during parsing. Exactly one of these should be set. optional string identifier_value = 3; optional uint64 positive_int_value = 4; optional int64 negative_int_value = 5; optional double double_value = 6; optional bytes string_value = 7; optional string aggregate_value = 8; } // =================================================================== // Optional source code info // Encapsulates information about the original source file from which a // FileDescriptorProto was generated. message SourceCodeInfo { // A Location identifies a piece of source code in a .proto file which // corresponds to a particular definition. This information is intended // to be useful to IDEs, code indexers, documentation generators, and similar // tools. // // For example, say we have a file like: // message Foo { // optional string foo = 1; // } // Let's look at just the field definition: // optional string foo = 1; // ^ ^^ ^^ ^ ^^^ // a bc de f ghi // We have the following locations: // span path represents // [a,i) [ 4, 0, 2, 0 ] The whole field definition. // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). // // Notes: // - A location may refer to a repeated field itself (i.e. not to any // particular index within it). This is used whenever a set of elements are // logically enclosed in a single code segment. For example, an entire // extend block (possibly containing multiple extension definitions) will // have an outer location whose path refers to the "extensions" repeated // field without an index. // - Multiple locations may have the same path. This happens when a single // logical declaration is spread out across multiple places. The most // obvious example is the "extend" block again -- there may be multiple // extend blocks in the same scope, each of which will have the same path. // - A location's span is not always a subset of its parent's span. For // example, the "extendee" of an extension declaration appears at the // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span // does not mean that it is a descendant. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to // ignore those that it doesn't understand, as more types of locations could // be recorded in the future. repeated Location location = 1; message Location { // Identifies which part of the FileDescriptorProto was defined at this // location. // // Each element is a field number or an index. They form a path from // the root FileDescriptorProto to the place where the definition occurs. For // example, this path: // [ 4, 3, 2, 7, 1 ] // refers to: // file.message_type(3) // 4, 3 // .field(7) // 2, 7 // .name() // 1 // This is because FileDescriptorProto.message_type has field number 4: // repeated DescriptorProto message_type = 4; // and DescriptorProto.field has field number 2: // repeated FieldDescriptorProto field = 2; // and FieldDescriptorProto.name has field number 1: // optional string name = 1; // // Thus, the above path gives the location of a field name. If we removed // the last element: // [ 4, 3, 2, 7 ] // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). repeated int32 path = 1 [packed = true]; // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. repeated int32 span = 2 [packed = true]; // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be // attached to the declaration. // // A series of line comments appearing on consecutive lines, with no other // tokens appearing on those lines, will be treated as a single comment. // // leading_detached_comments will keep paragraphs of comments that appear // before (but not connected to) the current element. Each paragraph, // separated by empty lines, will be one comment element in the repeated // field. // // Only the comment content is provided; comment markers (e.g. //) are // stripped out. For block comments, leading whitespace and an asterisk // will be stripped from the beginning of each line other than the first. // Newlines are included in the output. // // Examples: // // optional int32 foo = 1; // Comment attached to foo. // // Comment attached to bar. // optional int32 bar = 2; // // optional string baz = 3; // // Comment attached to baz. // // Another line attached to baz. // // // Comment attached to qux. // // // // Another line attached to qux. // optional double qux = 4; // // // Detached comment for corge. This is not leading or trailing comments // // to qux or corge because there are blank lines separating it from // // both. // // // Detached comment for corge paragraph 2. // // optional string corge = 5; // /* Block comment attached // * to corge. Leading asterisks // * will be removed. */ // /* Block comment attached to // * grault. */ // optional int32 grault = 6; // // // ignored detached comments. optional string leading_comments = 3; optional string trailing_comments = 4; repeated string leading_detached_comments = 6; } } // Describes the relationship between generated code and its original source // file. A GeneratedCodeInfo message is associated with only one generated // source file, but may contain references to different source .proto files. message GeneratedCodeInfo { // An Annotation connects some span of text in generated code to an element // of its generating .proto file. repeated Annotation annotation = 1; message Annotation { // Identifies the element in the original source .proto file. This field // is formatted the same as SourceCodeInfo.Location.path. repeated int32 path = 1 [packed = true]; // Identifies the filesystem path to the original source .proto. optional string source_file = 2; // Identifies the starting offset in bytes in the generated code // that relates to the identified object. optional int32 begin = 3; // Identifies the ending offset in bytes in the generated code that // relates to the identified offset. The end offset should be one past // the last relevant byte (so the length of the text = end - begin). optional int32 end = 4; } } ================================================ FILE: shop/third_party/protoc-gen-openapiv2/options/annotations.proto ================================================ syntax = "proto3"; package grpc.gateway.protoc_gen_openapiv2.options; option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; import "google/protobuf/descriptor.proto"; import "protoc-gen-openapiv2/options/openapiv2.proto"; extend google.protobuf.FileOptions { // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. // // All IDs are the same, as assigned. It is okay that they are the same, as they extend // different descriptor messages. Swagger openapiv2_swagger = 1042; } extend google.protobuf.MethodOptions { // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. // // All IDs are the same, as assigned. It is okay that they are the same, as they extend // different descriptor messages. Operation openapiv2_operation = 1042; } extend google.protobuf.MessageOptions { // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. // // All IDs are the same, as assigned. It is okay that they are the same, as they extend // different descriptor messages. Schema openapiv2_schema = 1042; } extend google.protobuf.ServiceOptions { // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. // // All IDs are the same, as assigned. It is okay that they are the same, as they extend // different descriptor messages. Tag openapiv2_tag = 1042; } extend google.protobuf.FieldOptions { // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. // // All IDs are the same, as assigned. It is okay that they are the same, as they extend // different descriptor messages. JSONSchema openapiv2_field = 1042; } ================================================ FILE: shop/third_party/protoc-gen-openapiv2/options/openapiv2.proto ================================================ syntax = "proto3"; package grpc.gateway.protoc_gen_openapiv2.options; option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; import "google/protobuf/struct.proto"; // Scheme describes the schemes supported by the OpenAPI Swagger // and Operation objects. enum Scheme { UNKNOWN = 0; HTTP = 1; HTTPS = 2; WS = 3; WSS = 4; } // `Swagger` is a representation of OpenAPI v2 specification's Swagger object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject // // Example: // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // info: { // title: "Echo API"; // version: "1.0"; // description: "; // contact: { // name: "gRPC-Gateway project"; // url: "https://github.com/grpc-ecosystem/grpc-gateway"; // email: "none@example.com"; // }; // license: { // name: "BSD 3-Clause License"; // url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; // }; // }; // schemes: HTTPS; // consumes: "application/json"; // produces: "application/json"; // }; // message Swagger { // Specifies the OpenAPI Specification version being used. It can be // used by the OpenAPI UI and other clients to interpret the API listing. The // value MUST be "2.0". string swagger = 1; // Provides metadata about the API. The metadata can be used by the // clients if needed. Info info = 2; // The host (name or ip) serving the API. This MUST be the host only and does // not include the scheme nor sub-paths. It MAY include a port. If the host is // not included, the host serving the documentation is to be used (including // the port). The host does not support path templating. string host = 3; // The base path on which the API is served, which is relative to the host. If // it is not included, the API is served directly under the host. The value // MUST start with a leading slash (/). The basePath does not support path // templating. // Note that using `base_path` does not change the endpoint paths that are // generated in the resulting OpenAPI file. If you wish to use `base_path` // with relatively generated OpenAPI paths, the `base_path` prefix must be // manually removed from your `google.api.http` paths and your code changed to // serve the API from the `base_path`. string base_path = 4; // The transfer protocol of the API. Values MUST be from the list: "http", // "https", "ws", "wss". If the schemes is not included, the default scheme to // be used is the one used to access the OpenAPI definition itself. repeated Scheme schemes = 5; // A list of MIME types the APIs can consume. This is global to all APIs but // can be overridden on specific API calls. Value MUST be as described under // Mime Types. repeated string consumes = 6; // A list of MIME types the APIs can produce. This is global to all APIs but // can be overridden on specific API calls. Value MUST be as described under // Mime Types. repeated string produces = 7; // field 8 is reserved for 'paths'. reserved 8; // field 9 is reserved for 'definitions', which at this time are already // exposed as and customizable as proto messages. reserved 9; // An object to hold responses that can be used across operations. This // property does not define global responses for all operations. map responses = 10; // Security scheme definitions that can be used across the specification. SecurityDefinitions security_definitions = 11; // A declaration of which security schemes are applied for the API as a whole. // The list of values describes alternative security schemes that can be used // (that is, there is a logical OR between the security requirements). // Individual operations can override this definition. repeated SecurityRequirement security = 12; // field 13 is reserved for 'tags', which are supposed to be exposed as and // customizable as proto services. TODO(ivucica): add processing of proto // service objects into OpenAPI v2 Tag objects. reserved 13; // Additional external documentation. ExternalDocumentation external_docs = 14; map extensions = 15; } // `Operation` is a representation of OpenAPI v2 specification's Operation object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject // // Example: // // service EchoService { // rpc Echo(SimpleMessage) returns (SimpleMessage) { // option (google.api.http) = { // get: "/v1/example/echo/{id}" // }; // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { // summary: "Get a message."; // operation_id: "getMessage"; // tags: "echo"; // responses: { // key: "200" // value: { // description: "OK"; // } // } // }; // } // } message Operation { // A list of tags for API documentation control. Tags can be used for logical // grouping of operations by resources or any other qualifier. repeated string tags = 1; // A short summary of what the operation does. For maximum readability in the // swagger-ui, this field SHOULD be less than 120 characters. string summary = 2; // A verbose explanation of the operation behavior. GFM syntax can be used for // rich text representation. string description = 3; // Additional external documentation for this operation. ExternalDocumentation external_docs = 4; // Unique string used to identify the operation. The id MUST be unique among // all operations described in the API. Tools and libraries MAY use the // operationId to uniquely identify an operation, therefore, it is recommended // to follow common programming naming conventions. string operation_id = 5; // A list of MIME types the operation can consume. This overrides the consumes // definition at the OpenAPI Object. An empty value MAY be used to clear the // global definition. Value MUST be as described under Mime Types. repeated string consumes = 6; // A list of MIME types the operation can produce. This overrides the produces // definition at the OpenAPI Object. An empty value MAY be used to clear the // global definition. Value MUST be as described under Mime Types. repeated string produces = 7; // field 8 is reserved for 'parameters'. reserved 8; // The list of possible responses as they are returned from executing this // operation. map responses = 9; // The transfer protocol for the operation. Values MUST be from the list: // "http", "https", "ws", "wss". The value overrides the OpenAPI Object // schemes definition. repeated Scheme schemes = 10; // Declares this operation to be deprecated. Usage of the declared operation // should be refrained. Default value is false. bool deprecated = 11; // A declaration of which security schemes are applied for this operation. The // list of values describes alternative security schemes that can be used // (that is, there is a logical OR between the security requirements). This // definition overrides any declared top-level security. To remove a top-level // security declaration, an empty array can be used. repeated SecurityRequirement security = 12; map extensions = 13; } // `Header` is a representation of OpenAPI v2 specification's Header object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject // message Header { // `Description` is a short description of the header. string description = 1; // The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. string type = 2; // `Format` The extending format for the previously mentioned type. string format = 3; // field 4 is reserved for 'items', but in OpenAPI-specific way. reserved 4; // field 5 is reserved `Collection Format` Determines the format of the array if type array is used. reserved 5; // `Default` Declares the value of the header that the server will use if none is provided. // See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. // Unlike JSON Schema this value MUST conform to the defined type for the header. string default = 6; // field 7 is reserved for 'maximum'. reserved 7; // field 8 is reserved for 'exclusiveMaximum'. reserved 8; // field 9 is reserved for 'minimum'. reserved 9; // field 10 is reserved for 'exclusiveMinimum'. reserved 10; // field 11 is reserved for 'maxLength'. reserved 11; // field 12 is reserved for 'minLength'. reserved 12; // 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. string pattern = 13; // field 14 is reserved for 'maxItems'. reserved 14; // field 15 is reserved for 'minItems'. reserved 15; // field 16 is reserved for 'uniqueItems'. reserved 16; // field 17 is reserved for 'enum'. reserved 17; // field 18 is reserved for 'multipleOf'. reserved 18; } // `Response` is a representation of OpenAPI v2 specification's Response object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject // message Response { // `Description` is a short description of the response. // GFM syntax can be used for rich text representation. string description = 1; // `Schema` optionally defines the structure of the response. // If `Schema` is not provided, it means there is no content to the response. Schema schema = 2; // `Headers` A list of headers that are sent with the response. // `Header` name is expected to be a string in the canonical format of the MIME header key // See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey map headers = 3; // `Examples` gives per-mimetype response examples. // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object map examples = 4; map extensions = 5; } // `Info` is a representation of OpenAPI v2 specification's Info object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject // // Example: // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // info: { // title: "Echo API"; // version: "1.0"; // description: "; // contact: { // name: "gRPC-Gateway project"; // url: "https://github.com/grpc-ecosystem/grpc-gateway"; // email: "none@example.com"; // }; // license: { // name: "BSD 3-Clause License"; // url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; // }; // }; // ... // }; // message Info { // The title of the application. string title = 1; // A short description of the application. GFM syntax can be used for rich // text representation. string description = 2; // The Terms of Service for the API. string terms_of_service = 3; // The contact information for the exposed API. Contact contact = 4; // The license information for the exposed API. License license = 5; // Provides the version of the application API (not to be confused // with the specification version). string version = 6; map extensions = 7; } // `Contact` is a representation of OpenAPI v2 specification's Contact object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject // // Example: // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // info: { // ... // contact: { // name: "gRPC-Gateway project"; // url: "https://github.com/grpc-ecosystem/grpc-gateway"; // email: "none@example.com"; // }; // ... // }; // ... // }; // message Contact { // The identifying name of the contact person/organization. string name = 1; // The URL pointing to the contact information. MUST be in the format of a // URL. string url = 2; // The email address of the contact person/organization. MUST be in the format // of an email address. string email = 3; } // `License` is a representation of OpenAPI v2 specification's License object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject // // Example: // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // info: { // ... // license: { // name: "BSD 3-Clause License"; // url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; // }; // ... // }; // ... // }; // message License { // The license name used for the API. string name = 1; // A URL to the license used for the API. MUST be in the format of a URL. string url = 2; } // `ExternalDocumentation` is a representation of OpenAPI v2 specification's // ExternalDocumentation object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject // // Example: // // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // ... // external_docs: { // description: "More about gRPC-Gateway"; // url: "https://github.com/grpc-ecosystem/grpc-gateway"; // } // ... // }; // message ExternalDocumentation { // A short description of the target documentation. GFM syntax can be used for // rich text representation. string description = 1; // The URL for the target documentation. Value MUST be in the format // of a URL. string url = 2; } // `Schema` is a representation of OpenAPI v2 specification's Schema object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject // message Schema { JSONSchema json_schema = 1; // Adds support for polymorphism. The discriminator is the schema property // name that is used to differentiate between other schema that inherit this // schema. The property name used MUST be defined at this schema and it MUST // be in the required property list. When used, the value MUST be the name of // this schema or any schema that inherits it. string discriminator = 2; // Relevant only for Schema "properties" definitions. Declares the property as // "read only". This means that it MAY be sent as part of a response but MUST // NOT be sent as part of the request. Properties marked as readOnly being // true SHOULD NOT be in the required list of the defined schema. Default // value is false. bool read_only = 3; // field 4 is reserved for 'xml'. reserved 4; // Additional external documentation for this schema. ExternalDocumentation external_docs = 5; // A free-form property to include an example of an instance for this schema in JSON. // This is copied verbatim to the output. string example = 6; } // `JSONSchema` represents properties from JSON Schema taken, and as used, in // the OpenAPI v2 spec. // // This includes changes made by OpenAPI v2. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject // // See also: https://cswr.github.io/JsonSchema/spec/basic_types/, // https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json // // Example: // // message SimpleMessage { // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { // json_schema: { // title: "SimpleMessage" // description: "A simple message." // required: ["id"] // } // }; // // // Id represents the message identifier. // string id = 1; [ // (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { // {description: "The unique identifier of the simple message." // }]; // } // message JSONSchema { // field 1 is reserved for '$id', omitted from OpenAPI v2. reserved 1; // field 2 is reserved for '$schema', omitted from OpenAPI v2. reserved 2; // Ref is used to define an external reference to include in the message. // This could be a fully qualified proto message reference, and that type must // be imported into the protofile. If no message is identified, the Ref will // be used verbatim in the output. // For example: // `ref: ".google.protobuf.Timestamp"`. string ref = 3; // field 4 is reserved for '$comment', omitted from OpenAPI v2. reserved 4; // The title of the schema. string title = 5; // A short description of the schema. string description = 6; string default = 7; bool read_only = 8; // A free-form property to include a JSON example of this field. This is copied // verbatim to the output swagger.json. Quotes must be escaped. // This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject string example = 9; double multiple_of = 10; // Maximum represents an inclusive upper limit for a numeric instance. The // value of MUST be a number, double maximum = 11; bool exclusive_maximum = 12; // minimum represents an inclusive lower limit for a numeric instance. The // value of MUST be a number, double minimum = 13; bool exclusive_minimum = 14; uint64 max_length = 15; uint64 min_length = 16; string pattern = 17; // field 18 is reserved for 'additionalItems', omitted from OpenAPI v2. reserved 18; // field 19 is reserved for 'items', but in OpenAPI-specific way. // TODO(ivucica): add 'items'? reserved 19; uint64 max_items = 20; uint64 min_items = 21; bool unique_items = 22; // field 23 is reserved for 'contains', omitted from OpenAPI v2. reserved 23; uint64 max_properties = 24; uint64 min_properties = 25; repeated string required = 26; // field 27 is reserved for 'additionalProperties', but in OpenAPI-specific // way. TODO(ivucica): add 'additionalProperties'? reserved 27; // field 28 is reserved for 'definitions', omitted from OpenAPI v2. reserved 28; // field 29 is reserved for 'properties', but in OpenAPI-specific way. // TODO(ivucica): add 'additionalProperties'? reserved 29; // following fields are reserved, as the properties have been omitted from // OpenAPI v2: // patternProperties, dependencies, propertyNames, const reserved 30 to 33; // Items in 'array' must be unique. repeated string array = 34; enum JSONSchemaSimpleTypes { UNKNOWN = 0; ARRAY = 1; BOOLEAN = 2; INTEGER = 3; NULL = 4; NUMBER = 5; OBJECT = 6; STRING = 7; } repeated JSONSchemaSimpleTypes type = 35; // `Format` string format = 36; // following fields are reserved, as the properties have been omitted from // OpenAPI v2: contentMediaType, contentEncoding, if, then, else reserved 37 to 41; // field 42 is reserved for 'allOf', but in OpenAPI-specific way. // TODO(ivucica): add 'allOf'? reserved 42; // following fields are reserved, as the properties have been omitted from // OpenAPI v2: // anyOf, oneOf, not reserved 43 to 45; // Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 repeated string enum = 46; } // `Tag` is a representation of OpenAPI v2 specification's Tag object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject // message Tag { // field 1 is reserved for 'name'. In our generator, this is (to be) extracted // from the name of proto service, and thus not exposed to the user, as // changing tag object's name would break the link to the references to the // tag in individual operation specifications. // // TODO(ivucica): Add 'name' property. Use it to allow override of the name of // global Tag object, then use that name to reference the tag throughout the // OpenAPI file. reserved 1; // A short description for the tag. GFM syntax can be used for rich text // representation. string description = 2; // Additional external documentation for this tag. ExternalDocumentation external_docs = 3; } // `SecurityDefinitions` is a representation of OpenAPI v2 specification's // Security Definitions object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject // // A declaration of the security schemes available to be used in the // specification. This does not enforce the security schemes on the operations // and only serves to provide the relevant details for each scheme. message SecurityDefinitions { // A single security scheme definition, mapping a "name" to the scheme it // defines. map security = 1; } // `SecurityScheme` is a representation of OpenAPI v2 specification's // Security Scheme object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject // // Allows the definition of a security scheme that can be used by the // operations. Supported schemes are basic authentication, an API key (either as // a header or as a query parameter) and OAuth2's common flows (implicit, // password, application and access code). message SecurityScheme { // The type of the security scheme. Valid values are "basic", // "apiKey" or "oauth2". enum Type { TYPE_INVALID = 0; TYPE_BASIC = 1; TYPE_API_KEY = 2; TYPE_OAUTH2 = 3; } // The location of the API key. Valid values are "query" or "header". enum In { IN_INVALID = 0; IN_QUERY = 1; IN_HEADER = 2; } // The flow used by the OAuth2 security scheme. Valid values are // "implicit", "password", "application" or "accessCode". enum Flow { FLOW_INVALID = 0; FLOW_IMPLICIT = 1; FLOW_PASSWORD = 2; FLOW_APPLICATION = 3; FLOW_ACCESS_CODE = 4; } // The type of the security scheme. Valid values are "basic", // "apiKey" or "oauth2". Type type = 1; // A short description for security scheme. string description = 2; // The name of the header or query parameter to be used. // Valid for apiKey. string name = 3; // The location of the API key. Valid values are "query" or // "header". // Valid for apiKey. In in = 4; // The flow used by the OAuth2 security scheme. Valid values are // "implicit", "password", "application" or "accessCode". // Valid for oauth2. Flow flow = 5; // The authorization URL to be used for this flow. This SHOULD be in // the form of a URL. // Valid for oauth2/implicit and oauth2/accessCode. string authorization_url = 6; // The token URL to be used for this flow. This SHOULD be in the // form of a URL. // Valid for oauth2/password, oauth2/application and oauth2/accessCode. string token_url = 7; // The available scopes for the OAuth2 security scheme. // Valid for oauth2. Scopes scopes = 8; map extensions = 9; } // `SecurityRequirement` is a representation of OpenAPI v2 specification's // Security Requirement object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject // // Lists the required security schemes to execute this operation. The object can // have multiple security schemes declared in it which are all required (that // is, there is a logical AND between the schemes). // // The name used for each property MUST correspond to a security scheme // declared in the Security Definitions. message SecurityRequirement { // If the security scheme is of type "oauth2", then the value is a list of // scope names required for the execution. For other security scheme types, // the array MUST be empty. message SecurityRequirementValue { repeated string scope = 1; } // Each name must correspond to a security scheme which is declared in // the Security Definitions. If the security scheme is of type "oauth2", // then the value is a list of scope names required for the execution. // For other security scheme types, the array MUST be empty. map security_requirement = 1; } // `Scopes` is a representation of OpenAPI v2 specification's Scopes object. // // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject // // Lists the available scopes for an OAuth2 security scheme. message Scopes { // Maps between a name of a scope to a short description of it (as the value // of the property). map scope = 1; } ================================================ FILE: shop/third_party/validate/README.md ================================================ # protoc-gen-validate (PGV) * https://github.com/envoyproxy/protoc-gen-validate ================================================ FILE: shop/third_party/validate/validate.proto ================================================ syntax = "proto2"; package validate; option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; option java_package = "io.envoyproxy.pgv.validate"; import "google/protobuf/descriptor.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; // Validation rules applied at the message level extend google.protobuf.MessageOptions { // Disabled nullifies any validation rules for this message, including any // message fields associated with it that do support validation. optional bool disabled = 1071; // Ignore skips generation of validation methods for this message. optional bool ignored = 1072; } // Validation rules applied at the oneof level extend google.protobuf.OneofOptions { // Required ensures that exactly one the field options in a oneof is set; // validation fails if no fields in the oneof are set. optional bool required = 1071; } // Validation rules applied at the field level extend google.protobuf.FieldOptions { // Rules specify the validations to be performed on this field. By default, // no validation is performed against a field. optional FieldRules rules = 1071; } // FieldRules encapsulates the rules for each type of field. Depending on the // field, the correct set should be used to ensure proper validations. message FieldRules { optional MessageRules message = 17; oneof type { // Scalar Field Types FloatRules float = 1; DoubleRules double = 2; Int32Rules int32 = 3; Int64Rules int64 = 4; UInt32Rules uint32 = 5; UInt64Rules uint64 = 6; SInt32Rules sint32 = 7; SInt64Rules sint64 = 8; Fixed32Rules fixed32 = 9; Fixed64Rules fixed64 = 10; SFixed32Rules sfixed32 = 11; SFixed64Rules sfixed64 = 12; BoolRules bool = 13; StringRules string = 14; BytesRules bytes = 15; // Complex Field Types EnumRules enum = 16; RepeatedRules repeated = 18; MapRules map = 19; // Well-Known Field Types AnyRules any = 20; DurationRules duration = 21; TimestampRules timestamp = 22; } } // FloatRules describes the constraints applied to `float` values message FloatRules { // Const specifies that this field must be exactly the specified value optional float const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional float lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional float lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional float gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional float gte = 5; // In specifies that this field must be equal to one of the specified // values repeated float in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated float not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // DoubleRules describes the constraints applied to `double` values message DoubleRules { // Const specifies that this field must be exactly the specified value optional double const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional double lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional double lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional double gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional double gte = 5; // In specifies that this field must be equal to one of the specified // values repeated double in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated double not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int32Rules describes the constraints applied to `int32` values message Int32Rules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Int64Rules describes the constraints applied to `int64` values message Int64Rules { // Const specifies that this field must be exactly the specified value optional int64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional int64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional int64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional int64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional int64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated int64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt32Rules describes the constraints applied to `uint32` values message UInt32Rules { // Const specifies that this field must be exactly the specified value optional uint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // UInt64Rules describes the constraints applied to `uint64` values message UInt64Rules { // Const specifies that this field must be exactly the specified value optional uint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional uint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional uint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional uint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional uint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated uint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated uint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt32Rules describes the constraints applied to `sint32` values message SInt32Rules { // Const specifies that this field must be exactly the specified value optional sint32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SInt64Rules describes the constraints applied to `sint64` values message SInt64Rules { // Const specifies that this field must be exactly the specified value optional sint64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sint64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sint64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sint64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sint64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sint64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sint64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed32Rules describes the constraints applied to `fixed32` values message Fixed32Rules { // Const specifies that this field must be exactly the specified value optional fixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // Fixed64Rules describes the constraints applied to `fixed64` values message Fixed64Rules { // Const specifies that this field must be exactly the specified value optional fixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional fixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional fixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional fixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional fixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated fixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated fixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed32Rules describes the constraints applied to `sfixed32` values message SFixed32Rules { // Const specifies that this field must be exactly the specified value optional sfixed32 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed32 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed32 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed32 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed32 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed32 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed32 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // SFixed64Rules describes the constraints applied to `sfixed64` values message SFixed64Rules { // Const specifies that this field must be exactly the specified value optional sfixed64 const = 1; // Lt specifies that this field must be less than the specified value, // exclusive optional sfixed64 lt = 2; // Lte specifies that this field must be less than or equal to the // specified value, inclusive optional sfixed64 lte = 3; // Gt specifies that this field must be greater than the specified value, // exclusive. If the value of Gt is larger than a specified Lt or Lte, the // range is reversed. optional sfixed64 gt = 4; // Gte specifies that this field must be greater than or equal to the // specified value, inclusive. If the value of Gte is larger than a // specified Lt or Lte, the range is reversed. optional sfixed64 gte = 5; // In specifies that this field must be equal to one of the specified // values repeated sfixed64 in = 6; // NotIn specifies that this field cannot be equal to one of the specified // values repeated sfixed64 not_in = 7; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 8; } // BoolRules describes the constraints applied to `bool` values message BoolRules { // Const specifies that this field must be exactly the specified value optional bool const = 1; } // StringRules describe the constraints applied to `string` values message StringRules { // Const specifies that this field must be exactly the specified value optional string const = 1; // Len specifies that this field must be the specified number of // characters (Unicode code points). Note that the number of // characters may differ from the number of bytes in the string. optional uint64 len = 19; // MinLen specifies that this field must be the specified number of // characters (Unicode code points) at a minimum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of // characters (Unicode code points) at a maximum. Note that the number of // characters may differ from the number of bytes in the string. optional uint64 max_len = 3; // LenBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 len_bytes = 20; // MinBytes specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_bytes = 4; // MaxBytes specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_bytes = 5; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 6; // Prefix specifies that this field must have the specified substring at // the beginning of the string. optional string prefix = 7; // Suffix specifies that this field must have the specified substring at // the end of the string. optional string suffix = 8; // Contains specifies that this field must have the specified substring // anywhere in the string. optional string contains = 9; // NotContains specifies that this field cannot have the specified substring // anywhere in the string. optional string not_contains = 23; // In specifies that this field must be equal to one of the specified // values repeated string in = 10; // NotIn specifies that this field cannot be equal to one of the specified // values repeated string not_in = 11; // WellKnown rules provide advanced constraints against common string // patterns oneof well_known { // Email specifies that the field must be a valid email address as // defined by RFC 5322 bool email = 12; // Hostname specifies that the field must be a valid hostname as // defined by RFC 1034. This constraint does not support // internationalized domain names (IDNs). bool hostname = 13; // Ip specifies that the field must be a valid IP (v4 or v6) address. // Valid IPv6 addresses should not include surrounding square brackets. bool ip = 14; // Ipv4 specifies that the field must be a valid IPv4 address. bool ipv4 = 15; // Ipv6 specifies that the field must be a valid IPv6 address. Valid // IPv6 addresses should not include surrounding square brackets. bool ipv6 = 16; // Uri specifies that the field must be a valid, absolute URI as defined // by RFC 3986 bool uri = 17; // UriRef specifies that the field must be a valid URI as defined by RFC // 3986 and may be relative or absolute. bool uri_ref = 18; // Address specifies that the field must be either a valid hostname as // defined by RFC 1034 (which does not support internationalized domain // names or IDNs), or it can be a valid IP (v4 or v6). bool address = 21; // Uuid specifies that the field must be a valid UUID as defined by // RFC 4122 bool uuid = 22; // WellKnownRegex specifies a common well known pattern defined as a regex. KnownRegex well_known_regex = 24; } // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable // strict header validation. // By default, this is true, and HTTP header validations are RFC-compliant. // Setting to false will enable a looser validations that only disallows // \r\n\0 characters, which can be used to bypass header matching rules. optional bool strict = 25 [default = true]; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 26; } // WellKnownRegex contain some well-known patterns. enum KnownRegex { UNKNOWN = 0; // HTTP header name as defined by RFC 7230. HTTP_HEADER_NAME = 1; // HTTP header value as defined by RFC 7230. HTTP_HEADER_VALUE = 2; } // BytesRules describe the constraints applied to `bytes` values message BytesRules { // Const specifies that this field must be exactly the specified value optional bytes const = 1; // Len specifies that this field must be the specified number of bytes optional uint64 len = 13; // MinLen specifies that this field must be the specified number of bytes // at a minimum optional uint64 min_len = 2; // MaxLen specifies that this field must be the specified number of bytes // at a maximum optional uint64 max_len = 3; // Pattern specifes that this field must match against the specified // regular expression (RE2 syntax). The included expression should elide // any delimiters. optional string pattern = 4; // Prefix specifies that this field must have the specified bytes at the // beginning of the string. optional bytes prefix = 5; // Suffix specifies that this field must have the specified bytes at the // end of the string. optional bytes suffix = 6; // Contains specifies that this field must have the specified bytes // anywhere in the string. optional bytes contains = 7; // In specifies that this field must be equal to one of the specified // values repeated bytes in = 8; // NotIn specifies that this field cannot be equal to one of the specified // values repeated bytes not_in = 9; // WellKnown rules provide advanced constraints against common byte // patterns oneof well_known { // Ip specifies that the field must be a valid IP (v4 or v6) address in // byte format bool ip = 10; // Ipv4 specifies that the field must be a valid IPv4 address in byte // format bool ipv4 = 11; // Ipv6 specifies that the field must be a valid IPv6 address in byte // format bool ipv6 = 12; } // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 14; } // EnumRules describe the constraints applied to enum values message EnumRules { // Const specifies that this field must be exactly the specified value optional int32 const = 1; // DefinedOnly specifies that this field must be only one of the defined // values for this enum, failing on any undefined value. optional bool defined_only = 2; // In specifies that this field must be equal to one of the specified // values repeated int32 in = 3; // NotIn specifies that this field cannot be equal to one of the specified // values repeated int32 not_in = 4; } // MessageRules describe the constraints applied to embedded message values. // For message-type fields, validation is performed recursively. message MessageRules { // Skip specifies that the validation rules of this field should not be // evaluated optional bool skip = 1; // Required specifies that this field must be set optional bool required = 2; } // RepeatedRules describe the constraints applied to `repeated` values message RepeatedRules { // MinItems specifies that this field must have the specified number of // items at a minimum optional uint64 min_items = 1; // MaxItems specifies that this field must have the specified number of // items at a maximum optional uint64 max_items = 2; // Unique specifies that all elements in this field must be unique. This // contraint is only applicable to scalar and enum types (messages are not // supported). optional bool unique = 3; // Items specifies the contraints to be applied to each item in the field. // Repeated message fields will still execute validation against each item // unless skip is specified here. optional FieldRules items = 4; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 5; } // MapRules describe the constraints applied to `map` values message MapRules { // MinPairs specifies that this field must have the specified number of // KVs at a minimum optional uint64 min_pairs = 1; // MaxPairs specifies that this field must have the specified number of // KVs at a maximum optional uint64 max_pairs = 2; // NoSparse specifies values in this field cannot be unset. This only // applies to map's with message value types. optional bool no_sparse = 3; // Keys specifies the constraints to be applied to each key in the field. optional FieldRules keys = 4; // Values specifies the constraints to be applied to the value of each key // in the field. Message values will still have their validations evaluated // unless skip is specified here. optional FieldRules values = 5; // IgnoreEmpty specifies that the validation rules of this field should be // evaluated only if the field is not empty optional bool ignore_empty = 6; } // AnyRules describe constraints applied exclusively to the // `google.protobuf.Any` well-known type message AnyRules { // Required specifies that this field must be set optional bool required = 1; // In specifies that this field's `type_url` must be equal to one of the // specified values. repeated string in = 2; // NotIn specifies that this field's `type_url` must not be equal to any of // the specified values. repeated string not_in = 3; } // DurationRules describe the constraints applied exclusively to the // `google.protobuf.Duration` well-known type message DurationRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Duration const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Duration lt = 3; // Lt specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Duration lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Duration gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Duration gte = 6; // In specifies that this field must be equal to one of the specified // values repeated google.protobuf.Duration in = 7; // NotIn specifies that this field cannot be equal to one of the specified // values repeated google.protobuf.Duration not_in = 8; } // TimestampRules describe the constraints applied exclusively to the // `google.protobuf.Timestamp` well-known type message TimestampRules { // Required specifies that this field must be set optional bool required = 1; // Const specifies that this field must be exactly the specified value optional google.protobuf.Timestamp const = 2; // Lt specifies that this field must be less than the specified value, // exclusive optional google.protobuf.Timestamp lt = 3; // Lte specifies that this field must be less than the specified value, // inclusive optional google.protobuf.Timestamp lte = 4; // Gt specifies that this field must be greater than the specified value, // exclusive optional google.protobuf.Timestamp gt = 5; // Gte specifies that this field must be greater than the specified value, // inclusive optional google.protobuf.Timestamp gte = 6; // LtNow specifies that this must be less than the current time. LtNow // can only be used with the Within rule. optional bool lt_now = 7; // GtNow specifies that this must be greater than the current time. GtNow // can only be used with the Within rule. optional bool gt_now = 8; // Within specifies that this field must be within this duration of the // current time. This constraint can be used alone or with the LtNow and // GtNow rules. optional google.protobuf.Duration within = 9; } ================================================ FILE: web/admin/config/config.dev.js ================================================ // https://umijs.org/config/ import { defineConfig } from 'umi'; export default defineConfig({ plugins: [ // https://github.com/zthxxx/react-dev-inspector 'react-dev-inspector/plugins/umi/react-inspector', ], // https://github.com/zthxxx/react-dev-inspector#inspector-loader-props inspectorConfig: { exclude: [], babelPlugins: [], babelOptions: {}, }, }); ================================================ FILE: web/admin/config/config.js ================================================ // https://umijs.org/config/ import { defineConfig } from 'umi'; import { join } from 'path'; import defaultSettings from './defaultSettings'; import proxy from './proxy'; import routes from './routes'; const { REACT_APP_ENV } = process.env; export default defineConfig({ hash: true, antd: {}, dva: { hmr: true, }, layout: { // https://umijs.org/zh-CN/plugins/plugin-layout locale: true, siderWidth: 208, ...defaultSettings, }, // https://umijs.org/zh-CN/plugins/plugin-locale locale: { // default zh-CN default: 'zh-CN', antd: true, // default true, when it is true, will use `navigator.language` overwrite default baseNavigator: true, }, dynamicImport: { loading: '@ant-design/pro-layout/es/PageLoading', }, targets: { ie: 11, }, // umi routes: https://umijs.org/docs/routing routes, // Theme for antd: https://ant.design/docs/react/customize-theme-cn theme: { 'root-entry-name': 'variable', }, // esbuild is father build tools // https://umijs.org/plugins/plugin-esbuild esbuild: {}, title: false, ignoreMomentLocale: true, proxy: proxy[REACT_APP_ENV || 'dev'], manifest: { basePath: '/', }, // Fast Refresh 热更新 fastRefresh: {}, openAPI: [ { requestLibPath: "import { request } from 'umi'", // 或者使用在线的版本 // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json" schemaPath: join(__dirname, 'oneapi.json'), mock: false, }, { requestLibPath: "import { request } from 'umi'", schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json', projectName: 'swagger', }, ], nodeModulesTransform: { type: 'none', }, mfsu: {}, webpack5: {}, exportStatic: {}, }); ================================================ FILE: web/admin/config/defaultSettings.js ================================================ const Settings = { navTheme: 'light', // 拂晓蓝 primaryColor: '#1890ff', layout: 'mix', contentWidth: 'Fluid', fixedHeader: false, fixSiderbar: true, colorWeak: false, title: 'Ant Design Pro', pwa: false, logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg', iconfontUrl: '', }; export default Settings; ================================================ FILE: web/admin/config/oneapi.json ================================================ { "openapi": "3.0.1", "info": { "title": "Ant Design Pro", "version": "1.0.0" }, "servers": [ { "url": "http://localhost:8000/" }, { "url": "https://localhost:8000/" } ], "paths": { "/api/currentUser": { "get": { "tags": ["api"], "description": "获取当前的用户", "operationId": "currentUser", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CurrentUser" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "x-swagger-router-controller": "api" }, "/api/login/captcha": { "post": { "description": "发送验证码", "operationId": "getFakeCaptcha", "tags": ["login"], "parameters": [ { "name": "phone", "in": "query", "description": "手机号", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FakeCaptcha" } } } } } } }, "/api/login/outLogin": { "post": { "description": "登录接口", "operationId": "outLogin", "tags": ["login"], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "x-swagger-router-controller": "api" }, "/api/login/account": { "post": { "tags": ["login"], "description": "登录接口", "operationId": "login", "requestBody": { "description": "登录系统", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginParams" } } }, "required": true }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginResult" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-codegen-request-body-name": "body" }, "x-swagger-router-controller": "api" }, "/api/notices": { "summary": "getNotices", "description": "NoticeIconItem", "get": { "tags": ["api"], "operationId": "getNotices", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoticeIconList" } } } } } } }, "/api/rule": { "get": { "tags": ["rule"], "description": "获取规则列表", "operationId": "rule", "parameters": [ { "name": "current", "in": "query", "description": "当前的页码", "schema": { "type": "number" } }, { "name": "pageSize", "in": "query", "description": "页面的容量", "schema": { "type": "number" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RuleList" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": ["rule"], "description": "新建规则", "operationId": "addRule", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RuleListItem" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "put": { "tags": ["rule"], "description": "新建规则", "operationId": "updateRule", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RuleListItem" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": ["rule"], "description": "删除规则", "operationId": "removeRule", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "x-swagger-router-controller": "api" }, "/swagger": { "x-swagger-pipe": "swagger_raw" } }, "components": { "schemas": { "CurrentUser": { "type": "object", "properties": { "name": { "type": "string" }, "avatar": { "type": "string" }, "userid": { "type": "string" }, "email": { "type": "string" }, "signature": { "type": "string" }, "title": { "type": "string" }, "group": { "type": "string" }, "tags": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" } } } }, "notifyCount": { "type": "integer", "format": "int32" }, "unreadCount": { "type": "integer", "format": "int32" }, "country": { "type": "string" }, "access": { "type": "string" }, "geographic": { "type": "object", "properties": { "province": { "type": "object", "properties": { "label": { "type": "string" }, "key": { "type": "string" } } }, "city": { "type": "object", "properties": { "label": { "type": "string" }, "key": { "type": "string" } } } } }, "address": { "type": "string" }, "phone": { "type": "string" } } }, "LoginResult": { "type": "object", "properties": { "status": { "type": "string" }, "type": { "type": "string" }, "currentAuthority": { "type": "string" } } }, "PageParams": { "type": "object", "properties": { "current": { "type": "number" }, "pageSize": { "type": "number" } } }, "RuleListItem": { "type": "object", "properties": { "key": { "type": "integer", "format": "int32" }, "disabled": { "type": "boolean" }, "href": { "type": "string" }, "avatar": { "type": "string" }, "name": { "type": "string" }, "owner": { "type": "string" }, "desc": { "type": "string" }, "callNo": { "type": "integer", "format": "int32" }, "status": { "type": "integer", "format": "int32" }, "updatedAt": { "type": "string", "format": "datetime" }, "createdAt": { "type": "string", "format": "datetime" }, "progress": { "type": "integer", "format": "int32" } } }, "RuleList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RuleListItem" } }, "total": { "type": "integer", "description": "列表的内容总数", "format": "int32" }, "success": { "type": "boolean" } } }, "FakeCaptcha": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "status": { "type": "string" } } }, "LoginParams": { "type": "object", "properties": { "username": { "type": "string" }, "password": { "type": "string" }, "autoLogin": { "type": "boolean" }, "type": { "type": "string" } } }, "ErrorResponse": { "required": ["errorCode"], "type": "object", "properties": { "errorCode": { "type": "string", "description": "业务约定的错误码" }, "errorMessage": { "type": "string", "description": "业务上的错误信息" }, "success": { "type": "boolean", "description": "业务上的请求是否成功" } } }, "NoticeIconList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/NoticeIconItem" } }, "total": { "type": "integer", "description": "列表的内容总数", "format": "int32" }, "success": { "type": "boolean" } } }, "NoticeIconItemType": { "title": "NoticeIconItemType", "description": "已读未读列表的枚举", "type": "string", "properties": {}, "enum": ["notification", "message", "event"] }, "NoticeIconItem": { "type": "object", "properties": { "id": { "type": "string" }, "extra": { "type": "string", "format": "any" }, "key": { "type": "string" }, "read": { "type": "boolean" }, "avatar": { "type": "string" }, "title": { "type": "string" }, "status": { "type": "string" }, "datetime": { "type": "string", "format": "date" }, "description": { "type": "string" }, "type": { "extensions": { "x-is-enum": true }, "$ref": "#/components/schemas/NoticeIconItemType" } } } } } } ================================================ FILE: web/admin/config/proxy.js ================================================ /** * 在生产环境 代理是无法生效的,所以这里没有生产环境的配置 * ------------------------------- * The agent cannot take effect in the production environment * so there is no configuration of the production environment * For details, please see * https://pro.ant.design/docs/deploy */ export default { dev: { // localhost:8000/api/** -> https://preview.pro.ant.design/api/** '/api/': { // 要代理的地址 target: 'http://localhost:9099', // 配置了这个可以从 http 代理到 https // 依赖 origin 的功能可能需要这个,比如 cookie changeOrigin: true, pathRewrite: { '^': '', }, }, }, test: { '/api/': { target: 'https://proapi.azurewebsites.net', changeOrigin: true, pathRewrite: { '^': '', }, }, }, pre: { '/api/': { target: 'http://127.0.0.1:9099', changeOrigin: true, pathRewrite: { '^': '', }, }, }, }; ================================================ FILE: web/admin/config/routes.js ================================================ export default [ { path: '/user', layout: false, routes: [ { path: '/user', routes: [ { name: 'login', path: '/user/login', component: './user/Login', }, ], }, { component: './404', }, ], }, { path: '/welcome', name: 'welcome', icon: 'smile', component: './Welcome', }, { path: '/admin', name: 'admin', icon: 'crown', access: 'canAdmin', component: './Admin', routes: [ { path: '/admin/sub-page', name: 'sub-page', icon: 'smile', component: './Welcome', }, { component: './404', }, ], }, { name: 'list.table-list', icon: 'table', path: '/list', component: './TableList', }, { path: '/', redirect: '/welcome', }, { component: './404', }, ]; ================================================ FILE: web/admin/jest.config.js ================================================ module.exports = { testURL: 'http://localhost:8000', verbose: false, extraSetupFiles: ['./tests/setupTests.js'], globals: { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false, localStorage: null, }, }; ================================================ FILE: web/admin/jsconfig.json ================================================ { "compilerOptions": { "jsx": "react-jsx", "emitDecoratorMetadata": true, "experimentalDecorators": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"] } } } ================================================ FILE: web/admin/package.json ================================================ { "name": "ant-design-pro", "version": "5.2.0", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { "analyze": "cross-env ANALYZE=1 umi build", "build": "umi build", "deploy": "npm run build && npm run gh-pages", "dev": "npm run start:dev", "gh-pages": "gh-pages -d dist", "i18n-remove": "pro i18n-remove --locale=zh-CN --write", "postinstall": "umi g tmp", "lint": "umi g tmp && npm run lint:js && npm run lint:style && npm run lint:prettier && npm run tsc", "lint-staged": "lint-staged", "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ", "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && npm run lint:style", "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src", "lint:prettier": "prettier -c --write \"src/**/*\" --end-of-line auto", "lint:style": "stylelint --fix \"src/**/*.less\" --syntax less", "openapi": "umi openapi", "playwright": "playwright install && playwright test", "precommit": "lint-staged", "prettier": "prettier -c --write \"src/**/*\"", "serve": "umi-serve", "start": "cross-env UMI_ENV=dev umi dev", "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev", "start:no-mock": "cross-env MOCK=none UMI_ENV=dev umi dev", "start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev", "start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev umi dev", "start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev umi dev", "test": "umi test", "test:component": "umi test ./src/components", "test:e2e": "node ./tests/run-tests.js", "tsc": "tsc --noEmit" }, "lint-staged": { "**/*.less": "stylelint --syntax less", "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js", "**/*.{js,jsx,tsx,ts,less,md,json}": ["prettier --write"] }, "browserslist": ["> 1%", "last 2 versions", "not ie <= 10"], "dependencies": { "@ant-design/icons": "^4.7.0", "@ant-design/pro-descriptions": "^1.10.0", "@ant-design/pro-form": "^1.52.0", "@ant-design/pro-layout": "^6.32.0", "@ant-design/pro-table": "^2.61.0", "@umijs/route-utils": "^2.0.0", "antd": "^4.17.0", "classnames": "^2.3.0", "lodash": "^4.17.0", "moment": "^2.29.0", "omit.js": "^2.0.2", "rc-menu": "^9.1.0", "rc-util": "^5.16.0", "react": "^17.0.0", "react-dev-inspector": "^1.7.0", "react-dom": "^17.0.0", "react-helmet-async": "^1.2.0", "umi": "^3.5.0" }, "devDependencies": { "@ant-design/pro-cli": "^2.1.0", "@playwright/test": "^1.17.0", "@types/express": "^4.17.0", "@types/history": "^4.7.0", "@types/jest": "^26.0.0", "@types/lodash": "^4.14.0", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", "@types/react-helmet": "^6.1.0", "@umijs/fabric": "^2.8.0", "@umijs/openapi": "^1.3.0", "@umijs/plugin-blocks": "^2.2.0", "@umijs/plugin-esbuild": "^1.4.0", "@umijs/plugin-openapi": "^1.3.0", "@umijs/preset-ant-design-pro": "^1.3.0", "@umijs/preset-dumi": "^1.1.0", "@umijs/preset-react": "^1.8.17", "@umijs/yorkie": "^2.0.5", "carlo": "^0.9.46", "cross-env": "^7.0.0", "cross-port-killer": "^1.3.0", "detect-installer": "^1.0.0", "enzyme": "^3.11.0", "eslint": "^7.32.0", "express": "^4.17.0", "gh-pages": "^3.2.0", "jsdom-global": "^3.0.0", "lint-staged": "^10.0.0", "mockjs": "^1.1.0", "prettier": "^2.5.0", "puppeteer-core": "^8.0.0", "stylelint": "^13.0.0", "swagger-ui-react": "^3.52.0", "typescript": "^4.5.0", "umi-serve": "^1.9.10" }, "engines": { "node": ">=10.0.0" }, "gitHooks": { "commit-msg": "fabric verify-commit" } } ================================================ FILE: web/admin/public/CNAME ================================================ preview.pro.ant.design ================================================ FILE: web/admin/src/access.js ================================================ /** * @see https://umijs.org/zh-CN/plugins/plugin-access * */ export default function access(initialState) { const { currentUser } = initialState || {}; return { canAdmin: currentUser && currentUser.access === 'admin', }; } ================================================ FILE: web/admin/src/app.jsx ================================================ import { SettingDrawer } from '@ant-design/pro-layout'; import { PageLoading } from '@ant-design/pro-layout'; import { history, Link } from 'umi'; import RightContent from '@/components/RightContent'; import Footer from '@/components/Footer'; import { currentUser as queryCurrentUser } from './services/ant-design-pro/api'; import { BookOutlined, LinkOutlined } from '@ant-design/icons'; import defaultSettings from '../config/defaultSettings'; const isDev = process.env.NODE_ENV === 'development'; const loginPath = '/user/login'; /** 获取用户信息比较慢的时候会展示一个 loading */ export const initialStateConfig = { loading: , }; /** * @see https://umijs.org/zh-CN/plugins/plugin-initial-state * */ export async function getInitialState() { const fetchUserInfo = async () => { try { const msg = await queryCurrentUser(); return msg.data; } catch (error) { history.push(loginPath); } return undefined; }; // 如果是登录页面,不执行 if (history.location.pathname !== loginPath) { const currentUser = await fetchUserInfo(); return { fetchUserInfo, currentUser, settings: defaultSettings, }; } return { fetchUserInfo, settings: defaultSettings, }; } // ProLayout 支持的api https://procomponents.ant.design/components/layout export const layout = ({ initialState, setInitialState }) => { return { rightContentRender: () => , disableContentMargin: false, waterMarkProps: { content: initialState?.currentUser?.name, }, footerRender: () =>