This commit is contained in:
zhuyasen 2022-09-29 23:32:03 +08:00
parent 75123fba0e
commit 87ef970c9a
78 changed files with 825 additions and 647 deletions

3
.gitignore vendored
View File

@ -5,7 +5,8 @@
*.so
*.dylib
*.log
cmd/sponge/sponge
cmd/serverNameExample/serverNameExample
*@@*@@*
# Test binary, built with `go test -c`
*.test

View File

@ -1,4 +1,4 @@
# This file configures github.com/zhufuyi/pkg.
# This file configures github.com/zhufuyi/sponge.
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
@ -129,7 +129,7 @@ linters-settings:
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: sponge
local-prefixes: github.com/zhufuyi/sponge
golint:
# minimal confidence for issues, default is 0.8

View File

@ -33,8 +33,8 @@ ci-lint:
.PHONY: build
# go build the linux amd64 binary file
build:
@cd cmd/sponge && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags "all=-N -l"
@echo "build finished, binary file in path 'cmd/sponge'"
@cd cmd/serverNameExample && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags "all=-N -l"
@echo "build finished, binary file in path 'cmd/serverNameExample'"
.PHONY: run
@ -71,26 +71,26 @@ cover:
.PHONY: docker
# build docker image
docker:
@tar zcf sponge.tar.gz ${PROJECT_FILES}
@mv -f sponge.tar.gz build/
docker build -t sponge/sponge:latest build/
@rm -rf build/sponge.tar.gz
@tar zcf serverNameExample.tar.gz ${PROJECT_FILES}
@mv -f serverNameExample.tar.gz build/
docker build -t project-name-example/server-name-example:latest build/
@rm -rf build/serverNameExample.tar.gz
.PHONY: docker-image
# copy the binary file to build the docker image, skip the compile to binary in docker
docker-image: build
@bash scripts/grpc_health_probe.sh
@mv -f cmd/sponge/sponge build/ && cp -f /tmp/grpc_health_probe build/
@mkdir -p build/config && cp -f config/conf.yml build/config/
docker build -f build/Dockerfile_sponge -t sponge/sponge:latest build/
@rm -rf build/sponge build/config/ build/grpc_health_probe
@mv -f cmd/serverNameExample/serverNameExample build/ && cp -f /tmp/grpc_health_probe build/
@mkdir -p build/configs && cp -f configs/serverNameExample.yml build/configs/
docker build -f build/Dockerfile_cp -t project-name-example/server-name-example:latest build/
@rm -rf build/serverNameExample build/configs/ build/grpc_health_probe
.PHONY: clean
# clean binary file, cover.out, redundant dependency packages
clean:
@rm -vrf cmd/sponge/sponge
@rm -vrf cmd/serverNameExample/serverNameExample
@rm -vrf cover.out
@go mod tidy
@echo "clean finished"
@ -99,7 +99,7 @@ clean:
.PHONY: docs
# generate swagger doc
docs:
@swag init -g cmd/sponge/main.go
@swag init -g cmd/serverNameExample/main.go
@echo "see docs by: http://localhost:8080/swagger/index.html"
@ -107,16 +107,8 @@ docs:
# generate interactive visual function dependency graphs
graph:
@echo "generating graph ......"
@go-callvis github.com/zhufuyi/sponge
.PHONY: mockgen
# mockgen gen mock file
mockgen:
cd ./internal && for file in `egrep -rnl "type.*?interface" ./repository | grep -v "_test" `; do \
echo $$file ; \
cd .. && mockgen -destination="./internal/mock/$$file" -source="./internal/$$file" && cd ./internal ; \
done
@cd cmd/serverNameExample
@go-callvis -nostd github.com/zhufuyi/sponge
.PHONY: proto

View File

