v1

package
v0.0.0-...-97cb226 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlogService_GetArticles_FullMethodName   = "/product.app.v1.BlogService/GetArticles"
	BlogService_CreateArticle_FullMethodName = "/product.app.v1.BlogService/CreateArticle"
	BlogService_SvrStream_FullMethodName     = "/product.app.v1.BlogService/SvrStream"
	BlogService_CliStream_FullMethodName     = "/product.app.v1.BlogService/CliStream"
	BlogService_BothStream_FullMethodName    = "/product.app.v1.BlogService/BothStream"
)

Variables

View Source
var BlogService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "product.app.v1.BlogService",
	HandlerType: (*BlogServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetArticles",
			Handler:    _BlogService_GetArticles_Handler,
		},
		{
			MethodName: "CreateArticle",
			Handler:    _BlogService_CreateArticle_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SvrStream",
			Handler:       _BlogService_SvrStream_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "CliStream",
			Handler:       _BlogService_CliStream_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "BothStream",
			Handler:       _BlogService_BothStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "api/product/app/v1/v1.proto",
}

BlogService_ServiceDesc is the grpc.ServiceDesc for BlogService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_api_product_app_v1_v1_proto protoreflect.FileDescriptor

Functions

func RegisterBlogServiceServer

func RegisterBlogServiceServer(s grpc.ServiceRegistrar, srv BlogServiceServer)

Types

type Article

type Article struct {
	Title   string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// @inject_tag: form:"author_id" uri:"author_id"
	AuthorId int32 `protobuf:"varint,3,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Article) Descriptor deprecated

func (*Article) Descriptor() ([]byte, []int)

Deprecated: Use Article.ProtoReflect.Descriptor instead.

func (*Article) GetAuthorId

func (x *Article) GetAuthorId() int32

func (*Article) GetContent

func (x *Article) GetContent() string

func (*Article) GetTitle

func (x *Article) GetTitle() string

func (*Article) ProtoMessage

func (*Article) ProtoMessage()

func (*Article) ProtoReflect

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

func (*Article) Reset

func (x *Article) Reset()

func (*Article) String

func (x *Article) String() string

type BlogServiceClient

type BlogServiceClient interface {
	// 获取文章列表
	GetArticles(ctx context.Context, in *GetArticlesReq, opts ...grpc.CallOption) (*GetArticlesResp, error)
	// 创建文章
	CreateArticle(ctx context.Context, in *Article, opts ...grpc.CallOption) (*Article, error)
	SvrStream(ctx context.Context, opts ...grpc.CallOption) (BlogService_SvrStreamClient, error)
	CliStream(ctx context.Context, in *SvrStreamRequest, opts ...grpc.CallOption) (BlogService_CliStreamClient, error)
	BothStream(ctx context.Context, opts ...grpc.CallOption) (BlogService_BothStreamClient, error)
}

BlogServiceClient is the client API for BlogService 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.

type BlogServiceServer

type BlogServiceServer interface {
	// 获取文章列表
	GetArticles(context.Context, *GetArticlesReq) (*GetArticlesResp, error)
	// 创建文章
	CreateArticle(context.Context, *Article) (*Article, error)
	SvrStream(BlogService_SvrStreamServer) error
	CliStream(*SvrStreamRequest, BlogService_CliStreamServer) error
	BothStream(BlogService_BothStreamServer) error
	// contains filtered or unexported methods
}

BlogServiceServer is the server API for BlogService service. All implementations must embed UnimplementedBlogServiceServer for forward compatibility

type BlogService_BothStreamClient

type BlogService_BothStreamClient interface {
	Send(*SvrStreamRequest) error
	Recv() (*SvrStreamReply, error)
	grpc.ClientStream
}

type BlogService_BothStreamServer

type BlogService_BothStreamServer interface {
	Send(*SvrStreamReply) error
	Recv() (*SvrStreamRequest, error)
	grpc.ServerStream
}

type BlogService_CliStreamClient

type BlogService_CliStreamClient interface {
	Recv() (*SvrStreamReply, error)
	grpc.ClientStream
}

type BlogService_CliStreamServer

type BlogService_CliStreamServer interface {
	Send(*SvrStreamReply) error
	grpc.ServerStream
}

type BlogService_SvrStreamClient

type BlogService_SvrStreamClient interface {
	Send(*SvrStreamRequest) error
	CloseAndRecv() (*SvrStreamReply, error)
	grpc.ClientStream
}

type BlogService_SvrStreamServer

type BlogService_SvrStreamServer interface {
	SendAndClose(*SvrStreamReply) error
	Recv() (*SvrStreamRequest, error)
	grpc.ServerStream
}

type GetArticlesReq

type GetArticlesReq struct {

	// @inject_tag: form:"title"
	Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	// @inject_tag: form:"page"
	Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"`
	// @inject_tag: form:"page_size"
	PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// 作者名
	// @inject_tag: form:"author_id" uri:"author_id"
	AuthorId int32 `protobuf:"varint,4,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetArticlesReq) Descriptor deprecated

func (*GetArticlesReq) Descriptor() ([]byte, []int)

Deprecated: Use GetArticlesReq.ProtoReflect.Descriptor instead.

func (*GetArticlesReq) GetAuthorId

func (x *GetArticlesReq) GetAuthorId() int32

func (*GetArticlesReq) GetPage

func (x *GetArticlesReq) GetPage() int32

func (*GetArticlesReq) GetPageSize

func (x *GetArticlesReq) GetPageSize() int32

func (*GetArticlesReq) GetTitle

func (x *GetArticlesReq) GetTitle() string

func (*GetArticlesReq) ProtoMessage

func (*GetArticlesReq) ProtoMessage()

func (*GetArticlesReq) ProtoReflect

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

func (*GetArticlesReq) Reset

func (x *GetArticlesReq) Reset()

func (*GetArticlesReq) String

func (x *GetArticlesReq) String() string

type GetArticlesResp

type GetArticlesResp struct {
	Total    int64      `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	Articles []*Article `protobuf:"bytes,2,rep,name=articles,proto3" json:"articles,omitempty"`
	// contains filtered or unexported fields
}

