client/golang/feed/timeline_grpc.pb.go

248 lines
8.5 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: timeline.proto
package feed
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Timeline_Recommend_FullMethodName = "/feed.Timeline/Recommend"
Timeline_Friend_FullMethodName = "/feed.Timeline/Friend"
Timeline_Follow_FullMethodName = "/feed.Timeline/Follow"
Timeline_Hot_FullMethodName = "/feed.Timeline/Hot"
)
// TimelineClient is the client API for Timeline 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 TimelineClient interface {
// 推荐
Recommend(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error)
// 好友动态
Friend(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error)
// 关注的动态
Follow(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error)
// 热门
Hot(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error)
}
type timelineClient struct {
cc grpc.ClientConnInterface
}
func NewTimelineClient(cc grpc.ClientConnInterface) TimelineClient {
return &timelineClient{cc}
}
func (c *timelineClient) Recommend(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PostListReply)
err := c.cc.Invoke(ctx, Timeline_Recommend_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *timelineClient) Friend(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PostListReply)
err := c.cc.Invoke(ctx, Timeline_Friend_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *timelineClient) Follow(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PostListReply)
err := c.cc.Invoke(ctx, Timeline_Follow_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *timelineClient) Hot(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PostListReply)
err := c.cc.Invoke(ctx, Timeline_Hot_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// TimelineServer is the server API for Timeline service.
// All implementations must embed UnimplementedTimelineServer
// for forward compatibility.
//
// 实时动态
type TimelineServer interface {
// 推荐
Recommend(context.Context, *FetchRequest) (*PostListReply, error)
// 好友动态
Friend(context.Context, *FetchRequest) (*PostListReply, error)
// 关注的动态
Follow(context.Context, *FetchRequest) (*PostListReply, error)
// 热门
Hot(context.Context, *FetchRequest) (*PostListReply, error)
mustEmbedUnimplementedTimelineServer()
}
// UnimplementedTimelineServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedTimelineServer struct{}
func (UnimplementedTimelineServer) Recommend(context.Context, *FetchRequest) (*PostListReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Recommend not implemented")
}
func (UnimplementedTimelineServer) Friend(context.Context, *FetchRequest) (*PostListReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Friend not implemented")
}
func (UnimplementedTimelineServer) Follow(context.Context, *FetchRequest) (*PostListReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Follow not implemented")
}
func (UnimplementedTimelineServer) Hot(context.Context, *FetchRequest) (*PostListReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Hot not implemented")
}
func (UnimplementedTimelineServer) mustEmbedUnimplementedTimelineServer() {}
func (UnimplementedTimelineServer) testEmbeddedByValue() {}
// UnsafeTimelineServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TimelineServer will
// result in compilation errors.
type UnsafeTimelineServer interface {
mustEmbedUnimplementedTimelineServer()
}
func RegisterTimelineServer(s grpc.ServiceRegistrar, srv TimelineServer) {
// If the following call pancis, it indicates UnimplementedTimelineServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Timeline_ServiceDesc, srv)
}
func _Timeline_Recommend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TimelineServer).Recommend(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Timeline_Recommend_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TimelineServer).Recommend(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Timeline_Friend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TimelineServer).Friend(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Timeline_Friend_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TimelineServer).Friend(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Timeline_Follow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TimelineServer).Follow(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Timeline_Follow_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TimelineServer).Follow(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Timeline_Hot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TimelineServer).Hot(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Timeline_Hot_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TimelineServer).Hot(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
// Timeline_ServiceDesc is the grpc.ServiceDesc for Timeline service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Timeline_ServiceDesc = grpc.ServiceDesc{
ServiceName: "feed.Timeline",
HandlerType: (*TimelineServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Recommend",
Handler: _Timeline_Recommend_Handler,
},
{
MethodName: "Friend",
Handler: _Timeline_Friend_Handler,
},
{
MethodName: "Follow",
Handler: _Timeline_Follow_Handler,
},
{
MethodName: "Hot",
Handler: _Timeline_Hot_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "timeline.proto",
}