@ -5,7 +5,7 @@
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.1
// source: api/userExample/v1/userExample.proto
// source: api/serverNameExample/v1/userExample.proto
package v1
@ -58,11 +58,11 @@ func (x GenderType) String() string {
}
func (GenderType) Descriptor() protoreflect.EnumDescriptor {
return file_api_userExample_v1_userExample_proto_enumTypes[0].Descriptor()
return file_api_serverNameExample_v1_userExample_proto_enumTypes[0].Descriptor()
}
func (GenderType) Type() protoreflect.EnumType {
return &file_api_userExample_v1_userExample_proto_enumTypes[0]
return &file_api_serverNameExample_v1_userExample_proto_enumTypes[0]
}
func (x GenderType) Number() protoreflect.EnumNumber {
@ -71,7 +71,7 @@ func (x GenderType) Number() protoreflect.EnumNumber {
// Deprecated: Use GenderType.Descriptor instead.
func (GenderType) EnumDescriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{0}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{0}
}
type CreateUserExampleRequest struct {
@ -91,7 +91,7 @@ type CreateUserExampleRequest struct {
func (x *CreateUserExampleRequest) Reset() {
*x = CreateUserExampleRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[0]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -104,7 +104,7 @@ func (x *CreateUserExampleRequest) String() string {
func (*CreateUserExampleRequest) ProtoMessage() {}
func (x *CreateUserExampleRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[0]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -117,7 +117,7 @@ func (x *CreateUserExampleRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateUserExampleRequest.ProtoReflect.Descriptor instead.
func (*CreateUserExampleRequest) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{0}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{0}
}
func (x *CreateUserExampleRequest) GetName() string {
@ -180,7 +180,7 @@ type CreateUserExampleReply struct {
func (x *CreateUserExampleReply) Reset() {
*x = CreateUserExampleReply{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[1]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -193,7 +193,7 @@ func (x *CreateUserExampleReply) String() string {
func (*CreateUserExampleReply) ProtoMessage() {}
func (x *CreateUserExampleReply) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[1]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -206,7 +206,7 @@ func (x *CreateUserExampleReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateUserExampleReply.ProtoReflect.Descriptor instead.
func (*CreateUserExampleReply) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{1}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{1}
}
func (x *CreateUserExampleReply) GetId() uint64 {
@ -227,7 +227,7 @@ type DeleteUserExampleByIDRequest struct {
func (x *DeleteUserExampleByIDRequest) Reset() {
*x = DeleteUserExampleByIDRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[2]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -240,7 +240,7 @@ func (x *DeleteUserExampleByIDRequest) String() string {
func (*DeleteUserExampleByIDRequest) ProtoMessage() {}
func (x *DeleteUserExampleByIDRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[2]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -253,7 +253,7 @@ func (x *DeleteUserExampleByIDRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteUserExampleByIDRequest.ProtoReflect.Descriptor instead.
func (*DeleteUserExampleByIDRequest) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{2}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{2}
}
func (x *DeleteUserExampleByIDRequest) GetId() uint64 {
@ -272,7 +272,7 @@ type DeleteUserExampleByIDReply struct {
func (x *DeleteUserExampleByIDReply) Reset() {
*x = DeleteUserExampleByIDReply{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[3]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -285,7 +285,7 @@ func (x *DeleteUserExampleByIDReply) String() string {
func (*DeleteUserExampleByIDReply) ProtoMessage() {}
func (x *DeleteUserExampleByIDReply) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[3]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -298,7 +298,7 @@ func (x *DeleteUserExampleByIDReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteUserExampleByIDReply.ProtoReflect.Descriptor instead.
func (*DeleteUserExampleByIDReply) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{3}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{3}
}
type UpdateUserExampleByIDRequest struct {
@ -310,7 +310,7 @@ type UpdateUserExampleByIDRequest struct {
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // 名称
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` // 邮件
Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` // 密码
Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` // 手机号码,必须在前加'+86'
Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` // 手机号码
Avatar string `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"` // 头像
Age int32 `protobuf:"varint,7,opt,name=age,proto3" json:"age,omitempty"` // 年龄
Gender GenderType `protobuf:"varint,8,opt,name=gender,proto3,enum=api.userExample.v1.GenderType" json:"gender,omitempty"` // 性别1:男2:女
@ -321,7 +321,7 @@ type UpdateUserExampleByIDRequest struct {
func (x *UpdateUserExampleByIDRequest) Reset() {
*x = UpdateUserExampleByIDRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[4]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -334,7 +334,7 @@ func (x *UpdateUserExampleByIDRequest) String() string {
func (*UpdateUserExampleByIDRequest) ProtoMessage() {}
func (x *UpdateUserExampleByIDRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[4]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -347,7 +347,7 @@ func (x *UpdateUserExampleByIDRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateUserExampleByIDRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserExampleByIDRequest) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{4}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{4}
}
func (x *UpdateUserExampleByIDRequest) GetId() uint64 {
@ -429,7 +429,7 @@ type UpdateUserExampleByIDReply struct {
func (x *UpdateUserExampleByIDReply) Reset() {
*x = UpdateUserExampleByIDReply{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[5]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -442,7 +442,7 @@ func (x *UpdateUserExampleByIDReply) String() string {
func (*UpdateUserExampleByIDReply) ProtoMessage() {}
func (x *UpdateUserExampleByIDReply) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[5]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -455,7 +455,7 @@ func (x *UpdateUserExampleByIDReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateUserExampleByIDReply.ProtoReflect.Descriptor instead.
func (*UpdateUserExampleByIDReply) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{5}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{5}
}
type UserExample struct {
@ -466,7 +466,7 @@ type UserExample struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // 名称
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` // 邮件
Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` // 手机号码,必须在前加'+86'
Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` // 手机号码
Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` // 头像
Age int32 `protobuf:"varint,6,opt,name=age,proto3" json:"age,omitempty"` // 年龄
Gender GenderType `protobuf:"varint,7,opt,name=gender,proto3,enum=api.userExample.v1.GenderType" json:"gender,omitempty"` // 性别1:男2:女
@ -479,7 +479,7 @@ type UserExample struct {
func (x *UserExample) Reset() {
*x = UserExample{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[6]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -492,7 +492,7 @@ func (x *UserExample) String() string {
func (*UserExample) ProtoMessage() {}
func (x *UserExample) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[6]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -505,7 +505,7 @@ func (x *UserExample) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserExample.ProtoReflect.Descriptor instead.
func (*UserExample) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{6}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{6}
}
func (x *UserExample) GetId() uint64 {
@ -596,7 +596,7 @@ type GetUserExampleByIDRequest struct {
func (x *GetUserExampleByIDRequest) Reset() {
*x = GetUserExampleByIDRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[7]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -609,7 +609,7 @@ func (x *GetUserExampleByIDRequest) String() string {
func (*GetUserExampleByIDRequest) ProtoMessage() {}
func (x *GetUserExampleByIDRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[7]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -622,7 +622,7 @@ func (x *GetUserExampleByIDRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetUserExampleByIDRequest.ProtoReflect.Descriptor instead.
func (*GetUserExampleByIDRequest) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{7}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{7}
}
func (x *GetUserExampleByIDRequest) GetId() uint64 {
@ -643,7 +643,7 @@ type GetUserExampleByIDReply struct {
func (x *GetUserExampleByIDReply) Reset() {
*x = GetUserExampleByIDReply{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[8]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -656,7 +656,7 @@ func (x *GetUserExampleByIDReply) String() string {
func (*GetUserExampleByIDReply) ProtoMessage() {}
func (x *GetUserExampleByIDReply) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[8]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -669,7 +669,7 @@ func (x *GetUserExampleByIDReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetUserExampleByIDReply.ProtoReflect.Descriptor instead.
func (*GetUserExampleByIDReply) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{8}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{8}
}
func (x *GetUserExampleByIDReply) GetUserExample() *UserExample {
@ -690,7 +690,7 @@ type ListUserExampleByIDsRequest struct {
func (x *ListUserExampleByIDsRequest) Reset() {
*x = ListUserExampleByIDsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[9]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -703,7 +703,7 @@ func (x *ListUserExampleByIDsRequest) String() string {
func (*ListUserExampleByIDsRequest) ProtoMessage() {}
func (x *ListUserExampleByIDsRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[9]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -716,7 +716,7 @@ func (x *ListUserExampleByIDsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserExampleByIDsRequest.ProtoReflect.Descriptor instead.
func (*ListUserExampleByIDsRequest) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{9}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{9}
}
func (x *ListUserExampleByIDsRequest) GetIds() []uint64 {
@ -737,7 +737,7 @@ type ListUserExampleByIDsReply struct {
func (x *ListUserExampleByIDsReply) Reset() {
*x = ListUserExampleByIDsReply{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[10]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -750,7 +750,7 @@ func (x *ListUserExampleByIDsReply) String() string {
func (*ListUserExampleByIDsReply) ProtoMessage() {}
func (x *ListUserExampleByIDsReply) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[10]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -763,7 +763,7 @@ func (x *ListUserExampleByIDsReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserExampleByIDsReply.ProtoReflect.Descriptor instead.
func (*ListUserExampleByIDsReply) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{10}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{10}
}
func (x *ListUserExampleByIDsReply) GetUserExamples() []*UserExample {
@ -784,7 +784,7 @@ type ListUserExampleRequest struct {
func (x *ListUserExampleRequest) Reset() {
*x = ListUserExampleRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[11]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -797,7 +797,7 @@ func (x *ListUserExampleRequest) String() string {
func (*ListUserExampleRequest) ProtoMessage() {}
func (x *ListUserExampleRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[11]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -810,7 +810,7 @@ func (x *ListUserExampleRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserExampleRequest.ProtoReflect.Descriptor instead.
func (*ListUserExampleRequest) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{11}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{11}
}
func (x *ListUserExampleRequest) GetParams() *types.Params {
@ -832,7 +832,7 @@ type ListUserExampleReply struct {
func (x *ListUserExampleReply) Reset() {
*x = ListUserExampleReply{}
if protoimpl.UnsafeEnabled {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[12]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -845,7 +845,7 @@ func (x *ListUserExampleReply) String() string {
func (*ListUserExampleReply) ProtoMessage() {}
func (x *ListUserExampleReply) ProtoReflect() protoreflect.Message {
mi := &file_api_userExample_v1_userExample_proto_msgTypes[12]
mi := &file_api_serverNameExample_v1_userExample_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -858,7 +858,7 @@ func (x *ListUserExampleReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserExampleReply.ProtoReflect.Descriptor instead.
func (*ListUserExampleReply) Descriptor() ([]byte, []int) {
return file_api_userExample_v1_userExample_proto_rawDescGZIP(), []int{12}
return file_api_serverNameExample_v1_userExample_proto_rawDescGZIP(), []int{12}
}
func (x *ListUserExampleReply) GetTotal() int64 {
@ -875,179 +875,180 @@ func (x *ListUserExampleReply) GetUserExamples() []*UserExample {
return nil
}
var File_api_userExample_v1_userExample_proto protoreflect.FileDescriptor
var File_api_serverNameExample_v1_userExample_proto protoreflect.FileDescriptor
var file_api_userExample_v1_userExample_proto_rawDesc = []byte{
0x0a, 0x24, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 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, 0x15, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x02, 0x0a, 0x18, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x02, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x60, 0x01, 0x52, 0x05, 0x65, 0x6d,
0x61, 0x69, 0x6c, 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, 0x0a, 0x52, 0x08,
0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11,
0x5e, 0x31, 0x5b, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x5d, 0x5c, 0x64, 0x7b, 0x39, 0x7d,
0x24, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x20, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74,
0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x88,
0x01, 0x01, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1b, 0x0a, 0x03, 0x61, 0x67,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x1a, 0x04, 0x18, 0x78,
0x28, 0x00, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65,
0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e,
0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10,
0x01, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x31, 0x0a, 0x16, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x37, 0x0a, 0x1c,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28,
0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x22, 0xa8, 0x02, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 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, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77,
0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77,
0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61,
0x74, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61,
0x72, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54,
0x79, 0x70, 0x65, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61,
0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x74, 0x22, 0x1c,
0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0xb0, 0x02, 0x0a,
0x0b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 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, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06,
0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76,
0x61, 0x74, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72,
0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x64,
0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16,
0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f,
0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41,
0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74,
0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b,
0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22,
0x34, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28,
0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5c, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79,
0x12, 0x41, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x22, 0x2f, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52,
0x03, 0x69, 0x64, 0x73, 0x22, 0x60, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x70, 0x6c,
0x79, 0x12, 0x43, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x22, 0x49, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x2f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42,
0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x73, 0x22, 0x71, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74,
0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12,
0x43, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x73, 0x2a, 0x2f, 0x0a, 0x0a, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79,
0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12,
0x08, 0x0a, 0x04, 0x4d, 0x41, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x45, 0x4d,
0x41, 0x4c, 0x45, 0x10, 0x02, 0x32, 0x96, 0x05, 0x0a, 0x12, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x06,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79,
0x22, 0x00, 0x12, 0x70, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x79, 0x49, 0x44,
0x12, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,
var file_api_serverNameExample_v1_userExample_proto_rawDesc = []byte{
0x0a, 0x2a, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x61, 0x70,
0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 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, 0x15, 0x61, 0x70, 0x69, 0x2f, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x22, 0xac, 0x02, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x72, 0x02, 0x10, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x05, 0x65, 0x6d,
0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02,
0x60, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 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, 0x0a, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2e,
0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa,
0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x31, 0x5b, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x5d, 0x5c, 0x64, 0x7b, 0x39, 0x7d, 0x24, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x20,
0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08,
0xfa, 0x42, 0x05, 0x72, 0x03, 0x88, 0x01, 0x01, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72,
0x12, 0x1b, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x42, 0x09, 0xfa,
0x42, 0x06, 0x1a, 0x04, 0x18, 0x78, 0x28, 0x00, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a,
0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e,
0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa,
0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22,
0x31, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x02,
0x69, 0x64, 0x22, 0x37, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73,
0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0xa8, 0x02, 0x0a, 0x1c, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42,
0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 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, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a,
0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f,
0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12,
0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x07,
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x67, 0x65, 0x6e,
0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47,
0x65, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65,
0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28,
0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67,
0x69, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x6f, 0x67,
0x69, 0x6e, 0x41, 0x74, 0x22, 0x1c, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70,
0x6c, 0x79, 0x22, 0x00, 0x12, 0x70, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79,
0x49, 0x44, 0x12, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x6c, 0x79, 0x22, 0xb0, 0x02, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 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, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05,
0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f,
0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x06,
0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76,
0x31, 0x2e, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x67, 0x65,
0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08,
0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07,
0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74,
0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65,
0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61,
0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x34, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5c, 0x0a, 0x17, 0x47,
0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49,
0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x41, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0b, 0x75, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0x2f, 0x0a, 0x1b, 0x4c, 0x69, 0x73,
0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x60, 0x0a, 0x19, 0x4c, 0x69,
0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49,
0x44, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x43, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e,
0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0c,
0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x22, 0x49, 0x0a, 0x16,
0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50,
0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52,
0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x71, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x55,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12,
0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x43, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0c, 0x75, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2a, 0x2f, 0x0a, 0x0a, 0x47, 0x65,
0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e,
0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x41, 0x4c, 0x45, 0x10, 0x01, 0x12,
0x0a, 0x0a, 0x06, 0x46, 0x45, 0x4d, 0x41, 0x4c, 0x45, 0x10, 0x02, 0x32, 0x96, 0x05, 0x0a, 0x12,
0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x12, 0x64, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76,
0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x70, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x65, 0x42, 0x79, 0x49, 0x44, 0x12, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49,
0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42,
0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x70, 0x0a, 0x0a, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x49, 0x44, 0x12, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42,
0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x67, 0x0a, 0x07,
0x47, 0x65, 0x74, 0x42, 0x79, 0x49, 0x44, 0x12, 0x2d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x67, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x79, 0x49,
0x44, 0x12, 0x2d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x2b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12,
0x6d, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x49, 0x44, 0x73, 0x12, 0x2f, 0x2e, 0x61,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x49,
0x44, 0x73, 0x12, 0x2f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x70,
0x6c, 0x79, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2a, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76,
0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e,
0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5e,
0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,
0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x31,
0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x68, 0x75,
0x66, 0x75, 0x79, 0x69, 0x2f, 0x73, 0x70, 0x6f, 0x6e, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76,
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69,
0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70,
0x6c, 0x79, 0x22, 0x00, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x7a, 0x68, 0x75, 0x66, 0x75, 0x79, 0x69, 0x2f, 0x73, 0x70, 0x6f, 0x6e, 0x67,
0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_api_userExample_v1_userExample_proto_rawDescOnce sync.Once
file_api_userExample_v1_userExample_proto_rawDescData = file_api_userExample_v1_userExample_proto_rawDesc
file_api_serverNameExample_v1_userExample_proto_rawDescOnce sync.Once
file_api_serverNameExample_v1_userExample_proto_rawDescData = file_api_serverNameExample_v1_userExample_proto_rawDesc
)
func file_api_userExample_v1_userExample_proto_rawDescGZIP() []byte {
file_api_userExample_v1_userExample_proto_rawDescOnce.Do(func() {
file_api_userExample_v1_userExample_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_userExample_v1_userExample_proto_rawDescData)
func file_api_serverNameExample_v1_userExample_proto_rawDescGZIP() []byte {
file_api_serverNameExample_v1_userExample_proto_rawDescOnce.Do(func() {
file_api_serverNameExample_v1_userExample_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_serverNameExample_v1_userExample_proto_rawDescData)
})
return file_api_userExample_v1_userExample_proto_rawDescData
return file_api_serverNameExample_v1_userExample_proto_rawDescData
}
var file_api_userExample_v1_userExample_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_userExample_v1_userExample_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_api_userExample_v1_userExample_proto_goTypes = []interface{}{
var file_api_serverNameExample_v1_userExample_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_serverNameExample_v1_userExample_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_api_serverNameExample_v1_userExample_proto_goTypes = []interface{}{
(GenderType)(0), // 0: api.userExample.v1.GenderType
(*CreateUserExampleRequest)(nil), // 1: api.userExample.v1.CreateUserExampleRequest
(*CreateUserExampleReply)(nil), // 2: api.userExample.v1.CreateUserExampleReply
@ -1064,7 +1065,7 @@ var file_api_userExample_v1_userExample_proto_goTypes = []interface{}{
(*ListUserExampleReply)(nil), // 13: api.userExample.v1.ListUserExampleReply
(*types.Params)(nil), // 14: types.Params
}
var file_api_userExample_v1_userExample_proto_depIdxs = []int32{
var file_api_serverNameExample_v1_userExample_proto_depIdxs = []int32{
0, // 0: api.userExample.v1.CreateUserExampleRequest.gender:type_name -> api.userExample.v1.GenderType
0, // 1: api.userExample.v1.UpdateUserExampleByIDRequest.gender:type_name -> api.userExample.v1.GenderType
0, // 2: api.userExample.v1.UserExample.gender:type_name -> api.userExample.v1.GenderType
@ -1091,13 +1092,13 @@ var file_api_userExample_v1_userExample_proto_depIdxs = []int32{
0, // [0:7] is the sub-list for field type_name
}
func init() { file_api_userExample_v1_userExample_proto_init() }
func file_api_userExample_v1_userExample_proto_init() {
if File_api_userExample_v1_userExample_proto != nil {
func init() { file_api_serverNameExample_v1_userExample_proto_init() }
func file_api_serverNameExample_v1_userExample_proto_init() {
if File_api_serverNameExample_v1_userExample_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_api_userExample_v1_userExample_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateUserExampleRequest); i {
case 0:
return &v.state
@ -1109,7 +1110,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateUserExampleReply); i {
case 0:
return &v.state
@ -1121,7 +1122,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteUserExampleByIDRequest); i {
case 0:
return &v.state
@ -1133,7 +1134,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteUserExampleByIDReply); i {
case 0:
return &v.state
@ -1145,7 +1146,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateUserExampleByIDRequest); i {
case 0:
return &v.state
@ -1157,7 +1158,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateUserExampleByIDReply); i {
case 0:
return &v.state
@ -1169,7 +1170,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserExample); i {
case 0:
return &v.state
@ -1181,7 +1182,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetUserExampleByIDRequest); i {
case 0:
return &v.state
@ -1193,7 +1194,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetUserExampleByIDReply); i {
case 0:
return &v.state
@ -1205,7 +1206,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListUserExampleByIDsRequest); i {
case 0:
return &v.state
@ -1217,7 +1218,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListUserExampleByIDsReply); i {
case 0:
return &v.state
@ -1229,7 +1230,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListUserExampleRequest); i {
case 0:
return &v.state
@ -1241,7 +1242,7 @@ func file_api_userExample_v1_userExample_proto_init() {
return nil
}
}
file_api_userExample_v1_userExample_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_api_serverNameExample_v1_userExample_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListUserExampleReply); i {
case 0:
return &v.state
@ -1258,19 +1259,19 @@ func file_api_userExample_v1_userExample_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_userExample_v1_userExample_proto_rawDesc,
RawDescriptor: file_api_serverNameExample_v1_userExample_proto_rawDesc,
NumEnums: 1,
NumMessages: 13,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_userExample_v1_userExample_proto_goTypes,
DependencyIndexes: file_api_userExample_v1_userExample_proto_depIdxs,
EnumInfos: file_api_userExample_v1_userExample_proto_enumTypes,
MessageInfos: file_api_userExample_v1_userExample_proto_msgTypes,
GoTypes: file_api_serverNameExample_v1_userExample_proto_goTypes,
DependencyIndexes: file_api_serverNameExample_v1_userExample_proto_depIdxs,
EnumInfos: file_api_serverNameExample_v1_userExample_proto_enumTypes,
MessageInfos: file_api_serverNameExample_v1_userExample_proto_msgTypes,
}.Build()
File_api_userExample_v1_userExample_proto = out.File
file_api_userExample_v1_userExample_proto_rawDesc = nil
file_api_userExample_v1_userExample_proto_goTypes = nil
file_api_userExample_v1_userExample_proto_depIdxs = nil
File_api_serverNameExample_v1_userExample_proto = out.File
file_api_serverNameExample_v1_userExample_proto_rawDesc = nil
file_api_serverNameExample_v1_userExample_proto_goTypes = nil
file_api_serverNameExample_v1_userExample_proto_depIdxs = nil
}

View File

@ -1,5 +1,5 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: api/userExample/v1/userExample.proto
// source: api/serverNameExample/v1/userExample.proto
package v1

View File

@ -8,7 +8,7 @@ package api.userExample.v1;
import "validate/validate.proto";
import "api/types/types.proto";
option go_package = "github.com/zhufuyi/sponge/api/userExample/v1;v1";
option go_package = "github.com/zhufuyi/sponge/api/serverNameExample/v1;v1";
service userExampleService {
rpc Create(CreateUserExampleRequest) returns (CreateUserExampleReply) {}
@ -52,7 +52,7 @@ message UpdateUserExampleByIDRequest {
string name = 2; //
string email = 3; //
string password = 4; //
string phone=5; // '+86'
string phone=5; //
string avatar=6; //
int32 age=7; //
GenderType gender=8; // 1:2:
@ -68,7 +68,7 @@ message UserExample {
uint64 id = 1;
string name = 2; //
string email = 3; //
string phone=4; // '+86'
string phone=4; //
string avatar=5; //
int32 age=6; //
GenderType gender=7; // 1:2:

View File

@ -2,7 +2,7 @@
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.20.1
// source: api/userExample/v1/userExample.proto
// source: api/serverNameExample/v1/userExample.proto
package v1
@ -281,5 +281,5 @@ var UserExampleService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/userExample/v1/userExample.proto",
Metadata: "api/serverNameExample/v1/userExample.proto",
}

View File

@ -1,12 +1,12 @@
# 需要先打包代码`tar zcf sponge.tar.gz $(ls)`并移动到和Dokerfile在同一个目录下
# 需要先打包代码`tar zcf serverNameExample.tar.gz $(ls)`并移动到和Dokerfile在同一个目录下
# 编译go代码
FROM golang:1.18-alpine as build
COPY . /go/src/sponge
WORKDIR /go/src/sponge
RUN tar zxf sponge.tar.gz
COPY . /go/src/serverNameExample
WORKDIR /go/src/serverNameExample
RUN tar zxf serverNameExample.tar.gz
RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags "all=-N -l" -o /sponge cmd/sponge/main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags "all=-N -l" -o /serverNameExample cmd/serverNameExample/main.go
# 构建grpc_health_probe
RUN go install github.com/grpc-ecosystem/grpc-health-probe@v0.4.12
@ -30,9 +30,10 @@ RUN apk add curl
# 添加grpc_health_probe用在grpc服务的健康检查
COPY --from=build /grpc_health_probe /bin/grpc_health_probe
COPY --from=build /sponge /app/sponge
COPY --from=build /go/src/sponge/config/conf.yml /app/config/conf.yml
COPY --from=build /serverNameExample /app/serverNameExample
COPY --from=build /go/src/serverNameExample/configs/serverNameExample.yml /app/configs/serverNameExample.yml
WORKDIR /app
CMD ["./sponge", "-c", "config/conf.yml"]
CMD ["./serverNameExample", "-c", "configs/serverNameExample.yml"]
# 使用配置中心serverNameExample.yml是配置中心的配置。
#CMD ["./serverNameExample", "-c", "configs/serverNameExample.yml", "-enable-cc"]

View File

@ -3,17 +3,20 @@ package main
import (
"context"
"flag"
"strconv"
"time"
"github.com/zhufuyi/sponge/config"
"github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/internal/server"
"github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/nacoscli"
"github.com/zhufuyi/sponge/pkg/tracer"
"github.com/jinzhu/copier"
// grpc import start
"fmt"
@ -27,11 +30,12 @@ import (
)
var (
version string
configFile string
version string
configFile string
enableConfigCenter bool
)
// @title sponge api docs
// @title serverNameExample api docs
// @description http server api docs
// @schemes http https
// @version v0.0.0
@ -49,23 +53,49 @@ func main() {
func registerInits() []app.Init {
// 初始化配置文件,必须优先执行,后面的初始化需要依赖配置
func() {
flag.StringVar(&configFile, "c", "", "配置文件")
flag.StringVar(&version, "version", "", "服务版本号")
flag.StringVar(&version, "version", "", "service Version Number")
flag.BoolVar(&enableConfigCenter, "enable-cc", false, "whether to get from the configuration center, "+
"if true, the '-c' parameter indicates the configuration center")
flag.StringVar(&configFile, "c", "", "configuration file")
flag.Parse()
if configFile == "" {
configFile = config.Path("conf.yml") // 默认配置文件config/conf.yml
}
err := config.Init(configFile)
if err != nil {
panic("init config error: " + err.Error())
if enableConfigCenter {
// 从配置中心获取配置(先获取nacos配置再根据nacos配置中心读取服务配置)
if configFile == "" {
configFile = configs.Path("serverNameExample_cc.yml")
}
nacosConfig, err := config.NewCenter(configFile)
if err != nil {
panic(err)
}
appConfig := &config.Config{}
params := &nacoscli.Params{}
_ = copier.Copy(params, &nacosConfig.Nacos)
err = nacoscli.Init(appConfig, params)
if err != nil {
panic(err)
}
if appConfig.App.Name == "" {
panic("read the config from center error, config data is empty")
}
config.Set(appConfig)
} else {
// 从本地配置文件获取配置
if configFile == "" {
configFile = configs.Path("serverNameExample.yml")
}
err := config.Init(configFile)
if err != nil {
panic("init config error: " + err.Error())
}
}
if version != "" {
config.Get().App.Version = version
}
//config.Show()
//fmt.Println(config.Show())
}()
// 执行初始化日志
// 初始化日志
func() {
_, err := logger.Init(
logger.WithLevel(config.Get().Logger.Level),

View File

@ -0,0 +1,16 @@
```bash
# todo 复制服务配置文件到configs目录下。
cd deployments/docker-compose
mkdir configs
cp ../../configs/serverNameExample.yml configs/
tree
# ├── configs
# │ └── serverNameExample.yml
# └── docker-compose.yml
```
启动服务:
> docker-compose up

View File

@ -6,15 +6,17 @@ services:
container_name: server-name-example
restart: always
command: ["./serverNameExample", "-c", "/app/configs/serverNameExample.yml"]
# todo 根据服务类型(http或grpc)选择端口
ports:
- "28080:8080" # http端口
- "29090:9090" # grpc服务端口
- "29082:9082" # grpc metrics端口
- "8080:8080" # http端口
- "8282:8282" # grpc服务端口
- "9082:9082" # grpc metrics端口
volumes:
- $PWD/configs:/app/configs
# todo 根据服务类型(http或grpc)选择健康检查
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"] # http健康检查镜像必须包含curl命令
#test: ["CMD", "grpc_health_probe", "-addr=localhost:9090"] # grpc健康检查镜像必须包含grpc_health_probe命令
#test: ["CMD", "grpc_health_probe", "-addr=localhost:8282"] # grpc健康检查镜像必须包含grpc_health_probe命令
interval: 10s # 间隔时间
timeout: 5s # 超时时间
retries: 3 # 重试次数

View File

@ -0,0 +1,17 @@
启动服务:
> kubectl apply -f ./
查看启动状态:
> kubectl get all -n project-name-example
<br>
简单测试http端口
```bash
# 在本机端口映射到服务的http端口
kubectl port-forward --address=0.0.0.0 service/server-name-example-svc 8080:8080 -n project-name-example
```

View File

@ -27,7 +27,7 @@ data:
# grpc 服务设置
grpc:
port: 9090 # 监听端口
port: 8282 # 监听端口
readTimeout: 3 # 读超时,单位(秒)
writeTimeout: 3 # 写超时,单位(秒)

View File

@ -20,11 +20,12 @@ spec:
# If using a local image, use Never, default is Always
#imagePullPolicy: Never
command: ["./serverNameExample", "-c", "/app/configs/serverNameExample.yml"]
# todo 根据服务类型(http或grpc)选择端口
ports:
- name: http-port
containerPort: 8080
- name: grpc-port
containerPort: 9090
containerPort: 8282
- name: metrics-port
containerPort: 9082
resources:
@ -38,26 +39,26 @@ spec:
- name: server-name-example-vl
mountPath: /app/configs/
readOnly: true
# todo 根据服务类型(http或grpc)选择健康检查
# 就绪探测
readinessProbe:
#httpGet:
#port: http-port
#path: /health
exec:
command: ["/bin/grpc_health_probe", "-addr=:9090"]
httpGet:
port: http-port
path: /health
#exec:
# command: ["/bin/grpc_health_probe", "-addr=:8282"]
initialDelaySeconds: 10
timeoutSeconds: 2
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
# 容器存活探测
livenessProbe:
#httpGet:
#port: http-port
#path: /health
exec:
command: ["/bin/grpc_health_probe", "-addr=:9090"]
httpGet:
port: http-port
path: /health
#exec:
# command: ["/bin/grpc_health_probe", "-addr=:8282"]
initialDelaySeconds: 10
timeoutSeconds: 2
periodSeconds: 10

View File

@ -7,13 +7,14 @@ spec:
selector:
app: server-name-example
type: ClusterIP
# todo 根据服务类型(http或grpc)选择服务端口
ports:
- name: server-name-example-svc-http-port
port: 8080
targetPort: 8080
- name: server-name-example-svc-grpc-port
port: 9090
targetPort: 9090
port: 8282
targetPort: 8282
- name: server-name-example-svc-grpc-metrics-port
port: 9082
targetPort: 9082

2
doc.go
View File

@ -1,5 +1,5 @@
/*
sponge 是一个微服务框架支持http和grpc及服务治理.
sponge is a microservices framework that supports http and grpc and service governance.
*/
package sponge

View File

@ -312,7 +312,7 @@ const docTemplate = `{
"type": "string"
},
"phone": {
"description": "手机号码,必须在前加'+86'",
"description": "手机号码",
"type": "string"
}
}
@ -402,7 +402,7 @@ const docTemplate = `{
"type": "string"
},
"phone": {
"description": "手机号码,必须在前加'+86'",
"description": "手机号码",
"type": "string"
}
}
@ -427,7 +427,7 @@ var SwaggerInfo = &swag.Spec{
Host: "localhost:8080",
BasePath: "",
Schemes: []string{"http", "https"},
Title: "sponge api docs",
Title: "serverNameExample api docs",
Description: "http server api docs",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,

View File

@ -175,26 +175,7 @@
<li>
<a href="#api%2ftypes%2ftypes.proto">api/types/types.proto</a>
<ul>
<li>
<a href="#types.Column"><span class="badge">M</span>Column</a>
</li>
<li>
<a href="#types.Params"><span class="badge">M</span>Params</a>
</li>
</ul>
</li>
<li>
<a href="#api%2fuserExample%2fv1%2fuserExample.proto">api/userExample/v1/userExample.proto</a>
<a href="#api%2fserverNameExample%2fv1%2fuserExample.proto">api/serverNameExample/v1/userExample.proto</a>
<ul>
<li>
@ -221,6 +202,14 @@
<a href="#api.userExample.v1.GetUserExampleByIDRequest"><span class="badge">M</span>GetUserExampleByIDRequest</a>
</li>
<li>
<a href="#api.userExample.v1.ListUserExampleByIDsReply"><span class="badge">M</span>ListUserExampleByIDsReply</a>
</li>
<li>
<a href="#api.userExample.v1.ListUserExampleByIDsRequest"><span class="badge">M</span>ListUserExampleByIDsRequest</a>
</li>
<li>
<a href="#api.userExample.v1.ListUserExampleReply"><span class="badge">M</span>ListUserExampleReply</a>
</li>
@ -255,6 +244,25 @@
</ul>
</li>
<li>
<a href="#api%2ftypes%2ftypes.proto">api/types/types.proto</a>
<ul>
<li>
<a href="#types.Column"><span class="badge">M</span>Column</a>
</li>
<li>
<a href="#types.Params"><span class="badge">M</span>Params</a>
</li>
</ul>
</li>
<li><a href="#scalar-value-types">Scalar Value Types</a></li>
</ul>
</div>
@ -262,111 +270,7 @@
<div class="file-heading">
<h2 id="api/types/types.proto">api/types/types.proto</h2><a href="#title">Top</a>
</div>
<p></p>
<h3 id="types.Column">Column</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>列名 </p></td>
</tr>
<tr>
<td>exp</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>表达式,值为空时默认为=,有=、!=、&gt;&gt;=、&lt;&lt;=、like七种类型 </p></td>
</tr>
<tr>
<td>value</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>列值 </p></td>
</tr>
<tr>
<td>logic</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>逻辑类型值为空时默认为and&amp;(and)、||(or)两种类型 </p></td>
</tr>
</tbody>
</table>
<h3 id="types.Params">Params</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>page</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>页码从0开始 </p></td>
</tr>
<tr>
<td>limit</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>每页行数 </p></td>
</tr>
<tr>
<td>sort</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>排序字段,多列排序用逗号分隔 </p></td>
</tr>
<tr>
<td>columns</td>
<td><a href="#types.Column">Column</a></td>
<td>repeated</td>
<td><p>查询条件 </p></td>
</tr>
</tbody>
</table>
<div class="file-heading">
<h2 id="api/userExample/v1/userExample.proto">api/userExample/v1/userExample.proto</h2><a href="#title">Top</a>
<h2 id="api/serverNameExample/v1/userExample.proto">api/serverNameExample/v1/userExample.proto</h2><a href="#title">Top</a>
</div>
<p></p>
@ -478,7 +382,7 @@
<td>gender</td>
<td><a href="#api.userExample.v1.GenderType">GenderType</a></td>
<td></td>
<td><p>性别1:男2:女 </p></td>
<td><p>性别,0:未知,1:男2:女 </p></td>
</tr>
</tbody>
@ -716,6 +620,54 @@
<h3 id="api.userExample.v1.ListUserExampleByIDsReply">ListUserExampleByIDsReply</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>userExamples</td>
<td><a href="#api.userExample.v1.UserExample">UserExample</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h3 id="api.userExample.v1.ListUserExampleByIDsRequest">ListUserExampleByIDsRequest</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>ids</td>
<td><a href="#uint64">uint64</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h3 id="api.userExample.v1.ListUserExampleReply">ListUserExampleReply</h3>
<p></p>
@ -1084,6 +1036,13 @@
<td><p></p></td>
</tr>
<tr>
<td>ListByIDs</td>
<td><a href="#api.userExample.v1.ListUserExampleByIDsRequest">ListUserExampleByIDsRequest</a></td>
<td><a href="#api.userExample.v1.ListUserExampleByIDsReply">ListUserExampleByIDsReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>List</td>
<td><a href="#api.userExample.v1.ListUserExampleRequest">ListUserExampleRequest</a></td>
@ -1096,6 +1055,110 @@
<div class="file-heading">
<h2 id="api/types/types.proto">api/types/types.proto</h2><a href="#title">Top</a>
</div>
<p></p>
<h3 id="types.Column">Column</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>列名 </p></td>
</tr>
<tr>
<td>exp</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>表达式,值为空时默认为=,有=、!=、&gt;&gt;=、&lt;&lt;=、like七种类型 </p></td>
</tr>
<tr>
<td>value</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>列值 </p></td>
</tr>
<tr>
<td>logic</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>逻辑类型值为空时默认为and只有&amp;(and)、||(or)两种类型 </p></td>
</tr>
</tbody>
</table>
<h3 id="types.Params">Params</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>page</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>页码从0开始 </p></td>
</tr>
<tr>
<td>limit</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>每页行数 </p></td>
</tr>
<tr>
<td>sort</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>排序字段,多列排序用逗号分隔 </p></td>
</tr>
<tr>
<td>columns</td>
<td><a href="#types.Column">Column</a></td>
<td>repeated</td>
<td><p>查询条件 </p></td>
</tr>
</tbody>
</table>
<h2 id="scalar-value-types">Scalar Value Types</h2>
<table class="scalar-value-types-table">

View File

@ -6,7 +6,7 @@
"swagger": "2.0",
"info": {
"description": "http server api docs",
"title": "sponge api docs",
"title": "serverNameExample api docs",
"contact": {},
"version": "v0.0.0"
},
@ -308,7 +308,7 @@
"type": "string"
},
"phone": {
"description": "手机号码,必须在前加'+86'",
"description": "手机号码",
"type": "string"
}
}
@ -398,7 +398,7 @@
"type": "string"
},
"phone": {
"description": "手机号码,必须在前加'+86'",
"description": "手机号码",
"type": "string"
}
}

View File

@ -38,7 +38,7 @@ definitions:
description: 密码
type: string
phone:
description: 手机号码,必须在前加'+86'
description: 手机号码
type: string
type: object
handler.GetUserExamplesByIDsRequest:
@ -102,7 +102,7 @@ definitions:
description: 密码
type: string
phone:
description: 手机号码,必须在前加'+86'
description: 手机号码
type: string
type: object
handlerfunc.checkHealthResponse:
@ -116,7 +116,7 @@ host: localhost:8080
info:
contact: {}
description: http server api docs
title: sponge api docs
title: serverNameExample api docs
version: v0.0.0
paths:
/api/v1/userExample:

8
go.mod
View File

@ -25,7 +25,7 @@ require (
github.com/hashicorp/consul/api v1.12.0
github.com/huandu/xstrings v1.3.1
github.com/jinzhu/copier v0.3.5
github.com/nacos-group/nacos-sdk-go v1.1.2
github.com/nacos-group/nacos-sdk-go/v2 v2.1.0
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/prometheus/client_golang v1.13.0
github.com/reugn/equalizer v0.0.0-20210216135016-a959c509d7ad
@ -47,7 +47,7 @@ require (
go.opentelemetry.io/otel/trace v1.9.0
go.uber.org/zap v1.21.0
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9
google.golang.org/grpc v1.48.0
google.golang.org/protobuf v1.28.1
gorm.io/driver/mysql v1.3.5
@ -67,6 +67,7 @@ require (
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
@ -83,7 +84,6 @@ require (
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
@ -97,6 +97,7 @@ require (
github.com/goccy/go-json v0.9.7 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.2.0 // indirect
@ -110,6 +111,7 @@ require (
github.com/jinzhu/configor v1.1.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/leodido/go-urn v1.2.1 // indirect

26
go.sum
View File

@ -92,7 +92,8 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZp
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
github.com/alicebob/miniredis/v2 v2.23.0 h1:+lwAJYjvvdIVg6doFHuotFjueJ/7KY10xo/vm3X3Scw=
github.com/alicebob/miniredis/v2 v2.23.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88=
github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk=
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 h1:PpfENOj/vPfhhy9N2OFRjpue0hjM5XqAp2thFmkXXIk=
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU=
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=
@ -191,8 +192,6 @@ github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/
github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do=
github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8=
github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
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=
@ -407,6 +406,7 @@ github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkr
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
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=
@ -493,8 +493,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nacos-group/nacos-sdk-go v1.1.2 h1:lWTpf5SXLetQetS7p31eGic/ncqsnn0Zbau1i3eC25Y=
github.com/nacos-group/nacos-sdk-go v1.1.2/go.mod h1:I8Vj4M8ZLpBk7EY2A8RXQE1SbfCA7b56TJBPIFTrUYE=
github.com/nacos-group/nacos-sdk-go/v2 v2.1.0 h1:PxRwOzHhnK6eGGvioEGkn8s6XRXmUVuXu91i2yQcdDs=
github.com/nacos-group/nacos-sdk-go/v2 v2.1.0/go.mod h1:ys/1adWeKXXzbNWfRNbaFlX/t6HVLWdpsNDvmoWTw0g=
github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM=
github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
@ -543,6 +543,7 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU=
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
@ -585,11 +586,9 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs=
github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg=
github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM=
@ -683,18 +682,14 @@ go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47
go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
@ -837,6 +832,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
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/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc=
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -943,8 +939,8 @@ 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/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M=
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 h1:ftMN5LMiBFjbzleLqtoBZk7KdJwhuybIU+FckUHgoyQ=
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/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=
@ -962,8 +958,6 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn
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-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/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=
@ -1196,7 +1190,7 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y=
gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4=
gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=

View File

@ -4,7 +4,7 @@ import (
"context"
"time"
"github.com/zhufuyi/sponge/internal/serverNameExample/model"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/cache"
"github.com/zhufuyi/sponge/pkg/encoding"
"github.com/zhufuyi/sponge/pkg/utils"

View File

@ -4,7 +4,7 @@ import (
"testing"
"time"
"github.com/zhufuyi/sponge/internal/serverNameExample/model"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/gotest"
"github.com/zhufuyi/sponge/pkg/utils"

View File

@ -6,8 +6,8 @@ import (
"fmt"
"time"
"github.com/zhufuyi/sponge/internal/serverNameExample/cache"
"github.com/zhufuyi/sponge/internal/serverNameExample/model"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/model"
cacheBase "github.com/zhufuyi/sponge/pkg/cache"
"github.com/zhufuyi/sponge/pkg/goredis"
"github.com/zhufuyi/sponge/pkg/mysql/query"

View File

@ -4,8 +4,8 @@ import (
"testing"
"time"
"github.com/zhufuyi/sponge/internal/serverNameExample/cache"
"github.com/zhufuyi/sponge/internal/serverNameExample/model"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/gotest"
"github.com/zhufuyi/sponge/pkg/mysql/query"

View File

@ -1,6 +1,8 @@
package ecode
import "github.com/zhufuyi/sponge/pkg/errcode"
import (
"github.com/zhufuyi/sponge/pkg/errcode"
)
// nolint
// rpc系统级别错误码有status前缀错误码范围300000~400000

View File

@ -1,6 +1,8 @@
package ecode
import "github.com/zhufuyi/sponge/pkg/errcode"
import (
"github.com/zhufuyi/sponge/pkg/errcode"
)
const (
// todo must be modified manually

View File

@ -1,6 +1,8 @@
package ecode
import "github.com/zhufuyi/sponge/pkg/errcode"
import (
"github.com/zhufuyi/sponge/pkg/errcode"
)
// nolint
// http系统级别错误码无Err前缀错误码范围100000~200000

View File

@ -1,6 +1,8 @@
package ecode
import "github.com/zhufuyi/sponge/pkg/errcode"
import (
"github.com/zhufuyi/sponge/pkg/errcode"
)
const (
// todo must be modified manually

View File

@ -3,10 +3,10 @@ package handler
import (
"time"
"github.com/zhufuyi/sponge/internal/serverNameExample/cache"
"github.com/zhufuyi/sponge/internal/serverNameExample/dao"
"github.com/zhufuyi/sponge/internal/serverNameExample/ecode"
"github.com/zhufuyi/sponge/internal/serverNameExample/model"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/gin/response"
"github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/mysql/query"
@ -270,7 +270,7 @@ type CreateUserExampleRequest struct {
Name string `json:"name" binding:"min=2"` // 名称
Email string `json:"email" binding:"email"` // 邮件
Password string `json:"password" binding:"md5"` // 密码
Phone string `form:"phone" binding:"e164"` // 手机号码,必须在前加'+86'
Phone string `form:"phone" binding:"e164"` // 手机号码,e164表示<+国家编号><手机号码>
Avatar string `form:"avatar" binding:"min=5"` // 头像
Age int `form:"age" binding:"gt=0,lt=120"` // 年龄
Gender int `form:"gender" binding:"gte=0,lte=2"` // 性别1:男2:女
@ -282,7 +282,7 @@ type UpdateUserExampleByIDRequest struct {
Name string `json:"name" binding:""` // 名称
Email string `json:"email" binding:""` // 邮件
Password string `json:"password" binding:""` // 密码
Phone string `form:"phone" binding:""` // 手机号码,必须在前加'+86'
Phone string `form:"phone" binding:""` // 手机号码
Avatar string `form:"avatar" binding:""` // 头像
Age int `form:"age" binding:""` // 年龄
Gender int `form:"gender" binding:""` // 性别1:男2:女

View File

@ -5,9 +5,9 @@ import (
"testing"
"time"
"github.com/zhufuyi/sponge/internal/serverNameExample/cache"
"github.com/zhufuyi/sponge/internal/serverNameExample/dao"
"github.com/zhufuyi/sponge/internal/serverNameExample/model"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/gohttp"
"github.com/zhufuyi/sponge/pkg/gotest"
"github.com/zhufuyi/sponge/pkg/mysql/query"

View File

@ -4,7 +4,7 @@ import (
"sync"
"time"
"github.com/zhufuyi/sponge/internal/serverNameExample/config"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/pkg/goredis"
"github.com/zhufuyi/sponge/pkg/mysql"
@ -76,7 +76,11 @@ func CloseMysql() error {
// InitRedis 连接redis
func InitRedis() {
opts := []goredis.Option{}
opts := []goredis.Option{
goredis.WithDialTimeout(time.Duration(config.Get().Redis.DialTimeout) * time.Second),
goredis.WithReadTimeout(time.Duration(config.Get().Redis.ReadTimeout) * time.Second),
goredis.WithWriteTimeout(time.Duration(config.Get().Redis.WriteTimeout) * time.Second),
}
if config.Get().App.EnableTracing {
opts = append(opts, goredis.WithEnableTrace())
}

View File

@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/serverNameExample/config"
"github.com/zhufuyi/sponge/internal/config"
)
// 测试时需要连接真实数据

View File

@ -5,7 +5,7 @@ import (
"strings"
"github.com/zhufuyi/sponge/docs"
"github.com/zhufuyi/sponge/internal/serverNameExample/config"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/pkg/gin/handlerfunc"
"github.com/zhufuyi/sponge/pkg/gin/middleware"
"github.com/zhufuyi/sponge/pkg/gin/middleware/metrics"

View File

@ -3,11 +3,11 @@ package routers
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/serverNameExample/config"
"github.com/zhufuyi/sponge/internal/config"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
)
func TestNewRouter(t *testing.T) {

View File

@ -1,7 +1,7 @@
package routers
import (
"github.com/zhufuyi/sponge/internal/serverNameExample/handler"
"github.com/zhufuyi/sponge/internal/handler"
"github.com/gin-gonic/gin"
)

View File

@ -8,8 +8,8 @@ import (
"net/http"
"time"
"github.com/zhufuyi/sponge/internal/serverNameExample/config"
"github.com/zhufuyi/sponge/internal/serverNameExample/service"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/service"
"github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/grpc/interceptor"
"github.com/zhufuyi/sponge/pkg/grpc/metrics"
@ -105,7 +105,7 @@ func (s *grpcServer) serverOptions() []grpc.ServerOption {
if s == nil || s.server == nil {
return errors.New("grpc server is nil")
}
promAddr := fmt.Sprintf(":%d", config.Get().Metrics.Port)
promAddr := fmt.Sprintf(":%d", config.Get().Grpc.MetricsPort)
s.metricsHTTPServer = metrics.GoHTTPService(promAddr, s.server)
logger.Infof("start up grpc metrics service, addr = %s", promAddr)
return nil

View File

@ -6,7 +6,7 @@ import (
"time"
"github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/serverNameExample/config"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/pkg/registry"
"github.com/zhufuyi/sponge/pkg/utils"
@ -25,7 +25,7 @@ func TestGRPCServer(t *testing.T) {
port, _ := utils.GetAvailablePort()
addr := fmt.Sprintf(":%d", port)
instance := registry.NewServiceInstance("foo", []string{"grpc://127.0.0.1:9090"})
instance := registry.NewServiceInstance("foo", []string{"grpc://127.0.0.1:8282"})
server := NewGRPCServer(addr,
WithGRPCReadTimeout(time.Second),

View File

@ -6,7 +6,7 @@ import (
"net/http"
"time"
"github.com/zhufuyi/sponge/internal/serverNameExample/routers"
"github.com/zhufuyi/sponge/internal/routers"
"github.com/zhufuyi/sponge/pkg/app"
"github.com/gin-gonic/gin"

View File

@ -6,7 +6,7 @@ import (
"time"
"github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/serverNameExample/config"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/pkg/utils"
"github.com/gin-gonic/gin"

View File

@ -4,10 +4,10 @@ import (
"context"
pb "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"github.com/zhufuyi/sponge/internal/serverNameExample/cache"
"github.com/zhufuyi/sponge/internal/serverNameExample/dao"
"github.com/zhufuyi/sponge/internal/serverNameExample/ecode"
"github.com/zhufuyi/sponge/internal/serverNameExample/model"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/mysql/query"

View File

@ -6,12 +6,12 @@ package service
import (
"context"
"fmt"
"github.com/zhufuyi/sponge/internal/config"
"testing"
pb "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"github.com/zhufuyi/sponge/api/types"
"github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/serverNameExample/config"
"github.com/zhufuyi/sponge/pkg/grpc/benchmark"
"google.golang.org/grpc"
@ -53,10 +53,10 @@ func Test_userExampleService_methods(t *testing.T) {
fn: func() (interface{}, error) {
// todo test after filling in parameters
return cli.Create(ctx, &pb.CreateUserExampleRequest{
Name: "宋九",
Name: "foo7",
Email: "foo7@bar.com",
Password: "f447b20a7fcbf53a5d5be013ea0b15af",
Phone: "+8618576552066",
Phone: "18666666666",
Avatar: "http://internal.com/7.jpg",
Age: 21,
Gender: 2,

View File

@ -1,14 +1,14 @@
package service
import (
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/model"
"testing"
"time"
pb "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"github.com/zhufuyi/sponge/api/types"
"github.com/zhufuyi/sponge/internal/serverNameExample/cache"
"github.com/zhufuyi/sponge/internal/serverNameExample/dao"
"github.com/zhufuyi/sponge/internal/serverNameExample/model"
"github.com/zhufuyi/sponge/pkg/gotest"
"github.com/DATA-DOG/go-sqlmock"

View File

@ -4,12 +4,6 @@
<br>
### 安装
> go get -u github.com/zhufuyi/pkg/app
<br>
### 使用示例
```go

View File

@ -2,16 +2,23 @@
解析yaml、json、toml配置文件到go struct结合[goctl](https://github.com/zhufuyi/goctl)工具自动生成config.go到指定目录例如
> goctl covert yaml --file=test.yaml --tags=json --out=/yourProjectName/config。
<br>
### 安装
> go get -u github.com/zhufuyi/pkg/conf
> goctl covert yaml --file=test.yaml --tags=json --out=yourServerName/config。
<br>
### 使用示例
具体示例看[config](internal/config)。
```go
// 方式一:无监听配置文件
conf := &App{}
err := Parse("test.yml", conf)
// 方式二:开启监听配置文件
conf := &App{}
fs := []func(){
func() {
fmt.Println("监听到配置文件有更新")
},
}
err := Parse("test.yml", conf, fs...)
```

View File

@ -55,7 +55,6 @@ func watchConfig(obj interface{}, fs ...func()) {
if err != nil {
fmt.Println("viper.Unmarshal error: ", err)
} else {
// 更新初始化
for _, f := range fs {
f()
}

View File

@ -3,6 +3,7 @@ package conf
import (
"fmt"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
@ -51,3 +52,28 @@ func Test_watchConfig(t *testing.T) {
watchConfig(c)
}
// 测试监听配置文件更新
func TestWatch(t *testing.T) {
conf := make(map[string]interface{})
fs := []func(){
func() {
fmt.Println("更新字段1")
},
func() {
fmt.Println("更新字段2")
},
}
err := Parse("test.yml", &conf, fs...)
if err != nil {
t.Error(err)
return
}
for i := 0; i < 1; i++ { // 设置在等待时间内修改配置文件env字段查看是否有变化
fmt.Println(conf["app"])
time.Sleep(time.Second)
}
}

View File

@ -1,7 +1,7 @@
# app 设置
app:
name: "userExample" # 服务名称
env: "dev" # 运行环境dev:开发环境prod:生产环境pre:预生产环境
env: "dev1" # 运行环境dev:开发环境prod:生产环境pre:预生产环境
version: "v0.0.0" # 版本

View File

@ -51,7 +51,7 @@ func Test_discoveryResolver_Close(t *testing.T) {
r.ResolveNow(resolver.ResolveNowOptions{})
r.update([]*registry.ServiceInstance{registry.NewServiceInstance(
"demo",
[]string{"grpc://127.0.0.1:9090"},
[]string{"grpc://127.0.0.1:8282"},
)})
r.watch()
}

View File

@ -13,12 +13,6 @@
<br>
### 安装
> go get -u github.com/zhufuyi/pkg/errcode
<br>
### 使用示例
### http错误码使用示例

View File

@ -4,12 +4,6 @@ gin中间件插件。
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/gin/middleware
<br>
## 使用示例
### 日志中间件

View File

@ -4,12 +4,6 @@ gin `path` or `ip` limit.
<br>
### Install
> go get -u github.com/zhufuyi/pkg/gin/middleware/ratelimiter
<br>
### Usage
```go

View File

@ -1,12 +1,6 @@
## response
封装gin返回json数据插件。
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/gin/response
封装gin返回同一个格式的json数据。
<br>

View File

@ -4,12 +4,6 @@ gin请求参数校验。
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/gin/validator
<br>
## 使用示例
```go

View File

@ -4,12 +4,6 @@
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/gofile
<br>
## 使用示例
```go

View File

@ -4,12 +4,6 @@ http请求客户端只支持返回json格式。
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/gohttp
<br>
## 使用示例
### 标准CURD

View File

@ -4,12 +4,6 @@
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/goredis
<br>
## 使用示例
```go

View File

@ -14,28 +14,15 @@ const (
DefaultRedisName = "default"
)
// RedisClient redis 客户端
var RedisClient *redis.Client
// Init 连接redis
// redisURL 支持格式:
// dsn 支持格式:
// 没有密码没有dblocalhost:6379
// 有密码有db<user>:<pass>@localhost:6379/2
func Init(redisURL string, opts ...Option) (*redis.Client, error) {
func Init(dsn string, opts ...Option) (*redis.Client, error) {
o := defaultOptions()
o.apply(opts...)
if len(redisURL) > 8 {
if !strings.Contains(redisURL[len(redisURL)-3:], "/") {
redisURL += "/0" // 默认使用db 0
}
if redisURL[:8] != "redis://" {
redisURL = "redis://" + redisURL
}
}
opt, err := redis.ParseURL(redisURL)
opt, err := getRedisOpt(dsn, o)
if err != nil {
return nil, err
}
@ -48,3 +35,53 @@ func Init(redisURL string, opts ...Option) (*redis.Client, error) {
return rdb, nil
}
func getRedisOpt(dsn string, opts *options) (*redis.Options, error) {
if len(dsn) > 8 {
if !strings.Contains(dsn[len(dsn)-3:], "/") {
dsn += "/0" // 默认使用db 0
}
if dsn[:8] != "redis://" {
dsn = "redis://" + dsn
}
}
redisOpts, err := redis.ParseURL(dsn)
if err != nil {
return nil, err
}
if opts.dialTimeout > 0 {
redisOpts.DialTimeout = opts.dialTimeout
}
if opts.readTimeout > 0 {
redisOpts.ReadTimeout = opts.readTimeout
}
if opts.writeTimeout > 0 {
redisOpts.WriteTimeout = opts.writeTimeout
}
return redisOpts, nil
}
// Init2 连接redis
func Init2(addr string, password string, db int, opts ...Option) *redis.Client {
o := defaultOptions()
o.apply(opts...)
rdb := redis.NewClient(&redis.Options{
Addr: addr,
Password: password,
DB: db,
DialTimeout: o.dialTimeout,
ReadTimeout: o.readTimeout,
WriteTimeout: o.writeTimeout,
})
if o.enableTrace { // 根据设置是否开启链路跟踪
rdb.AddHook(redisotel.TracingHook{})
}
return rdb
}

View File

@ -1,10 +1,15 @@
package goredis
import "time"
// Option set the redis options.
type Option func(*options)
type options struct {
enableTrace bool
enableTrace bool
dialTimeout time.Duration
readTimeout time.Duration
writeTimeout time.Duration
}
func (o *options) apply(opts ...Option) {
@ -26,3 +31,24 @@ func WithEnableTrace() Option {
o.enableTrace = true
}
}
// WithDialTimeout set dail timeout
func WithDialTimeout(t time.Duration) Option {
return func(o *options) {
o.dialTimeout = t
}
}
// WithReadTimeout set read timeout
func WithReadTimeout(t time.Duration) Option {
return func(o *options) {
o.readTimeout = t
}
}
// WithWriteTimeout set write timeout
func WithWriteTimeout(t time.Duration) Option {
return func(o *options) {
o.writeTimeout = t
}
}

View File

@ -2,13 +2,6 @@
gotest是一个模拟测试cache、dao、handler的库。
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/gotest
<br>
## 使用示例

View File

@ -6,8 +6,8 @@
```go
func benchmarkExample() error {
host := "127.0.0.1:9090"
protoFile := "api/userExample/v1/userExample.proto"
host := "127.0.0.1:8282"
protoFile := "api/serverNameExample/v1/userExample.proto"
// 如果压测过程中缺少第三方依赖复制到项目的third_party目录下(不包括import路径)
importPaths := []string{"third_party"}
message := &pb.GetUserExampleByIDRequest{

View File

@ -8,18 +8,18 @@ import (
)
func TestDial(t *testing.T) {
_, err := Dial(context.Background(), "localhost:9090")
_, err := Dial(context.Background(), "localhost:8282")
assert.NotNil(t, err)
}
func TestDialInsecure(t *testing.T) {
_, err := DialInsecure(context.Background(), "localhost:9090")
_, err := DialInsecure(context.Background(), "localhost:8282")
assert.NoError(t, err)
}
func Test_dial(t *testing.T) {
_, err := dial(context.Background(), "localhost:9090", true)
_, err := dial(context.Background(), "localhost:8282", true)
assert.NotNil(t, err)
_, err = dial(context.Background(), "localhost:9090", false)
_, err = dial(context.Background(), "localhost:8282", false)
assert.NoError(t, err)
}

View File

@ -11,7 +11,7 @@ import (
var r = &ResolverBuilder{
SchemeVal: "grpc",
ServiceName: "demo",
Addrs: []string{"localhost:9090"},
Addrs: []string{"localhost:8282"},
}
func TestRegister(t *testing.T) {

View File

@ -4,12 +4,6 @@ token生成和验证。
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/jwt
<br>
## 使用示例
```go

View File

@ -42,13 +42,13 @@ func TestVerifyTokenStandard(t *testing.T) {
// token已过期
Init(
WithSigningKey("123456"),
WithExpire(time.Millisecond*200),
WithExpire(time.Second),
)
token, err = GenerateTokenStandard()
if err != nil {
t.Fatal(err)
}
time.Sleep(time.Second)
time.Sleep(time.Second * 2)
err = VerifyTokenStandard(token)
assert.Equal(t, err, errExpired)
}

View File

@ -4,12 +4,6 @@
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/krand
<br>
## 使用示例
### 生成随机字符串

View File

@ -8,12 +8,6 @@
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/logger
<br>
## 使用示例
支持Debug、Info、Warn、Error、Panic、Fatal也支持类似fmt.Printf打印日志Debugf、Infof、Warnf、Errorf、Panicf、Fatalf

View File

@ -4,12 +4,6 @@
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/mysql
<br>
## 使用示例
### 初始化连接示例

View File

@ -24,8 +24,8 @@ func setETCDRegistry(etcdEndpoints []string) registry.Registry {
}
func registryExample() {
// endpoint组成schema://ip例如grpc://127.0.0.1:9090, http://127.0.0.1:8080
endpoints:=[]string{"grpc://127.0.0.1:9090"}
// endpoint组成schema://ip例如grpc://127.0.0.1:8282, http://127.0.0.1:8080
endpoints:=[]string{"grpc://127.0.0.1:8282"}
serviceInstance := registry.NewServiceInstance("user", endpoints,
//registry.WithID("1"), // 服务id唯一编号
//registry.WithVersion("v0.0.1"), // 服务版本

View File

@ -16,7 +16,7 @@ import (
)
func TestGRPCSeverRegistry(t *testing.T) {
instance := registry.NewServiceInstance("foo", []string{"grpc://127.0.0.1:9090"})
instance := registry.NewServiceInstance("foo", []string{"grpc://127.0.0.1:8282"})
cli, err := clientv3.New(clientv3.Config{
Endpoints: []string{"192.168.3.37:2379"},

View File

@ -9,9 +9,9 @@ import (
"github.com/zhufuyi/sponge/pkg/registry"
"github.com/nacos-group/nacos-sdk-go/clients/naming_client"
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/vo"
"github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client"
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
)
var (
@ -82,7 +82,7 @@ func New(cli naming_client.INamingClient, opts ...Option) (r *Registry) {
// Register the registration.
func (r *Registry) Register(_ context.Context, si *registry.ServiceInstance) error {
if si.Name == "" {
return fmt.Errorf("eagle/nacos: serviceInstance.name can not be empty")
return fmt.Errorf("nacos: serviceInstance.name can not be empty")
}
for _, endpoint := range si.Endpoints {
u, err := url.Parse(endpoint)

View File

@ -0,0 +1,28 @@
package nacos
import (
"testing"
"github.com/nacos-group/nacos-sdk-go/v2/clients"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
"github.com/stretchr/testify/assert"
)
func TestNew(t *testing.T) {
namingClient, err := clients.NewNamingClient(
vo.NacosClientParam{
ClientConfig: nil,
ServerConfigs: nil,
},
)
assert.Error(t, err)
r := New(namingClient,
WithPrefix("/micro"),
WithWeight(1),
WithCluster("cluster"),
WithGroup("dev"),
WithDefaultKind("grpc"),
)
assert.NotNil(t, r)
}

View File

@ -6,9 +6,9 @@ import (
"github.com/zhufuyi/sponge/pkg/registry"
"github.com/nacos-group/nacos-sdk-go/clients/naming_client"
"github.com/nacos-group/nacos-sdk-go/model"
"github.com/nacos-group/nacos-sdk-go/vo"
"github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client"
"github.com/nacos-group/nacos-sdk-go/v2/model"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
)
var _ registry.Watcher = (*watcher)(nil)
@ -39,7 +39,7 @@ func newWatcher(ctx context.Context, cli naming_client.INamingClient, serviceNam
ServiceName: serviceName,
Clusters: clusters,
GroupName: groupName,
SubscribeCallback: func(services []model.SubscribeService, err error) {
SubscribeCallback: func(services []model.Instance, err error) {
w.watchChan <- struct{}{}
},
})

View File

@ -6,7 +6,7 @@ import (
)
func TestNewServiceInstance(t *testing.T) {
s := NewServiceInstance("demo", []string{"grpc://127.0.0.1:9090"},
s := NewServiceInstance("demo", []string{"grpc://127.0.0.1:8282"},
WithID("1"),
WithVersion("v1.0.0"),
WithMetadata(map[string]string{"foo": "bar"}),

View File

@ -4,12 +4,6 @@
<br>
## 安装
> go get -u github.com/zhufuyi/pkg/tracer
<br>
## 使用示例
初始化trace指定exporter和resource。

View File

@ -1,8 +1,8 @@
#!/bin/bash
serverName="sponge"
serverName="serverNameExample"
binaryFile="cmd/sponge/${serverName}"
binaryFile="cmd/${serverName}/${serverName}"
if [ -f "${serverName}" ] ;then
rm "${serverName}"
@ -18,8 +18,7 @@ function checkResult() {
sleep 0.2
# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${serverName}
#go build -o ${serverName}
go build -o ${binaryFile} cmd/sponge/main.go
go build -o ${binaryFile} cmd/${serverName}/main.go
checkResult $?
# 运行服务

View File

@ -0,0 +1,14 @@
version: "3"
services:
nacos:
image: nacos/nacos-server:v2.1.1
container_name: nacos-standalone
environment:
- PREFER_HOST_MODE=hostname
- MODE=standalone
volumes:
- ./standalone-logs/:/home/nacos/logs
- ./init.d/custom.properties:/home/nacos/init.d/custom.properties
ports:
- "8848:8848"
- "9848:9848"