| // |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| // |
| |
| // Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| // versions: |
| // - protoc-gen-go-grpc v1.6.1 |
| // - protoc v6.31.1 |
| // source: InstanceCommunication.proto |
| |
| package api |
| |
| 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" |
| ) |
| |
| // 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 ( |
| InstanceControl_GetFunctionStatus_FullMethodName = "/proto.InstanceControl/GetFunctionStatus" |
| InstanceControl_GetAndResetMetrics_FullMethodName = "/proto.InstanceControl/GetAndResetMetrics" |
| InstanceControl_ResetMetrics_FullMethodName = "/proto.InstanceControl/ResetMetrics" |
| InstanceControl_GetMetrics_FullMethodName = "/proto.InstanceControl/GetMetrics" |
| InstanceControl_HealthCheck_FullMethodName = "/proto.InstanceControl/HealthCheck" |
| ) |
| |
| // InstanceControlClient is the client API for InstanceControl 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 InstanceControlClient interface { |
| GetFunctionStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FunctionStatus, error) |
| GetAndResetMetrics(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*MetricsData, error) |
| ResetMetrics(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) |
| GetMetrics(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*MetricsData, error) |
| HealthCheck(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HealthCheckResult, error) |
| } |
| |
| type instanceControlClient struct { |
| cc grpc.ClientConnInterface |
| } |
| |
| func NewInstanceControlClient(cc grpc.ClientConnInterface) InstanceControlClient { |
| return &instanceControlClient{cc} |
| } |
| |
| func (c *instanceControlClient) GetFunctionStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FunctionStatus, error) { |
| cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| out := new(FunctionStatus) |
| err := c.cc.Invoke(ctx, InstanceControl_GetFunctionStatus_FullMethodName, in, out, cOpts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *instanceControlClient) GetAndResetMetrics(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*MetricsData, error) { |
| cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| out := new(MetricsData) |
| err := c.cc.Invoke(ctx, InstanceControl_GetAndResetMetrics_FullMethodName, in, out, cOpts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *instanceControlClient) ResetMetrics(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { |
| cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| out := new(emptypb.Empty) |
| err := c.cc.Invoke(ctx, InstanceControl_ResetMetrics_FullMethodName, in, out, cOpts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *instanceControlClient) GetMetrics(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*MetricsData, error) { |
| cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| out := new(MetricsData) |
| err := c.cc.Invoke(ctx, InstanceControl_GetMetrics_FullMethodName, in, out, cOpts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *instanceControlClient) HealthCheck(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HealthCheckResult, error) { |
| cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| out := new(HealthCheckResult) |
| err := c.cc.Invoke(ctx, InstanceControl_HealthCheck_FullMethodName, in, out, cOpts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| // InstanceControlServer is the server API for InstanceControl service. |
| // All implementations must embed UnimplementedInstanceControlServer |
| // for forward compatibility. |
| type InstanceControlServer interface { |
| GetFunctionStatus(context.Context, *emptypb.Empty) (*FunctionStatus, error) |
| GetAndResetMetrics(context.Context, *emptypb.Empty) (*MetricsData, error) |
| ResetMetrics(context.Context, *emptypb.Empty) (*emptypb.Empty, error) |
| GetMetrics(context.Context, *emptypb.Empty) (*MetricsData, error) |
| HealthCheck(context.Context, *emptypb.Empty) (*HealthCheckResult, error) |
| mustEmbedUnimplementedInstanceControlServer() |
| } |
| |
| // UnimplementedInstanceControlServer 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 UnimplementedInstanceControlServer struct{} |
| |
| func (UnimplementedInstanceControlServer) GetFunctionStatus(context.Context, *emptypb.Empty) (*FunctionStatus, error) { |
| return nil, status.Error(codes.Unimplemented, "method GetFunctionStatus not implemented") |
| } |
| func (UnimplementedInstanceControlServer) GetAndResetMetrics(context.Context, *emptypb.Empty) (*MetricsData, error) { |
| return nil, status.Error(codes.Unimplemented, "method GetAndResetMetrics not implemented") |
| } |
| func (UnimplementedInstanceControlServer) ResetMetrics(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { |
| return nil, status.Error(codes.Unimplemented, "method ResetMetrics not implemented") |
| } |
| func (UnimplementedInstanceControlServer) GetMetrics(context.Context, *emptypb.Empty) (*MetricsData, error) { |
| return nil, status.Error(codes.Unimplemented, "method GetMetrics not implemented") |
| } |
| func (UnimplementedInstanceControlServer) HealthCheck(context.Context, *emptypb.Empty) (*HealthCheckResult, error) { |
| return nil, status.Error(codes.Unimplemented, "method HealthCheck not implemented") |
| } |
| func (UnimplementedInstanceControlServer) mustEmbedUnimplementedInstanceControlServer() {} |
| func (UnimplementedInstanceControlServer) testEmbeddedByValue() {} |
| |
| // UnsafeInstanceControlServer may be embedded to opt out of forward compatibility for this service. |
| // Use of this interface is not recommended, as added methods to InstanceControlServer will |
| // result in compilation errors. |
| type UnsafeInstanceControlServer interface { |
| mustEmbedUnimplementedInstanceControlServer() |
| } |
| |
| func RegisterInstanceControlServer(s grpc.ServiceRegistrar, srv InstanceControlServer) { |
| // If the following call panics, it indicates UnimplementedInstanceControlServer 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(&InstanceControl_ServiceDesc, srv) |
| } |
| |
| func _InstanceControl_GetFunctionStatus_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.(InstanceControlServer).GetFunctionStatus(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: InstanceControl_GetFunctionStatus_FullMethodName, |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(InstanceControlServer).GetFunctionStatus(ctx, req.(*emptypb.Empty)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _InstanceControl_GetAndResetMetrics_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.(InstanceControlServer).GetAndResetMetrics(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: InstanceControl_GetAndResetMetrics_FullMethodName, |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(InstanceControlServer).GetAndResetMetrics(ctx, req.(*emptypb.Empty)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _InstanceControl_ResetMetrics_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.(InstanceControlServer).ResetMetrics(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: InstanceControl_ResetMetrics_FullMethodName, |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(InstanceControlServer).ResetMetrics(ctx, req.(*emptypb.Empty)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _InstanceControl_GetMetrics_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.(InstanceControlServer).GetMetrics(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: InstanceControl_GetMetrics_FullMethodName, |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(InstanceControlServer).GetMetrics(ctx, req.(*emptypb.Empty)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _InstanceControl_HealthCheck_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.(InstanceControlServer).HealthCheck(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: InstanceControl_HealthCheck_FullMethodName, |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(InstanceControlServer).HealthCheck(ctx, req.(*emptypb.Empty)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| // InstanceControl_ServiceDesc is the grpc.ServiceDesc for InstanceControl service. |
| // It's only intended for direct use with grpc.RegisterService, |
| // and not to be introspected or modified (even as a copy) |
| var InstanceControl_ServiceDesc = grpc.ServiceDesc{ |
| ServiceName: "proto.InstanceControl", |
| HandlerType: (*InstanceControlServer)(nil), |
| Methods: []grpc.MethodDesc{ |
| { |
| MethodName: "GetFunctionStatus", |
| Handler: _InstanceControl_GetFunctionStatus_Handler, |
| }, |
| { |
| MethodName: "GetAndResetMetrics", |
| Handler: _InstanceControl_GetAndResetMetrics_Handler, |
| }, |
| { |
| MethodName: "ResetMetrics", |
| Handler: _InstanceControl_ResetMetrics_Handler, |
| }, |
| { |
| MethodName: "GetMetrics", |
| Handler: _InstanceControl_GetMetrics_Handler, |
| }, |
| { |
| MethodName: "HealthCheck", |
| Handler: _InstanceControl_HealthCheck_Handler, |
| }, |
| }, |
| Streams: []grpc.StreamDesc{}, |
| Metadata: "InstanceCommunication.proto", |
| } |