commonv1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package commonv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var File_common_v1_common_proto protoreflect.FileDescriptor
View Source
var StatusService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "common.v1.StatusService",
	HandlerType: (*StatusServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetBuildInfo",
			Handler:    _StatusService_GetBuildInfo_Handler,
		},
		{
			MethodName: "GetConfig",
			Handler:    _StatusService_GetConfig_Handler,
		},
		{
			MethodName: "GetDiffConfig",
			Handler:    _StatusService_GetDiffConfig_Handler,
		},
		{
			MethodName: "GetDefaultConfig",
			Handler:    _StatusService_GetDefaultConfig_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "common/v1/common.proto",
}

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

Functions

func RegisterStatusServiceHandler

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

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

func RegisterStatusServiceHandlerClient

func RegisterStatusServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StatusServiceClient) error

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

func RegisterStatusServiceHandlerFromEndpoint

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

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

func RegisterStatusServiceHandlerServer

func RegisterStatusServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StatusServiceServer) error

RegisterStatusServiceHandlerServer registers the http handlers for service StatusService to "mux". UnaryRPC :call StatusServiceServer 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 RegisterStatusServiceHandlerFromEndpoint instead.

func RegisterStatusServiceServer

func RegisterStatusServiceServer(s grpc.ServiceRegistrar, srv StatusServiceServer)

Types

type GetBuildInfoData

type GetBuildInfoData struct {
	Version   string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	Revision  string `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
	Branch    string `protobuf:"bytes,3,opt,name=branch,proto3" json:"branch,omitempty"`
	BuildUser string `protobuf:"bytes,4,opt,name=build_user,json=buildUser,proto3" json:"build_user,omitempty"`
	BuildDate string `protobuf:"bytes,5,opt,name=build_date,json=buildDate,proto3" json:"build_date,omitempty"`
	GoVersion string `protobuf:"bytes,6,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"`
	// contains filtered or unexported fields
}

func (*GetBuildInfoData) Descriptor deprecated

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

Deprecated: Use GetBuildInfoData.ProtoReflect.Descriptor instead.

func (*GetBuildInfoData) GetBranch

func (x *GetBuildInfoData) GetBranch() string

func (*GetBuildInfoData) GetBuildDate

func (x *GetBuildInfoData) GetBuildDate() string

func (*GetBuildInfoData) GetBuildUser

func (x *GetBuildInfoData) GetBuildUser() string

func (*GetBuildInfoData) GetGoVersion

func (x *GetBuildInfoData) GetGoVersion() string

func (*GetBuildInfoData) GetRevision

func (x *GetBuildInfoData) GetRevision() string

func (*GetBuildInfoData) GetVersion

func (x *GetBuildInfoData) GetVersion() string

func (*GetBuildInfoData) MarshalToSizedBufferVT

func (m *GetBuildInfoData) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*GetBuildInfoData) MarshalToVT

func (m *GetBuildInfoData) MarshalToVT(dAtA []byte) (int, error)

func (*GetBuildInfoData) MarshalVT

func (m *GetBuildInfoData) MarshalVT() (dAtA []byte, err error)

func (*GetBuildInfoData) ProtoMessage

func (*GetBuildInfoData) ProtoMessage()

func (*GetBuildInfoData) ProtoReflect

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

func (*GetBuildInfoData) Reset

func (x *GetBuildInfoData) Reset()

func (*GetBuildInfoData) SizeVT

func (m *GetBuildInfoData) SizeVT() (n int)

func (*GetBuildInfoData) String

func (x *GetBuildInfoData) String() string

func (*GetBuildInfoData) UnmarshalVT

func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error

type GetBuildInfoRequest

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

func (*GetBuildInfoRequest) Descriptor deprecated

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

Deprecated: Use GetBuildInfoRequest.ProtoReflect.Descriptor instead.

func (*GetBuildInfoRequest) MarshalToSizedBufferVT

func (m *GetBuildInfoRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*GetBuildInfoRequest) MarshalToVT

func (m *GetBuildInfoRequest) MarshalToVT(dAtA []byte) (int, error)

func (*GetBuildInfoRequest) MarshalVT

func (m *GetBuildInfoRequest) MarshalVT() (dAtA []byte, err error)

func (*GetBuildInfoRequest) ProtoMessage

func (*GetBuildInfoRequest) ProtoMessage()

func (*GetBuildInfoRequest) ProtoReflect

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

func (*GetBuildInfoRequest) Reset

func (x *GetBuildInfoRequest) Reset()

func (*GetBuildInfoRequest) SizeVT

func (m *GetBuildInfoRequest) SizeVT() (n int)

func (*GetBuildInfoRequest) String

func (x *GetBuildInfoRequest) String() string

func (*GetBuildInfoRequest) UnmarshalVT

func (m *GetBuildInfoRequest) UnmarshalVT(dAtA []byte) error

type GetBuildInfoResponse

type GetBuildInfoResponse struct {
	Status string            `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Data   *GetBuildInfoData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*GetBuildInfoResponse) Descriptor deprecated

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

