863 lines
31 KiB
Go
863 lines
31 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.2.0
|
|
// - protoc v3.19.4
|
|
// source: proto/tsgrain.proto
|
|
|
|
package tsgrain_rpc
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
|
|
)
|
|
|
|
// 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
|
|
|
|
// TSGRainClient is the client API for TSGRain 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 TSGRainClient interface {
|
|
// Starte eine neue Bewässerungsaufgabe (oder stoppe eine laufende, wenn
|
|
// diese bereits läuft).
|
|
RequestTask(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskRequestResult, error)
|
|
// Starte eine Bewässerungsaufgabe
|
|
StartTask(ctx context.Context, in *TaskStart, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
|
|
// Stoppe eine Bewässerungsaufgabe
|
|
StopTask(ctx context.Context, in *TaskStop, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
|
|
// Gibt sämtliche in der Warteschlange befindlichen Bewässerungsaufgaben zurück.
|
|
GetTasks(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TaskList, error)
|
|
// Streamt die aktuelle Warteschlange mit ihren Bewässerungsaufgaben,
|
|
// d.h. bei Änderung wird die neue Version übertragen.
|
|
StreamTasks(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (TSGRain_StreamTasksClient, error)
|
|
// Erstelle einen neuen Bewässerungsjob.
|
|
CreateJob(ctx context.Context, in *Job, opts ...grpc.CallOption) (*JobID, error)
|
|
// Gibt den Bewässerungsjob mit der gegebenen ID zurück.
|
|
GetJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*Job, error)
|
|
// Gibt alle gespeicherten Bewässerungsjobs zurück.
|
|
GetJobs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*JobList, error)
|
|
// Aktualisiert einen Bewässerungsjob.
|
|
UpdateJob(ctx context.Context, in *Job, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
// Lösche den Bewässerungsjob mit der gegebenen ID.
|
|
DeleteJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
// Aktiviere Bewässerungsjob
|
|
EnableJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
// Deaktiviere Bewässerungsjob
|
|
DisableJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
// Gibt zurück, ob der Automatikmodus aktiviert ist.
|
|
GetAutoMode(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
|
|
// Aktiviert/deaktiviert den Automatikmodus.
|
|
SetAutoMode(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
// Datum/Uhrzeit/Zeitzone abrufen
|
|
GetSystemTime(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SystemTime, error)
|
|
// Datum/Uhrzeit einstellen
|
|
SetSystemTime(ctx context.Context, in *Timestamp, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
// Zeitzone einstellen
|
|
SetSystemTimezone(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
// Standardzeit bei manueller Bewässerung abrufen
|
|
GetDefaultIrrigationTime(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.Int32Value, error)
|
|
// Standardzeit bei manueller Bewässerung einstellen
|
|
SetDefaultIrrigationTime(ctx context.Context, in *wrapperspb.Int32Value, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
// Anzahl Bewässerungszonen abrufen
|
|
GetNZones(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.Int32Value, error)
|
|
}
|
|
|
|
type tSGRainClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewTSGRainClient(cc grpc.ClientConnInterface) TSGRainClient {
|
|
return &tSGRainClient{cc}
|
|
}
|
|
|
|
func (c *tSGRainClient) RequestTask(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskRequestResult, error) {
|
|
out := new(TaskRequestResult)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/RequestTask", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) StartTask(ctx context.Context, in *TaskStart, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) {
|
|
out := new(wrapperspb.BoolValue)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/StartTask", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) StopTask(ctx context.Context, in *TaskStop, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) {
|
|
out := new(wrapperspb.BoolValue)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/StopTask", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) GetTasks(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TaskList, error) {
|
|
out := new(TaskList)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/GetTasks", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) StreamTasks(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (TSGRain_StreamTasksClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &TSGRain_ServiceDesc.Streams[0], "/TSGRain/StreamTasks", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &tSGRainStreamTasksClient{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 TSGRain_StreamTasksClient interface {
|
|
Recv() (*TaskList, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type tSGRainStreamTasksClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *tSGRainStreamTasksClient) Recv() (*TaskList, error) {
|
|
m := new(TaskList)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) CreateJob(ctx context.Context, in *Job, opts ...grpc.CallOption) (*JobID, error) {
|
|
out := new(JobID)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/CreateJob", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) GetJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*Job, error) {
|
|
out := new(Job)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/GetJob", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) GetJobs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*JobList, error) {
|
|
out := new(JobList)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/GetJobs", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) UpdateJob(ctx context.Context, in *Job, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/UpdateJob", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) DeleteJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/DeleteJob", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) EnableJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/EnableJob", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) DisableJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/DisableJob", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) GetAutoMode(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) {
|
|
out := new(wrapperspb.BoolValue)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/GetAutoMode", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) SetAutoMode(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/SetAutoMode", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) GetSystemTime(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SystemTime, error) {
|
|
out := new(SystemTime)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/GetSystemTime", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) SetSystemTime(ctx context.Context, in *Timestamp, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/SetSystemTime", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) SetSystemTimezone(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/SetSystemTimezone", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) GetDefaultIrrigationTime(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.Int32Value, error) {
|
|
out := new(wrapperspb.Int32Value)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/GetDefaultIrrigationTime", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) SetDefaultIrrigationTime(ctx context.Context, in *wrapperspb.Int32Value, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/SetDefaultIrrigationTime", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tSGRainClient) GetNZones(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.Int32Value, error) {
|
|
out := new(wrapperspb.Int32Value)
|
|
err := c.cc.Invoke(ctx, "/TSGRain/GetNZones", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// TSGRainServer is the server API for TSGRain service.
|
|
// All implementations must embed UnimplementedTSGRainServer
|
|
// for forward compatibility
|
|
type TSGRainServer interface {
|
|
// Starte eine neue Bewässerungsaufgabe (oder stoppe eine laufende, wenn
|
|
// diese bereits läuft).
|
|
RequestTask(context.Context, *TaskRequest) (*TaskRequestResult, error)
|
|
// Starte eine Bewässerungsaufgabe
|
|
StartTask(context.Context, *TaskStart) (*wrapperspb.BoolValue, error)
|
|
// Stoppe eine Bewässerungsaufgabe
|
|
StopTask(context.Context, *TaskStop) (*wrapperspb.BoolValue, error)
|
|
// Gibt sämtliche in der Warteschlange befindlichen Bewässerungsaufgaben zurück.
|
|
GetTasks(context.Context, *emptypb.Empty) (*TaskList, error)
|
|
// Streamt die aktuelle Warteschlange mit ihren Bewässerungsaufgaben,
|
|
// d.h. bei Änderung wird die neue Version übertragen.
|
|
StreamTasks(*emptypb.Empty, TSGRain_StreamTasksServer) error
|
|
// Erstelle einen neuen Bewässerungsjob.
|
|
CreateJob(context.Context, *Job) (*JobID, error)
|
|
// Gibt den Bewässerungsjob mit der gegebenen ID zurück.
|
|
GetJob(context.Context, *JobID) (*Job, error)
|
|
// Gibt alle gespeicherten Bewässerungsjobs zurück.
|
|
GetJobs(context.Context, *emptypb.Empty) (*JobList, error)
|
|
// Aktualisiert einen Bewässerungsjob.
|
|
UpdateJob(context.Context, *Job) (*emptypb.Empty, error)
|
|
// Lösche den Bewässerungsjob mit der gegebenen ID.
|
|
DeleteJob(context.Context, *JobID) (*emptypb.Empty, error)
|
|
// Aktiviere Bewässerungsjob
|
|
EnableJob(context.Context, *JobID) (*emptypb.Empty, error)
|
|
// Deaktiviere Bewässerungsjob
|
|
DisableJob(context.Context, *JobID) (*emptypb.Empty, error)
|
|
// Gibt zurück, ob der Automatikmodus aktiviert ist.
|
|
GetAutoMode(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error)
|
|
// Aktiviert/deaktiviert den Automatikmodus.
|
|
SetAutoMode(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error)
|
|
// Datum/Uhrzeit/Zeitzone abrufen
|
|
GetSystemTime(context.Context, *emptypb.Empty) (*SystemTime, error)
|
|
// Datum/Uhrzeit einstellen
|
|
SetSystemTime(context.Context, *Timestamp) (*emptypb.Empty, error)
|
|
// Zeitzone einstellen
|
|
SetSystemTimezone(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
|
|
// Standardzeit bei manueller Bewässerung abrufen
|
|
GetDefaultIrrigationTime(context.Context, *emptypb.Empty) (*wrapperspb.Int32Value, error)
|
|
// Standardzeit bei manueller Bewässerung einstellen
|
|
SetDefaultIrrigationTime(context.Context, *wrapperspb.Int32Value) (*emptypb.Empty, error)
|
|
// Anzahl Bewässerungszonen abrufen
|
|
GetNZones(context.Context, *emptypb.Empty) (*wrapperspb.Int32Value, error)
|
|
mustEmbedUnimplementedTSGRainServer()
|
|
}
|
|
|
|
// UnimplementedTSGRainServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedTSGRainServer struct {
|
|
}
|
|
|
|
func (UnimplementedTSGRainServer) RequestTask(context.Context, *TaskRequest) (*TaskRequestResult, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method RequestTask not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) StartTask(context.Context, *TaskStart) (*wrapperspb.BoolValue, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method StartTask not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) StopTask(context.Context, *TaskStop) (*wrapperspb.BoolValue, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method StopTask not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) GetTasks(context.Context, *emptypb.Empty) (*TaskList, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetTasks not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) StreamTasks(*emptypb.Empty, TSGRain_StreamTasksServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method StreamTasks not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) CreateJob(context.Context, *Job) (*JobID, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateJob not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) GetJob(context.Context, *JobID) (*Job, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetJob not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) GetJobs(context.Context, *emptypb.Empty) (*JobList, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetJobs not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) UpdateJob(context.Context, *Job) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateJob not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) DeleteJob(context.Context, *JobID) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteJob not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) EnableJob(context.Context, *JobID) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method EnableJob not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) DisableJob(context.Context, *JobID) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DisableJob not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) GetAutoMode(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetAutoMode not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) SetAutoMode(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SetAutoMode not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) GetSystemTime(context.Context, *emptypb.Empty) (*SystemTime, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetSystemTime not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) SetSystemTime(context.Context, *Timestamp) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SetSystemTime not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) SetSystemTimezone(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SetSystemTimezone not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) GetDefaultIrrigationTime(context.Context, *emptypb.Empty) (*wrapperspb.Int32Value, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetDefaultIrrigationTime not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) SetDefaultIrrigationTime(context.Context, *wrapperspb.Int32Value) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SetDefaultIrrigationTime not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) GetNZones(context.Context, *emptypb.Empty) (*wrapperspb.Int32Value, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetNZones not implemented")
|
|
}
|
|
func (UnimplementedTSGRainServer) mustEmbedUnimplementedTSGRainServer() {}
|
|
|
|
// UnsafeTSGRainServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to TSGRainServer will
|
|
// result in compilation errors.
|
|
type UnsafeTSGRainServer interface {
|
|
mustEmbedUnimplementedTSGRainServer()
|
|
}
|
|
|
|
func RegisterTSGRainServer(s grpc.ServiceRegistrar, srv TSGRainServer) {
|
|
s.RegisterService(&TSGRain_ServiceDesc, srv)
|
|
}
|
|
|
|
func _TSGRain_RequestTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(TaskRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).RequestTask(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/RequestTask",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).RequestTask(ctx, req.(*TaskRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_StartTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(TaskStart)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).StartTask(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/StartTask",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).StartTask(ctx, req.(*TaskStart))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_StopTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(TaskStop)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).StopTask(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/StopTask",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).StopTask(ctx, req.(*TaskStop))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_GetTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(emptypb.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).GetTasks(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/GetTasks",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).GetTasks(ctx, req.(*emptypb.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_StreamTasks_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(emptypb.Empty)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(TSGRainServer).StreamTasks(m, &tSGRainStreamTasksServer{stream})
|
|
}
|
|
|
|
type TSGRain_StreamTasksServer interface {
|
|
Send(*TaskList) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type tSGRainStreamTasksServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *tSGRainStreamTasksServer) Send(m *TaskList) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func _TSGRain_CreateJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Job)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).CreateJob(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/CreateJob",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).CreateJob(ctx, req.(*Job))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_GetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(JobID)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).GetJob(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/GetJob",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).GetJob(ctx, req.(*JobID))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_GetJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(emptypb.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).GetJobs(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/GetJobs",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).GetJobs(ctx, req.(*emptypb.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_UpdateJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Job)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).UpdateJob(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/UpdateJob",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).UpdateJob(ctx, req.(*Job))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_DeleteJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(JobID)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).DeleteJob(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/DeleteJob",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).DeleteJob(ctx, req.(*JobID))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_EnableJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(JobID)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).EnableJob(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/EnableJob",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).EnableJob(ctx, req.(*JobID))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_DisableJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(JobID)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).DisableJob(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/DisableJob",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).DisableJob(ctx, req.(*JobID))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_GetAutoMode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(emptypb.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).GetAutoMode(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/GetAutoMode",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).GetAutoMode(ctx, req.(*emptypb.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_SetAutoMode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(wrapperspb.BoolValue)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).SetAutoMode(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/SetAutoMode",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).SetAutoMode(ctx, req.(*wrapperspb.BoolValue))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_GetSystemTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(emptypb.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).GetSystemTime(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/GetSystemTime",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).GetSystemTime(ctx, req.(*emptypb.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_SetSystemTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Timestamp)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).SetSystemTime(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/SetSystemTime",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).SetSystemTime(ctx, req.(*Timestamp))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_SetSystemTimezone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(wrapperspb.StringValue)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).SetSystemTimezone(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/SetSystemTimezone",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).SetSystemTimezone(ctx, req.(*wrapperspb.StringValue))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_GetDefaultIrrigationTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(emptypb.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).GetDefaultIrrigationTime(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/GetDefaultIrrigationTime",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).GetDefaultIrrigationTime(ctx, req.(*emptypb.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_SetDefaultIrrigationTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(wrapperspb.Int32Value)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).SetDefaultIrrigationTime(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/SetDefaultIrrigationTime",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).SetDefaultIrrigationTime(ctx, req.(*wrapperspb.Int32Value))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TSGRain_GetNZones_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(emptypb.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TSGRainServer).GetNZones(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TSGRain/GetNZones",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TSGRainServer).GetNZones(ctx, req.(*emptypb.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// TSGRain_ServiceDesc is the grpc.ServiceDesc for TSGRain service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var TSGRain_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "TSGRain",
|
|
HandlerType: (*TSGRainServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "RequestTask",
|
|
Handler: _TSGRain_RequestTask_Handler,
|
|
},
|
|
{
|
|
MethodName: "StartTask",
|
|
Handler: _TSGRain_StartTask_Handler,
|
|
},
|
|
{
|
|
MethodName: "StopTask",
|
|
Handler: _TSGRain_StopTask_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetTasks",
|
|
Handler: _TSGRain_GetTasks_Handler,
|
|
},
|
|
{
|
|
MethodName: "CreateJob",
|
|
Handler: _TSGRain_CreateJob_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetJob",
|
|
Handler: _TSGRain_GetJob_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetJobs",
|
|
Handler: _TSGRain_GetJobs_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateJob",
|
|
Handler: _TSGRain_UpdateJob_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteJob",
|
|
Handler: _TSGRain_DeleteJob_Handler,
|
|
},
|
|
{
|
|
MethodName: "EnableJob",
|
|
Handler: _TSGRain_EnableJob_Handler,
|
|
},
|
|
{
|
|
MethodName: "DisableJob",
|
|
Handler: _TSGRain_DisableJob_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetAutoMode",
|
|
Handler: _TSGRain_GetAutoMode_Handler,
|
|
},
|
|
{
|
|
MethodName: "SetAutoMode",
|
|
Handler: _TSGRain_SetAutoMode_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetSystemTime",
|
|
Handler: _TSGRain_GetSystemTime_Handler,
|
|
},
|
|
{
|
|
MethodName: "SetSystemTime",
|
|
Handler: _TSGRain_SetSystemTime_Handler,
|
|
},
|
|
{
|
|
MethodName: "SetSystemTimezone",
|
|
Handler: _TSGRain_SetSystemTimezone_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetDefaultIrrigationTime",
|
|
Handler: _TSGRain_GetDefaultIrrigationTime_Handler,
|
|
},
|
|
{
|
|
MethodName: "SetDefaultIrrigationTime",
|
|
Handler: _TSGRain_SetDefaultIrrigationTime_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetNZones",
|
|
Handler: _TSGRain_GetNZones_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "StreamTasks",
|
|
Handler: _TSGRain_StreamTasks_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "proto/tsgrain.proto",
|
|
}
|