refactor: 统一 Docker 服务命名规范,全小写横杠分隔

This commit is contained in:
fish
2026-03-28 18:28:01 +08:00
parent 9aef457ce9
commit 075a0d2441
6 changed files with 1302 additions and 41 deletions

292
backend/common/common.pb.go Normal file
View File

@@ -0,0 +1,292 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v6.31.1
// source: shared/proto/common.proto
package common
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Empty struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Empty) Reset() {
*x = Empty{}
mi := &file_shared_proto_common_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Empty) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Empty) ProtoMessage() {}
func (x *Empty) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
func (*Empty) Descriptor() ([]byte, []int) {
return file_shared_proto_common_proto_rawDescGZIP(), []int{0}
}
type Status struct {
state protoimpl.MessageState `protogen:"open.v1"`
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Status) Reset() {
*x = Status{}
mi := &file_shared_proto_common_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Status) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Status) ProtoMessage() {}
func (x *Status) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Status.ProtoReflect.Descriptor instead.
func (*Status) Descriptor() ([]byte, []int) {
return file_shared_proto_common_proto_rawDescGZIP(), []int{1}
}
func (x *Status) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *Status) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *Status) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
type Pagination struct {
state protoimpl.MessageState `protogen:"open.v1"`
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
Total int32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Pagination) Reset() {
*x = Pagination{}
mi := &file_shared_proto_common_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Pagination) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Pagination) ProtoMessage() {}
func (x *Pagination) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Pagination.ProtoReflect.Descriptor instead.
func (*Pagination) Descriptor() ([]byte, []int) {
return file_shared_proto_common_proto_rawDescGZIP(), []int{2}
}
func (x *Pagination) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *Pagination) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *Pagination) GetTotal() int32 {
if x != nil {
return x.Total
}
return 0
}
type IdRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *IdRequest) Reset() {
*x = IdRequest{}
mi := &file_shared_proto_common_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *IdRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IdRequest) ProtoMessage() {}
func (x *IdRequest) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IdRequest.ProtoReflect.Descriptor instead.
func (*IdRequest) Descriptor() ([]byte, []int) {
return file_shared_proto_common_proto_rawDescGZIP(), []int{3}
}
func (x *IdRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
var File_shared_proto_common_proto protoreflect.FileDescriptor
const file_shared_proto_common_proto_rawDesc = "" +
"\n" +
"\x19shared/proto/common.proto\x12\x06common\"\a\n" +
"\x05Empty\"P\n" +
"\x06Status\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\x12\x12\n" +
"\x04code\x18\x03 \x01(\tR\x04code\"S\n" +
"\n" +
"Pagination\x12\x12\n" +
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" +
"\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x14\n" +
"\x05total\x18\x03 \x01(\x05R\x05total\"\x1b\n" +
"\tIdRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02idB\n" +
"Z\b./commonb\x06proto3"
var (
file_shared_proto_common_proto_rawDescOnce sync.Once
file_shared_proto_common_proto_rawDescData []byte
)
func file_shared_proto_common_proto_rawDescGZIP() []byte {
file_shared_proto_common_proto_rawDescOnce.Do(func() {
file_shared_proto_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_shared_proto_common_proto_rawDesc), len(file_shared_proto_common_proto_rawDesc)))
})
return file_shared_proto_common_proto_rawDescData
}
var file_shared_proto_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_shared_proto_common_proto_goTypes = []any{
(*Empty)(nil), // 0: common.Empty
(*Status)(nil), // 1: common.Status
(*Pagination)(nil), // 2: common.Pagination
(*IdRequest)(nil), // 3: common.IdRequest
}
var file_shared_proto_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_shared_proto_common_proto_init() }
func file_shared_proto_common_proto_init() {
if File_shared_proto_common_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_shared_proto_common_proto_rawDesc), len(file_shared_proto_common_proto_rawDesc)),
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_shared_proto_common_proto_goTypes,
DependencyIndexes: file_shared_proto_common_proto_depIdxs,
MessageInfos: file_shared_proto_common_proto_msgTypes,
}.Build()
File_shared_proto_common_proto = out.File
file_shared_proto_common_proto_goTypes = nil
file_shared_proto_common_proto_depIdxs = nil
}

View File

