Documentation
¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error
- func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type CreateUserRequest
- func (*CreateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserRequest) GetAge() int32
- func (x *CreateUserRequest) GetEmail() string
- func (x *CreateUserRequest) GetName() string
- func (*CreateUserRequest) ProtoMessage()
- func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateUserRequest) Reset()
- func (x *CreateUserRequest) String() string
- type CreateUserResponse
- func (*CreateUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserResponse) GetAge() int32
- func (x *CreateUserResponse) GetCreatedAt() string
- func (x *CreateUserResponse) GetEmail() string
- func (x *CreateUserResponse) GetId() string
- func (x *CreateUserResponse) GetName() string
- func (*CreateUserResponse) ProtoMessage()
- func (x *CreateUserResponse) ProtoReflect() protoreflect.Message
- func (x *CreateUserResponse) Reset()
- func (x *CreateUserResponse) String() string
- type DeleteUserRequest
- type DeleteUserResponse
- func (*DeleteUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteUserResponse) GetMessage() string
- func (x *DeleteUserResponse) GetSuccess() bool
- func (*DeleteUserResponse) ProtoMessage()
- func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message
- func (x *DeleteUserResponse) Reset()
- func (x *DeleteUserResponse) String() string
- type GetUserRequest
- type GetUserResponse
- func (*GetUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserResponse) GetAge() int32
- func (x *GetUserResponse) GetCreatedAt() string
- func (x *GetUserResponse) GetEmail() string
- func (x *GetUserResponse) GetId() string
- func (x *GetUserResponse) GetName() string
- func (x *GetUserResponse) GetUpdatedAt() string
- func (*GetUserResponse) ProtoMessage()
- func (x *GetUserResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserResponse) Reset()
- func (x *GetUserResponse) String() string
- type ListUsersRequest
- func (*ListUsersRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListUsersRequest) GetPage() int32
- func (x *ListUsersRequest) GetPageSize() int32
- func (x *ListUsersRequest) GetSearch() string
- func (*ListUsersRequest) ProtoMessage()
- func (x *ListUsersRequest) ProtoReflect() protoreflect.Message
- func (x *ListUsersRequest) Reset()
- func (x *ListUsersRequest) String() string
- type ListUsersResponse
- func (*ListUsersResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListUsersResponse) GetPage() int32
- func (x *ListUsersResponse) GetPageSize() int32
- func (x *ListUsersResponse) GetTotal() int32
- func (x *ListUsersResponse) GetUsers() []*User
- func (*ListUsersResponse) ProtoMessage()
- func (x *ListUsersResponse) ProtoReflect() protoreflect.Message
- func (x *ListUsersResponse) Reset()
- func (x *ListUsersResponse) String() string
- type UnimplementedUserServiceServer
- func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
- func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
- func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
- func (UnimplementedUserServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
- func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
- type UnsafeUserServiceServer
- type UpdateUserRequest
- func (*UpdateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateUserRequest) GetAge() int32
- func (x *UpdateUserRequest) GetEmail() string
- func (x *UpdateUserRequest) GetId() string
- func (x *UpdateUserRequest) GetName() string
- func (*UpdateUserRequest) ProtoMessage()
- func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateUserRequest) Reset()
- func (x *UpdateUserRequest) String() string
- type UpdateUserResponse
- func (*UpdateUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateUserResponse) GetAge() int32
- func (x *UpdateUserResponse) GetEmail() string
- func (x *UpdateUserResponse) GetId() string
- func (x *UpdateUserResponse) GetName() string
- func (x *UpdateUserResponse) GetUpdatedAt() string
- func (*UpdateUserResponse) ProtoMessage()
- func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateUserResponse) Reset()
- func (x *UpdateUserResponse) String() string
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetAge() int32
- func (x *User) GetCreatedAt() string
- func (x *User) GetEmail() string
- func (x *User) GetId() string
- func (x *User) GetName() string
- func (x *User) GetUpdatedAt() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type UserServiceClient
- type UserServiceServer
Constants ¶
const ( UserService_CreateUser_FullMethodName = "/v1alpha.UserService/CreateUser" UserService_GetUser_FullMethodName = "/v1alpha.UserService/GetUser" UserService_UpdateUser_FullMethodName = "/v1alpha.UserService/UpdateUser" UserService_DeleteUser_FullMethodName = "/v1alpha.UserService/DeleteUser" UserService_ListUsers_FullMethodName = "/v1alpha.UserService/ListUsers" )
Variables ¶
var File_api_service_proto protoreflect.FileDescriptor
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "v1alpha.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateUser", Handler: _UserService_CreateUser_Handler, }, { MethodName: "GetUser", Handler: _UserService_GetUser_Handler, }, { MethodName: "UpdateUser", Handler: _UserService_UpdateUser_Handler, }, { MethodName: "DeleteUser", Handler: _UserService_DeleteUser_Handler, }, { MethodName: "ListUsers", Handler: _UserService_ListUsers_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/service.proto", }
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)
Functions ¶
func RegisterUserServiceHandler ¶
func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterUserServiceHandler registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterUserServiceHandlerClient ¶
func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error
RegisterUserServiceHandlerClient registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UserServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterUserServiceHandlerFromEndpoint ¶
func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUserServiceHandlerServer ¶
func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error
RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". UnaryRPC :call UserServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
Age int32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"`
// contains filtered or unexported fields
}
创建用户请求
func (*CreateUserRequest) Descriptor
deprecated
func (*CreateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) GetAge ¶
func (x *CreateUserRequest) GetAge() int32
func (*CreateUserRequest) GetEmail ¶
func (x *CreateUserRequest) GetEmail() string
func (*CreateUserRequest) GetName ¶
func (x *CreateUserRequest) GetName() string
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) ProtoReflect ¶
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateUserRequest) Reset ¶
func (x *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (x *CreateUserRequest) String() string
type CreateUserResponse ¶
type CreateUserResponse struct {
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"`
Age int32 `protobuf:"varint,4,opt,name=age,proto3" json:"age,omitempty"`
CreatedAt string `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
// contains filtered or unexported fields
}
创建用户响应
func (*CreateUserResponse) Descriptor
deprecated
func (*CreateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.
func (*CreateUserResponse) GetAge ¶
func (x *CreateUserResponse) GetAge() int32
func (*CreateUserResponse) GetCreatedAt ¶
func (x *CreateUserResponse) GetCreatedAt() string
func (*CreateUserResponse) GetEmail ¶
func (x *CreateUserResponse) GetEmail() string
func (*CreateUserResponse) GetId ¶
func (x *CreateUserResponse) GetId() string
func (*CreateUserResponse) GetName ¶
func (x *CreateUserResponse) GetName() string
func (*CreateUserResponse) ProtoMessage ¶
func (*CreateUserResponse) ProtoMessage()
func (*CreateUserResponse) ProtoReflect ¶
func (x *CreateUserResponse) ProtoReflect() protoreflect.Message
func (*CreateUserResponse) Reset ¶
func (x *CreateUserResponse) Reset()
func (*CreateUserResponse) String ¶
func (x *CreateUserResponse) String() string
type DeleteUserRequest ¶
type DeleteUserRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
删除用户请求
func (*DeleteUserRequest) Descriptor
deprecated
func (*DeleteUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.
func (*DeleteUserRequest) GetId ¶
func (x *DeleteUserRequest) GetId() string
func (*DeleteUserRequest) ProtoMessage ¶
func (*DeleteUserRequest) ProtoMessage()
func (*DeleteUserRequest) ProtoReflect ¶
func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message
func (*DeleteUserRequest) Reset ¶
func (x *DeleteUserRequest) Reset()
func (*DeleteUserRequest) String ¶
func (x *DeleteUserRequest) String() string
type DeleteUserResponse ¶
type DeleteUserResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
// contains filtered or unexported fields
}
删除用户响应
func (*DeleteUserResponse) Descriptor
deprecated
func (*DeleteUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead.
func (*DeleteUserResponse) GetMessage ¶
func (x *DeleteUserResponse) GetMessage() string
func (*DeleteUserResponse) GetSuccess ¶
func (x *DeleteUserResponse) GetSuccess() bool
func (*DeleteUserResponse) ProtoMessage ¶
func (*DeleteUserResponse) ProtoMessage()
func (*DeleteUserResponse) ProtoReflect ¶
func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message
func (*DeleteUserResponse) Reset ¶
func (x *DeleteUserResponse) Reset()
func (*DeleteUserResponse) String ¶
func (x *DeleteUserResponse) String() string
type GetUserRequest ¶
type GetUserRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
获取用户请求
func (*GetUserRequest) Descriptor
deprecated
func (*GetUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) GetId ¶
func (x *GetUserRequest) GetId() string
func (*GetUserRequest) ProtoMessage ¶
func (*GetUserRequest) ProtoMessage()
func (*GetUserRequest) ProtoReflect ¶
func (x *GetUserRequest) ProtoReflect() protoreflect.Message
func (*GetUserRequest) Reset ¶
func (x *GetUserRequest) Reset()
func (*GetUserRequest) String ¶
func (x *GetUserRequest) String() string
type GetUserResponse ¶
type GetUserResponse struct {
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"`
Age int32 `protobuf:"varint,4,opt,name=age,proto3" json:"age,omitempty"`
CreatedAt string `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt string `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
// contains filtered or unexported fields
}
获取用户响应
func (*GetUserResponse) Descriptor
deprecated
func (*GetUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
func (*GetUserResponse) GetAge ¶
func (x *GetUserResponse) GetAge() int32
func (*GetUserResponse) GetCreatedAt ¶
func (x *GetUserResponse) GetCreatedAt() string
func (*GetUserResponse) GetEmail ¶
func (x *GetUserResponse) GetEmail() string
func (*GetUserResponse) GetId ¶
func (x *GetUserResponse) GetId() string
func (*GetUserResponse) GetName ¶
func (x *GetUserResponse) GetName() string
func (*GetUserResponse) GetUpdatedAt ¶
func (x *GetUserResponse) GetUpdatedAt() string
func (*GetUserResponse) ProtoMessage ¶
func (*GetUserResponse) ProtoMessage()
func (*GetUserResponse) ProtoReflect ¶
func (x *GetUserResponse) ProtoReflect() protoreflect.Message
func (*GetUserResponse) Reset ¶
func (x *GetUserResponse) Reset()
func (*GetUserResponse) String ¶
func (x *GetUserResponse) String() string
type ListUsersRequest ¶
type ListUsersRequest struct {
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"`
Search string `protobuf:"bytes,3,opt,name=search,proto3" json:"search,omitempty"`
// contains filtered or unexported fields
}
列出用户请求
func (*ListUsersRequest) Descriptor
deprecated
func (*ListUsersRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead.
func (*ListUsersRequest) GetPage ¶
func (x *ListUsersRequest) GetPage() int32
func (*ListUsersRequest) GetPageSize ¶
func (x *ListUsersRequest) GetPageSize() int32
func (*ListUsersRequest) GetSearch ¶
func (x *ListUsersRequest) GetSearch() string
func (*ListUsersRequest) ProtoMessage ¶
func (*ListUsersRequest) ProtoMessage()
func (*ListUsersRequest) ProtoReflect ¶
func (x *ListUsersRequest) ProtoReflect() protoreflect.Message
func (*ListUsersRequest) Reset ¶
func (x *ListUsersRequest) Reset()
func (*ListUsersRequest) String ¶
func (x *ListUsersRequest) String() string
type ListUsersResponse ¶
type ListUsersResponse struct {
Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// contains filtered or unexported fields
}
列出用户响应
func (*ListUsersResponse) Descriptor
deprecated
func (*ListUsersResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead.
func (*ListUsersResponse) GetPage ¶
func (x *ListUsersResponse) GetPage() int32
func (*ListUsersResponse) GetPageSize ¶
func (x *ListUsersResponse) GetPageSize() int32
func (*ListUsersResponse) GetTotal ¶
func (x *ListUsersResponse) GetTotal() int32
func (*ListUsersResponse) GetUsers ¶
func (x *ListUsersResponse) GetUsers() []*User
func (*ListUsersResponse) ProtoMessage ¶
func (*ListUsersResponse) ProtoMessage()
func (*ListUsersResponse) ProtoReflect ¶
func (x *ListUsersResponse) ProtoReflect() protoreflect.Message
func (*ListUsersResponse) Reset ¶
func (x *ListUsersResponse) Reset()
func (*ListUsersResponse) String ¶
func (x *ListUsersResponse) String() string
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct{}
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.
func (UnimplementedUserServiceServer) CreateUser ¶
func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
func (UnimplementedUserServiceServer) DeleteUser ¶
func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
func (UnimplementedUserServiceServer) GetUser ¶
func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
func (UnimplementedUserServiceServer) ListUsers ¶
func (UnimplementedUserServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
func (UnimplementedUserServiceServer) UpdateUser ¶
func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
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 UpdateUserRequest ¶
type UpdateUserRequest struct {
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"`
Age int32 `protobuf:"varint,4,opt,name=age,proto3" json:"age,omitempty"`
// contains filtered or unexported fields
}
更新用户请求
func (*UpdateUserRequest) Descriptor
deprecated
func (*UpdateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserRequest) GetAge ¶
func (x *UpdateUserRequest) GetAge() int32
func (*UpdateUserRequest) GetEmail ¶
func (x *UpdateUserRequest) GetEmail() string
func (*UpdateUserRequest) GetId ¶
func (x *UpdateUserRequest) GetId() string
func (*UpdateUserRequest) GetName ¶
func (x *UpdateUserRequest) GetName() string
func (*UpdateUserRequest) ProtoMessage ¶
func (*UpdateUserRequest) ProtoMessage()
func (*UpdateUserRequest) ProtoReflect ¶
func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
func (*UpdateUserRequest) Reset ¶
func (x *UpdateUserRequest) Reset()
func (*UpdateUserRequest) String ¶
func (x *UpdateUserRequest) String() string
type UpdateUserResponse ¶
type UpdateUserResponse struct {
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"`
Age int32 `protobuf:"varint,4,opt,name=age,proto3" json:"age,omitempty"`
UpdatedAt string `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
// contains filtered or unexported fields
}
更新用户响应
func (*UpdateUserResponse) Descriptor
deprecated
func (*UpdateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserResponse.ProtoReflect.Descriptor instead.
func (*UpdateUserResponse) GetAge ¶
func (x *UpdateUserResponse) GetAge() int32
func (*UpdateUserResponse) GetEmail ¶
func (x *UpdateUserResponse) GetEmail() string
func (*UpdateUserResponse) GetId ¶
func (x *UpdateUserResponse) GetId() string
func (*UpdateUserResponse) GetName ¶
func (x *UpdateUserResponse) GetName() string
func (*UpdateUserResponse) GetUpdatedAt ¶
func (x *UpdateUserResponse) GetUpdatedAt() string
func (*UpdateUserResponse) ProtoMessage ¶
func (*UpdateUserResponse) ProtoMessage()
func (*UpdateUserResponse) ProtoReflect ¶
func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message
func (*UpdateUserResponse) Reset ¶
func (x *UpdateUserResponse) Reset()
func (*UpdateUserResponse) String ¶
func (x *UpdateUserResponse) String() string
type User ¶
type User struct {
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"`
Age int32 `protobuf:"varint,4,opt,name=age,proto3" json:"age,omitempty"`
CreatedAt string `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt string `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
// contains filtered or unexported fields
}
用户信息
func (*User) Descriptor
deprecated
func (*User) GetCreatedAt ¶
func (*User) GetUpdatedAt ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
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)
// 更新用户
UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error)
// 删除用户
DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error)
// 列出用户
ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)
}
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.
用户服务
func NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface {
// 创建用户
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
// 获取用户
GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
// 更新用户
UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
// 删除用户
DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
// 列出用户
ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
// contains filtered or unexported methods
}
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility.
用户服务