protobuf

package
v0.0.0-...-d6337b2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Metrics_Ping_FullMethodName           = "/protobuf.Metrics/Ping"
	Metrics_GetAllMetrics_FullMethodName  = "/protobuf.Metrics/GetAllMetrics"
	Metrics_GetMetric_FullMethodName      = "/protobuf.Metrics/GetMetric"
	Metrics_SaveMetricList_FullMethodName = "/protobuf.Metrics/SaveMetricList"
	Metrics_SaveMetric_FullMethodName     = "/protobuf.Metrics/SaveMetric"
)

Variables

View Source
var (
	MetricType_name = map[int32]string{
		0: "UNKNOWN",
		1: "COUNTER",
		2: "GAUGE",
	}
	MetricType_value = map[string]int32{
		"UNKNOWN": 0,
		"COUNTER": 1,
		"GAUGE":   2,
	}
)

Enum value maps for MetricType.

View Source
var File_contracts_proto protoreflect.FileDescriptor
View Source
var Metrics_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protobuf.Metrics",
	HandlerType: (*MetricsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Ping",
			Handler:    _Metrics_Ping_Handler,
		},
		{
			MethodName: "GetAllMetrics",
			Handler:    _Metrics_GetAllMetrics_Handler,
		},
		{
			MethodName: "GetMetric",
			Handler:    _Metrics_GetMetric_Handler,
		},
		{
			MethodName: "SaveMetricList",
			Handler:    _Metrics_SaveMetricList_Handler,
		},
		{
			MethodName: "SaveMetric",
			Handler:    _Metrics_SaveMetric_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "contracts.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 RegisterMetricsServer

func RegisterMetricsServer(s grpc.ServiceRegistrar, srv MetricsServer)

Types

type GetAllMetricsRequest

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

func (*GetAllMetricsRequest) Descriptor deprecated

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

Deprecated: Use GetAllMetricsRequest.ProtoReflect.Descriptor instead.

func (*GetAllMetricsRequest) ProtoMessage

func (*GetAllMetricsRequest) ProtoMessage()

func (*GetAllMetricsRequest) ProtoReflect

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

func (*GetAllMetricsRequest) Reset

func (x *GetAllMetricsRequest) Reset()

func (*GetAllMetricsRequest) String

func (x *GetAllMetricsRequest) String() string

type GetAllMetricsResponse

type GetAllMetricsResponse struct {
	Html  string `protobuf:"bytes,1,opt,name=Html,proto3" json:"Html,omitempty"`
	Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAllMetricsResponse) Descriptor deprecated

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

Deprecated: Use GetAllMetricsResponse.ProtoReflect.Descriptor instead.

func (*GetAllMetricsResponse) GetError

func (x *GetAllMetricsResponse) GetError() string

func (*GetAllMetricsResponse) GetHtml

func (x *GetAllMetricsResponse) GetHtml() string

func (*GetAllMetricsResponse) ProtoMessage

func (*GetAllMetricsResponse) ProtoMessage()

func (*GetAllMetricsResponse) ProtoReflect

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

func (*GetAllMetricsResponse) Reset

func (x *GetAllMetricsResponse) Reset()

func (*GetAllMetricsResponse) String

func (x *GetAllMetricsResponse) String() string

type GetMetricRequest

type GetMetricRequest struct {
	Type MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=protobuf.MetricType" json:"type,omitempty"`
	Name string     `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMetricRequest) Descriptor deprecated

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

Deprecated: Use GetMetricRequest.ProtoReflect.Descriptor instead.

func (*GetMetricRequest) GetName

func (x *GetMetricRequest) GetName() string

func (*GetMetricRequest) GetType

func (x *GetMetricRequest) GetType() MetricType

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 GetMetricResponse

type GetMetricResponse struct {
	Type    MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=protobuf.MetricType" json:"type,omitempty"`
	Counter int64      `protobuf:"zigzag64,2,opt,name=counter,proto3" json:"counter,omitempty"`
	Gauge   float64    `protobuf:"fixed64,3,opt,name=gauge,proto3" json:"gauge,omitempty"`
	Name    string     `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	Error   string     `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMetricResponse) Descriptor deprecated

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

Deprecated: Use GetMetricResponse.ProtoReflect.Descriptor instead.

func (*GetMetricResponse) GetCounter

func (x *GetMetricResponse) GetCounter() int64

func (*GetMetricResponse) GetError

func (x *GetMetricResponse) GetError() string

func (*GetMetricResponse) GetGauge

func (x *GetMetricResponse) GetGauge() float64

func (*GetMetricResponse) GetName

func (x *GetMetricResponse) GetName() string

func (*GetMetricResponse) GetType

func (x *GetMetricResponse) GetType() MetricType

func (*GetMetricResponse) ProtoMessage

func (*GetMetricResponse) ProtoMessage()

func (*GetMetricResponse) ProtoReflect

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

func (*GetMetricResponse) Reset

func (x *GetMetricResponse) Reset()

func (*GetMetricResponse) String

func (x *GetMetricResponse) String() string

type MetricType

type MetricType int32
const (
	MetricType_UNKNOWN MetricType = 0
	MetricType_COUNTER MetricType = 1
	MetricType_GAUGE   MetricType = 2
)

func (MetricType) Descriptor

func (MetricType) Descriptor() protoreflect.EnumDescriptor

func (MetricType) Enum

func (x MetricType) Enum() *MetricType

func (MetricType) EnumDescriptor deprecated

func (MetricType) EnumDescriptor() ([]byte, []int)

Deprecated: Use MetricType.Descriptor instead.

func (MetricType) Number

func (x MetricType) Number() protoreflect.EnumNumber

func (MetricType) String

func (x MetricType) String() string

func (MetricType) Type

type MetricsClient

type MetricsClient interface {
	Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
	GetAllMetrics(ctx context.Context, in *GetAllMetricsRequest, opts ...grpc.CallOption) (*GetAllMetricsResponse, error)
	GetMetric(ctx context.Context, in *GetMetricRequest, opts ...grpc.CallOption) (*GetMetricResponse, error)
	SaveMetricList(ctx context.Context, in *SaveMetricListRequest, opts ...grpc.CallOption) (*SaveMetricListResponse, error)
	SaveMetric(ctx context.Context, in *SaveMetricRequest, opts ...grpc.CallOption) (*SaveMetricResponse, 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 {
	Ping(context.Context, *PingRequest) (*PingResponse, error)
	GetAllMetrics(context.Context, *GetAllMetricsRequest) (*GetAllMetricsResponse, error)
	GetMetric(context.Context, *GetMetricRequest) (*GetMetricResponse, error)
	SaveMetricList(context.Context, *SaveMetricListRequest) (*SaveMetricListResponse, error)
	SaveMetric(context.Context, *SaveMetricRequest) (*SaveMetricResponse, error)
	// contains filtered or unexported methods
}

MetricsServer is the server API for Metrics service. All implementations must embed UnimplementedMetricsServer for forward compatibility.

type PingRequest

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

func (*PingRequest) Descriptor deprecated

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

Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.

func (*PingRequest) ProtoMessage

func (*PingRequest) ProtoMessage()

func (*PingRequest) ProtoReflect

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

func (*PingRequest) Reset

func (x *PingRequest) Reset()

func (*PingRequest) String

func (x *PingRequest) String() string

type PingResponse

type PingResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Error   string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*PingResponse) Descriptor deprecated

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

Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.

func (*PingResponse) GetError

func (x *PingResponse) GetError() string

func (*PingResponse) GetMessage

func (x *PingResponse) GetMessage() string

func (*PingResponse) ProtoMessage

func (*PingResponse) ProtoMessage()

func (*PingResponse) ProtoReflect

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

func (*PingResponse) Reset

func (x *PingResponse) Reset()

func (*PingResponse) String

func (x *PingResponse) String() string

type SaveMetricListRequest

type SaveMetricListRequest struct {
	Request []*SaveMetricRequest `protobuf:"bytes,1,rep,name=request,proto3" json:"request,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveMetricListRequest) Descriptor deprecated

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

Deprecated: Use SaveMetricListRequest.ProtoReflect.Descriptor instead.

func (*SaveMetricListRequest) GetRequest

func (x *SaveMetricListRequest) GetRequest() []*SaveMetricRequest

func (*SaveMetricListRequest) ProtoMessage

func (*SaveMetricListRequest) ProtoMessage()

func (*SaveMetricListRequest) ProtoReflect

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

func (*SaveMetricListRequest) Reset

func (x *SaveMetricListRequest) Reset()

func (*SaveMetricListRequest) String

func (x *SaveMetricListRequest) String() string

type SaveMetricListResponse

type SaveMetricListResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Error   string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveMetricListResponse) Descriptor deprecated

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

Deprecated: Use SaveMetricListResponse.ProtoReflect.Descriptor instead.

func (*SaveMetricListResponse) GetError

func (x *SaveMetricListResponse) GetError() string

func (*SaveMetricListResponse) GetMessage

func (x *SaveMetricListResponse) GetMessage() string

func (*SaveMetricListResponse) ProtoMessage

func (*SaveMetricListResponse) ProtoMessage()

func (*SaveMetricListResponse) ProtoReflect

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

func (*SaveMetricListResponse) Reset

func (x *SaveMetricListResponse) Reset()

func (*SaveMetricListResponse) String

func (x *SaveMetricListResponse) String() string

type SaveMetricRequest

type SaveMetricRequest struct {
	Type    MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=protobuf.MetricType" json:"type,omitempty"`
	Name    string     `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Counter int64      `protobuf:"zigzag64,3,opt,name=counter,proto3" json:"counter,omitempty"`
	Gauge   float64    `protobuf:"fixed64,4,opt,name=gauge,proto3" json:"gauge,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveMetricRequest) Descriptor deprecated

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

Deprecated: Use SaveMetricRequest.ProtoReflect.Descriptor instead.

func (*SaveMetricRequest) GetCounter

func (x *SaveMetricRequest) GetCounter() int64

func (*SaveMetricRequest) GetGauge

func (x *SaveMetricRequest) GetGauge() float64

func (*SaveMetricRequest) GetName

func (x *SaveMetricRequest) GetName() string

func (*SaveMetricRequest) GetType

func (x *SaveMetricRequest) GetType() MetricType

func (*SaveMetricRequest) ProtoMessage

func (*SaveMetricRequest) ProtoMessage()

func (*SaveMetricRequest) ProtoReflect

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

func (*SaveMetricRequest) Reset

func (x *SaveMetricRequest) Reset()

func (*SaveMetricRequest) String

func (x *SaveMetricRequest) String() string

type SaveMetricResponse

type SaveMetricResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Error   string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveMetricResponse) Descriptor deprecated

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

Deprecated: Use SaveMetricResponse.ProtoReflect.Descriptor instead.

func (*SaveMetricResponse) GetError

func (x *SaveMetricResponse) GetError() string

func (*SaveMetricResponse) GetMessage

func (x *SaveMetricResponse) GetMessage() string

func (*SaveMetricResponse) ProtoMessage

func (*SaveMetricResponse) ProtoMessage()

func (*SaveMetricResponse) ProtoReflect

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

func (*SaveMetricResponse) Reset

func (x *SaveMetricResponse) Reset()

func (*SaveMetricResponse) String

func (x *SaveMetricResponse) String() string

type UnimplementedMetricsServer

type UnimplementedMetricsServer struct{}

UnimplementedMetricsServer 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.

func (UnimplementedMetricsServer) GetAllMetrics

func (UnimplementedMetricsServer) GetMetric

func (UnimplementedMetricsServer) Ping

func (UnimplementedMetricsServer) SaveMetric

func (UnimplementedMetricsServer) SaveMetricList

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.

Jump to

Keyboard shortcuts

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