// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v4.25.1 // source: storage.proto package storagepb 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 // StorageServiceClient is the client API for StorageService 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 StorageServiceClient interface { Route(ctx context.Context, in *RouteRequest, opts ...grpc.CallOption) (*RouteResponse, error) Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) StreamWrite(ctx context.Context, opts ...grpc.CallOption) (StorageService_StreamWriteClient, error) SqlQuery(ctx context.Context, in *SqlQueryRequest, opts ...grpc.CallOption) (*SqlQueryResponse, error) StreamSqlQuery(ctx context.Context, in *SqlQueryRequest, opts ...grpc.CallOption) (StorageService_StreamSqlQueryClient, error) PromRemoteQuery(ctx context.Context, in *PrometheusRemoteQueryRequest, opts ...grpc.CallOption) (*PrometheusRemoteQueryResponse, error) // This interface is mainly for testing now PromQuery(ctx context.Context, in *PrometheusQueryRequest, opts ...grpc.CallOption) (*PrometheusQueryResponse, error) } type storageServiceClient struct { cc grpc.ClientConnInterface } func NewStorageServiceClient(cc grpc.ClientConnInterface) StorageServiceClient { return &storageServiceClient{cc} } func (c *storageServiceClient) Route(ctx context.Context, in *RouteRequest, opts ...grpc.CallOption) (*RouteResponse, error) { out := new(RouteResponse) err := c.cc.Invoke(ctx, "/storage.StorageService/Route", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *storageServiceClient) Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) { out := new(WriteResponse) err := c.cc.Invoke(ctx, "/storage.StorageService/Write", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *storageServiceClient) StreamWrite(ctx context.Context, opts ...grpc.CallOption) (StorageService_StreamWriteClient, error) { stream, err := c.cc.NewStream(ctx, &StorageService_ServiceDesc.Streams[0], "/storage.StorageService/StreamWrite", opts...) if err != nil { return nil, err } x := &storageServiceStreamWriteClient{stream} return x, nil } type StorageService_StreamWriteClient interface { Send(*WriteRequest) error CloseAndRecv() (*WriteResponse, error) grpc.ClientStream } type storageServiceStreamWriteClient struct { grpc.ClientStream } func (x *storageServiceStreamWriteClient) Send(m *WriteRequest) error { return x.ClientStream.SendMsg(m) } func (x *storageServiceStreamWriteClient) CloseAndRecv() (*WriteResponse, error) { if err := x.ClientStream.CloseSend(); err != nil { return nil, err } m := new(WriteResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *storageServiceClient) SqlQuery(ctx context.Context, in *SqlQueryRequest, opts ...grpc.CallOption) (*SqlQueryResponse, error) { out := new(SqlQueryResponse) err := c.cc.Invoke(ctx, "/storage.StorageService/SqlQuery", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *storageServiceClient) StreamSqlQuery(ctx context.Context, in *SqlQueryRequest, opts ...grpc.CallOption) (StorageService_StreamSqlQueryClient, error) { stream, err := c.cc.NewStream(ctx, &StorageService_ServiceDesc.Streams[1], "/storage.StorageService/StreamSqlQuery", opts...) if err != nil { return nil, err } x := &storageServiceStreamSqlQueryClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } if err := x.ClientStream.CloseSend(); err != nil { return nil, err } return x, nil } type StorageService_StreamSqlQueryClient interface { Recv() (*SqlQueryResponse, error) grpc.ClientStream } type storageServiceStreamSqlQueryClient struct { grpc.ClientStream } func (x *storageServiceStreamSqlQueryClient) Recv() (*SqlQueryResponse, error) { m := new(SqlQueryResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *storageServiceClient) PromRemoteQuery(ctx context.Context, in *PrometheusRemoteQueryRequest, opts ...grpc.CallOption) (*PrometheusRemoteQueryResponse, error) { out := new(PrometheusRemoteQueryResponse) err := c.cc.Invoke(ctx, "/storage.StorageService/PromRemoteQuery", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *storageServiceClient) PromQuery(ctx context.Context, in *PrometheusQueryRequest, opts ...grpc.CallOption) (*PrometheusQueryResponse, error) { out := new(PrometheusQueryResponse) err := c.cc.Invoke(ctx, "/storage.StorageService/PromQuery", in, out, opts...) if err != nil { return nil, err } return out, nil } // StorageServiceServer is the server API for StorageService service. // All implementations must embed UnimplementedStorageServiceServer // for forward compatibility type StorageServiceServer interface { Route(context.Context, *RouteRequest) (*RouteResponse, error) Write(context.Context, *WriteRequest) (*WriteResponse, error) StreamWrite(StorageService_StreamWriteServer) error SqlQuery(context.Context, *SqlQueryRequest) (*SqlQueryResponse, error) StreamSqlQuery(*SqlQueryRequest, StorageService_StreamSqlQueryServer) error PromRemoteQuery(context.Context, *PrometheusRemoteQueryRequest) (*PrometheusRemoteQueryResponse, error) // This interface is mainly for testing now PromQuery(context.Context, *PrometheusQueryRequest) (*PrometheusQueryResponse, error) mustEmbedUnimplementedStorageServiceServer() } // UnimplementedStorageServiceServer must be embedded to have forward compatible implementations. type UnimplementedStorageServiceServer struct { } func (UnimplementedStorageServiceServer) Route(context.Context, *RouteRequest) (*RouteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Route not implemented") } func (UnimplementedStorageServiceServer) Write(context.Context, *WriteRequest) (*WriteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Write not implemented") } func (UnimplementedStorageServiceServer) StreamWrite(StorageService_StreamWriteServer) error { return status.Errorf(codes.Unimplemented, "method StreamWrite not implemented") } func (UnimplementedStorageServiceServer) SqlQuery(context.Context, *SqlQueryRequest) (*SqlQueryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SqlQuery not implemented") } func (UnimplementedStorageServiceServer) StreamSqlQuery(*SqlQueryRequest, StorageService_StreamSqlQueryServer) error { return status.Errorf(codes.Unimplemented, "method StreamSqlQuery not implemented") } func (UnimplementedStorageServiceServer) PromRemoteQuery(context.Context, *PrometheusRemoteQueryRequest) (*PrometheusRemoteQueryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PromRemoteQuery not implemented") } func (UnimplementedStorageServiceServer) PromQuery(context.Context, *PrometheusQueryRequest) (*PrometheusQueryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PromQuery not implemented") } func (UnimplementedStorageServiceServer) mustEmbedUnimplementedStorageServiceServer() {} // UnsafeStorageServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to StorageServiceServer will // result in compilation errors. type UnsafeStorageServiceServer interface { mustEmbedUnimplementedStorageServiceServer() } func RegisterStorageServiceServer(s grpc.ServiceRegistrar, srv StorageServiceServer) { s.RegisterService(&StorageService_ServiceDesc, srv) } func _StorageService_Route_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RouteRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(StorageServiceServer).Route(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/storage.StorageService/Route", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StorageServiceServer).Route(ctx, req.(*RouteRequest)) } return interceptor(ctx, in, info, handler) } func _StorageService_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(WriteRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(StorageServiceServer).Write(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/storage.StorageService/Write", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StorageServiceServer).Write(ctx, req.(*WriteRequest)) } return interceptor(ctx, in, info, handler) } func _StorageService_StreamWrite_Handler(srv interface{}, stream grpc.ServerStream) error { return srv.(StorageServiceServer).StreamWrite(&storageServiceStreamWriteServer{stream}) } type StorageService_StreamWriteServer interface { SendAndClose(*WriteResponse) error Recv() (*WriteRequest, error) grpc.ServerStream } type storageServiceStreamWriteServer struct { grpc.ServerStream } func (x *storageServiceStreamWriteServer) SendAndClose(m *WriteResponse) error { return x.ServerStream.SendMsg(m) } func (x *storageServiceStreamWriteServer) Recv() (*WriteRequest, error) { m := new(WriteRequest) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func _StorageService_SqlQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SqlQueryRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(StorageServiceServer).SqlQuery(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/storage.StorageService/SqlQuery", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StorageServiceServer).SqlQuery(ctx, req.(*SqlQueryRequest)) } return interceptor(ctx, in, info, handler) } func _StorageService_StreamSqlQuery_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(SqlQueryRequest) if err := stream.RecvMsg(m); err != nil { return err } return srv.(StorageServiceServer).StreamSqlQuery(m, &storageServiceStreamSqlQueryServer{stream}) } type StorageService_StreamSqlQueryServer interface { Send(*SqlQueryResponse) error grpc.ServerStream } type storageServiceStreamSqlQueryServer struct { grpc.ServerStream } func (x *storageServiceStreamSqlQueryServer) Send(m *SqlQueryResponse) error { return x.ServerStream.SendMsg(m) } func _StorageService_PromRemoteQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PrometheusRemoteQueryRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(StorageServiceServer).PromRemoteQuery(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/storage.StorageService/PromRemoteQuery", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StorageServiceServer).PromRemoteQuery(ctx, req.(*PrometheusRemoteQueryRequest)) } return interceptor(ctx, in, info, handler) } func _StorageService_PromQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PrometheusQueryRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(StorageServiceServer).PromQuery(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/storage.StorageService/PromQuery", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StorageServiceServer).PromQuery(ctx, req.(*PrometheusQueryRequest)) } return interceptor(ctx, in, info, handler) } // StorageService_ServiceDesc is the grpc.ServiceDesc for StorageService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var StorageService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "storage.StorageService", HandlerType: (*StorageServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Route", Handler: _StorageService_Route_Handler, }, { MethodName: "Write", Handler: _StorageService_Write_Handler, }, { MethodName: "SqlQuery", Handler: _StorageService_SqlQuery_Handler, }, { MethodName: "PromRemoteQuery", Handler: _StorageService_PromRemoteQuery_Handler, }, { MethodName: "PromQuery", Handler: _StorageService_PromQuery_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "StreamWrite", Handler: _StorageService_StreamWrite_Handler, ClientStreams: true, }, { StreamName: "StreamSqlQuery", Handler: _StorageService_StreamSqlQuery_Handler, ServerStreams: true, }, }, Metadata: "storage.proto", }