puzzleblogservice

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 8 Imported by: 3

README

puzzleblogservice

service description to store blog post

Documentation

Index

Constants

This section is empty.

Variables

View Source
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)

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) Descriptor() ([]byte, []int)

Deprecated: Use Content.ProtoReflect.Descriptor instead.

func (*Content) GetCreatedAt

func (x *Content) GetCreatedAt() int64

func (*Content) GetPostId

func (x *Content) GetPostId() uint64

func (*Content) GetText

func (x *Content) GetText() string

func (*Content) GetTitle

func (x *Content) GetTitle() string

func (*Content) GetUserId

func (x *Content) GetUserId() uint64

func (*Content) ProtoMessage

func (*Content) ProtoMessage()

func (*Content) ProtoReflect

func (x *Content) ProtoReflect() protoreflect.Message

func (*Content) Reset

func (x *Content) Reset()

func (*Content) String

func (x *Content) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Contents.ProtoReflect.Descriptor instead.

func (*Contents) GetList

func (x *Contents) GetList() []*Content

func (*Contents) GetTotal

func (x *Contents) GetTotal() uint64

func (*Contents) ProtoMessage

func (*Contents) ProtoMessage()

func (*Contents) ProtoReflect

func (x *Contents) ProtoReflect() protoreflect.Message

func (*Contents) Reset

func (x *Contents) Reset()

func (*Contents) String

func (x *Contents) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use IdRequest.ProtoReflect.Descriptor instead.

func (*IdRequest) GetBlogId

func (x *IdRequest) GetBlogId() uint64

func (*IdRequest) GetPostId

func (x *IdRequest) GetPostId() uint64

func (*IdRequest) ProtoMessage

func (*IdRequest) ProtoMessage()

func (*IdRequest) ProtoReflect

func (x *IdRequest) ProtoReflect() protoreflect.Message

func (*IdRequest) Reset

func (x *IdRequest) Reset()

func (*IdRequest) String

func (x *IdRequest) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetId added in v1.1.0

func (x *Response) GetId() uint64

func (*Response) GetSuccess added in v1.1.0

func (x *Response) GetSuccess() bool

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

func (*Response) Reset added in v1.1.0

func (x *Response) Reset()

func (*Response) String added in v1.1.0

func (x *Response) String() string

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) DeletePost

func (UnimplementedBlogServer) GetPost

func (UnimplementedBlogServer) GetPosts

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL