metricsv1

package
v0.0.0-...-f507469 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package metricsv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	MetricsAPI_GetMetrics_FullMethodName = "/clutch.metrics.v1.MetricsAPI/GetMetrics"
)

Variables

View Source
var File_metrics_v1_metrics_proto protoreflect.FileDescriptor
View Source
var MetricsAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "clutch.metrics.v1.MetricsAPI",
	HandlerType: (*MetricsAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetMetrics",
			Handler:    _MetricsAPI_GetMetrics_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "metrics/v1/metrics.proto",
}

MetricsAPI_ServiceDesc is the grpc.ServiceDesc for MetricsAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterMetricsAPIHandler

func RegisterMetricsAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMetricsAPIHandler registers the http handlers for service MetricsAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMetricsAPIHandlerClient

func RegisterMetricsAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MetricsAPIClient) error

RegisterMetricsAPIHandlerClient registers the http handlers for service MetricsAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MetricsAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MetricsAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MetricsAPIClient" to call the correct interceptors.

func RegisterMetricsAPIHandlerFromEndpoint

func RegisterMetricsAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMetricsAPIHandlerFromEndpoint is same as RegisterMetricsAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMetricsAPIHandlerServer

func RegisterMetricsAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MetricsAPIServer) error

RegisterMetricsAPIHandlerServer registers the http handlers for service MetricsAPI to "mux". UnaryRPC :call MetricsAPIServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMetricsAPIHandlerFromEndpoint instead.

func RegisterMetricsAPIServer

func RegisterMetricsAPIServer(s grpc.ServiceRegistrar, srv MetricsAPIServer)

Types

type DataPoint

