Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterBlogServer(s grpc.ServiceRegistrar, srv BlogServer)
- type BlogClient
- type BlogServer
- type ListUserRequest
- func (*ListUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListUserRequest) GetLimit() int64
- func (x *ListUserRequest) GetOffset() int64
- func (*ListUserRequest) ProtoMessage()
- func (x *ListUserRequest) ProtoReflect() protoreflect.Message
- func (x *ListUserRequest) Reset()
- func (x *ListUserRequest) String() string
- type ListUserResponse
- func (*ListUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListUserResponse) GetTotalCount() int64
- func (x *ListUserResponse) GetUsers() []*UserInfo
- func (*ListUserResponse) ProtoMessage()
- func (x *ListUserResponse) ProtoReflect() protoreflect.Message
- func (x *ListUserResponse) Reset()
- func (x *ListUserResponse) String() string
- type UnimplementedBlogServer
- type UnsafeBlogServer
- type UserInfo
- func (*UserInfo) Descriptor() ([]byte, []int)deprecated
- func (x *UserInfo) GetCreatedAt() *timestamppb.Timestamp
- func (x *UserInfo) GetEmail() string
- func (x *UserInfo) GetNickname() string
- func (x *UserInfo) GetPhone() string
- func (x *UserInfo) GetPostCount() int64
- func (x *UserInfo) GetUpdatedAt() *timestamppb.Timestamp
- func (x *UserInfo) GetUsername() string
- func (*UserInfo) ProtoMessage()
- func (x *UserInfo) ProtoReflect() protoreflect.Message
- func (x *UserInfo) Reset()
- func (x *UserInfo) String() string
Constants ¶
const (
Blog_ListUser_FullMethodName = "/v1.Blog/ListUser"
)
Variables ¶
var Blog_ServiceDesc = grpc.ServiceDesc{ ServiceName: "v1.Blog", HandlerType: (*BlogServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListUser", Handler: _Blog_ListUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "blog/v1/blog.proto", }
Blog_ServiceDesc is the grpc.ServiceDesc for Blog service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_blog_v1_blog_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBlogServer ¶
func RegisterBlogServer(s grpc.ServiceRegistrar, srv BlogServer)
Types ¶
type BlogClient ¶
type BlogClient interface {
ListUser(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (*ListUserResponse, error)
}
BlogClient is the client API for Blog 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 NewBlogClient ¶
func NewBlogClient(cc grpc.ClientConnInterface) BlogClient
type BlogServer ¶
type BlogServer interface { ListUser(context.Context, *ListUserRequest) (*ListUserResponse, error) // contains filtered or unexported methods }
BlogServer is the server API for Blog service. All implementations must embed UnimplementedBlogServer for forward compatibility
type ListUserRequest ¶
type ListUserRequest struct { Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
ListUserRequest 指定了 `ListUser` 接口的请求参数.
func (*ListUserRequest) Descriptor
deprecated
func (*ListUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListUserRequest.ProtoReflect.Descriptor instead.
func (*ListUserRequest) GetLimit ¶
func (x *ListUserRequest) GetLimit() int64
func (*ListUserRequest) GetOffset ¶
func (x *ListUserRequest) GetOffset() int64
func (*ListUserRequest) ProtoMessage ¶
func (*ListUserRequest) ProtoMessage()
func (*ListUserRequest) ProtoReflect ¶
func (x *ListUserRequest) ProtoReflect() protoreflect.Message
func (*ListUserRequest) Reset ¶
func (x *ListUserRequest) Reset()
func (*ListUserRequest) String ¶
func (x *ListUserRequest) String() string
type ListUserResponse ¶
type ListUserResponse struct { TotalCount int64 `protobuf:"varint,1,opt,name=totalCount,proto3" json:"totalCount,omitempty"` Users []*UserInfo `protobuf:"bytes,2,rep,name=Users,proto3" json:"Users,omitempty"` // contains filtered or unexported fields }
ListUserResponse 指定了 `GET /v1/users` 接口的返回参数,相当于 HTTP Response.
func (*ListUserResponse) Descriptor
deprecated
func (*ListUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListUserResponse.ProtoReflect.Descriptor instead.
func (*ListUserResponse) GetTotalCount ¶
func (x *ListUserResponse) GetTotalCount() int64
func (*ListUserResponse) GetUsers ¶
func (x *ListUserResponse) GetUsers() []*UserInfo
func (*ListUserResponse) ProtoMessage ¶
func (*ListUserResponse) ProtoMessage()
func (*ListUserResponse) ProtoReflect ¶
func (x *ListUserResponse) ProtoReflect() protoreflect.Message
func (*ListUserResponse) Reset ¶
func (x *ListUserResponse) Reset()
func (*ListUserResponse) String ¶
func (x *ListUserResponse) String() string
type UnimplementedBlogServer ¶
type UnimplementedBlogServer struct { }
UnimplementedBlogServer must be embedded to have forward compatible implementations.
func (UnimplementedBlogServer) ListUser ¶
func (UnimplementedBlogServer) ListUser(context.Context, *ListUserRequest) (*ListUserResponse, error)
type UnsafeBlogServer ¶
type UnsafeBlogServer interface {
// contains filtered or unexported methods
}
UnsafeBlogServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BlogServer will result in compilation errors.
type UserInfo ¶
type UserInfo struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"` Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` PostCount int64 `protobuf:"varint,6,opt,name=postCount,proto3" json:"postCount,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=createdAt,proto3" json:"createdAt,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` // contains filtered or unexported fields }
func (*UserInfo) Descriptor
deprecated
func (*UserInfo) GetCreatedAt ¶
func (x *UserInfo) GetCreatedAt() *timestamppb.Timestamp
func (*UserInfo) GetNickname ¶
func (*UserInfo) GetPostCount ¶
func (*UserInfo) GetUpdatedAt ¶
func (x *UserInfo) GetUpdatedAt() *timestamppb.Timestamp
func (*UserInfo) GetUsername ¶
func (*UserInfo) ProtoMessage ¶
func (*UserInfo) ProtoMessage()
func (*UserInfo) ProtoReflect ¶
func (x *UserInfo) ProtoReflect() protoreflect.Message