Documentation ¶
Overview ¶
Package grpcapi provides protobuf bindings to use with gRPC and various helper functions.
Index ¶
- Variables
- func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer)
- func RegisterMetricsServer(s grpc.ServiceRegistrar, srv MetricsServer)
- type BatchUpdateRequest
- func (*BatchUpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BatchUpdateRequest) GetData() []*MetricReq
- func (*BatchUpdateRequest) ProtoMessage()
- func (x *BatchUpdateRequest) ProtoReflect() protoreflect.Message
- func (x *BatchUpdateRequest) Reset()
- func (x *BatchUpdateRequest) String() string
- type BatchUpdateResponse
- func (*BatchUpdateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BatchUpdateResponse) GetData() []*MetricReq
- func (*BatchUpdateResponse) ProtoMessage()
- func (x *BatchUpdateResponse) ProtoReflect() protoreflect.Message
- func (x *BatchUpdateResponse) Reset()
- func (x *BatchUpdateResponse) String() string
- type GetMetricRequest
- func (*GetMetricRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetMetricRequest) GetId() string
- func (x *GetMetricRequest) GetMtype() string
- func (*GetMetricRequest) ProtoMessage()
- func (x *GetMetricRequest) ProtoReflect() protoreflect.Message
- func (x *GetMetricRequest) Reset()
- func (x *GetMetricRequest) String() string
- type HealthClient
- type HealthServer
- type MetricReq
- func (*MetricReq) Descriptor() ([]byte, []int)deprecated
- func (x *MetricReq) GetDelta() int64
- func (x *MetricReq) GetHash() string
- func (x *MetricReq) GetId() string
- func (x *MetricReq) GetMtype() string
- func (x *MetricReq) GetValue() float64
- func (*MetricReq) ProtoMessage()
- func (x *MetricReq) ProtoReflect() protoreflect.Message
- func (x *MetricReq) Reset()
- func (x *MetricReq) String() string
- type MetricsClient
- type MetricsServer
- type UnimplementedHealthServer
- type UnimplementedMetricsServer
- type UnsafeHealthServer
- type UnsafeMetricsServer
Constants ¶
This section is empty.
Variables ¶
var File_health_proto protoreflect.FileDescriptor
var File_metrics_proto protoreflect.FileDescriptor
var Health_ServiceDesc = grpc.ServiceDesc{ ServiceName: "metrics.collector.v1.Health", HandlerType: (*HealthServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _Health_Ping_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "health.proto", }
Health_ServiceDesc is the grpc.ServiceDesc for Health service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var Metrics_ServiceDesc = grpc.ServiceDesc{ ServiceName: "metrics.collector.v1.Metrics", HandlerType: (*MetricsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Update", Handler: _Metrics_Update_Handler, }, { MethodName: "BatchUpdate", Handler: _Metrics_BatchUpdate_Handler, }, { MethodName: "Get", Handler: _Metrics_Get_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "metrics.proto", }
Metrics_ServiceDesc is the grpc.ServiceDesc for Metrics service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHealthServer ¶
func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer)
func RegisterMetricsServer ¶
func RegisterMetricsServer(s grpc.ServiceRegistrar, srv MetricsServer)
Types ¶
type BatchUpdateRequest ¶
type BatchUpdateRequest struct { Data []*MetricReq `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*BatchUpdateRequest) Descriptor
deprecated
func (*BatchUpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use BatchUpdateRequest.ProtoReflect.Descriptor instead.
func (*BatchUpdateRequest) GetData ¶
func (x *BatchUpdateRequest) GetData() []*MetricReq
func (*BatchUpdateRequest) ProtoMessage ¶
func (*BatchUpdateRequest) ProtoMessage()
func (*BatchUpdateRequest) ProtoReflect ¶
func (x *BatchUpdateRequest) ProtoReflect() protoreflect.Message
func (*BatchUpdateRequest) Reset ¶
func (x *BatchUpdateRequest) Reset()
func (*BatchUpdateRequest) String ¶
func (x *BatchUpdateRequest) String() string
type BatchUpdateResponse ¶
type BatchUpdateResponse struct { Data []*MetricReq `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*BatchUpdateResponse) Descriptor
deprecated
func (*BatchUpdateResponse) Descriptor() ([]byte, []int)
Deprecated: Use BatchUpdateResponse.ProtoReflect.Descriptor instead.
func (*BatchUpdateResponse) GetData ¶
func (x *BatchUpdateResponse) GetData() []*MetricReq
func (*BatchUpdateResponse) ProtoMessage ¶
func (*BatchUpdateResponse) ProtoMessage()
func (*BatchUpdateResponse) ProtoReflect ¶
func (x *BatchUpdateResponse) ProtoReflect() protoreflect.Message
func (*BatchUpdateResponse) Reset ¶
func (x *BatchUpdateResponse) Reset()
func (*BatchUpdateResponse) String ¶
func (x *BatchUpdateResponse) String() string
type GetMetricRequest ¶
type GetMetricRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Mtype string `protobuf:"bytes,2,opt,name=mtype,proto3" json:"mtype,omitempty"` // contains filtered or unexported fields }
func NewGetCounterReq ¶
func NewGetCounterReq(name string) *GetMetricRequest
NewGetCounterReq creates new GetMetricRequest structure to be used for retrieving of counter metric.
func NewGetGaugeReq ¶
func NewGetGaugeReq(name string) *GetMetricRequest
NewGetGaugeReq creates new GetMetricRequest structure to be used for retrieving of gauge metric.
func (*GetMetricRequest) Descriptor
deprecated
func (*GetMetricRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetMetricRequest.ProtoReflect.Descriptor instead.
func (*GetMetricRequest) GetId ¶
func (x *GetMetricRequest) GetId() string
func (*GetMetricRequest) GetMtype ¶
func (x *GetMetricRequest) GetMtype() string
func (*GetMetricRequest) ProtoMessage ¶
func (*GetMetricRequest) ProtoMessage()
func (*GetMetricRequest) ProtoReflect ¶
func (x *GetMetricRequest) ProtoReflect() protoreflect.Message
func (*GetMetricRequest) Reset ¶
func (x *GetMetricRequest) Reset()
func (*GetMetricRequest) String ¶
func (x *GetMetricRequest) String() string
type HealthClient ¶
type HealthClient interface {
Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
HealthClient is the client API for Health 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.
func NewHealthClient ¶
func NewHealthClient(cc grpc.ClientConnInterface) HealthClient
type HealthServer ¶
type HealthServer interface { Ping(context.Context, *emptypb.Empty) (*emptypb.Empty, error) // contains filtered or unexported methods }
HealthServer is the server API for Health service. All implementations must embed UnimplementedHealthServer for forward compatibility
type MetricReq ¶
type MetricReq struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Mtype string `protobuf:"bytes,2,opt,name=mtype,proto3" json:"mtype,omitempty"` Delta int64 `protobuf:"varint,3,opt,name=delta,proto3" json:"delta,omitempty"` Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` Hash string `protobuf:"bytes,5,opt,name=hash,proto3" json:"hash,omitempty"` // contains filtered or unexported fields }
NB (alkurbatov): The name was intentionally choosen to match the similar structure from HTTP API for convenience.
func NewUpdateCounterReq ¶
NewUpdateCounterReq creates new MetricReq structure to be used for updating counter metric.
func NewUpdateGaugeReq ¶
NewUpdateGaugeReq creates new MetricReq structure to be used for updating gauge metric.
func (*MetricReq) Descriptor
deprecated
func (*MetricReq) ProtoMessage ¶
func (*MetricReq) ProtoMessage()
func (*MetricReq) ProtoReflect ¶
func (x *MetricReq) ProtoReflect() protoreflect.Message
type MetricsClient ¶
type MetricsClient interface { Update(ctx context.Context, in *MetricReq, opts ...grpc.CallOption) (*MetricReq, error) BatchUpdate(ctx context.Context, in *BatchUpdateRequest, opts ...grpc.CallOption) (*BatchUpdateResponse, error) Get(ctx context.Context, in *GetMetricRequest, opts ...grpc.CallOption) (*MetricReq, error) }
MetricsClient is the client API for Metrics 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.
func NewMetricsClient ¶
func NewMetricsClient(cc grpc.ClientConnInterface) MetricsClient
type MetricsServer ¶
type MetricsServer interface { Update(context.Context, *MetricReq) (*MetricReq, error) BatchUpdate(context.Context, *BatchUpdateRequest) (*BatchUpdateResponse, error) Get(context.Context, *GetMetricRequest) (*MetricReq, error) // contains filtered or unexported methods }
MetricsServer is the server API for Metrics service. All implementations must embed UnimplementedMetricsServer for forward compatibility
type UnimplementedHealthServer ¶
type UnimplementedHealthServer struct { }
UnimplementedHealthServer must be embedded to have forward compatible implementations.
type UnimplementedMetricsServer ¶
type UnimplementedMetricsServer struct { }
UnimplementedMetricsServer must be embedded to have forward compatible implementations.
func (UnimplementedMetricsServer) BatchUpdate ¶
func (UnimplementedMetricsServer) BatchUpdate(context.Context, *BatchUpdateRequest) (*BatchUpdateResponse, error)
func (UnimplementedMetricsServer) Get ¶
func (UnimplementedMetricsServer) Get(context.Context, *GetMetricRequest) (*MetricReq, error)
type UnsafeHealthServer ¶
type UnsafeHealthServer interface {
// contains filtered or unexported methods
}
UnsafeHealthServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HealthServer will result in compilation errors.
type UnsafeMetricsServer ¶
type UnsafeMetricsServer interface {
// contains filtered or unexported methods
}
UnsafeMetricsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MetricsServer will result in compilation errors.