2023-04-25 23:16:36 -04:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
2024-11-22 23:43:02 -05:00
// - protoc-gen-go-grpc v1.3.0
// - protoc v5.28.1
2023-04-25 23:16:36 -04:00
// source: proto/nezha.proto
package proto
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.
2024-11-22 23:43:02 -05:00
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc . SupportPackageIsVersion7
2023-04-25 23:16:36 -04:00
const (
NezhaService_ReportSystemState_FullMethodName = "/proto.NezhaService/ReportSystemState"
NezhaService_ReportSystemInfo_FullMethodName = "/proto.NezhaService/ReportSystemInfo"
NezhaService_RequestTask_FullMethodName = "/proto.NezhaService/RequestTask"
2024-07-14 00:47:36 -04:00
NezhaService_IOStream_FullMethodName = "/proto.NezhaService/IOStream"
2024-11-22 09:40:43 -05:00
NezhaService_ReportGeoIP_FullMethodName = "/proto.NezhaService/ReportGeoIP"
2024-12-06 22:06:42 -05:00
NezhaService_ReportSystemInfo2_FullMethodName = "/proto.NezhaService/ReportSystemInfo2"
2023-04-25 23:16:36 -04:00
)
// NezhaServiceClient is the client API for NezhaService 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 NezhaServiceClient interface {
2024-11-22 23:43:02 -05:00
ReportSystemState ( ctx context . Context , opts ... grpc . CallOption ) ( NezhaService_ReportSystemStateClient , error )
2023-04-25 23:16:36 -04:00
ReportSystemInfo ( ctx context . Context , in * Host , opts ... grpc . CallOption ) ( * Receipt , error )
2024-12-04 11:11:34 -05:00
RequestTask ( ctx context . Context , opts ... grpc . CallOption ) ( NezhaService_RequestTaskClient , error )
2024-11-22 23:43:02 -05:00
IOStream ( ctx context . Context , opts ... grpc . CallOption ) ( NezhaService_IOStreamClient , error )
2024-11-22 09:40:43 -05:00
ReportGeoIP ( ctx context . Context , in * GeoIP , opts ... grpc . CallOption ) ( * GeoIP , error )
2024-12-06 23:19:48 -05:00
ReportSystemInfo2 ( ctx context . Context , in * Host , opts ... grpc . CallOption ) ( * Uint64Receipt , error )
2023-04-25 23:16:36 -04:00
}
type nezhaServiceClient struct {
cc grpc . ClientConnInterface
}
func NewNezhaServiceClient ( cc grpc . ClientConnInterface ) NezhaServiceClient {
return & nezhaServiceClient { cc }
}
2024-11-22 23:43:02 -05:00
func ( c * nezhaServiceClient ) ReportSystemState ( ctx context . Context , opts ... grpc . CallOption ) ( NezhaService_ReportSystemStateClient , error ) {
stream , err := c . cc . NewStream ( ctx , & NezhaService_ServiceDesc . Streams [ 0 ] , NezhaService_ReportSystemState_FullMethodName , opts ... )
2023-04-25 23:16:36 -04:00
if err != nil {
return nil , err
}
2024-11-22 23:43:02 -05:00
x := & nezhaServiceReportSystemStateClient { stream }
return x , nil
}
type NezhaService_ReportSystemStateClient interface {
Send ( * State ) error
Recv ( ) ( * Receipt , error )
grpc . ClientStream
}
type nezhaServiceReportSystemStateClient struct {
grpc . ClientStream
}
func ( x * nezhaServiceReportSystemStateClient ) Send ( m * State ) error {
return x . ClientStream . SendMsg ( m )
}
func ( x * nezhaServiceReportSystemStateClient ) Recv ( ) ( * Receipt , error ) {
m := new ( Receipt )
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
2023-04-25 23:16:36 -04:00
}
func ( c * nezhaServiceClient ) ReportSystemInfo ( ctx context . Context , in * Host , opts ... grpc . CallOption ) ( * Receipt , error ) {
out := new ( Receipt )
2024-11-22 23:43:02 -05:00
err := c . cc . Invoke ( ctx , NezhaService_ReportSystemInfo_FullMethodName , in , out , opts ... )
2023-04-25 23:16:36 -04:00
if err != nil {
return nil , err
}
return out , nil
}
2024-12-04 11:11:34 -05:00
func ( c * nezhaServiceClient ) RequestTask ( ctx context . Context , opts ... grpc . CallOption ) ( NezhaService_RequestTaskClient , error ) {
2024-11-22 23:43:02 -05:00
stream , err := c . cc . NewStream ( ctx , & NezhaService_ServiceDesc . Streams [ 1 ] , NezhaService_RequestTask_FullMethodName , opts ... )
2023-04-25 23:16:36 -04:00
if err != nil {
return nil , err
}
2024-11-22 23:43:02 -05:00
x := & nezhaServiceRequestTaskClient { stream }
2023-04-25 23:16:36 -04:00
return x , nil
}
2024-11-22 23:43:02 -05:00
type NezhaService_RequestTaskClient interface {
2024-12-04 11:11:34 -05:00
Send ( * TaskResult ) error
2024-11-22 23:43:02 -05:00
Recv ( ) ( * Task , error )
grpc . ClientStream
}
2023-04-25 23:16:36 -04:00
2024-11-22 23:43:02 -05:00
type nezhaServiceRequestTaskClient struct {
grpc . ClientStream
}
2024-12-04 11:11:34 -05:00
func ( x * nezhaServiceRequestTaskClient ) Send ( m * TaskResult ) error {
return x . ClientStream . SendMsg ( m )
}
2024-11-22 23:43:02 -05:00
func ( x * nezhaServiceRequestTaskClient ) Recv ( ) ( * Task , error ) {
m := new ( Task )
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
func ( c * nezhaServiceClient ) IOStream ( ctx context . Context , opts ... grpc . CallOption ) ( NezhaService_IOStreamClient , error ) {
stream , err := c . cc . NewStream ( ctx , & NezhaService_ServiceDesc . Streams [ 2 ] , NezhaService_IOStream_FullMethodName , opts ... )
2024-07-14 00:47:36 -04:00
if err != nil {
return nil , err
}
2024-11-22 23:43:02 -05:00
x := & nezhaServiceIOStreamClient { stream }
2024-07-14 00:47:36 -04:00
return x , nil
}
2024-11-22 23:43:02 -05:00
type NezhaService_IOStreamClient interface {
Send ( * IOStreamData ) error
Recv ( ) ( * IOStreamData , error )
grpc . ClientStream
}
type nezhaServiceIOStreamClient struct {
grpc . ClientStream
}
func ( x * nezhaServiceIOStreamClient ) Send ( m * IOStreamData ) error {
return x . ClientStream . SendMsg ( m )
}
func ( x * nezhaServiceIOStreamClient ) Recv ( ) ( * IOStreamData , error ) {
m := new ( IOStreamData )
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
2024-07-14 00:47:36 -04:00
2024-11-22 09:40:43 -05:00
func ( c * nezhaServiceClient ) ReportGeoIP ( ctx context . Context , in * GeoIP , opts ... grpc . CallOption ) ( * GeoIP , error ) {
2024-07-28 01:59:58 -04:00
out := new ( GeoIP )
2024-11-22 23:43:02 -05:00
err := c . cc . Invoke ( ctx , NezhaService_ReportGeoIP_FullMethodName , in , out , opts ... )
2024-07-28 01:59:58 -04:00
if err != nil {
return nil , err
}
return out , nil
}
2024-12-06 23:19:48 -05:00
func ( c * nezhaServiceClient ) ReportSystemInfo2 ( ctx context . Context , in * Host , opts ... grpc . CallOption ) ( * Uint64Receipt , error ) {
out := new ( Uint64Receipt )
2024-12-06 22:06:42 -05:00
err := c . cc . Invoke ( ctx , NezhaService_ReportSystemInfo2_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-04-25 23:16:36 -04:00
// NezhaServiceServer is the server API for NezhaService service.
// All implementations should embed UnimplementedNezhaServiceServer
2024-11-22 23:43:02 -05:00
// for forward compatibility
2023-04-25 23:16:36 -04:00
type NezhaServiceServer interface {
2024-11-22 23:43:02 -05:00
ReportSystemState ( NezhaService_ReportSystemStateServer ) error
2023-04-25 23:16:36 -04:00
ReportSystemInfo ( context . Context , * Host ) ( * Receipt , error )
2024-12-04 11:11:34 -05:00
RequestTask ( NezhaService_RequestTaskServer ) error
2024-11-22 23:43:02 -05:00
IOStream ( NezhaService_IOStreamServer ) error
2024-11-22 09:40:43 -05:00
ReportGeoIP ( context . Context , * GeoIP ) ( * GeoIP , error )
2024-12-06 23:19:48 -05:00
ReportSystemInfo2 ( context . Context , * Host ) ( * Uint64Receipt , error )
2023-04-25 23:16:36 -04:00
}
2024-11-22 23:43:02 -05:00
// UnimplementedNezhaServiceServer should be embedded to have forward compatible implementations.
type UnimplementedNezhaServiceServer struct {
}
2023-04-25 23:16:36 -04:00
2024-11-22 23:43:02 -05:00
func ( UnimplementedNezhaServiceServer ) ReportSystemState ( NezhaService_ReportSystemStateServer ) error {
return status . Errorf ( codes . Unimplemented , "method ReportSystemState not implemented" )
2023-04-25 23:16:36 -04:00
}
func ( UnimplementedNezhaServiceServer ) ReportSystemInfo ( context . Context , * Host ) ( * Receipt , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method ReportSystemInfo not implemented" )
}
2024-12-04 11:11:34 -05:00
func ( UnimplementedNezhaServiceServer ) RequestTask ( NezhaService_RequestTaskServer ) error {
2023-04-25 23:16:36 -04:00
return status . Errorf ( codes . Unimplemented , "method RequestTask not implemented" )
}
2024-11-22 23:43:02 -05:00
func ( UnimplementedNezhaServiceServer ) IOStream ( NezhaService_IOStreamServer ) error {
2024-07-14 00:47:36 -04:00
return status . Errorf ( codes . Unimplemented , "method IOStream not implemented" )
}
2024-11-22 09:40:43 -05:00
func ( UnimplementedNezhaServiceServer ) ReportGeoIP ( context . Context , * GeoIP ) ( * GeoIP , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method ReportGeoIP not implemented" )
2024-07-28 01:59:58 -04:00
}
2024-12-06 23:19:48 -05:00
func ( UnimplementedNezhaServiceServer ) ReportSystemInfo2 ( context . Context , * Host ) ( * Uint64Receipt , error ) {
2024-12-06 22:06:42 -05:00
return nil , status . Errorf ( codes . Unimplemented , "method ReportSystemInfo2 not implemented" )
}
2023-04-25 23:16:36 -04:00
// UnsafeNezhaServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NezhaServiceServer will
// result in compilation errors.
type UnsafeNezhaServiceServer interface {
mustEmbedUnimplementedNezhaServiceServer ( )
}
func RegisterNezhaServiceServer ( s grpc . ServiceRegistrar , srv NezhaServiceServer ) {
s . RegisterService ( & NezhaService_ServiceDesc , srv )
}
2024-11-22 23:43:02 -05:00
func _NezhaService_ReportSystemState_Handler ( srv interface { } , stream grpc . ServerStream ) error {
return srv . ( NezhaServiceServer ) . ReportSystemState ( & nezhaServiceReportSystemStateServer { stream } )
}
type NezhaService_ReportSystemStateServer interface {
Send ( * Receipt ) error
Recv ( ) ( * State , error )
grpc . ServerStream
}
type nezhaServiceReportSystemStateServer struct {
grpc . ServerStream
}
func ( x * nezhaServiceReportSystemStateServer ) Send ( m * Receipt ) error {
return x . ServerStream . SendMsg ( m )
}
func ( x * nezhaServiceReportSystemStateServer ) Recv ( ) ( * State , error ) {
m := new ( State )
if err := x . ServerStream . RecvMsg ( m ) ; err != nil {
2023-04-25 23:16:36 -04:00
return nil , err
}
2024-11-22 23:43:02 -05:00
return m , nil
2023-04-25 23:16:36 -04:00
}
func _NezhaService_ReportSystemInfo_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( Host )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NezhaServiceServer ) . ReportSystemInfo ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : NezhaService_ReportSystemInfo_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NezhaServiceServer ) . ReportSystemInfo ( ctx , req . ( * Host ) )
}
return interceptor ( ctx , in , info , handler )
}
func _NezhaService_RequestTask_Handler ( srv interface { } , stream grpc . ServerStream ) error {
2024-12-04 11:11:34 -05:00
return srv . ( NezhaServiceServer ) . RequestTask ( & nezhaServiceRequestTaskServer { stream } )
2024-11-22 23:43:02 -05:00
}
type NezhaService_RequestTaskServer interface {
Send ( * Task ) error
2024-12-04 11:11:34 -05:00
Recv ( ) ( * TaskResult , error )
2024-11-22 23:43:02 -05:00
grpc . ServerStream
}
type nezhaServiceRequestTaskServer struct {
grpc . ServerStream
2023-04-25 23:16:36 -04:00
}
2024-11-22 23:43:02 -05:00
func ( x * nezhaServiceRequestTaskServer ) Send ( m * Task ) error {
return x . ServerStream . SendMsg ( m )
}
2023-04-25 23:16:36 -04:00
2024-12-04 11:11:34 -05:00
func ( x * nezhaServiceRequestTaskServer ) Recv ( ) ( * TaskResult , error ) {
m := new ( TaskResult )
if err := x . ServerStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
2024-07-14 00:47:36 -04:00
func _NezhaService_IOStream_Handler ( srv interface { } , stream grpc . ServerStream ) error {
2024-11-22 23:43:02 -05:00
return srv . ( NezhaServiceServer ) . IOStream ( & nezhaServiceIOStreamServer { stream } )
2024-07-14 00:47:36 -04:00
}
2024-11-22 23:43:02 -05:00
type NezhaService_IOStreamServer interface {
Send ( * IOStreamData ) error
Recv ( ) ( * IOStreamData , error )
grpc . ServerStream
}
type nezhaServiceIOStreamServer struct {
grpc . ServerStream
}
func ( x * nezhaServiceIOStreamServer ) Send ( m * IOStreamData ) error {
return x . ServerStream . SendMsg ( m )
}
func ( x * nezhaServiceIOStreamServer ) Recv ( ) ( * IOStreamData , error ) {
m := new ( IOStreamData )
if err := x . ServerStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
2024-07-14 00:47:36 -04:00
2024-11-22 09:40:43 -05:00
func _NezhaService_ReportGeoIP_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2024-07-28 01:59:58 -04:00
in := new ( GeoIP )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2024-11-22 09:40:43 -05:00
return srv . ( NezhaServiceServer ) . ReportGeoIP ( ctx , in )
2024-07-28 01:59:58 -04:00
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-11-22 09:40:43 -05:00
FullMethod : NezhaService_ReportGeoIP_FullMethodName ,
2024-07-28 01:59:58 -04:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2024-11-22 09:40:43 -05:00
return srv . ( NezhaServiceServer ) . ReportGeoIP ( ctx , req . ( * GeoIP ) )
2024-07-28 01:59:58 -04:00
}
return interceptor ( ctx , in , info , handler )
}
2024-12-06 22:06:42 -05:00
func _NezhaService_ReportSystemInfo2_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( Host )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NezhaServiceServer ) . ReportSystemInfo2 ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : NezhaService_ReportSystemInfo2_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NezhaServiceServer ) . ReportSystemInfo2 ( ctx , req . ( * Host ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-04-25 23:16:36 -04:00
// NezhaService_ServiceDesc is the grpc.ServiceDesc for NezhaService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var NezhaService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "proto.NezhaService" ,
HandlerType : ( * NezhaServiceServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "ReportSystemInfo" ,
Handler : _NezhaService_ReportSystemInfo_Handler ,
} ,
2024-07-28 01:59:58 -04:00
{
2024-11-22 09:40:43 -05:00
MethodName : "ReportGeoIP" ,
Handler : _NezhaService_ReportGeoIP_Handler ,
2024-07-28 01:59:58 -04:00
} ,
2024-12-06 22:06:42 -05:00
{
MethodName : "ReportSystemInfo2" ,
Handler : _NezhaService_ReportSystemInfo2_Handler ,
} ,
2023-04-25 23:16:36 -04:00
} ,
Streams : [ ] grpc . StreamDesc {
2024-11-22 23:43:02 -05:00
{
StreamName : "ReportSystemState" ,
Handler : _NezhaService_ReportSystemState_Handler ,
ServerStreams : true ,
ClientStreams : true ,
} ,
2023-04-25 23:16:36 -04:00
{
StreamName : "RequestTask" ,
Handler : _NezhaService_RequestTask_Handler ,
ServerStreams : true ,
2024-12-04 11:11:34 -05:00
ClientStreams : true ,
2023-04-25 23:16:36 -04:00
} ,
2024-07-14 00:47:36 -04:00
{
StreamName : "IOStream" ,
Handler : _NezhaService_IOStream_Handler ,
ServerStreams : true ,
ClientStreams : true ,
} ,
2023-04-25 23:16:36 -04:00
} ,
Metadata : "proto/nezha.proto" ,
}