func (*GetArticlesResp) Descriptor deprecated

func (*GetArticlesResp) Descriptor() ([]byte, []int)

Deprecated: Use GetArticlesResp.ProtoReflect.Descriptor instead.

func (*GetArticlesResp) GetArticles

func (x *GetArticlesResp) GetArticles() []*Article

func (*GetArticlesResp) GetTotal

func (x *GetArticlesResp) GetTotal() int64

func (*GetArticlesResp) ProtoMessage

func (*GetArticlesResp) ProtoMessage()

func (*GetArticlesResp) ProtoReflect

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

func (*GetArticlesResp) Reset

func (x *GetArticlesResp) Reset()

func (*GetArticlesResp) String

func (x *GetArticlesResp) String() string

type SvrStreamReply

type SvrStreamReply struct {
	// contains filtered or unexported fields
}

func (*SvrStreamReply) Descriptor deprecated

func (*SvrStreamReply) Descriptor() ([]byte, []int)

Deprecated: Use SvrStreamReply.ProtoReflect.Descriptor instead.

func (*SvrStreamReply) ProtoMessage

func (*SvrStreamReply) ProtoMessage()

func (*SvrStreamReply) ProtoReflect

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

func (*SvrStreamReply) Reset

func (x *SvrStreamReply) Reset()

func (*SvrStreamReply) String

func (x *SvrStreamReply) String() string

type SvrStreamRequest

type SvrStreamRequest struct {
	// contains filtered or unexported fields
}

func (*SvrStreamRequest) Descriptor deprecated

func (*SvrStreamRequest) Descriptor() ([]byte, []int)

Deprecated: Use SvrStreamRequest.ProtoReflect.Descriptor instead.

func (*SvrStreamRequest) ProtoMessage

func (*SvrStreamRequest) ProtoMessage()

func (*SvrStreamRequest) ProtoReflect

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

func (*SvrStreamRequest) Reset

func (x *SvrStreamRequest) Reset()

func (*SvrStreamRequest) String

func (x *SvrStreamRequest) String() string

type UnimplementedBlogServiceServer

type UnimplementedBlogServiceServer struct {
}

UnimplementedBlogServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedBlogServiceServer) BothStream

func (UnimplementedBlogServiceServer) CliStream

func (UnimplementedBlogServiceServer) CreateArticle

func (UnimplementedBlogServiceServer) GetArticles

func (UnimplementedBlogServiceServer) SvrStream

type UnsafeBlogServiceServer

type UnsafeBlogServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeBlogServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BlogServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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