@@ -1,42 +1,47 @@
version: '3.8' version: '3.8'
services: services:
nginx: asset-helper-nginx:
image: nginx:1.25-alpine image: nginx:1.25-alpine
container_name: asset-helper-nginx-dev
ports: ports:
- "80:80" - "80:80"
volumes: volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on: depends_on:
- gateway - asset-helper-gateway
networks: networks:
- backend-network - asset-helper-network
gateway: asset-helper-gateway:
build: build:
context: ./gateway context: ./gateway
dockerfile: Dockerfile dockerfile: Dockerfile
image: asset-helper-gateway
container_name: asset-helper-gateway-dev
ports: ports:
- "8080:8080" - "8080:8080"
environment: environment:
- GO_ENV=development - GO_ENV=development
- REDIS_ADDR=redis:6379 - REDIS_ADDR=asset-helper-redis:6379
volumes: volumes:
- ./gateway:/app - ./gateway:/app
depends_on: depends_on:
- redis - asset-helper-redis
networks: networks:
- backend-network - asset-helper-network
user-svc: asset-helper-user-svc:
build: build:
context: ./services/user-svc context: ./services/user-svc
dockerfile: Dockerfile dockerfile: Dockerfile
image: asset-helper-user-svc
container_name: asset-helper-user-svc-dev
ports: ports:
- "50051:50051" - "50051:50051"
environment: environment:
- GO_ENV=development - GO_ENV=development
- POSTGRES_HOST=postgres - POSTGRES_HOST=asset-helper-postgres
- POSTGRES_PORT=5432 - POSTGRES_PORT=5432
- POSTGRES_USER=admin - POSTGRES_USER=admin
- POSTGRES_PASSWORD=password - POSTGRES_PASSWORD=password
@@ -44,12 +49,13 @@ services:
volumes: volumes:
- ./services/user-svc:/app - ./services/user-svc:/app
depends_on: depends_on:
- postgres - asset-helper-postgres
networks: networks:
- backend-network - asset-helper-network
postgres: asset-helper-postgres:
image: postgres:18.3-alpine3.23 image: postgres:18.3-alpine3.23
container_name: asset-helper-postgres-dev
ports: ports:
- "5432:5432" - "5432:5432"
environment: environment:
@@ -57,23 +63,24 @@ services:
- POSTGRES_PASSWORD=password - POSTGRES_PASSWORD=password
- POSTGRES_DB=userdb - POSTGRES_DB=userdb
volumes: volumes:
- postgres-data:/var/lib/postgresql/data - asset-helper-postgres-data:/var/lib/postgresql/data
networks: networks:
- backend-network - asset-helper-network
redis: asset-helper-redis:
image: redis:8.6.2-alpine image: redis:8.6.2-alpine
container_name: asset-helper-redis-dev
ports: ports:
- "6379:6379" - "6379:6379"
volumes: volumes:
- redis-data:/data - asset-helper-redis-data:/data
networks: networks:
- backend-network - asset-helper-network
volumes: volumes:
postgres-data: asset-helper-postgres-data:
redis-data: asset-helper-redis-data:
networks: networks:
backend-network: asset-helper-network:
driver: bridge driver: bridge

View File

@@ -1,51 +1,57 @@
version: '3.8' version: '3.8'
services: services:
nginx: asset-helper-nginx:
image: nginx:1.25-alpine image: nginx:1.25-alpine
container_name: asset-helper-nginx
ports: ports:
- "80:80" - "80:80"
volumes: volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on: depends_on:
- gateway - asset-helper-gateway
networks: networks:
- backend-network - asset-helper-network
gateway: asset-helper-gateway:
build: build:
context: ./gateway context: ./gateway
dockerfile: Dockerfile dockerfile: Dockerfile
image: asset-helper-gateway
container_name: asset-helper-gateway
ports: ports:
- "8080:8080" - "8080:8080"
environment: environment:
- GO_ENV=production - GO_ENV=production
- REDIS_ADDR=redis:6379 - REDIS_ADDR=asset-helper-redis:6379
depends_on: depends_on:
- redis - asset-helper-redis
networks: networks:
- backend-network - asset-helper-network
user-svc: asset-helper-user-svc:
build: build:
context: ./services/user-svc context: ./services/user-svc
dockerfile: Dockerfile dockerfile: Dockerfile
image: asset-helper-user-svc
container_name: asset-helper-user-svc
ports: ports:
- "50051:50051" - "50051:50051"
environment: environment:
- GO_ENV=production - GO_ENV=production
- POSTGRES_HOST=postgres - POSTGRES_HOST=asset-helper-postgres
- POSTGRES_PORT=5432 - POSTGRES_PORT=5432
- POSTGRES_USER=admin - POSTGRES_USER=admin
- POSTGRES_PASSWORD=password - POSTGRES_PASSWORD=password
- POSTGRES_DB=userdb - POSTGRES_DB=userdb
depends_on: depends_on:
- postgres - asset-helper-postgres
networks: networks:
- backend-network - asset-helper-network
postgres: asset-helper-postgres:
image: postgres:18.3-alpine3.23 image: postgres:18.3-alpine3.23
container_name: asset-helper-postgres
ports: ports:
- "5432:5432" - "5432:5432"
environment: environment:
@@ -53,23 +59,24 @@ services:
- POSTGRES_PASSWORD=password - POSTGRES_PASSWORD=password
- POSTGRES_DB=userdb - POSTGRES_DB=userdb
volumes: volumes:
- postgres-data:/var/lib/postgresql/data - asset-helper-postgres-data:/var/lib/postgresql/data
networks: networks:
- backend-network - asset-helper-network
redis: asset-helper-redis:
image: redis:8.6.2-alpine image: redis:8.6.2-alpine
container_name: asset-helper-redis
ports: ports:
- "6379:6379" - "6379:6379"
volumes: volumes:
- redis-data:/data - asset-helper-redis-data:/data
networks: networks:
- backend-network - asset-helper-network
volumes: volumes:
postgres-data: asset-helper-postgres-data:
redis-data: asset-helper-redis-data:
networks: networks:
backend-network: asset-helper-network:
driver: bridge driver: bridge

View File

@@ -19,7 +19,7 @@ http {
keepalive_timeout 65; keepalive_timeout 65;
upstream gateway { upstream gateway {
server gateway:8080; server asset-helper-gateway:8080;
} }
server { server {

682
backend/user/user.pb.go Normal file
View File

@@ -0,0 +1,682 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v6.31.1
// source: services/user-svc/user.proto
package user
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type User struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,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"`
Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *User) Reset() {
*x = User{}
mi := &file_services_user_svc_user_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *User) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*User) ProtoMessage() {}
func (x *User) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use User.ProtoReflect.Descriptor instead.
func (*User) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{0}
}
func (x *User) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *User) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *User) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *User) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
type CreateUserRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateUserRequest) Reset() {
*x = CreateUserRequest{}
mi := &file_services_user_svc_user_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateUserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateUserRequest) ProtoMessage() {}
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{1}
}
func (x *CreateUserRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *CreateUserRequest) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *CreateUserRequest) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
type CreateUserResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateUserResponse) Reset() {
*x = CreateUserResponse{}
mi := &file_services_user_svc_user_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateUserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateUserResponse) ProtoMessage() {}
func (x *CreateUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.
func (*CreateUserResponse) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{2}
}
func (x *CreateUserResponse) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
type GetUserRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetUserRequest) Reset() {
*x = GetUserRequest{}
mi := &file_services_user_svc_user_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetUserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetUserRequest) ProtoMessage() {}
func (x *GetUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{3}
}
func (x *GetUserRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type GetUserResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetUserResponse) Reset() {
*x = GetUserResponse{}
mi := &file_services_user_svc_user_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetUserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetUserResponse) ProtoMessage() {}
func (x *GetUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
func (*GetUserResponse) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{4}
}
func (x *GetUserResponse) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
type ListUsersRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListUsersRequest) Reset() {
*x = ListUsersRequest{}
mi := &file_services_user_svc_user_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListUsersRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListUsersRequest) ProtoMessage() {}
func (x *ListUsersRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead.
func (*ListUsersRequest) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{5}
}
type ListUsersResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListUsersResponse) Reset() {
*x = ListUsersResponse{}
mi := &file_services_user_svc_user_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListUsersResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListUsersResponse) ProtoMessage() {}
func (x *ListUsersResponse) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead.
func (*ListUsersResponse) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{6}
}
func (x *ListUsersResponse) GetUsers() []*User {
if x != nil {
return x.Users
}
return nil
}
type UpdateUserRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,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"`
Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UpdateUserRequest) Reset() {
*x = UpdateUserRequest{}
mi := &file_services_user_svc_user_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UpdateUserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateUserRequest) ProtoMessage() {}
func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserRequest) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{7}
}
func (x *UpdateUserRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *UpdateUserRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *UpdateUserRequest) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *UpdateUserRequest) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
type UpdateUserResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UpdateUserResponse) Reset() {
*x = UpdateUserResponse{}
mi := &file_services_user_svc_user_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UpdateUserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateUserResponse) ProtoMessage() {}
func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateUserResponse.ProtoReflect.Descriptor instead.
func (*UpdateUserResponse) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{8}
}
func (x *UpdateUserResponse) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
type DeleteUserRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteUserRequest) Reset() {
*x = DeleteUserRequest{}
mi := &file_services_user_svc_user_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteUserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteUserRequest) ProtoMessage() {}
func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.
func (*DeleteUserRequest) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{9}
}
func (x *DeleteUserRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type DeleteUserResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteUserResponse) Reset() {
*x = DeleteUserResponse{}
mi := &file_services_user_svc_user_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteUserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteUserResponse) ProtoMessage() {}
func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_services_user_svc_user_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead.
func (*DeleteUserResponse) Descriptor() ([]byte, []int) {
return file_services_user_svc_user_proto_rawDescGZIP(), []int{10}
}
func (x *DeleteUserResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
var File_services_user_svc_user_proto protoreflect.FileDescriptor
const file_services_user_svc_user_proto_rawDesc = "" +
"\n" +
"\x1cservices/user-svc/user.proto\x12\x04user\"\\\n" +
"\x04User\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" +
"\x05email\x18\x03 \x01(\tR\x05email\x12\x1a\n" +
"\bpassword\x18\x04 \x01(\tR\bpassword\"Y\n" +
"\x11CreateUserRequest\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
"\x05email\x18\x02 \x01(\tR\x05email\x12\x1a\n" +
"\bpassword\x18\x03 \x01(\tR\bpassword\"4\n" +
"\x12CreateUserResponse\x12\x1e\n" +
"\x04user\x18\x01 \x01(\v2\n" +
".user.UserR\x04user\" \n" +
"\x0eGetUserRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\"1\n" +
"\x0fGetUserResponse\x12\x1e\n" +
"\x04user\x18\x01 \x01(\v2\n" +
".user.UserR\x04user\"\x12\n" +
"\x10ListUsersRequest\"5\n" +
"\x11ListUsersResponse\x12 \n" +
"\x05users\x18\x01 \x03(\v2\n" +
".user.UserR\x05users\"i\n" +
"\x11UpdateUserRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" +
"\x05email\x18\x03 \x01(\tR\x05email\x12\x1a\n" +
"\bpassword\x18\x04 \x01(\tR\bpassword\"4\n" +
"\x12UpdateUserResponse\x12\x1e\n" +
"\x04user\x18\x01 \x01(\v2\n" +
".user.UserR\x04user\"#\n" +
"\x11DeleteUserRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\".\n" +
"\x12DeleteUserResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess2\xc6\x02\n" +
"\vUserService\x12?\n" +
"\n" +
"CreateUser\x12\x17.user.CreateUserRequest\x1a\x18.user.CreateUserResponse\x126\n" +
"\aGetUser\x12\x14.user.GetUserRequest\x1a\x15.user.GetUserResponse\x12<\n" +
"\tListUsers\x12\x16.user.ListUsersRequest\x1a\x17.user.ListUsersResponse\x12?\n" +
"\n" +
"UpdateUser\x12\x17.user.UpdateUserRequest\x1a\x18.user.UpdateUserResponse\x12?\n" +
"\n" +
"DeleteUser\x12\x17.user.DeleteUserRequest\x1a\x18.user.DeleteUserResponseB\bZ\x06./userb\x06proto3"
var (
file_services_user_svc_user_proto_rawDescOnce sync.Once
file_services_user_svc_user_proto_rawDescData []byte
)
func file_services_user_svc_user_proto_rawDescGZIP() []byte {
file_services_user_svc_user_proto_rawDescOnce.Do(func() {
file_services_user_svc_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_services_user_svc_user_proto_rawDesc), len(file_services_user_svc_user_proto_rawDesc)))
})
return file_services_user_svc_user_proto_rawDescData
}
var file_services_user_svc_user_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_services_user_svc_user_proto_goTypes = []any{
(*User)(nil), // 0: user.User
(*CreateUserRequest)(nil), // 1: user.CreateUserRequest
(*CreateUserResponse)(nil), // 2: user.CreateUserResponse
(*GetUserRequest)(nil), // 3: user.GetUserRequest
(*GetUserResponse)(nil), // 4: user.GetUserResponse
(*ListUsersRequest)(nil), // 5: user.ListUsersRequest
(*ListUsersResponse)(nil), // 6: user.ListUsersResponse
(*UpdateUserRequest)(nil), // 7: user.UpdateUserRequest
(*UpdateUserResponse)(nil), // 8: user.UpdateUserResponse
(*DeleteUserRequest)(nil), // 9: user.DeleteUserRequest
(*DeleteUserResponse)(nil), // 10: user.DeleteUserResponse
}
var file_services_user_svc_user_proto_depIdxs = []int32{
0, // 0: user.CreateUserResponse.user:type_name -> user.User
0, // 1: user.GetUserResponse.user:type_name -> user.User
0, // 2: user.ListUsersResponse.users:type_name -> user.User
0, // 3: user.UpdateUserResponse.user:type_name -> user.User
1, // 4: user.UserService.CreateUser:input_type -> user.CreateUserRequest
3, // 5: user.UserService.GetUser:input_type -> user.GetUserRequest
5, // 6: user.UserService.ListUsers:input_type -> user.ListUsersRequest
7, // 7: user.UserService.UpdateUser:input_type -> user.UpdateUserRequest
9, // 8: user.UserService.DeleteUser:input_type -> user.DeleteUserRequest
2, // 9: user.UserService.CreateUser:output_type -> user.CreateUserResponse
4, // 10: user.UserService.GetUser:output_type -> user.GetUserResponse
6, // 11: user.UserService.ListUsers:output_type -> user.ListUsersResponse
8, // 12: user.UserService.UpdateUser:output_type -> user.UpdateUserResponse
10, // 13: user.UserService.DeleteUser:output_type -> user.DeleteUserResponse
9, // [9:14] is the sub-list for method output_type
4, // [4:9] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_services_user_svc_user_proto_init() }
func file_services_user_svc_user_proto_init() {
if File_services_user_svc_user_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_services_user_svc_user_proto_rawDesc), len(file_services_user_svc_user_proto_rawDesc)),
NumEnums: 0,
NumMessages: 11,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_services_user_svc_user_proto_goTypes,
DependencyIndexes: file_services_user_svc_user_proto_depIdxs,
MessageInfos: file_services_user_svc_user_proto_msgTypes,
}.Build()
File_services_user_svc_user_proto = out.File
file_services_user_svc_user_proto_goTypes = nil
file_services_user_svc_user_proto_depIdxs = nil
}