type DataPoint struct {
	Value     float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	Timestamp int64   `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*DataPoint) Descriptor deprecated

func (*DataPoint) Descriptor() ([]byte, []int)

Deprecated: Use DataPoint.ProtoReflect.Descriptor instead.

func (*DataPoint) GetTimestamp

func (x *DataPoint) GetTimestamp() int64

func (*DataPoint) GetValue

func (x *DataPoint) GetValue() float64

func (*DataPoint) ProtoMessage

func (*DataPoint) ProtoMessage()

func (*DataPoint) ProtoReflect

func (x *DataPoint) ProtoReflect() protoreflect.Message

func (*DataPoint) Reset

func (x *DataPoint) Reset()

func (*DataPoint) String

func (x *DataPoint) String() string

func (*DataPoint) Validate

func (m *DataPoint) Validate() error

Validate checks the field values on DataPoint with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DataPoint) ValidateAll

func (m *DataPoint) ValidateAll() error

ValidateAll checks the field values on DataPoint with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DataPointMultiError, or nil if none found.

type DataPointMultiError

type DataPointMultiError []error

DataPointMultiError is an error wrapping multiple validation errors returned by DataPoint.ValidateAll() if the designated constraints aren't met.

func (DataPointMultiError) AllErrors

func (m DataPointMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DataPointMultiError) Error

func (m DataPointMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DataPointValidationError

type DataPointValidationError struct {
	// contains filtered or unexported fields
}

DataPointValidationError is the validation error returned by DataPoint.Validate if the designated constraints aren't met.

func (DataPointValidationError) Cause

func (e DataPointValidationError) Cause() error

Cause function returns cause value.

func (DataPointValidationError) Error

func (e DataPointValidationError) Error() string

Error satisfies the builtin error interface

func (DataPointValidationError) ErrorName

func (e DataPointValidationError) ErrorName() string

ErrorName returns error name.

func (DataPointValidationError) Field

func (e DataPointValidationError) Field() string

Field function returns field value.

func (DataPointValidationError) Key

Key function returns key value.

func (DataPointValidationError) Reason

func (e DataPointValidationError) Reason() string

Reason function returns reason value.

type GetMetricsRequest

type GetMetricsRequest struct {
	MetricQueries []*Query `protobuf:"bytes,1,rep,name=metric_queries,json=metricQueries,proto3" json:"metric_queries,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMetricsRequest) Descriptor deprecated

func (*GetMetricsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetMetricsRequest.ProtoReflect.Descriptor instead.

func (*GetMetricsRequest) GetMetricQueries

func (x *GetMetricsRequest) GetMetricQueries() []*Query

func (*GetMetricsRequest) ProtoMessage

func (*GetMetricsRequest) ProtoMessage()

func (*GetMetricsRequest) ProtoReflect

func (x *GetMetricsRequest) ProtoReflect() protoreflect.Message

func (*GetMetricsRequest) Reset

func (x *GetMetricsRequest) Reset()

func (*GetMetricsRequest) String

func (x *GetMetricsRequest) String() string

func (*GetMetricsRequest) Validate

func (m *GetMetricsRequest) Validate() error

Validate checks the field values on GetMetricsRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetMetricsRequest) ValidateAll

func (m *GetMetricsRequest) ValidateAll() error

ValidateAll checks the field values on GetMetricsRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetMetricsRequestMultiError, or nil if none found.

type GetMetricsRequestMultiError

type GetMetricsRequestMultiError []error

GetMetricsRequestMultiError is an error wrapping multiple validation errors returned by GetMetricsRequest.ValidateAll() if the designated constraints aren't met.

func (GetMetricsRequestMultiError) AllErrors

func (m GetMetricsRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetMetricsRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetMetricsRequestValidationError

type GetMetricsRequestValidationError struct {
	// contains filtered or unexported fields
}

GetMetricsRequestValidationError is the validation error returned by GetMetricsRequest.Validate if the designated constraints aren't met.

func (GetMetricsRequestValidationError) Cause

Cause function returns cause value.

func (GetMetricsRequestValidationError) Error

Error satisfies the builtin error interface

func (GetMetricsRequestValidationError) ErrorName

ErrorName returns error name.

func (GetMetricsRequestValidationError) Field

Field function returns field value.

func (GetMetricsRequestValidationError) Key

Key function returns key value.

func (GetMetricsRequestValidationError) Reason

Reason function returns reason value.

type GetMetricsResponse

type GetMetricsResponse struct {

	// * A mapping of individual queries to their respective results
	QueryResults map[string]*Result `` /* 185-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GetMetricsResponse) Descriptor deprecated

func (*GetMetricsResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetMetricsResponse.ProtoReflect.Descriptor instead.

func (*GetMetricsResponse) GetQueryResults

func (x *GetMetricsResponse) GetQueryResults() map[string]*Result

func (*GetMetricsResponse) ProtoMessage

func (*GetMetricsResponse) ProtoMessage()

func (*GetMetricsResponse) ProtoReflect

func (x *GetMetricsResponse) ProtoReflect() protoreflect.Message

func (*GetMetricsResponse) Reset

func (x *GetMetricsResponse) Reset()

func (*GetMetricsResponse) String

func (x *GetMetricsResponse) String() string

func (*GetMetricsResponse) Validate

func (m *GetMetricsResponse) Validate() error

Validate checks the field values on GetMetricsResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetMetricsResponse) ValidateAll

func (m *GetMetricsResponse) ValidateAll() error

ValidateAll checks the field values on GetMetricsResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetMetricsResponseMultiError, or nil if none found.

type GetMetricsResponseMultiError

type GetMetricsResponseMultiError []error

GetMetricsResponseMultiError is an error wrapping multiple validation errors returned by GetMetricsResponse.ValidateAll() if the designated constraints aren't met.

func (GetMetricsResponseMultiError) AllErrors

func (m GetMetricsResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetMetricsResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetMetricsResponseValidationError

type GetMetricsResponseValidationError struct {
	// contains filtered or unexported fields
}

GetMetricsResponseValidationError is the validation error returned by GetMetricsResponse.Validate if the designated constraints aren't met.

func (GetMetricsResponseValidationError) Cause

Cause function returns cause value.

func (GetMetricsResponseValidationError) Error

Error satisfies the builtin error interface

func (GetMetricsResponseValidationError) ErrorName

ErrorName returns error name.

func (GetMetricsResponseValidationError) Field

Field function returns field value.

func (GetMetricsResponseValidationError) Key

Key function returns key value.

func (GetMetricsResponseValidationError) Reason

Reason function returns reason value.

type Metrics

type Metrics struct {
	DataPoints []*DataPoint      `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"`
	Label      string            `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	Tags       map[string]string `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Metrics) Descriptor deprecated

func (*Metrics) Descriptor() ([]byte, []int)

Deprecated: Use Metrics.ProtoReflect.Descriptor instead.

func (*Metrics) GetDataPoints

func (x *Metrics) GetDataPoints() []*DataPoint

func (*Metrics) GetLabel

func (x *Metrics) GetLabel() string

func (*Metrics) GetTags

func (x *Metrics) GetTags() map[string]string

func (*Metrics) ProtoMessage

func (*Metrics) ProtoMessage()

func (*Metrics) ProtoReflect

func (x *Metrics) ProtoReflect() protoreflect.Message

func (*Metrics) Reset

func (x *Metrics) Reset()

func (*Metrics) String

func (x *Metrics) String() string

func (*Metrics) Validate

func (m *Metrics) Validate() error

Validate checks the field values on Metrics with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Metrics) ValidateAll

func (m *Metrics) ValidateAll() error

ValidateAll checks the field values on Metrics with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in MetricsMultiError, or nil if none found.

type MetricsAPIClient

type MetricsAPIClient interface {
	GetMetrics(ctx context.Context, in *GetMetricsRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error)
}

MetricsAPIClient is the client API for MetricsAPI 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 NewMetricsAPIClient

func NewMetricsAPIClient(cc grpc.ClientConnInterface) MetricsAPIClient

type MetricsAPIServer

type MetricsAPIServer interface {
	GetMetrics(context.Context, *GetMetricsRequest) (*GetMetricsResponse, error)
}

MetricsAPIServer is the server API for MetricsAPI service. All implementations should embed UnimplementedMetricsAPIServer for forward compatibility

type MetricsMultiError

type MetricsMultiError []error

MetricsMultiError is an error wrapping multiple validation errors returned by Metrics.ValidateAll() if the designated constraints aren't met.

func (MetricsMultiError) AllErrors

func (m MetricsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MetricsMultiError) Error

func (m MetricsMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type MetricsValidationError

type MetricsValidationError struct {
	// contains filtered or unexported fields
}

MetricsValidationError is the validation error returned by Metrics.Validate if the designated constraints aren't met.

func (MetricsValidationError) Cause

func (e MetricsValidationError) Cause() error

Cause function returns cause value.

func (MetricsValidationError) Error

func (e MetricsValidationError) Error() string

Error satisfies the builtin error interface

func (MetricsValidationError) ErrorName

func (e MetricsValidationError) ErrorName() string

ErrorName returns error name.

func (MetricsValidationError) Field

func (e MetricsValidationError) Field() string

Field function returns field value.

func (MetricsValidationError) Key

func (e MetricsValidationError) Key() bool

Key function returns key value.

func (MetricsValidationError) Reason

func (e MetricsValidationError) Reason() string

Reason function returns reason value.

type Query

type Query struct {

	// * query string
	Expression string `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"`
	// * inclusive
	StartTimeMs int64 `protobuf:"varint,2,opt,name=start_time_ms,json=startTimeMs,proto3" json:"start_time_ms,omitempty"`
	// * inclusive
	EndTimeMs int64 `protobuf:"varint,3,opt,name=end_time_ms,json=endTimeMs,proto3" json:"end_time_ms,omitempty"`
	// * default is 1 minute (60000)
	StepMs int64 `protobuf:"varint,4,opt,name=step_ms,json=stepMs,proto3" json:"step_ms,omitempty"`
	// contains filtered or unexported fields
}

func (*Query) Descriptor deprecated

func (*Query) Descriptor() ([]byte, []int)

Deprecated: Use Query.ProtoReflect.Descriptor instead.

func (*Query) GetEndTimeMs

func (x *Query) GetEndTimeMs() int64

func (*Query) GetExpression

func (x *Query) GetExpression() string

func (*Query) GetStartTimeMs

func (x *Query) GetStartTimeMs() int64

func (*Query) GetStepMs

func (x *Query) GetStepMs() int64

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) ProtoReflect

func (x *Query) ProtoReflect() protoreflect.Message

func (*Query) Reset

func (x *Query) Reset()

func (*Query) String

func (x *Query) String() string

func (*Query) Validate

func (m *Query) Validate() error

Validate checks the field values on Query with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Query) ValidateAll

func (m *Query) ValidateAll() error

ValidateAll checks the field values on Query with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in QueryMultiError, or nil if none found.

type QueryMultiError

type QueryMultiError []error

QueryMultiError is an error wrapping multiple validation errors returned by Query.ValidateAll() if the designated constraints aren't met.

func (QueryMultiError) AllErrors

func (m QueryMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (QueryMultiError) Error

func (m QueryMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type QueryValidationError

type QueryValidationError struct {
	// contains filtered or unexported fields
}

QueryValidationError is the validation error returned by Query.Validate if the designated constraints aren't met.

func (QueryValidationError) Cause

func (e QueryValidationError) Cause() error

Cause function returns cause value.

func (QueryValidationError) Error

func (e QueryValidationError) Error() string

Error satisfies the builtin error interface

func (QueryValidationError) ErrorName

func (e QueryValidationError) ErrorName() string

ErrorName returns error name.

func (QueryValidationError) Field

func (e QueryValidationError) Field() string

Field function returns field value.

func (QueryValidationError) Key

func (e QueryValidationError) Key() bool

Key function returns key value.

func (QueryValidationError) Reason

func (e QueryValidationError) Reason() string

Reason function returns reason value.

type Result

type Result struct {
	Metrics []*Metrics `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"`
	// contains filtered or unexported fields
}

func (*Result) Descriptor deprecated

func (*Result) Descriptor() ([]byte, []int)

Deprecated: Use Result.ProtoReflect.Descriptor instead.

func (*Result) GetMetrics

func (x *Result) GetMetrics() []*Metrics

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) ProtoReflect

func (x *Result) ProtoReflect() protoreflect.Message

func (*Result) Reset

func (x *Result) Reset()

func (*Result) String

func (x *Result) String() string

func (*Result) Validate

func (m *Result) Validate() error

Validate checks the field values on Result with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Result) ValidateAll

func (m *Result) ValidateAll() error

ValidateAll checks the field values on Result with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ResultMultiError, or nil if none found.

type ResultMultiError

type ResultMultiError []error

ResultMultiError is an error wrapping multiple validation errors returned by Result.ValidateAll() if the designated constraints aren't met.

func (ResultMultiError) AllErrors

func (m ResultMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ResultMultiError) Error

func (m ResultMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ResultValidationError

type ResultValidationError struct {
	// contains filtered or unexported fields
}

ResultValidationError is the validation error returned by Result.Validate if the designated constraints aren't met.

func (ResultValidationError) Cause

func (e ResultValidationError) Cause() error

Cause function returns cause value.

func (ResultValidationError) Error

func (e ResultValidationError) Error() string

Error satisfies the builtin error interface

func (ResultValidationError) ErrorName

func (e ResultValidationError) ErrorName() string

ErrorName returns error name.

func (ResultValidationError) Field

func (e ResultValidationError) Field() string

Field function returns field value.

func (ResultValidationError) Key

func (e ResultValidationError) Key() bool

Key function returns key value.

func (ResultValidationError) Reason

func (e ResultValidationError) Reason() string

Reason function returns reason value.

type UnimplementedMetricsAPIServer

type UnimplementedMetricsAPIServer struct {
}

UnimplementedMetricsAPIServer should be embedded to have forward compatible implementations.

func (UnimplementedMetricsAPIServer) GetMetrics

type UnsafeMetricsAPIServer

type UnsafeMetricsAPIServer interface {
	// contains filtered or unexported methods
}

UnsafeMetricsAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MetricsAPIServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL