Documentation
¶
Index ¶
- Variables
- func RegisterBlogServer(s grpc.ServiceRegistrar, srv BlogServer)
- type BlogClient
- type BlogServer
- type Content
- func (*Content) Descriptor() ([]byte, []int)deprecated
- func (x *Content) GetCreatedAt() int64
- func (x *Content) GetPostId() uint64
- func (x *Content) GetText() string
- func (x *Content) GetTitle() string
- func (x *Content) GetUserId() uint64
- func (*Content) ProtoMessage()
- func (x *Content) ProtoReflect() protoreflect.Message
- func (x *Content) Reset()
- func (x *Content) String() string
- type Contents
- type CreateRequest
- func (*CreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRequest) GetBlogId() uint64
- func (x *CreateRequest) GetText() string
- func (x *CreateRequest) GetTitle() string
- func (x *CreateRequest) GetUserId() uint64
- func (*CreateRequest) ProtoMessage()
- func (x *CreateRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRequest) Reset()
- func (x *CreateRequest) String() string
- type IdRequest
- type Response
- type SearchRequest
- func (*SearchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SearchRequest) GetBlogId() uint64
- func (x *SearchRequest) GetEnd() uint64
- func (x *SearchRequest) GetFilter() string
- func (x *SearchRequest) GetStart() uint64
- func (*SearchRequest) ProtoMessage()
- func (x *SearchRequest) ProtoReflect() protoreflect.Message
- func (x *SearchRequest) Reset()
- func (x *SearchRequest) String() string
- type UnimplementedBlogServer
- func (UnimplementedBlogServer) CreatePost(context.Context, *CreateRequest) (*Response, error)
- func (UnimplementedBlogServer) DeletePost(context.Context, *IdRequest) (*Response, error)
- func (UnimplementedBlogServer) GetPost(context.Context, *IdRequest) (*Content, error)
- func (UnimplementedBlogServer) GetPosts(context.Context, *SearchRequest) (*Contents, error)
- type UnsafeBlogServer
Constants ¶
This section is empty.
Variables ¶
var Blog_ServiceDesc = grpc.ServiceDesc{ ServiceName: "puzzleblogservice.Blog", HandlerType: (*BlogServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreatePost", Handler: _Blog_CreatePost_Handler, }, { MethodName: "GetPost", Handler: _Blog_GetPost_Handler, }, { MethodName: "GetPosts", Handler: _Blog_GetPosts_Handler, }, { MethodName: "DeletePost", Handler: _Blog_DeletePost_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "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_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBlogServer ¶
func RegisterBlogServer(s grpc.ServiceRegistrar, srv BlogServer)
Types ¶
type BlogClient ¶
type BlogClient interface { CreatePost(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*Response, error) GetPost(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Content, error) GetPosts(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*Contents, error) DeletePost(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, 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 { CreatePost(context.Context, *CreateRequest) (*Response, error) GetPost(context.Context, *IdRequest) (*Content, error) GetPosts(context.Context, *SearchRequest) (*Contents, error) DeletePost(context.Context, *IdRequest) (*Response, error) // contains filtered or unexported methods }
BlogServer is the server API for Blog service. All implementations must embed UnimplementedBlogServer for forward compatibility
type Content ¶
type Content struct { PostId uint64 `protobuf:"varint,1,opt,name=postId,proto3" json:"postId,omitempty"` UserId uint64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` CreatedAt int64 `protobuf:"varint,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` // contains filtered or unexported fields }
func (*Content) Descriptor
deprecated
func (*Content) GetCreatedAt ¶
func (*Content) ProtoMessage ¶
func (*Content) ProtoMessage()
func (*Content) ProtoReflect ¶
func (x *Content) ProtoReflect() protoreflect.Message
type Contents ¶
type Contents struct { List []*Content `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total uint64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` // contains filtered or unexported fields }
func (*Contents) Descriptor
deprecated
func (*Contents) ProtoMessage ¶
func (*Contents) ProtoMessage()
func (*Contents) ProtoReflect ¶
func (x *Contents) ProtoReflect() protoreflect.Message
type CreateRequest ¶
type CreateRequest struct { BlogId uint64 `protobuf:"varint,1,opt,name=blogId,proto3" json:"blogId,omitempty"` UserId uint64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` // contains filtered or unexported fields }
func (*CreateRequest) Descriptor
deprecated
func (*CreateRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.
func (*CreateRequest) GetBlogId ¶
func (x *CreateRequest) GetBlogId() uint64
func (*CreateRequest) GetText ¶
func (x *CreateRequest) GetText() string
func (*CreateRequest) GetTitle ¶
func (x *CreateRequest) GetTitle() string
func (*CreateRequest) GetUserId ¶
func (x *CreateRequest) GetUserId() uint64
func (*CreateRequest) ProtoMessage ¶
func (*CreateRequest) ProtoMessage()
func (*CreateRequest) ProtoReflect ¶
func (x *CreateRequest) ProtoReflect() protoreflect.Message
func (*CreateRequest) Reset ¶
func (x *CreateRequest) Reset()
func (*CreateRequest) String ¶
func (x *CreateRequest) String() string
type IdRequest ¶
type IdRequest struct { BlogId uint64 `protobuf:"varint,1,opt,name=blogId,proto3" json:"blogId,omitempty"` PostId uint64 `protobuf:"varint,2,opt,name=postId,proto3" json:"postId,omitempty"` // contains filtered or unexported fields }
func (*IdRequest) Descriptor
deprecated
func (*IdRequest) ProtoMessage ¶
func (*IdRequest) ProtoMessage()
func (*IdRequest) ProtoReflect ¶
func (x *IdRequest) ProtoReflect() protoreflect.Message
type Response ¶ added in v1.1.0
type Response struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
added in
v1.1.0
func (*Response) GetSuccess ¶ added in v1.1.0
func (*Response) ProtoMessage ¶ added in v1.1.0
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶ added in v1.1.0
func (x *Response) ProtoReflect() protoreflect.Message
type SearchRequest ¶
type SearchRequest struct { BlogId uint64 `protobuf:"varint,1,opt,name=blogId,proto3" json:"blogId,omitempty"` Start uint64 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` End uint64 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"` Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"` // contains filtered or unexported fields }
func (*SearchRequest) Descriptor
deprecated
func (*SearchRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) GetBlogId ¶
func (x *SearchRequest) GetBlogId() uint64
func (*SearchRequest) GetEnd ¶
func (x *SearchRequest) GetEnd() uint64
func (*SearchRequest) GetFilter ¶
func (x *SearchRequest) GetFilter() string
func (*SearchRequest) GetStart ¶
func (x *SearchRequest) GetStart() uint64
func (*SearchRequest) ProtoMessage ¶
func (*SearchRequest) ProtoMessage()
func (*SearchRequest) ProtoReflect ¶
func (x *SearchRequest) ProtoReflect() protoreflect.Message
func (*SearchRequest) Reset ¶
func (x *SearchRequest) Reset()
func (*SearchRequest) String ¶
func (x *SearchRequest) String() string
type UnimplementedBlogServer ¶
type UnimplementedBlogServer struct { }
UnimplementedBlogServer must be embedded to have forward compatible implementations.
func (UnimplementedBlogServer) CreatePost ¶
func (UnimplementedBlogServer) CreatePost(context.Context, *CreateRequest) (*Response, error)
func (UnimplementedBlogServer) DeletePost ¶
func (UnimplementedBlogServer) GetPosts ¶
func (UnimplementedBlogServer) GetPosts(context.Context, *SearchRequest) (*Contents, 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.