View File

@@ -0,0 +1,273 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc v6.31.1
// source: services/user-svc/user.proto
package user
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
UserService_CreateUser_FullMethodName = "/user.UserService/CreateUser"
UserService_GetUser_FullMethodName = "/user.UserService/GetUser"
UserService_ListUsers_FullMethodName = "/user.UserService/ListUsers"
UserService_UpdateUser_FullMethodName = "/user.UserService/UpdateUser"
UserService_DeleteUser_FullMethodName = "/user.UserService/DeleteUser"
)
// UserServiceClient is the client API for UserService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type UserServiceClient interface {
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)
UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error)
DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error)
}
type userServiceClient struct {
cc grpc.ClientConnInterface
}
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
return &userServiceClient{cc}
}
func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateUserResponse)
err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetUserResponse)
err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListUsersResponse)
err := c.cc.Invoke(ctx, UserService_ListUsers_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UpdateUserResponse)
err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeleteUserResponse)
err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserServiceServer is the server API for UserService service.
// All implementations must embed UnimplementedUserServiceServer
// for forward compatibility.
type UserServiceServer interface {
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
mustEmbedUnimplementedUserServiceServer()
}
// UnimplementedUserServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedUserServiceServer struct{}
func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) {
return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented")
}
func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetUser not implemented")
}
func (UnimplementedUserServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListUsers not implemented")
}
func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) {
return nil, status.Error(codes.Unimplemented, "method UpdateUser not implemented")
}
func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) {
return nil, status.Error(codes.Unimplemented, "method DeleteUser not implemented")
}
func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {}
func (UnimplementedUserServiceServer) testEmbeddedByValue() {}
// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserServiceServer will
// result in compilation errors.
type UnsafeUserServiceServer interface {
mustEmbedUnimplementedUserServiceServer()
}
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
// If the following call panics, it indicates UnimplementedUserServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&UserService_ServiceDesc, srv)
}
func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).CreateUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_CreateUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).CreateUser(ctx, req.(*CreateUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).GetUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_GetUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_ListUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListUsersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).ListUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_ListUsers_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).ListUsers(ctx, req.(*ListUsersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).UpdateUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_UpdateUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).DeleteUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_DeleteUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest))
}
return interceptor(ctx, in, info, handler)
}
// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "user.UserService",
HandlerType: (*UserServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateUser",
Handler: _UserService_CreateUser_Handler,
},
{
MethodName: "GetUser",
Handler: _UserService_GetUser_Handler,
},
{
MethodName: "ListUsers",
Handler: _UserService_ListUsers_Handler,
},
{
MethodName: "UpdateUser",
Handler: _UserService_UpdateUser_Handler,
},
{
MethodName: "DeleteUser",
Handler: _UserService_DeleteUser_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "services/user-svc/user.proto",
}