Deprecated: Use GetBuildInfoResponse.ProtoReflect.Descriptor instead.

func (*GetBuildInfoResponse) GetData

func (x *GetBuildInfoResponse) GetData() *GetBuildInfoData

func (*GetBuildInfoResponse) GetStatus

func (x *GetBuildInfoResponse) GetStatus() string

func (*GetBuildInfoResponse) MarshalToSizedBufferVT

func (m *GetBuildInfoResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*GetBuildInfoResponse) MarshalToVT

func (m *GetBuildInfoResponse) MarshalToVT(dAtA []byte) (int, error)

func (*GetBuildInfoResponse) MarshalVT

func (m *GetBuildInfoResponse) MarshalVT() (dAtA []byte, err error)

func (*GetBuildInfoResponse) ProtoMessage

func (*GetBuildInfoResponse) ProtoMessage()

func (*GetBuildInfoResponse) ProtoReflect

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

func (*GetBuildInfoResponse) Reset

func (x *GetBuildInfoResponse) Reset()

func (*GetBuildInfoResponse) SizeVT

func (m *GetBuildInfoResponse) SizeVT() (n int)

func (*GetBuildInfoResponse) String

func (x *GetBuildInfoResponse) String() string

func (*GetBuildInfoResponse) UnmarshalVT

func (m *GetBuildInfoResponse) UnmarshalVT(dAtA []byte) error

type GetConfigRequest

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

func (*GetConfigRequest) Descriptor deprecated

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

Deprecated: Use GetConfigRequest.ProtoReflect.Descriptor instead.

func (*GetConfigRequest) MarshalToSizedBufferVT

func (m *GetConfigRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*GetConfigRequest) MarshalToVT

func (m *GetConfigRequest) MarshalToVT(dAtA []byte) (int, error)

func (*GetConfigRequest) MarshalVT

func (m *GetConfigRequest) MarshalVT() (dAtA []byte, err error)

func (*GetConfigRequest) ProtoMessage

func (*GetConfigRequest) ProtoMessage()

func (*GetConfigRequest) ProtoReflect

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

func (*GetConfigRequest) Reset

func (x *GetConfigRequest) Reset()

func (*GetConfigRequest) SizeVT

func (m *GetConfigRequest) SizeVT() (n int)

func (*GetConfigRequest) String

func (x *GetConfigRequest) String() string

func (*GetConfigRequest) UnmarshalVT

func (m *GetConfigRequest) UnmarshalVT(dAtA []byte) error

type GetConfigResponse

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

func (*GetConfigResponse) Descriptor deprecated

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

Deprecated: Use GetConfigResponse.ProtoReflect.Descriptor instead.

func (*GetConfigResponse) MarshalToSizedBufferVT

func (m *GetConfigResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*GetConfigResponse) MarshalToVT

func (m *GetConfigResponse) MarshalToVT(dAtA []byte) (int, error)

func (*GetConfigResponse) MarshalVT

func (m *GetConfigResponse) MarshalVT() (dAtA []byte, err error)

func (*GetConfigResponse) ProtoMessage

func (*GetConfigResponse) ProtoMessage()

func (*GetConfigResponse) ProtoReflect

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

func (*GetConfigResponse) Reset

func (x *GetConfigResponse) Reset()

