142 lines
4.7 KiB
Go
142 lines
4.7 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.2.0
|
|
// - protoc v3.21.8
|
|
// source: api.proto
|
|
|
|
package pb
|
|
|
|
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.32.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion7
|
|
|
|
// BiliAPIClient is the client API for BiliAPI 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 BiliAPIClient interface {
|
|
GetUserStat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatReply, error)
|
|
GetUserBasicInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoReply, error)
|
|
}
|
|
|
|
type biliAPIClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewBiliAPIClient(cc grpc.ClientConnInterface) BiliAPIClient {
|
|
return &biliAPIClient{cc}
|
|
}
|
|
|
|
func (c *biliAPIClient) GetUserStat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatReply, error) {
|
|
out := new(StatReply)
|
|
err := c.cc.Invoke(ctx, "/api.BiliAPI/GetUserStat", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *biliAPIClient) GetUserBasicInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoReply, error) {
|
|
out := new(InfoReply)
|
|
err := c.cc.Invoke(ctx, "/api.BiliAPI/GetUserBasicInfo", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// BiliAPIServer is the server API for BiliAPI service.
|
|
// All implementations must embed UnimplementedBiliAPIServer
|
|
// for forward compatibility
|
|
type BiliAPIServer interface {
|
|
GetUserStat(context.Context, *StatRequest) (*StatReply, error)
|
|
GetUserBasicInfo(context.Context, *InfoRequest) (*InfoReply, error)
|
|
mustEmbedUnimplementedBiliAPIServer()
|
|
}
|
|
|
|
// UnimplementedBiliAPIServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedBiliAPIServer struct {
|
|
}
|
|
|
|
func (UnimplementedBiliAPIServer) GetUserStat(context.Context, *StatRequest) (*StatReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetUserStat not implemented")
|
|
}
|
|
func (UnimplementedBiliAPIServer) GetUserBasicInfo(context.Context, *InfoRequest) (*InfoReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetUserBasicInfo not implemented")
|
|
}
|
|
func (UnimplementedBiliAPIServer) mustEmbedUnimplementedBiliAPIServer() {}
|
|
|
|
// UnsafeBiliAPIServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to BiliAPIServer will
|
|
// result in compilation errors.
|
|
type UnsafeBiliAPIServer interface {
|
|
mustEmbedUnimplementedBiliAPIServer()
|
|
}
|
|
|
|
func RegisterBiliAPIServer(s grpc.ServiceRegistrar, srv BiliAPIServer) {
|
|
s.RegisterService(&BiliAPI_ServiceDesc, srv)
|
|
}
|
|
|
|
func _BiliAPI_GetUserStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(StatRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BiliAPIServer).GetUserStat(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/api.BiliAPI/GetUserStat",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BiliAPIServer).GetUserStat(ctx, req.(*StatRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BiliAPI_GetUserBasicInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(InfoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BiliAPIServer).GetUserBasicInfo(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/api.BiliAPI/GetUserBasicInfo",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BiliAPIServer).GetUserBasicInfo(ctx, req.(*InfoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// BiliAPI_ServiceDesc is the grpc.ServiceDesc for BiliAPI service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var BiliAPI_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api.BiliAPI",
|
|
HandlerType: (*BiliAPIServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetUserStat",
|
|
Handler: _BiliAPI_GetUserStat_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetUserBasicInfo",
|
|
Handler: _BiliAPI_GetUserBasicInfo_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "api.proto",
|
|
}
|