Use gogoproto to generate Go code

pull/203/head
Owais Lone 6 years ago
parent 26aa36c099
commit ec2dbabc96
  1. 2
      RELEASING.md
  2. 1218
      gen-go/agent/common/v1/common.pb.go
  3. 555
      gen-go/agent/metrics/v1/metrics_service.pb.go
  4. 974
      gen-go/agent/trace/v1/trace_service.pb.go
  5. 3800
      gen-go/metrics/v1/metrics.pb.go
  6. 452
      gen-go/resource/v1/resource.pb.go
  7. 2295
      gen-go/stats/v1/stats.pb.go
  8. 5079
      gen-go/trace/v1/trace.pb.go
  9. 1094
      gen-go/trace/v1/trace_config.pb.go
  10. 3
      go.mod
  11. 4
      src/mkgogen.sh
  12. 44
      src/mkgogogen.sh

@ -21,7 +21,7 @@ $ cd $(go env GOPATH)/src/github.com/census-instrumentation/opencensus-proto
$ git checkout -b update-gen-go
$ rm -rf gen-go
$ cd src
$ ./mkgogen.sh
$ ./mkgogogen.sh
$ git add -A
$ git commit -m "Update gen-go files."
```

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: opencensus/proto/agent/metrics/v1/metrics_service.proto
package v1
@ -11,8 +11,7 @@ import (
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"
io "io"
math "math"
)
@ -25,7 +24,7 @@ var _ = math.Inf
// 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
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ExportMetricsServiceRequest struct {
// This is required only in the first message on the stream or if the
@ -51,18 +50,26 @@ 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)
return m.Unmarshal(b)
}
func (m *ExportMetricsServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ExportMetricsServiceRequest.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_ExportMetricsServiceRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
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)
return m.Size()
}
func (m *ExportMetricsServiceRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ExportMetricsServiceRequest.DiscardUnknown(m)
@ -103,18 +110,26 @@ 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)
return m.Unmarshal(b)
}
func (m *ExportMetricsServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ExportMetricsServiceResponse.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_ExportMetricsServiceResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
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)
return m.Size()
}
func (m *ExportMetricsServiceResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ExportMetricsServiceResponse.DiscardUnknown(m)
@ -132,30 +147,31 @@ func init() {
}
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, 0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00, 0x00, 0x00, 0xff,
0xff, 0x19, 0x28, 0xa4, 0x50, 0x3f, 0x03, 0x00, 0x00,
// 382 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xfb, 0x40,
0x18, 0xc6, 0x7b, 0xed, 0x9f, 0xfe, 0xe5, 0x0a, 0x0e, 0x71, 0x29, 0x55, 0x42, 0x5b, 0x45, 0x2a,
0x92, 0x8b, 0xa9, 0x83, 0x20, 0xa8, 0x58, 0x71, 0x11, 0xd4, 0x12, 0xc1, 0xc1, 0x45, 0xda, 0xf4,
0x25, 0x66, 0xc8, 0x5d, 0xbc, 0xbb, 0x04, 0xbf, 0x85, 0xab, 0xb3, 0xdf, 0xc3, 0xdd, 0xd1, 0x0f,
0xe0, 0x20, 0x75, 0xf3, 0x53, 0x48, 0x72, 0x97, 0x96, 0x12, 0x6b, 0xc1, 0xed, 0x25, 0x79, 0x7e,
0xcf, 0xfb, 0x3c, 0x77, 0x87, 0xf7, 0x58, 0x04, 0xd4, 0x03, 0x2a, 0x62, 0x61, 0x47, 0x9c, 0x49,
0x66, 0x0f, 0x7c, 0xa0, 0xd2, 0x0e, 0x41, 0xf2, 0xc0, 0x13, 0x76, 0xe2, 0xe4, 0xe3, 0xad, 0x00,
0x9e, 0x04, 0x1e, 0x90, 0x4c, 0x66, 0xb4, 0xa6, 0xa0, 0xfa, 0x42, 0x32, 0x90, 0x68, 0x35, 0x49,
0x9c, 0x86, 0x35, 0xc7, 0xdb, 0x63, 0x61, 0xc8, 0x68, 0x6a, 0xad, 0x26, 0xc5, 0x37, 0xb6, 0x0a,
0xf2, 0x62, 0x08, 0x2d, 0xdd, 0x2e, 0x48, 0x39, 0x08, 0x16, 0x73, 0x0f, 0x52, 0x6d, 0x3e, 0x2b,
0x71, 0xfb, 0x1d, 0xe1, 0xd5, 0xd3, 0x87, 0x88, 0x71, 0x79, 0xae,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0x39, 0xce, 0x62, 0xe8, 0xd5, 0xe4, 0xda, 0x19, 0x56, 0x33, 0x8b, 0xdd,
0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x8d, 0xae, 0x9f, 0x4f, 0x03, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -221,14 +237,6 @@ type MetricsServiceServer interface {
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)
}
@ -273,3 +281,462 @@ var _MetricsService_serviceDesc = grpc.ServiceDesc{
},
Metadata: "opencensus/proto/agent/metrics/v1/metrics_service.proto",
}
func (m *ExportMetricsServiceRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ExportMetricsServiceRequest) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Node != nil {
dAtA[i] = 0xa
i++
i = encodeVarintMetricsService(dAtA, i, uint64(m.Node.Size()))
n1, err1 := m.Node.MarshalTo(dAtA[i:])
if err1 != nil {
return 0, err1
}
i += n1
}
if len(m.Metrics) > 0 {
for _, msg := range m.Metrics {
dAtA[i] = 0x12
i++
i = encodeVarintMetricsService(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.Resource != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintMetricsService(dAtA, i, uint64(m.Resource.Size()))
n2, err2 := m.Resource.MarshalTo(dAtA[i:])
if err2 != nil {
return 0, err2
}
i += n2
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *ExportMetricsServiceResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ExportMetricsServiceResponse) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func encodeVarintMetricsService(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *ExportMetricsServiceRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Node != nil {
l = m.Node.Size()
n += 1 + l + sovMetricsService(uint64(l))
}
if len(m.Metrics) > 0 {
for _, e := range m.Metrics {
l = e.Size()
n += 1 + l + sovMetricsService(uint64(l))
}
}
if m.Resource != nil {
l = m.Resource.Size()
n += 1 + l + sovMetricsService(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *ExportMetricsServiceResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovMetricsService(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozMetricsService(x uint64) (n int) {
return sovMetricsService(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *ExportMetricsServiceRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMetricsService
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ExportMetricsServiceRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ExportMetricsServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMetricsService
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthMetricsService
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthMetricsService
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Node == nil {
m.Node = &v1.Node{}
}
if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Metrics", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMetricsService
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthMetricsService
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthMetricsService
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Metrics = append(m.Metrics, &v11.Metric{})
if err := m.Metrics[len(m.Metrics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMetricsService
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthMetricsService
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthMetricsService
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Resource == nil {
m.Resource = &v12.Resource{}
}
if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipMetricsService(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthMetricsService
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthMetricsService
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ExportMetricsServiceResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMetricsService
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ExportMetricsServiceResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ExportMetricsServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipMetricsService(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthMetricsService
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthMetricsService
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipMetricsService(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowMetricsService
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowMetricsService
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowMetricsService
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthMetricsService
}
iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthMetricsService
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowMetricsService
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipMetricsService(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthMetricsService
}
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthMetricsService = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowMetricsService = fmt.Errorf("proto: integer overflow")
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: opencensus/proto/resource/v1/resource.proto
package v1
@ -6,6 +6,7 @@ package v1
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
io "io"
math "math"
)
@ -18,7 +19,7 @@ var _ = math.Inf
// 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
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// Resource information.
type Resource struct {
@ -37,18 +38,26 @@ func (*Resource) ProtoMessage() {}
func (*Resource) Descriptor() ([]byte, []int) {
return fileDescriptor_584700775a2fc762, []int{0}
}
func (m *Resource) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Resource.Unmarshal(m, b)
return m.Unmarshal(b)
}
func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Resource.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_Resource.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Resource) XXX_Merge(src proto.Message) {
xxx_messageInfo_Resource.Merge(m, src)
}
func (m *Resource) XXX_Size() int {
return xxx_messageInfo_Resource.Size(m)
return m.Size()
}
func (m *Resource) XXX_DiscardUnknown() {
xxx_messageInfo_Resource.DiscardUnknown(m)
@ -80,7 +89,7 @@ func init() {
}
var fileDescriptor_584700775a2fc762 = []byte{
// 251 bytes of a gzipped FileDescriptorProto
// 269 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xce, 0x2f, 0x48, 0xcd,
0x4b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x2f, 0x4a, 0x2d,
0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x2f, 0x33, 0x84, 0xb3, 0xf5, 0xc0, 0x52, 0x42, 0x32, 0x08,
@ -90,11 +99,426 @@ var fileDescriptor_584700775a2fc762 = []byte{
0x6d, 0x64, 0xa4, 0x87, 0xcf, 0x3c, 0x3d, 0x98, 0x59, 0x7a, 0x3e, 0x60, 0x4d, 0xae, 0x79, 0x25,
0x45, 0x95, 0x41, 0x50, 0x13, 0xa4, 0x2c, 0xb9, 0xb8, 0x91, 0x84, 0x85, 0x04, 0xb8, 0x98, 0xb3,
0x53, 0x2b, 0xa1, 0xb6, 0x81, 0x98, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12,
0x4c, 0x60, 0x31, 0x08, 0xc7, 0x8a, 0xc9, 0x82, 0xd1, 0x69, 0x06, 0x23, 0x97, 0x7c, 0x66, 0x3e,
0x5e, 0xbb, 0x9d, 0x78, 0x61, 0x96, 0x07, 0x80, 0xa4, 0x02, 0x18, 0xa3, 0x5c, 0xd3, 0x33, 0x4b,
0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x21, 0xba, 0x74, 0x33, 0xf3, 0x8a, 0x4b, 0x8a,
0x4a, 0x73, 0x53, 0xf3, 0x4a, 0x12, 0x4b, 0x32, 0xf3, 0xf3, 0xf4, 0x11, 0x06, 0xea, 0x42, 0x42,
0x32, 0x3d, 0x35, 0x4f, 0x37, 0x1d, 0x25, 0x40, 0x5f, 0x31, 0xc9, 0xf8, 0x17, 0xa4, 0xe6, 0x39,
0x43, 0xac, 0x05, 0x9b, 0x8d, 0xf0, 0x66, 0x98, 0x61, 0x12, 0x1b, 0x58, 0xa3, 0x31, 0x20, 0x00,
0x00, 0xff, 0xff, 0xcf, 0x32, 0xff, 0x46, 0x96, 0x01, 0x00, 0x00,
0x4c, 0x60, 0x31, 0x08, 0xc7, 0x8a, 0xc9, 0x82, 0xd1, 0x69, 0x05, 0xe3, 0x89, 0x47, 0x72, 0x8c,
0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x03, 0x97, 0x7c, 0x66,
0x3e, 0x5e, 0xb7, 0x38, 0xf1, 0xc2, 0x1c, 0x13, 0x00, 0x92, 0x0a, 0x60, 0x8c, 0x72, 0x4d, 0xcf,
0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0xe8, 0xd2, 0xcd, 0xcc, 0x2b, 0x2e,
0x29, 0x2a, 0xcd, 0x4d, 0xcd, 0x2b, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x47, 0x18, 0xa8, 0x0b,
0x09, 0xd9, 0xf4, 0xd4, 0x3c, 0xdd, 0x74, 0x94, 0x00, 0x7e, 0xc5, 0x24, 0xe3, 0x5f, 0x90, 0x9a,
0xe7, 0x0c, 0xb1, 0x16, 0x6c, 0x36, 0xc2, 0xdb, 0x61, 0x86, 0x49, 0x6c, 0x60, 0x8d, 0xc6, 0x80,
0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0xac, 0xe7, 0xce, 0xa6, 0x01, 0x00, 0x00,
}
func (m *Resource) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Resource) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Type) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintResource(dAtA, i, uint64(len(m.Type)))
i += copy(dAtA[i:], m.Type)
}
if len(m.Labels) > 0 {
for k, _ := range m.Labels {
dAtA[i] = 0x12
i++
v := m.Labels[k]
mapSize := 1 + len(k) + sovResource(uint64(len(k))) + 1 + len(v) + sovResource(uint64(len(v)))
i = encodeVarintResource(dAtA, i, uint64(mapSize))
dAtA[i] = 0xa
i++
i = encodeVarintResource(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintResource(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v)
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func encodeVarintResource(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *Resource) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Type)
if l > 0 {
n += 1 + l + sovResource(uint64(l))
}
if len(m.Labels) > 0 {
for k, v := range m.Labels {
_ = k
_ = v
mapEntrySize := 1 + len(k) + sovResource(uint64(len(k))) + 1 + len(v) + sovResource(uint64(len(v)))
n += mapEntrySize + 1 + sovResource(uint64(mapEntrySize))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovResource(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozResource(x uint64) (n int) {
return sovResource(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Resource) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowResource
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Resource: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowResource
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthResource
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthResource
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Type = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowResource
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthResource
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthResource
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Labels == nil {
m.Labels = make(map[string]string)
}
var mapkey string
var mapvalue string
for iNdEx < postIndex {
entryPreIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowResource
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
if fieldNum == 1 {
var stringLenmapkey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowResource
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapkey |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapkey := int(stringLenmapkey)
if intStringLenmapkey < 0 {
return ErrInvalidLengthResource
}
postStringIndexmapkey := iNdEx + intStringLenmapkey
if postStringIndexmapkey < 0 {
return ErrInvalidLengthResource
}
if postStringIndexmapkey > l {
return io.ErrUnexpectedEOF
}
mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
iNdEx = postStringIndexmapkey
} else if fieldNum == 2 {
var stringLenmapvalue uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowResource
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapvalue |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapvalue := int(stringLenmapvalue)
if intStringLenmapvalue < 0 {
return ErrInvalidLengthResource
}
postStringIndexmapvalue := iNdEx + intStringLenmapvalue
if postStringIndexmapvalue < 0 {
return ErrInvalidLengthResource
}
if postStringIndexmapvalue > l {
return io.ErrUnexpectedEOF
}
mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
iNdEx = postStringIndexmapvalue
} else {
iNdEx = entryPreIndex
skippy, err := skipResource(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthResource
}
if (iNdEx + skippy) > postIndex {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
m.Labels[mapkey] = mapvalue
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipResource(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthResource
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthResource
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipResource(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowResource
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowResource
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowResource
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthResource
}
iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthResource
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowResource
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipResource(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthResource
}
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthResource = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowResource = fmt.Errorf("proto: integer overflow")
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,3 @@
module github.com/census-instrumentation/opencensus-proto
go 1.12

@ -1,5 +1,9 @@
#!/usr/bin/env bash
# NOTE: mkgogogen.sh should be used instead. This only exist
# for people who can't use gogoproto and need to maintain a fork to
# contiue to use golang/protobuf
# Run this if opencensus-proto is checked in the GOPATH.
# go get -d github.com/census-instrumentation/opencensus-proto
# to check in the repo to the GOAPTH.

@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Run this if opencensus-proto is checked in the GOPATH.
# go get -d github.com/census-instrumentation/opencensus-proto
# to check in the repo to the GOAPTH.
#
# This also requires the grpc-gateway plugin.
# See: https://github.com/grpc-ecosystem/grpc-gateway#installation
#
# To generate:
#
# cd $(go env GOPATH)/census-instrumentation/opencensus-proto
# ./mkgogogen.sh
OUTDIR="$(go env GOPATH)/src"
INCLUDES="$(go env GOPATH)/src/github.com/gogo/protobuf/protobuf"
TYPES="Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types"
ARGS="goproto_registration=true"
protoc --gofast_out=$TYPES,$ARGS,plugins=grpc:$OUTDIR opencensus/proto/stats/v1/stats.proto \
&& protoc --gofast_out=$TYPES,$ARGS,plugins=grpc:$OUTDIR opencensus/proto/metrics/v1/metrics.proto \
&& protoc --gofast_out=$TYPES,$ARGS,plugins=grpc:$OUTDIR opencensus/proto/resource/v1/resource.proto \
&& protoc --gofast_out=$TYPES,$ARGS,plugins=grpc:$OUTDIR opencensus/proto/trace/v1/trace.proto \
&& protoc --gofast_out=$TYPES,$ARGS,plugins=grpc:$OUTDIR opencensus/proto/trace/v1/trace_config.proto \
&& protoc -I=. --gofast_out=$TYPES,$ARGS,plugins=grpc:$OUTDIR opencensus/proto/agent/common/v1/common.proto \
&& protoc -I=. --gofast_out=$TYPES,$ARGS,plugins=grpc:$OUTDIR opencensus/proto/agent/metrics/v1/metrics_service.proto \
&& protoc -I=. --gofast_out=$TYPES,$ARGS,plugins=grpc:$OUTDIR opencensus/proto/agent/trace/v1/trace_service.proto \
&& protoc --grpc-gateway_out=logtostderr=true,grpc_api_configuration=./opencensus/proto/agent/trace/v1/trace_service_http.yaml:$OUTDIR opencensus/proto/agent/trace/v1/trace_service.proto \
&& protoc --grpc-gateway_out=logtostderr=true,grpc_api_configuration=./opencensus/proto/agent/metrics/v1/metrics_service_http.yaml:$OUTDIR opencensus/proto/agent/metrics/v1/metrics_service.proto
# Generate OpenApi (Swagger) documentation file for grpc-gateway endpoints.
OPENAPI_OUTDIR=../gen-openapi
mkdir -p $OPENAPI_OUTDIR
protoc --swagger_out=logtostderr=true,grpc_api_configuration=./opencensus/proto/agent/trace/v1/trace_service_http.yaml:$OPENAPI_OUTDIR \
opencensus/proto/agent/trace/v1/trace_service.proto
protoc --swagger_out=logtostderr=true,grpc_api_configuration=./opencensus/proto/agent/metrics/v1/metrics_service_http.yaml:$OPENAPI_OUTDIR \
opencensus/proto/agent/metrics/v1/metrics_service.proto
Loading…
Cancel
Save