func (*GetConfigResponse) SizeVT

func (m *GetConfigResponse) SizeVT() (n int)

func (*GetConfigResponse) String

func (x *GetConfigResponse) String() string

func (*GetConfigResponse) UnmarshalVT

func (m *GetConfigResponse) UnmarshalVT(dAtA []byte) error

type LabelPair

type LabelPair struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*LabelPair) Descriptor deprecated

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

Deprecated: Use LabelPair.ProtoReflect.Descriptor instead.

func (*LabelPair) GetName

func (x *LabelPair) GetName() string

func (*LabelPair) GetValue

func (x *LabelPair) GetValue() string

func (*LabelPair) MarshalToSizedBufferVT

func (m *LabelPair) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*LabelPair) MarshalToVT

func (m *LabelPair) MarshalToVT(dAtA []byte) (int, error)

func (*LabelPair) MarshalVT

func (m *LabelPair) MarshalVT() (dAtA []byte, err error)

func (*LabelPair) ProtoMessage

func (*LabelPair) ProtoMessage()

func (*LabelPair) ProtoReflect

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

func (*LabelPair) Reset

func (x *LabelPair) Reset()

func (*LabelPair) SizeVT

func (m *LabelPair) SizeVT() (n int)

func (*LabelPair) String

func (x *LabelPair) String() string

func (*LabelPair) UnmarshalVT

func (m *LabelPair) UnmarshalVT(dAtA []byte) error

type Labels

type Labels struct {

	// LabelPair is the key value pairs to identify the corresponding profile
	Labels []*LabelPair `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"`
	// contains filtered or unexported fields
}

func (*Labels) Descriptor deprecated

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

Deprecated: Use Labels.ProtoReflect.Descriptor instead.

func (*Labels) GetLabels

func (x *Labels) GetLabels() []*LabelPair

func (*Labels) MarshalToSizedBufferVT

func (m *Labels) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Labels) MarshalToVT

func (m *Labels) MarshalToVT(dAtA []byte) (int, error)

func (*Labels) MarshalVT

func (m *Labels) MarshalVT() (dAtA []byte, err error)

func (*Labels) ProtoMessage

func (*Labels) ProtoMessage()

func (*Labels) ProtoReflect

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

func (*Labels) Reset

func (x *Labels) Reset()

func (*Labels) SizeVT

func (m *Labels) SizeVT() (n int)

func (*Labels) String

func (x *Labels) String() string

func (*Labels) UnmarshalVT

func (m *Labels) UnmarshalVT(dAtA []byte) error

type Point

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

func (*Point) Descriptor deprecated

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

Deprecated: Use Point.ProtoReflect.Descriptor instead.

func (*Point) GetTimestamp

func (x *Point) GetTimestamp() int64

func (*Point) GetValue

func (x *Point) GetValue() float64

func (*Point) MarshalToSizedBufferVT

func (m *Point) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Point) MarshalToVT

func (m *Point) MarshalToVT(dAtA []byte) (int, error)

func (*Point) MarshalVT

func (m *Point) MarshalVT() (dAtA []byte, err error)

func (*Point) ProtoMessage

func (*Point) ProtoMessage()

func (*Point) ProtoReflect

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

func (*Point) Reset

func (x *Point) Reset()

func (*Point) SizeVT

func (m *Point) SizeVT() (n int)

func (*Point) String

func (x *Point) String() string

func (*Point) UnmarshalVT

func (m *Point) UnmarshalVT(dAtA []byte) error

type ProfileType

type ProfileType struct {
	ID         string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Name       string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	SampleType string `protobuf:"bytes,4,opt,name=sample_type,json=sampleType,proto3" json:"sample_type,omitempty"`
	SampleUnit string `protobuf:"bytes,5,opt,name=sample_unit,json=sampleUnit,proto3" json:"sample_unit,omitempty"`
	PeriodType string `protobuf:"bytes,6,opt,name=period_type,json=periodType,proto3" json:"period_type,omitempty"`
	PeriodUnit string `protobuf:"bytes,7,opt,name=period_unit,json=periodUnit,proto3" json:"period_unit,omitempty"`
	// contains filtered or unexported fields
}

func (*ProfileType) Descriptor deprecated

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

