Documentation ¶
Index ¶
- Variables
- func RegisterPostServiceServer(s grpc.ServiceRegistrar, srv PostServiceServer)
- type GetPostRequest
- type GetPostResponse
- type Post
- func (*Post) Descriptor() ([]byte, []int)deprecated
- func (x *Post) GetAuthor() *User
- func (x *Post) GetContent() []byte
- func (x *Post) GetCreatedAt() *timestamppb.Timestamp
- func (x *Post) GetId() int64
- func (x *Post) GetPublishedAt() *timestamppb.Timestamp
- func (x *Post) GetStatus() PostStatus
- func (x *Post) GetTitle() string
- func (x *Post) GetUpdatedAt() *timestamppb.Timestamp
- func (*Post) ProtoMessage()
- func (x *Post) ProtoReflect() protoreflect.Message
- func (x *Post) Reset()
- func (x *Post) String() string
- type PostServiceClient
- type PostServiceServer
- type PostStatus
- type UnimplementedPostServiceServer
- type UnsafePostServiceServer
- type User
Constants ¶
This section is empty.
Variables ¶
var ( PostStatus_name = map[int32]string{ 0: "POST_STATUS_UNSPECIFIED", 1: "POST_STATUS_DRAFT", 2: "POST_STATUS_PRIVATE", 3: "POST_STATUS_UNLISTED", 4: "POST_STATUS_PUBLIC", } PostStatus_value = map[string]int32{ "POST_STATUS_UNSPECIFIED": 0, "POST_STATUS_DRAFT": 1, "POST_STATUS_PRIVATE": 2, "POST_STATUS_UNLISTED": 3, "POST_STATUS_PUBLIC": 4, } )
Enum value maps for PostStatus.
var File_blog_v1_post_proto protoreflect.FileDescriptor
var File_blog_v1_user_proto protoreflect.FileDescriptor
var PostService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "blog.v1.PostService", HandlerType: (*PostServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPost", Handler: _PostService_GetPost_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "blog/v1/post.proto", }
PostService_ServiceDesc is the grpc.ServiceDesc for PostService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPostServiceServer ¶
func RegisterPostServiceServer(s grpc.ServiceRegistrar, srv PostServiceServer)
Types ¶
type GetPostRequest ¶
type GetPostRequest struct { PostId int64 `protobuf:"varint,1,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` // contains filtered or unexported fields }
func (*GetPostRequest) Descriptor
deprecated
func (*GetPostRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPostRequest.ProtoReflect.Descriptor instead.
func (*GetPostRequest) GetPostId ¶
func (x *GetPostRequest) GetPostId() int64
func (*GetPostRequest) ProtoMessage ¶
func (*GetPostRequest) ProtoMessage()
func (*GetPostRequest) ProtoReflect ¶
func (x *GetPostRequest) ProtoReflect() protoreflect.Message
func (*GetPostRequest) Reset ¶
func (x *GetPostRequest) Reset()
func (*GetPostRequest) String ¶
func (x *GetPostRequest) String() string
type GetPostResponse ¶
type GetPostResponse struct { Post *Post `protobuf:"bytes,1,opt,name=post,proto3" json:"post,omitempty"` // contains filtered or unexported fields }
func (*GetPostResponse) Descriptor
deprecated
func (*GetPostResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPostResponse.ProtoReflect.Descriptor instead.
func (*GetPostResponse) GetPost ¶
func (x *GetPostResponse) GetPost() *Post
func (*GetPostResponse) ProtoMessage ¶
func (*GetPostResponse) ProtoMessage()
func (*GetPostResponse) ProtoReflect ¶
func (x *GetPostResponse) ProtoReflect() protoreflect.Message
func (*GetPostResponse) Reset ¶
func (x *GetPostResponse) Reset()
func (*GetPostResponse) String ¶
func (x *GetPostResponse) String() string
type Post ¶
type Post struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Author *User `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Content []byte `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` Status PostStatus `protobuf:"varint,5,opt,name=status,proto3,enum=blog.v1.PostStatus" json:"status,omitempty"` PublishedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=published_at,json=publishedAt,proto3" json:"published_at,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
func (*Post) Descriptor
deprecated
func (*Post) GetContent ¶
func (*Post) GetCreatedAt ¶
func (x *Post) GetCreatedAt() *timestamppb.Timestamp
func (*Post) GetPublishedAt ¶
func (x *Post) GetPublishedAt() *timestamppb.Timestamp
func (*Post) GetStatus ¶
func (x *Post) GetStatus() PostStatus
func (*Post) GetUpdatedAt ¶
func (x *Post) GetUpdatedAt() *timestamppb.Timestamp
func (*Post) ProtoMessage ¶
func (*Post) ProtoMessage()
func (*Post) ProtoReflect ¶
func (x *Post) ProtoReflect() protoreflect.Message
type PostServiceClient ¶
type PostServiceClient interface {
GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*GetPostResponse, error)
}
PostServiceClient is the client API for PostService 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 NewPostServiceClient ¶
func NewPostServiceClient(cc grpc.ClientConnInterface) PostServiceClient
type PostServiceServer ¶
type PostServiceServer interface {
GetPost(context.Context, *GetPostRequest) (*GetPostResponse, error)
}
PostServiceServer is the server API for PostService service. All implementations should embed UnimplementedPostServiceServer for forward compatibility
type PostStatus ¶
type PostStatus int32
const ( PostStatus_POST_STATUS_UNSPECIFIED PostStatus = 0 PostStatus_POST_STATUS_DRAFT PostStatus = 1 PostStatus_POST_STATUS_PRIVATE PostStatus = 2 PostStatus_POST_STATUS_UNLISTED PostStatus = 3 PostStatus_POST_STATUS_PUBLIC PostStatus = 4 )
func (PostStatus) Descriptor ¶
func (PostStatus) Descriptor() protoreflect.EnumDescriptor
func (PostStatus) Enum ¶
func (x PostStatus) Enum() *PostStatus
func (PostStatus) EnumDescriptor
deprecated
func (PostStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use PostStatus.Descriptor instead.
func (PostStatus) Number ¶
func (x PostStatus) Number() protoreflect.EnumNumber
func (PostStatus) String ¶
func (x PostStatus) String() string
func (PostStatus) Type ¶
func (PostStatus) Type() protoreflect.EnumType
type UnimplementedPostServiceServer ¶
type UnimplementedPostServiceServer struct { }
UnimplementedPostServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedPostServiceServer) GetPost ¶
func (UnimplementedPostServiceServer) GetPost(context.Context, *GetPostRequest) (*GetPostResponse, error)
type UnsafePostServiceServer ¶
type UnsafePostServiceServer interface {
// contains filtered or unexported methods
}
UnsafePostServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PostServiceServer will result in compilation errors.
type User ¶
type User struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message