forked from hswaw/hscloud
third_party/go: pay off some technical debt and hide the bodies
This is an amalgamation of a handful of small changes to Go deps. Notably: - we remove our opencensus-proto fork, use upstream, use exclude=src to fix the build - unvendorify some deps - bump io_rules_go to fix WKT resolution Notably, we now do not have the 'protoc-gen-go' error when running kubecfg/kubectl anymore. Change-Id: I34fb9e78b2b12e4543142183d601d01987076f32
This commit is contained in:
parent
e23717d520
commit
301435f3c3
22 changed files with 20 additions and 5301 deletions
|
@ -40,10 +40,10 @@ hscloud_setup_nix(
|
|||
# Download Go/Gazelle rules
|
||||
http_archive(
|
||||
name = "io_bazel_rules_go",
|
||||
sha256 = "6a68e269802911fa419abb940c850734086869d7fe9bc8e12aaf60a09641c818",
|
||||
sha256 = "d1ffd055969c8f8d431e2d439813e42326961d0942bdf734d2c95dc30c369566",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.0/rules_go-v0.23.0.tar.gz",
|
||||
"https://github.com/bazelbuild/rules_go/releases/download/v0.23.0/rules_go-v0.23.0.tar.gz",
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz",
|
||||
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz",
|
||||
],
|
||||
)
|
||||
http_archive(
|
||||
|
|
1
third_party/go/opencensus-proto/BUILD
vendored
1
third_party/go/opencensus-proto/BUILD
vendored
|
@ -1 +0,0 @@
|
|||
# Stay away Gazelle. (this files tells Gazelle to ignore it)
|
5
third_party/go/opencensus-proto/README.md
vendored
5
third_party/go/opencensus-proto/README.md
vendored
|
@ -1,5 +0,0 @@
|
|||
From github.com/census-instrumentation/opencensus-proto.
|
||||
|
||||
Why is this vendored? https://github.com/census-instrumentation/opencensus-proto/issues/200
|
||||
|
||||
Hopefully we can get rid of this at some point.
|
1
third_party/go/opencensus-proto/WORKSPACE
vendored
1
third_party/go/opencensus-proto/WORKSPACE
vendored
|
@ -1 +0,0 @@
|
|||
workspace(name = "com_github_census_instrumentation_opencensus_proto")
|
|
@ -1,12 +0,0 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["common.pb.go"],
|
||||
importpath = "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
|
||||
],
|
||||
)
|
|
@ -1,361 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: opencensus/proto/agent/common/v1/common.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type LibraryInfo_Language int32
|
||||
|
||||
const (
|
||||
LibraryInfo_LANGUAGE_UNSPECIFIED LibraryInfo_Language = 0
|
||||
LibraryInfo_CPP LibraryInfo_Language = 1
|
||||
LibraryInfo_C_SHARP LibraryInfo_Language = 2
|
||||
LibraryInfo_ERLANG LibraryInfo_Language = 3
|
||||
LibraryInfo_GO_LANG LibraryInfo_Language = 4
|
||||
LibraryInfo_JAVA LibraryInfo_Language = 5
|
||||
LibraryInfo_NODE_JS LibraryInfo_Language = 6
|
||||
LibraryInfo_PHP LibraryInfo_Language = 7
|
||||
LibraryInfo_PYTHON LibraryInfo_Language = 8
|
||||
LibraryInfo_RUBY LibraryInfo_Language = 9
|
||||
LibraryInfo_WEB_JS LibraryInfo_Language = 10
|
||||
)
|
||||
|
||||
var LibraryInfo_Language_name = map[int32]string{
|
||||
0: "LANGUAGE_UNSPECIFIED",
|
||||
1: "CPP",
|
||||
2: "C_SHARP",
|
||||
3: "ERLANG",
|
||||
4: "GO_LANG",
|
||||
5: "JAVA",
|
||||
6: "NODE_JS",
|
||||
7: "PHP",
|
||||
8: "PYTHON",
|
||||
9: "RUBY",
|
||||
10: "WEB_JS",
|
||||
}
|
||||
|
||||
var LibraryInfo_Language_value = map[string]int32{
|
||||
"LANGUAGE_UNSPECIFIED": 0,
|
||||
"CPP": 1,
|
||||
"C_SHARP": 2,
|
||||
"ERLANG": 3,
|
||||
"GO_LANG": 4,
|
||||
"JAVA": 5,
|
||||
"NODE_JS": 6,
|
||||
"PHP": 7,
|
||||
"PYTHON": 8,
|
||||
"RUBY": 9,
|
||||
"WEB_JS": 10,
|
||||
}
|
||||
|
||||
func (x LibraryInfo_Language) String() string {
|
||||
return proto.EnumName(LibraryInfo_Language_name, int32(x))
|
||||
}
|
||||
|
||||
func (LibraryInfo_Language) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_126c72ed8a252c84, []int{2, 0}
|
||||
}
|
||||
|
||||
// Identifier metadata of the Node that produces the span or tracing data.
|
||||
// Note, this is not the metadata about the Node or service that is described by associated spans.
|
||||
// In the future we plan to extend the identifier proto definition to support
|
||||
// additional information (e.g cloud id, etc.)
|
||||
type Node struct {
|
||||
// Identifier that uniquely identifies a process within a VM/container.
|
||||
Identifier *ProcessIdentifier `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
|
||||
// Information on the OpenCensus Library that initiates the stream.
|
||||
LibraryInfo *LibraryInfo `protobuf:"bytes,2,opt,name=library_info,json=libraryInfo,proto3" json:"library_info,omitempty"`
|
||||
// Additional information on service.
|
||||
ServiceInfo *ServiceInfo `protobuf:"bytes,3,opt,name=service_info,json=serviceInfo,proto3" json:"service_info,omitempty"`
|
||||
// Additional attributes.
|
||||
Attributes map[string]string `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Node) Reset() { *m = Node{} }
|
||||
func (m *Node) String() string { return proto.CompactTextString(m) }
|
||||
func (*Node) ProtoMessage() {}
|
||||
func (*Node) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_126c72ed8a252c84, []int{0}
|
||||
}
|
||||
|
||||
func (m *Node) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Node.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Node.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Node) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Node.Merge(m, src)
|
||||
}
|
||||
func (m *Node) XXX_Size() int {
|
||||
return xxx_messageInfo_Node.Size(m)
|
||||
}
|
||||
func (m *Node) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Node.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Node proto.InternalMessageInfo
|
||||
|
||||
func (m *Node) GetIdentifier() *ProcessIdentifier {
|
||||
if m != nil {
|
||||
return m.Identifier
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Node) GetLibraryInfo() *LibraryInfo {
|
||||
if m != nil {
|
||||
return m.LibraryInfo
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Node) GetServiceInfo() *ServiceInfo {
|
||||
if m != nil {
|
||||
return m.ServiceInfo
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Node) GetAttributes() map[string]string {
|
||||
if m != nil {
|
||||
return m.Attributes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Identifier that uniquely identifies a process within a VM/container.
|
||||
type ProcessIdentifier struct {
|
||||
// The host name. Usually refers to the machine/container name.
|
||||
// For example: os.Hostname() in Go, socket.gethostname() in Python.
|
||||
HostName string `protobuf:"bytes,1,opt,name=host_name,json=hostName,proto3" json:"host_name,omitempty"`
|
||||
// Process id.
|
||||
Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"`
|
||||
// Start time of this ProcessIdentifier. Represented in epoch time.
|
||||
StartTimestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ProcessIdentifier) Reset() { *m = ProcessIdentifier{} }
|
||||
func (m *ProcessIdentifier) String() string { return proto.CompactTextString(m) }
|
||||
func (*ProcessIdentifier) ProtoMessage() {}
|
||||
func (*ProcessIdentifier) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_126c72ed8a252c84, []int{1}
|
||||
}
|
||||
|
||||
func (m *ProcessIdentifier) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ProcessIdentifier.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ProcessIdentifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ProcessIdentifier.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ProcessIdentifier) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ProcessIdentifier.Merge(m, src)
|
||||
}
|
||||
func (m *ProcessIdentifier) XXX_Size() int {
|
||||
return xxx_messageInfo_ProcessIdentifier.Size(m)
|
||||
}
|
||||
func (m *ProcessIdentifier) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ProcessIdentifier.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ProcessIdentifier proto.InternalMessageInfo
|
||||
|
||||
func (m *ProcessIdentifier) GetHostName() string {
|
||||
if m != nil {
|
||||
return m.HostName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *ProcessIdentifier) GetPid() uint32 {
|
||||
if m != nil {
|
||||
return m.Pid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ProcessIdentifier) GetStartTimestamp() *timestamp.Timestamp {
|
||||
if m != nil {
|
||||
return m.StartTimestamp
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Information on OpenCensus Library.
|
||||
type LibraryInfo struct {
|
||||
// Language of OpenCensus Library.
|
||||
Language LibraryInfo_Language `protobuf:"varint,1,opt,name=language,proto3,enum=opencensus.proto.agent.common.v1.LibraryInfo_Language" json:"language,omitempty"`
|
||||
// Version of Agent exporter of Library.
|
||||
ExporterVersion string `protobuf:"bytes,2,opt,name=exporter_version,json=exporterVersion,proto3" json:"exporter_version,omitempty"`
|
||||
// Version of OpenCensus Library.
|
||||
CoreLibraryVersion string `protobuf:"bytes,3,opt,name=core_library_version,json=coreLibraryVersion,proto3" json:"core_library_version,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *LibraryInfo) Reset() { *m = LibraryInfo{} }
|
||||
func (m *LibraryInfo) String() string { return proto.CompactTextString(m) }
|
||||
func (*LibraryInfo) ProtoMessage() {}
|
||||
func (*LibraryInfo) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_126c72ed8a252c84, []int{2}
|
||||
}
|
||||
|
||||
func (m *LibraryInfo) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_LibraryInfo.Unmarshal(m, b)
|
||||
}
|
||||
func (m *LibraryInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_LibraryInfo.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *LibraryInfo) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_LibraryInfo.Merge(m, src)
|
||||
}
|
||||
func (m *LibraryInfo) XXX_Size() int {
|
||||
return xxx_messageInfo_LibraryInfo.Size(m)
|
||||
}
|
||||
func (m *LibraryInfo) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_LibraryInfo.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_LibraryInfo proto.InternalMessageInfo
|
||||
|
||||
func (m *LibraryInfo) GetLanguage() LibraryInfo_Language {
|
||||
if m != nil {
|
||||
return m.Language
|
||||
}
|
||||
return LibraryInfo_LANGUAGE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (m *LibraryInfo) GetExporterVersion() string {
|
||||
if m != nil {
|
||||
return m.ExporterVersion
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *LibraryInfo) GetCoreLibraryVersion() string {
|
||||
if m != nil {
|
||||
return m.CoreLibraryVersion
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Additional service information.
|
||||
type ServiceInfo struct {
|
||||
// Name of the service.
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ServiceInfo) Reset() { *m = ServiceInfo{} }
|
||||
func (m *ServiceInfo) String() string { return proto.CompactTextString(m) }
|
||||
func (*ServiceInfo) ProtoMessage() {}
|
||||
func (*ServiceInfo) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_126c72ed8a252c84, []int{3}
|
||||
}
|
||||
|
||||
func (m *ServiceInfo) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ServiceInfo.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ServiceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ServiceInfo.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ServiceInfo) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ServiceInfo.Merge(m, src)
|
||||
}
|
||||
func (m *ServiceInfo) XXX_Size() int {
|
||||
return xxx_messageInfo_ServiceInfo.Size(m)
|
||||
}
|
||||
func (m *ServiceInfo) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ServiceInfo.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ServiceInfo proto.InternalMessageInfo
|
||||
|
||||
func (m *ServiceInfo) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("opencensus.proto.agent.common.v1.LibraryInfo_Language", LibraryInfo_Language_name, LibraryInfo_Language_value)
|
||||
proto.RegisterType((*Node)(nil), "opencensus.proto.agent.common.v1.Node")
|
||||
proto.RegisterMapType((map[string]string)(nil), "opencensus.proto.agent.common.v1.Node.AttributesEntry")
|
||||
proto.RegisterType((*ProcessIdentifier)(nil), "opencensus.proto.agent.common.v1.ProcessIdentifier")
|
||||
proto.RegisterType((*LibraryInfo)(nil), "opencensus.proto.agent.common.v1.LibraryInfo")
|
||||
proto.RegisterType((*ServiceInfo)(nil), "opencensus.proto.agent.common.v1.ServiceInfo")
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("opencensus/proto/agent/common/v1/common.proto", fileDescriptor_126c72ed8a252c84)
|
||||
}
|
||||
|
||||
var fileDescriptor_126c72ed8a252c84 = []byte{
|
||||
// 618 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4f, 0x6e, 0xda, 0x4e,
|
||||
0x14, 0xc7, 0x7f, 0xc6, 0x24, 0x81, 0xe7, 0x5f, 0x13, 0x77, 0x94, 0x05, 0x4a, 0x17, 0xa5, 0x74,
|
||||
0x93, 0x2e, 0xb0, 0x9b, 0x44, 0xaa, 0xaa, 0x4a, 0x5d, 0x18, 0xe2, 0x26, 0x44, 0x11, 0x58, 0x26,
|
||||
0xa1, 0x4a, 0x37, 0x96, 0x21, 0x83, 0x33, 0x2a, 0x9e, 0x41, 0xe3, 0x31, 0x2a, 0x27, 0xe8, 0x09,
|
||||
0xda, 0x03, 0xf4, 0x50, 0x3d, 0x44, 0x4f, 0x51, 0xcd, 0x8c, 0x01, 0xab, 0x59, 0x90, 0xdd, 0xfb,
|
||||
0xf3, 0xfd, 0x7e, 0x9e, 0xf5, 0xe6, 0xc9, 0xd0, 0x66, 0x73, 0x4c, 0x27, 0x98, 0x66, 0x79, 0xe6,
|
||||
0xce, 0x39, 0x13, 0xcc, 0x8d, 0x13, 0x4c, 0x85, 0x3b, 0x61, 0x69, 0xca, 0xa8, 0xbb, 0x38, 0x29,
|
||||
0x22, 0x47, 0x35, 0x51, 0x73, 0x23, 0xd7, 0x15, 0x47, 0xc9, 0x9d, 0x42, 0xb4, 0x38, 0x39, 0x7a,
|
||||
0x99, 0x30, 0x96, 0xcc, 0xb0, 0x86, 0x8d, 0xf3, 0xa9, 0x2b, 0x48, 0x8a, 0x33, 0x11, 0xa7, 0x73,
|
||||
0x6d, 0x68, 0xfd, 0x34, 0xa1, 0xda, 0x67, 0xf7, 0x18, 0x0d, 0x01, 0xc8, 0x3d, 0xa6, 0x82, 0x4c,
|
||||
0x09, 0xe6, 0x0d, 0xa3, 0x69, 0x1c, 0x5b, 0xa7, 0x67, 0xce, 0xb6, 0x01, 0x4e, 0xc0, 0xd9, 0x04,
|
||||
0x67, 0x59, 0x6f, 0x6d, 0x0d, 0x4b, 0x18, 0x14, 0xc0, 0xff, 0x33, 0x32, 0xe6, 0x31, 0x5f, 0x46,
|
||||
0x84, 0x4e, 0x59, 0xa3, 0xa2, 0xb0, 0xed, 0xed, 0xd8, 0x6b, 0xed, 0xea, 0xd1, 0x29, 0x0b, 0xad,
|
||||
0xd9, 0x26, 0x91, 0xc4, 0x0c, 0xf3, 0x05, 0x99, 0x60, 0x4d, 0x34, 0x9f, 0x4a, 0x1c, 0x6a, 0x97,
|
||||
0x26, 0x66, 0x9b, 0x04, 0x8d, 0x00, 0x62, 0x21, 0x38, 0x19, 0xe7, 0x02, 0x67, 0x8d, 0x6a, 0xd3,
|
||||
0x3c, 0xb6, 0x4e, 0xdf, 0x6d, 0xe7, 0xc9, 0xa5, 0x39, 0xde, 0xda, 0xe8, 0x53, 0xc1, 0x97, 0x61,
|
||||
0x89, 0x74, 0xf4, 0x11, 0x0e, 0xfe, 0x69, 0x23, 0x1b, 0xcc, 0xaf, 0x78, 0xa9, 0x96, 0x5b, 0x0f,
|
||||
0x65, 0x88, 0x0e, 0x61, 0x67, 0x11, 0xcf, 0x72, 0xac, 0x36, 0x53, 0x0f, 0x75, 0xf2, 0xa1, 0xf2,
|
||||
0xde, 0x68, 0x7d, 0x37, 0xe0, 0xf9, 0xa3, 0xe5, 0xa2, 0x17, 0x50, 0x7f, 0x60, 0x99, 0x88, 0x68,
|
||||
0x9c, 0xe2, 0x82, 0x53, 0x93, 0x85, 0x7e, 0x9c, 0x62, 0x89, 0x9f, 0x93, 0x7b, 0x85, 0x7a, 0x16,
|
||||
0xca, 0x10, 0x75, 0xe1, 0x20, 0x13, 0x31, 0x17, 0xd1, 0xfa, 0xd9, 0x8b, 0x85, 0x1d, 0x39, 0xfa,
|
||||
0x30, 0x9c, 0xd5, 0x61, 0x38, 0x37, 0x2b, 0x45, 0xb8, 0xaf, 0x2c, 0xeb, 0xbc, 0xf5, 0xbb, 0x02,
|
||||
0x56, 0xe9, 0x3d, 0x50, 0x08, 0xb5, 0x59, 0x4c, 0x93, 0x3c, 0x4e, 0xf4, 0x27, 0xec, 0x3f, 0x65,
|
||||
0x5d, 0x25, 0x80, 0x73, 0x5d, 0xb8, 0xc3, 0x35, 0x07, 0xbd, 0x01, 0x1b, 0x7f, 0x9b, 0x33, 0x2e,
|
||||
0x30, 0x8f, 0x16, 0x98, 0x67, 0x84, 0xd1, 0x62, 0x25, 0x07, 0xab, 0xfa, 0x48, 0x97, 0xd1, 0x5b,
|
||||
0x38, 0x9c, 0x30, 0x8e, 0xa3, 0xd5, 0x61, 0xad, 0xe4, 0xa6, 0x92, 0x23, 0xd9, 0x2b, 0x86, 0x15,
|
||||
0x8e, 0xd6, 0x0f, 0x03, 0x6a, 0xab, 0x99, 0xa8, 0x01, 0x87, 0xd7, 0x5e, 0xff, 0xe2, 0xd6, 0xbb,
|
||||
0xf0, 0xa3, 0xdb, 0xfe, 0x30, 0xf0, 0xbb, 0xbd, 0x4f, 0x3d, 0xff, 0xdc, 0xfe, 0x0f, 0xed, 0x81,
|
||||
0xd9, 0x0d, 0x02, 0xdb, 0x40, 0x16, 0xec, 0x75, 0xa3, 0xe1, 0xa5, 0x17, 0x06, 0x76, 0x05, 0x01,
|
||||
0xec, 0xfa, 0xa1, 0x74, 0xd8, 0xa6, 0x6c, 0x5c, 0x0c, 0x22, 0x95, 0x54, 0x51, 0x0d, 0xaa, 0x57,
|
||||
0xde, 0xc8, 0xb3, 0x77, 0x64, 0xb9, 0x3f, 0x38, 0xf7, 0xa3, 0xab, 0xa1, 0xbd, 0x2b, 0x29, 0xc1,
|
||||
0x65, 0x60, 0xef, 0x49, 0x63, 0x70, 0x77, 0x73, 0x39, 0xe8, 0xdb, 0x35, 0xa9, 0x0d, 0x6f, 0x3b,
|
||||
0x77, 0x76, 0x5d, 0x56, 0x3f, 0xfb, 0x1d, 0x29, 0x85, 0xd6, 0x2b, 0xb0, 0x4a, 0x57, 0x89, 0x10,
|
||||
0x54, 0x4b, 0xcf, 0xaa, 0xe2, 0xce, 0x2f, 0x03, 0x5e, 0x13, 0xb6, 0x75, 0xbd, 0x1d, 0xab, 0xab,
|
||||
0xc2, 0x40, 0x36, 0x03, 0xe3, 0x4b, 0x2f, 0x21, 0xe2, 0x21, 0x1f, 0x4b, 0x81, 0xab, 0x7d, 0x6d,
|
||||
0x42, 0x33, 0xc1, 0xf3, 0x14, 0x53, 0x11, 0x0b, 0xc2, 0xa8, 0xbb, 0x41, 0xb6, 0xf5, 0x9f, 0x26,
|
||||
0xc1, 0xb4, 0x9d, 0x3c, 0xfa, 0xe1, 0xfc, 0xa9, 0x34, 0x07, 0x73, 0x4c, 0xbb, 0x7a, 0xb8, 0xe2,
|
||||
0x3b, 0x9e, 0x1a, 0xae, 0x27, 0x3a, 0xa3, 0x93, 0xf1, 0xae, 0x02, 0x9c, 0xfd, 0x0d, 0x00, 0x00,
|
||||
0xff, 0xff, 0xe3, 0x53, 0x74, 0x5e, 0xbe, 0x04, 0x00, 0x00,
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["metrics_service.pb.go"],
|
||||
importpath = "github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@com_github_census_instrumentation_opencensus_proto//gen-go/agent/common/v1:go_default_library",
|
||||
"@com_github_census_instrumentation_opencensus_proto//gen-go/metrics/v1:go_default_library",
|
||||
"@com_github_census_instrumentation_opencensus_proto//gen-go/resource/v1:go_default_library",
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
],
|
||||
)
|
|
@ -1,275 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: opencensus/proto/agent/metrics/v1/metrics_service.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
v1 "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1"
|
||||
v11 "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1"
|
||||
v12 "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type ExportMetricsServiceRequest struct {
|
||||
// This is required only in the first message on the stream or if the
|
||||
// previous sent ExportMetricsServiceRequest message has a different Node (e.g.
|
||||
// when the same RPC is used to send Metrics from multiple Applications).
|
||||
Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
|
||||
// A list of metrics that belong to the last received Node.
|
||||
Metrics []*v11.Metric `protobuf:"bytes,2,rep,name=metrics,proto3" json:"metrics,omitempty"`
|
||||
// The resource for the metrics in this message that do not have an explicit
|
||||
// resource set.
|
||||
// If unset, the most recently set resource in the RPC stream applies. It is
|
||||
// valid to never be set within a stream, e.g. when no resource info is known
|
||||
// at all or when all sent metrics have an explicit resource set.
|
||||
Resource *v12.Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ExportMetricsServiceRequest) Reset() { *m = ExportMetricsServiceRequest{} }
|
||||
func (m *ExportMetricsServiceRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ExportMetricsServiceRequest) ProtoMessage() {}
|
||||
func (*ExportMetricsServiceRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_47e253a956287d04, []int{0}
|
||||
}
|
||||
|
||||
func (m *ExportMetricsServiceRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ExportMetricsServiceRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ExportMetricsServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ExportMetricsServiceRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ExportMetricsServiceRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ExportMetricsServiceRequest.Merge(m, src)
|
||||
}
|
||||
func (m *ExportMetricsServiceRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_ExportMetricsServiceRequest.Size(m)
|
||||
}
|
||||
func (m *ExportMetricsServiceRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ExportMetricsServiceRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ExportMetricsServiceRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *ExportMetricsServiceRequest) GetNode() *v1.Node {
|
||||
if m != nil {
|
||||
return m.Node
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ExportMetricsServiceRequest) GetMetrics() []*v11.Metric {
|
||||
if m != nil {
|
||||
return m.Metrics
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ExportMetricsServiceRequest) GetResource() *v12.Resource {
|
||||
if m != nil {
|
||||
return m.Resource
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ExportMetricsServiceResponse struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ExportMetricsServiceResponse) Reset() { *m = ExportMetricsServiceResponse{} }
|
||||
func (m *ExportMetricsServiceResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ExportMetricsServiceResponse) ProtoMessage() {}
|
||||
func (*ExportMetricsServiceResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_47e253a956287d04, []int{1}
|
||||
}
|
||||
|
||||
func (m *ExportMetricsServiceResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ExportMetricsServiceResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ExportMetricsServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ExportMetricsServiceResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ExportMetricsServiceResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ExportMetricsServiceResponse.Merge(m, src)
|
||||
}
|
||||
func (m *ExportMetricsServiceResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_ExportMetricsServiceResponse.Size(m)
|
||||
}
|
||||
func (m *ExportMetricsServiceResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ExportMetricsServiceResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ExportMetricsServiceResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*ExportMetricsServiceRequest)(nil), "opencensus.proto.agent.metrics.v1.ExportMetricsServiceRequest")
|
||||
proto.RegisterType((*ExportMetricsServiceResponse)(nil), "opencensus.proto.agent.metrics.v1.ExportMetricsServiceResponse")
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("opencensus/proto/agent/metrics/v1/metrics_service.proto", fileDescriptor_47e253a956287d04)
|
||||
}
|
||||
|
||||
var fileDescriptor_47e253a956287d04 = []byte{
|
||||
// 361 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x41, 0x4a, 0xc3, 0x40,
|
||||
0x14, 0x86, 0x9d, 0x56, 0xaa, 0x4c, 0xc1, 0x45, 0xdc, 0x94, 0x2a, 0xd2, 0x56, 0x91, 0x8a, 0x64,
|
||||
0x62, 0xea, 0x42, 0x10, 0x54, 0xac, 0xb8, 0x11, 0xd4, 0x12, 0xc1, 0x85, 0x1b, 0x69, 0xd3, 0x47,
|
||||
0xcc, 0x22, 0x33, 0x71, 0x66, 0x12, 0xbc, 0x85, 0x77, 0x70, 0xef, 0x8d, 0x3c, 0x81, 0xa7, 0x90,
|
||||
0xe4, 0x4d, 0x5a, 0x4a, 0x8c, 0x05, 0x77, 0x8f, 0xe4, 0xff, 0xfe, 0xf7, 0xff, 0x33, 0x43, 0x4f,
|
||||
0x44, 0x0c, 0xdc, 0x07, 0xae, 0x12, 0xe5, 0xc4, 0x52, 0x68, 0xe1, 0x8c, 0x03, 0xe0, 0xda, 0x89,
|
||||
0x40, 0xcb, 0xd0, 0x57, 0x4e, 0xea, 0x16, 0xe3, 0xb3, 0x02, 0x99, 0x86, 0x3e, 0xb0, 0x5c, 0x66,
|
||||
0x75, 0xe7, 0x20, 0x7e, 0x61, 0x39, 0xc8, 0x8c, 0x9a, 0xa5, 0x6e, 0xdb, 0xae, 0xf0, 0xf6, 0x45,
|
||||
0x14, 0x09, 0x9e, 0x59, 0xe3, 0x84, 0x7c, 0xfb, 0xa0, 0x24, 0x2f, 0x87, 0x30, 0xd2, 0xc3, 0x92,
|
||||
0x54, 0x82, 0x12, 0x89, 0xf4, 0x21, 0xd3, 0x16, 0x33, 0x8a, 0x7b, 0x5f, 0x84, 0x6e, 0x5d, 0xbf,
|
||||
0xc5, 0x42, 0xea, 0x5b, 0x34, 0x79, 0xc0, 0x22, 0x1e, 0xbc, 0x26, 0xa0, 0xb4, 0x75, 0x4a, 0x57,
|
||||
0xb9, 0x98, 0x42, 0x8b, 0x74, 0x48, 0xbf, 0x39, 0xd8, 0x67, 0x15, 0xc5, 0x4c, 0xd6, 0xd4, 0x65,
|
||||
0x77, 0x62, 0x0a, 0x5e, 0xce, 0x58, 0x67, 0x74, 0xcd, 0x24, 0x6b, 0xd5, 0x3a, 0xf5, 0x7e, 0x73,
|
||||
0xb0, 0x5b, 0xc6, 0xe7, 0x27, 0xc2, 0x30, 0x80, 0x57, 0x30, 0xd6, 0x90, 0xae, 0x17, 0x61, 0x5b,
|
||||
0xf5, 0xaa, 0xf5, 0xb3, 0x3a, 0xa9, 0xcb, 0x3c, 0x33, 0x7b, 0x33, 0xae, 0xb7, 0x43, 0xb7, 0x7f,
|
||||
0x6f, 0xa7, 0x62, 0xc1, 0x15, 0x0c, 0x3e, 0x08, 0xdd, 0x58, 0xfc, 0x65, 0xbd, 0x13, 0xda, 0x40,
|
||||
0xc6, 0x3a, 0x67, 0x4b, 0xef, 0x91, 0xfd, 0x71, 0x78, 0xed, 0x8b, 0x7f, 0xf3, 0x18, 0xaf, 0xb7,
|
||||
0xd2, 0x27, 0x47, 0x64, 0xf8, 0x49, 0xe8, 0x5e, 0x28, 0x96, 0x7b, 0x0d, 0x37, 0x17, 0x6d, 0x46,
|
||||
0x99, 0x6a, 0x44, 0x9e, 0x6e, 0x82, 0x50, 0xbf, 0x24, 0x93, 0xec, 0x92, 0x1c, 0x34, 0xb0, 0x43,
|
||||
0xae, 0xb4, 0x4c, 0x22, 0xe0, 0x7a, 0xac, 0x43, 0xc1, 0x9d, 0xb9, 0xb7, 0x8d, 0x4f, 0x26, 0x00,
|
||||
0x6e, 0x07, 0xe5, 0xf7, 0xfe, 0x5d, 0xeb, 0xde, 0xc7, 0xc0, 0xaf, 0x30, 0x46, 0xbe, 0x80, 0x5d,
|
||||
0xe6, 0x31, 0xcc, 0x6a, 0xf6, 0xe8, 0x4e, 0x1a, 0xb9, 0xc5, 0xf1, 0x4f, 0x00, 0x00, 0x00, 0xff,
|
||||
0xff, 0x19, 0x28, 0xa4, 0x50, 0x3f, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConn
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// MetricsServiceClient is the client API for MetricsService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type MetricsServiceClient interface {
|
||||
// For performance reasons, it is recommended to keep this RPC
|
||||
// alive for the entire life of the application.
|
||||
Export(ctx context.Context, opts ...grpc.CallOption) (MetricsService_ExportClient, error)
|
||||
}
|
||||
|
||||
type metricsServiceClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient {
|
||||
return &metricsServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *metricsServiceClient) Export(ctx context.Context, opts ...grpc.CallOption) (MetricsService_ExportClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &_MetricsService_serviceDesc.Streams[0], "/opencensus.proto.agent.metrics.v1.MetricsService/Export", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &metricsServiceExportClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type MetricsService_ExportClient interface {
|
||||
Send(*ExportMetricsServiceRequest) error
|
||||
Recv() (*ExportMetricsServiceResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type metricsServiceExportClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *metricsServiceExportClient) Send(m *ExportMetricsServiceRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *metricsServiceExportClient) Recv() (*ExportMetricsServiceResponse, error) {
|
||||
m := new(ExportMetricsServiceResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// MetricsServiceServer is the server API for MetricsService service.
|
||||
type MetricsServiceServer interface {
|
||||
// For performance reasons, it is recommended to keep this RPC
|
||||
// alive for the entire life of the application.
|
||||
Export(MetricsService_ExportServer) error
|
||||
}
|
||||
|
||||
// UnimplementedMetricsServiceServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedMetricsServiceServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedMetricsServiceServer) Export(srv MetricsService_ExportServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Export not implemented")
|
||||
}
|
||||
|
||||
func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) {
|
||||
s.RegisterService(&_MetricsService_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _MetricsService_Export_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(MetricsServiceServer).Export(&metricsServiceExportServer{stream})
|
||||
}
|
||||
|
||||
type MetricsService_ExportServer interface {
|
||||
Send(*ExportMetricsServiceResponse) error
|
||||
Recv() (*ExportMetricsServiceRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type metricsServiceExportServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *metricsServiceExportServer) Send(m *ExportMetricsServiceResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *metricsServiceExportServer) Recv() (*ExportMetricsServiceRequest, error) {
|
||||
m := new(ExportMetricsServiceRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
var _MetricsService_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "opencensus.proto.agent.metrics.v1.MetricsService",
|
||||
HandlerType: (*MetricsServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Export",
|
||||
Handler: _MetricsService_Export_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "opencensus/proto/agent/metrics/v1/metrics_service.proto",
|
||||
}
|
|
@ -1,150 +0,0 @@
|
|||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: opencensus/proto/agent/metrics/v1/metrics_service.proto
|
||||
|
||||
/*
|
||||
Package v1 is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
|
||||
func request_MetricsService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client MetricsServiceClient, req *http.Request, pathParams map[string]string) (MetricsService_ExportClient, runtime.ServerMetadata, error) {
|
||||
var metadata runtime.ServerMetadata
|
||||
stream, err := client.Export(ctx)
|
||||
if err != nil {
|
||||
grpclog.Infof("Failed to start streaming: %v", err)
|
||||
return nil, metadata, err
|
||||
}
|
||||
dec := marshaler.NewDecoder(req.Body)
|
||||
handleSend := func() error {
|
||||
var protoReq ExportMetricsServiceRequest
|
||||
err := dec.Decode(&protoReq)
|
||||
if err == io.EOF {
|
||||
return err
|
||||
}
|
||||
if err != nil {
|
||||
grpclog.Infof("Failed to decode request: %v", err)
|
||||
return err
|
||||
}
|
||||
if err := stream.Send(&protoReq); err != nil {
|
||||
grpclog.Infof("Failed to send request: %v", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if err := handleSend(); err != nil {
|
||||
if cerr := stream.CloseSend(); cerr != nil {
|
||||
grpclog.Infof("Failed to terminate client stream: %v", cerr)
|
||||
}
|
||||
if err == io.EOF {
|
||||
return stream, metadata, nil
|
||||
}
|
||||
return nil, metadata, err
|
||||
}
|
||||
go func() {
|
||||
for {
|
||||
if err := handleSend(); err != nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
if err := stream.CloseSend(); err != nil {
|
||||
grpclog.Infof("Failed to terminate client stream: %v", err)
|
||||
}
|
||||
}()
|
||||
header, err := stream.Header()
|
||||
if err != nil {
|
||||
grpclog.Infof("Failed to get header from client: %v", err)
|
||||
return nil, metadata, err
|
||||
}
|
||||
metadata.HeaderMD = header
|
||||
return stream, metadata, nil
|
||||
}
|
||||
|
||||
// RegisterMetricsServiceHandlerFromEndpoint is same as RegisterMetricsServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterMetricsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.Dial(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterMetricsServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterMetricsServiceHandler registers the http handlers for service MetricsService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterMetricsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterMetricsServiceHandlerClient(ctx, mux, NewMetricsServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterMetricsServiceHandlerClient registers the http handlers for service MetricsService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MetricsServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MetricsServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "MetricsServiceClient" to call the correct interceptors.
|
||||
func RegisterMetricsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MetricsServiceClient) error {
|
||||
|
||||
mux.Handle("POST", pattern_MetricsService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_MetricsService_Export_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_MetricsService_Export_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_MetricsService_Export_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "metrics"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_MetricsService_Export_0 = runtime.ForwardResponseStream
|
||||
)
|
|
@ -1,24 +0,0 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"trace_service.pb.go",
|
||||
"trace_service.pb.gw.go",
|
||||
],
|
||||
importpath = "github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@com_github_census_instrumentation_opencensus_proto//gen-go/agent/common/v1:go_default_library",
|
||||
"@com_github_census_instrumentation_opencensus_proto//gen-go/resource/v1:go_default_library",
|
||||
"@com_github_census_instrumentation_opencensus_proto//gen-go/trace/v1:go_default_library",
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library",
|
||||
"@com_github_grpc_ecosystem_grpc_gateway//utilities:go_default_library",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//grpclog:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"@org_golang_x_net//context:go_default_library",
|
||||
],
|
||||
)
|
|
@ -1,457 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: opencensus/proto/agent/trace/v1/trace_service.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
v1 "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1"
|
||||
v12 "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1"
|
||||
v11 "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type CurrentLibraryConfig struct {
|
||||
// This is required only in the first message on the stream or if the
|
||||
// previous sent CurrentLibraryConfig message has a different Node (e.g.
|
||||
// when the same RPC is used to configure multiple Applications).
|
||||
Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
|
||||
// Current configuration.
|
||||
Config *v11.TraceConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CurrentLibraryConfig) Reset() { *m = CurrentLibraryConfig{} }
|
||||
func (m *CurrentLibraryConfig) String() string { return proto.CompactTextString(m) }
|
||||
func (*CurrentLibraryConfig) ProtoMessage() {}
|
||||
func (*CurrentLibraryConfig) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_7027f99caf7ac6a5, []int{0}
|
||||
}
|
||||
|
||||
func (m *CurrentLibraryConfig) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CurrentLibraryConfig.Unmarshal(m, b)
|
||||
}
|
||||
func (m *CurrentLibraryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_CurrentLibraryConfig.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *CurrentLibraryConfig) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_CurrentLibraryConfig.Merge(m, src)
|
||||
}
|
||||
func (m *CurrentLibraryConfig) XXX_Size() int {
|
||||
return xxx_messageInfo_CurrentLibraryConfig.Size(m)
|
||||
}
|
||||
func (m *CurrentLibraryConfig) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_CurrentLibraryConfig.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_CurrentLibraryConfig proto.InternalMessageInfo
|
||||
|
||||
func (m *CurrentLibraryConfig) GetNode() *v1.Node {
|
||||
if m != nil {
|
||||
return m.Node
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CurrentLibraryConfig) GetConfig() *v11.TraceConfig {
|
||||
if m != nil {
|
||||
return m.Config
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type UpdatedLibraryConfig struct {
|
||||
// This field is ignored when the RPC is used to configure only one Application.
|
||||
// This is required only in the first message on the stream or if the
|
||||
// previous sent UpdatedLibraryConfig message has a different Node.
|
||||
Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
|
||||
// Requested updated configuration.
|
||||
Config *v11.TraceConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *UpdatedLibraryConfig) Reset() { *m = UpdatedLibraryConfig{} }
|
||||
func (m *UpdatedLibraryConfig) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdatedLibraryConfig) ProtoMessage() {}
|
||||
func (*UpdatedLibraryConfig) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_7027f99caf7ac6a5, []int{1}
|
||||
}
|
||||
|
||||
func (m *UpdatedLibraryConfig) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdatedLibraryConfig.Unmarshal(m, b)
|
||||
}
|
||||
func (m *UpdatedLibraryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_UpdatedLibraryConfig.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *UpdatedLibraryConfig) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_UpdatedLibraryConfig.Merge(m, src)
|
||||
}
|
||||
func (m *UpdatedLibraryConfig) XXX_Size() int {
|
||||
return xxx_messageInfo_UpdatedLibraryConfig.Size(m)
|
||||
}
|
||||
func (m *UpdatedLibraryConfig) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_UpdatedLibraryConfig.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_UpdatedLibraryConfig proto.InternalMessageInfo
|
||||
|
||||
func (m *UpdatedLibraryConfig) GetNode() *v1.Node {
|
||||
if m != nil {
|
||||
return m.Node
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *UpdatedLibraryConfig) GetConfig() *v11.TraceConfig {
|
||||
if m != nil {
|
||||
return m.Config
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ExportTraceServiceRequest struct {
|
||||
// This is required only in the first message on the stream or if the
|
||||
// previous sent ExportTraceServiceRequest message has a different Node (e.g.
|
||||
// when the same RPC is used to send Spans from multiple Applications).
|
||||
Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
|
||||
// A list of Spans that belong to the last received Node.
|
||||
Spans []*v11.Span `protobuf:"bytes,2,rep,name=spans,proto3" json:"spans,omitempty"`
|
||||
// The resource for the spans in this message that do not have an explicit
|
||||
// resource set.
|
||||
// If unset, the most recently set resource in the RPC stream applies. It is
|
||||
// valid to never be set within a stream, e.g. when no resource info is known.
|
||||
Resource *v12.Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ExportTraceServiceRequest) Reset() { *m = ExportTraceServiceRequest{} }
|
||||
func (m *ExportTraceServiceRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ExportTraceServiceRequest) ProtoMessage() {}
|
||||
func (*ExportTraceServiceRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_7027f99caf7ac6a5, []int{2}
|
||||
}
|
||||
|
||||
func (m *ExportTraceServiceRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ExportTraceServiceRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ExportTraceServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ExportTraceServiceRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ExportTraceServiceRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ExportTraceServiceRequest.Merge(m, src)
|
||||
}
|
||||
func (m *ExportTraceServiceRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_ExportTraceServiceRequest.Size(m)
|
||||
}
|
||||
func (m *ExportTraceServiceRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ExportTraceServiceRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ExportTraceServiceRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *ExportTraceServiceRequest) GetNode() *v1.Node {
|
||||
if m != nil {
|
||||
return m.Node
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ExportTraceServiceRequest) GetSpans() []*v11.Span {
|
||||
if m != nil {
|
||||
return m.Spans
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ExportTraceServiceRequest) GetResource() *v12.Resource {
|
||||
if m != nil {
|
||||
return m.Resource
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ExportTraceServiceResponse struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ExportTraceServiceResponse) Reset() { *m = ExportTraceServiceResponse{} }
|
||||
func (m *ExportTraceServiceResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ExportTraceServiceResponse) ProtoMessage() {}
|
||||
func (*ExportTraceServiceResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_7027f99caf7ac6a5, []int{3}
|
||||
}
|
||||
|
||||
func (m *ExportTraceServiceResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ExportTraceServiceResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ExportTraceServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ExportTraceServiceResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ExportTraceServiceResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ExportTraceServiceResponse.Merge(m, src)
|
||||
}
|
||||
func (m *ExportTraceServiceResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_ExportTraceServiceResponse.Size(m)
|
||||
}
|
||||
func (m *ExportTraceServiceResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ExportTraceServiceResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ExportTraceServiceResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*CurrentLibraryConfig)(nil), "opencensus.proto.agent.trace.v1.CurrentLibraryConfig")
|
||||
proto.RegisterType((*UpdatedLibraryConfig)(nil), "opencensus.proto.agent.trace.v1.UpdatedLibraryConfig")
|
||||
proto.RegisterType((*ExportTraceServiceRequest)(nil), "opencensus.proto.agent.trace.v1.ExportTraceServiceRequest")
|
||||
proto.RegisterType((*ExportTraceServiceResponse)(nil), "opencensus.proto.agent.trace.v1.ExportTraceServiceResponse")
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("opencensus/proto/agent/trace/v1/trace_service.proto", fileDescriptor_7027f99caf7ac6a5)
|
||||
}
|
||||
|
||||
var fileDescriptor_7027f99caf7ac6a5 = []byte{
|
||||
// 442 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0xcf, 0xaa, 0xd4, 0x30,
|
||||
0x14, 0xc6, 0x4d, 0xaf, 0x16, 0xc9, 0x75, 0x63, 0x71, 0x51, 0x8b, 0x30, 0x97, 0x82, 0x32, 0xa0,
|
||||
0x4d, 0xed, 0x5c, 0xee, 0xe6, 0x0a, 0x82, 0x33, 0x08, 0x2e, 0x44, 0x2f, 0x1d, 0x75, 0xe1, 0x66,
|
||||
0xe8, 0xb4, 0xc7, 0xda, 0xc5, 0x24, 0x31, 0x49, 0x8b, 0x82, 0x7b, 0xf7, 0x2e, 0x7c, 0x03, 0x5f,
|
||||
0xc8, 0xc7, 0xf0, 0x29, 0xa4, 0x39, 0x9d, 0x3f, 0x3a, 0x53, 0x0b, 0xba, 0xb9, 0xbb, 0x43, 0xf3,
|
||||
0xfd, 0xbe, 0xf3, 0x25, 0x39, 0x29, 0x3d, 0x15, 0x12, 0x78, 0x0e, 0x5c, 0xd7, 0x3a, 0x96, 0x4a,
|
||||
0x18, 0x11, 0x67, 0x25, 0x70, 0x13, 0x1b, 0x95, 0xe5, 0x10, 0x37, 0x09, 0x16, 0x0b, 0x0d, 0xaa,
|
||||
0xa9, 0x72, 0x60, 0x56, 0xe2, 0x8d, 0xb6, 0x10, 0x7e, 0x61, 0x16, 0x62, 0x56, 0xcb, 0x9a, 0x24,
|
||||
0x88, 0x7a, 0x5c, 0x73, 0xb1, 0x5a, 0x09, 0xde, 0xda, 0x62, 0x85, 0x74, 0x70, 0x7f, 0x4f, 0xae,
|
||||
0x40, 0x8b, 0x5a, 0x61, 0x82, 0x75, 0xdd, 0x89, 0xef, 0xee, 0x89, 0x7f, 0xcf, 0xda, 0xc9, 0x1e,
|
||||
0x0c, 0xc8, 0x16, 0xb9, 0xe0, 0xef, 0xaa, 0x12, 0xd5, 0xe1, 0x57, 0x42, 0x6f, 0xcd, 0x6a, 0xa5,
|
||||
0x80, 0x9b, 0xe7, 0xd5, 0x52, 0x65, 0xea, 0xd3, 0xcc, 0x2e, 0x7b, 0xe7, 0xf4, 0x2a, 0x17, 0x05,
|
||||
0xf8, 0xe4, 0x84, 0x8c, 0x8f, 0x27, 0xf7, 0x58, 0xcf, 0xce, 0xbb, 0xed, 0x34, 0x09, 0x7b, 0x21,
|
||||
0x0a, 0x48, 0x2d, 0xe3, 0x3d, 0xa6, 0x2e, 0x36, 0xf1, 0x9d, 0x3e, 0x7a, 0x7d, 0x62, 0xec, 0x55,
|
||||
0x5b, 0x60, 0xcf, 0xb4, 0xa3, 0x6c, 0xa8, 0xd7, 0xb2, 0xc8, 0x0c, 0x14, 0x97, 0x27, 0xd4, 0x0f,
|
||||
0x42, 0x6f, 0x3f, 0xfd, 0x28, 0x85, 0x32, 0x76, 0x75, 0x8e, 0x83, 0x91, 0xc2, 0x87, 0x1a, 0xb4,
|
||||
0xf9, 0xaf, 0x64, 0x67, 0xf4, 0x9a, 0x96, 0x19, 0xd7, 0xbe, 0x73, 0x72, 0x34, 0x3e, 0x9e, 0x8c,
|
||||
0xfe, 0x12, 0x6c, 0x2e, 0x33, 0x9e, 0xa2, 0xda, 0x9b, 0xd2, 0xeb, 0xeb, 0x09, 0xf1, 0x8f, 0xfa,
|
||||
0xda, 0x6e, 0x66, 0xa8, 0x49, 0x58, 0xda, 0xd5, 0xe9, 0x86, 0x0b, 0xef, 0xd0, 0xe0, 0xd0, 0x9e,
|
||||
0xb4, 0x14, 0x5c, 0xc3, 0xe4, 0x9b, 0x43, 0x6f, 0xec, 0x2e, 0x78, 0x9f, 0xa9, 0xdb, 0xdd, 0xc4,
|
||||
0x19, 0x1b, 0x78, 0x0a, 0xec, 0xd0, 0x54, 0x05, 0xc3, 0xd8, 0xa1, 0x7b, 0x0f, 0xaf, 0x8c, 0xc9,
|
||||
0x43, 0xe2, 0x7d, 0x21, 0xd4, 0xc5, 0xb4, 0xde, 0xf9, 0xa0, 0x4f, 0xef, 0x55, 0x05, 0x8f, 0xfe,
|
||||
0x89, 0xc5, 0x23, 0xc1, 0x24, 0xd3, 0xef, 0x84, 0x86, 0x95, 0x18, 0xf2, 0x99, 0xde, 0xdc, 0xb5,
|
||||
0xb8, 0x68, 0x15, 0x17, 0xe4, 0xed, 0xb3, 0xb2, 0x32, 0xef, 0xeb, 0x65, 0x3b, 0x0a, 0x31, 0xc2,
|
||||
0x51, 0xc5, 0xb5, 0x51, 0xf5, 0x0a, 0xb8, 0xc9, 0x4c, 0x25, 0x78, 0xbc, 0xf5, 0x8d, 0xf0, 0x05,
|
||||
0x97, 0xc0, 0xa3, 0xf2, 0xcf, 0x3f, 0xd4, 0x4f, 0x67, 0xf4, 0x52, 0x02, 0x9f, 0x61, 0x00, 0x6b,
|
||||
0xcf, 0x9e, 0xd8, 0x00, 0xb6, 0x2d, 0x7b, 0x93, 0x2c, 0x5d, 0x8b, 0x9f, 0xfe, 0x0a, 0x00, 0x00,
|
||||
0xff, 0xff, 0x65, 0x76, 0xd7, 0xb9, 0xed, 0x04, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConn
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// TraceServiceClient is the client API for TraceService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type TraceServiceClient interface {
|
||||
// After initialization, this RPC must be kept alive for the entire life of
|
||||
// the application. The agent pushes configs down to applications via a
|
||||
// stream.
|
||||
Config(ctx context.Context, opts ...grpc.CallOption) (TraceService_ConfigClient, error)
|
||||
// For performance reasons, it is recommended to keep this RPC
|
||||
// alive for the entire life of the application.
|
||||
Export(ctx context.Context, opts ...grpc.CallOption) (TraceService_ExportClient, error)
|
||||
}
|
||||
|
||||
type traceServiceClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewTraceServiceClient(cc *grpc.ClientConn) TraceServiceClient {
|
||||
return &traceServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *traceServiceClient) Config(ctx context.Context, opts ...grpc.CallOption) (TraceService_ConfigClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &_TraceService_serviceDesc.Streams[0], "/opencensus.proto.agent.trace.v1.TraceService/Config", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &traceServiceConfigClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type TraceService_ConfigClient interface {
|
||||
Send(*CurrentLibraryConfig) error
|
||||
Recv() (*UpdatedLibraryConfig, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type traceServiceConfigClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *traceServiceConfigClient) Send(m *CurrentLibraryConfig) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *traceServiceConfigClient) Recv() (*UpdatedLibraryConfig, error) {
|
||||
m := new(UpdatedLibraryConfig)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *traceServiceClient) Export(ctx context.Context, opts ...grpc.CallOption) (TraceService_ExportClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &_TraceService_serviceDesc.Streams[1], "/opencensus.proto.agent.trace.v1.TraceService/Export", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &traceServiceExportClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type TraceService_ExportClient interface {
|
||||
Send(*ExportTraceServiceRequest) error
|
||||
Recv() (*ExportTraceServiceResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type traceServiceExportClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *traceServiceExportClient) Send(m *ExportTraceServiceRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *traceServiceExportClient) Recv() (*ExportTraceServiceResponse, error) {
|
||||
m := new(ExportTraceServiceResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// TraceServiceServer is the server API for TraceService service.
|
||||
type TraceServiceServer interface {
|
||||
// After initialization, this RPC must be kept alive for the entire life of
|
||||
// the application. The agent pushes configs down to applications via a
|
||||
// stream.
|
||||
Config(TraceService_ConfigServer) error
|
||||
// For performance reasons, it is recommended to keep this RPC
|
||||
// alive for the entire life of the application.
|
||||
Export(TraceService_ExportServer) error
|
||||
}
|
||||
|
||||
// UnimplementedTraceServiceServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedTraceServiceServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedTraceServiceServer) Config(srv TraceService_ConfigServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Config not implemented")
|
||||
}
|
||||
func (*UnimplementedTraceServiceServer) Export(srv TraceService_ExportServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Export not implemented")
|
||||
}
|
||||
|
||||
func RegisterTraceServiceServer(s *grpc.Server, srv TraceServiceServer) {
|
||||
s.RegisterService(&_TraceService_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _TraceService_Config_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(TraceServiceServer).Config(&traceServiceConfigServer{stream})
|
||||
}
|
||||
|
||||
type TraceService_ConfigServer interface {
|
||||
Send(*UpdatedLibraryConfig) error
|
||||
Recv() (*CurrentLibraryConfig, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type traceServiceConfigServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *traceServiceConfigServer) Send(m *UpdatedLibraryConfig) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *traceServiceConfigServer) Recv() (*CurrentLibraryConfig, error) {
|
||||
m := new(CurrentLibraryConfig)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _TraceService_Export_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(TraceServiceServer).Export(&traceServiceExportServer{stream})
|
||||
}
|
||||
|
||||
type TraceService_ExportServer interface {
|
||||
Send(*ExportTraceServiceResponse) error
|
||||
Recv() (*ExportTraceServiceRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type traceServiceExportServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *traceServiceExportServer) Send(m *ExportTraceServiceResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *traceServiceExportServer) Recv() (*ExportTraceServiceRequest, error) {
|
||||
m := new(ExportTraceServiceRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
var _TraceService_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "opencensus.proto.agent.trace.v1.TraceService",
|
||||
HandlerType: (*TraceServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Config",
|
||||
Handler: _TraceService_Config_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "Export",
|
||||
Handler: _TraceService_Export_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "opencensus/proto/agent/trace/v1/trace_service.proto",
|
||||
}
|
|
@ -1,150 +0,0 @@
|
|||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: opencensus/proto/agent/trace/v1/trace_service.proto
|
||||
|
||||
/*
|
||||
Package v1 is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
|
||||
func request_TraceService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client TraceServiceClient, req *http.Request, pathParams map[string]string) (TraceService_ExportClient, runtime.ServerMetadata, error) {
|
||||
var metadata runtime.ServerMetadata
|
||||
stream, err := client.Export(ctx)
|
||||
if err != nil {
|
||||
grpclog.Infof("Failed to start streaming: %v", err)
|
||||
return nil, metadata, err
|
||||
}
|
||||
dec := marshaler.NewDecoder(req.Body)
|
||||
handleSend := func() error {
|
||||
var protoReq ExportTraceServiceRequest
|
||||
err := dec.Decode(&protoReq)
|
||||
if err == io.EOF {
|
||||
return err
|
||||
}
|
||||
if err != nil {
|
||||
grpclog.Infof("Failed to decode request: %v", err)
|
||||