Deprecated: Use ProfileType.ProtoReflect.Descriptor instead.

func (*ProfileType) GetID

func (x *ProfileType) GetID() string

func (*ProfileType) GetName

func (x *ProfileType) GetName() string

func (*ProfileType) GetPeriodType

func (x *ProfileType) GetPeriodType() string

func (*ProfileType) GetPeriodUnit

func (x *ProfileType) GetPeriodUnit() string

func (*ProfileType) GetSampleType

func (x *ProfileType) GetSampleType() string

func (*ProfileType) GetSampleUnit

func (x *ProfileType) GetSampleUnit() string

func (*ProfileType) MarshalToSizedBufferVT

func (m *ProfileType) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ProfileType) MarshalToVT

func (m *ProfileType) MarshalToVT(dAtA []byte) (int, error)

func (*ProfileType) MarshalVT

func (m *ProfileType) MarshalVT() (dAtA []byte, err error)

func (*ProfileType) ProtoMessage

func (*ProfileType) ProtoMessage()

func (*ProfileType) ProtoReflect

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

func (*ProfileType) Reset

func (x *ProfileType) Reset()

func (*ProfileType) SizeVT

func (m *ProfileType) SizeVT() (n int)

func (*ProfileType) String

func (x *ProfileType) String() string

func (*ProfileType) UnmarshalVT

func (m *ProfileType) UnmarshalVT(dAtA []byte) error

type Series

type Series struct {
	Labels []*LabelPair `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"`
	Points []*Point     `protobuf:"bytes,2,rep,name=points,proto3" json:"points,omitempty"`
	// contains filtered or unexported fields
}

func (*Series) Descriptor deprecated

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

Deprecated: Use Series.ProtoReflect.Descriptor instead.

func (*Series) GetLabels

func (x *Series) GetLabels() []*LabelPair

func (*Series) GetPoints

func (x *Series) GetPoints() []*Point

func (*Series) MarshalToSizedBufferVT

func (m *Series) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Series) MarshalToVT

func (m *Series) MarshalToVT(dAtA []byte) (int, error)

func (*Series) MarshalVT

func (m *Series) MarshalVT() (dAtA []byte, err error)

func (*Series) ProtoMessage

func (*Series) ProtoMessage()

func (*Series) ProtoReflect

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

func (*Series) Reset

func (x *Series) Reset()

func (*Series) SizeVT

func (m *Series) SizeVT() (n int)

func (*Series) String

func (x *Series) String() string

func (*Series) UnmarshalVT

func (m *Series) UnmarshalVT(dAtA []byte) error

type StatusServiceClient

type StatusServiceClient interface {
	// Retrieve build information about the binary
	GetBuildInfo(ctx context.Context, in *GetBuildInfoRequest, opts ...grpc.CallOption) (*GetBuildInfoResponse, error)
	// Retrieve the running config
	GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
	// Retrieve the diff config to the defaults
	GetDiffConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
	GetDefaultConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
}

StatusServiceClient is the client API for StatusService 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 StatusServiceServer

type StatusServiceServer interface {
	// Retrieve build information about the binary
	GetBuildInfo(context.Context, *GetBuildInfoRequest) (*GetBuildInfoResponse, error)
	// Retrieve the running config
	GetConfig(context.Context, *GetConfigRequest) (*httpbody.HttpBody, error)
	// Retrieve the diff config to the defaults
	GetDiffConfig(context.Context, *GetConfigRequest) (*httpbody.HttpBody, error)
	GetDefaultConfig(context.Context, *GetConfigRequest) (*httpbody.HttpBody, error)
	// contains filtered or unexported methods
}

StatusServiceServer is the server API for StatusService service. All implementations must embed UnimplementedStatusServiceServer for forward compatibility

type UnimplementedStatusServiceServer

type UnimplementedStatusServiceServer struct {
}

UnimplementedStatusServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedStatusServiceServer) GetBuildInfo

func (UnimplementedStatusServiceServer) GetConfig

func (UnimplementedStatusServiceServer) GetDefaultConfig

func (UnimplementedStatusServiceServer) GetDiffConfig

type UnsafeStatusServiceServer

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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