1909 lines
44 KiB
Go
1909 lines
44 KiB
Go
// Code generated by protoc-gen-gogo.
|
|
// source: struct.proto
|
|
// DO NOT EDIT!
|
|
|
|
/*
|
|
Package types is a generated protocol buffer package.
|
|
|
|
It is generated from these files:
|
|
struct.proto
|
|
|
|
It has these top-level messages:
|
|
Struct
|
|
Value
|
|
ListValue
|
|
*/
|
|
package types
|
|
|
|
import proto "github.com/gogo/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
|
|
import strconv "strconv"
|
|
|
|
import strings "strings"
|
|
import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
|
|
import sort "sort"
|
|
import reflect "reflect"
|
|
import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
|
|
|
|
import io "io"
|
|
|
|
// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
// `NullValue` is a singleton enumeration to represent the null value for the
|
|
// `Value` type union.
|
|
//
|
|
// The JSON representation for `NullValue` is JSON `null`.
|
|
type NullValue int32
|
|
|
|
const (
|
|
// Null value.
|
|
NULL_VALUE NullValue = 0
|
|
)
|
|
|
|
var NullValue_name = map[int32]string{
|
|
0: "NULL_VALUE",
|
|
}
|
|
var NullValue_value = map[string]int32{
|
|
"NULL_VALUE": 0,
|
|
}
|
|
|
|
func (NullValue) EnumDescriptor() ([]byte, []int) { return fileDescriptorStruct, []int{0} }
|
|
func (NullValue) XXX_WellKnownType() string { return "NullValue" }
|
|
|
|
// `Struct` represents a structured data value, consisting of fields
|
|
// which map to dynamically typed values. In some languages, `Struct`
|
|
// might be supported by a native representation. For example, in
|
|
// scripting languages like JS a struct is represented as an
|
|
// object. The details of that representation are described together
|
|
// with the proto support for the language.
|
|
//
|
|
// The JSON representation for `Struct` is JSON object.
|
|
type Struct struct {
|
|
// Unordered map of dynamically typed values.
|
|
Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
|
|
}
|
|
|
|
func (m *Struct) Reset() { *m = Struct{} }
|
|
func (*Struct) ProtoMessage() {}
|
|
func (*Struct) Descriptor() ([]byte, []int) { return fileDescriptorStruct, []int{0} }
|
|
func (*Struct) XXX_WellKnownType() string { return "Struct" }
|
|
|
|
func (m *Struct) GetFields() map[string]*Value {
|
|
if m != nil {
|
|
return m.Fields
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// `Value` represents a dynamically typed value which can be either
|
|
// null, a number, a string, a boolean, a recursive struct value, or a
|
|
// list of values. A producer of value is expected to set one of that
|
|
// variants, absence of any variant indicates an error.
|
|
//
|
|
// The JSON representation for `Value` is JSON value.
|
|
type Value struct {
|
|
// The kind of value.
|
|
//
|
|
// Types that are valid to be assigned to Kind:
|
|
// *Value_NullValue
|
|
// *Value_NumberValue
|
|
// *Value_StringValue
|
|
// *Value_BoolValue
|
|
// *Value_StructValue
|
|
// *Value_ListValue
|
|
Kind isValue_Kind `protobuf_oneof:"kind"`
|
|
}
|
|
|
|
func (m *Value) Reset() { *m = Value{} }
|
|
func (*Value) ProtoMessage() {}
|
|
func (*Value) Descriptor() ([]byte, []int) { return fileDescriptorStruct, []int{1} }
|
|
func (*Value) XXX_WellKnownType() string { return "Value" }
|
|
|
|
type isValue_Kind interface {
|
|
isValue_Kind()
|
|
Equal(interface{}) bool
|
|
MarshalTo([]byte) (int, error)
|
|
Size() int
|
|
}
|
|
|
|
type Value_NullValue struct {
|
|
NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
|
|
}
|
|
type Value_NumberValue struct {
|
|
NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"`
|
|
}
|
|
type Value_StringValue struct {
|
|
StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"`
|
|
}
|
|
type Value_BoolValue struct {
|
|
BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"`
|
|
}
|
|
type Value_StructValue struct {
|
|
StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,oneof"`
|
|
}
|
|
type Value_ListValue struct {
|
|
ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,oneof"`
|
|
}
|
|
|
|
func (*Value_NullValue) isValue_Kind() {}
|
|
func (*Value_NumberValue) isValue_Kind() {}
|
|
func (*Value_StringValue) isValue_Kind() {}
|
|
func (*Value_BoolValue) isValue_Kind() {}
|
|
func (*Value_StructValue) isValue_Kind() {}
|
|
func (*Value_ListValue) isValue_Kind() {}
|
|
|
|
func (m *Value) GetKind() isValue_Kind {
|
|
if m != nil {
|
|
return m.Kind
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Value) GetNullValue() NullValue {
|
|
if x, ok := m.GetKind().(*Value_NullValue); ok {
|
|
return x.NullValue
|
|
}
|
|
return NULL_VALUE
|
|
}
|
|
|
|
func (m *Value) GetNumberValue() float64 {
|
|
if x, ok := m.GetKind().(*Value_NumberValue); ok {
|
|
return x.NumberValue
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Value) GetStringValue() string {
|
|
if x, ok := m.GetKind().(*Value_StringValue); ok {
|
|
return x.StringValue
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Value) GetBoolValue() bool {
|
|
if x, ok := m.GetKind().(*Value_BoolValue); ok {
|
|
return x.BoolValue
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *Value) GetStructValue() *Struct {
|
|
if x, ok := m.GetKind().(*Value_StructValue); ok {
|
|
return x.StructValue
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Value) GetListValue() *ListValue {
|
|
if x, ok := m.GetKind().(*Value_ListValue); ok {
|
|
return x.ListValue
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofFuncs is for the internal use of the proto package.
|
|
func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
|
|
return _Value_OneofMarshaler, _Value_OneofUnmarshaler, _Value_OneofSizer, []interface{}{
|
|
(*Value_NullValue)(nil),
|
|
(*Value_NumberValue)(nil),
|
|
(*Value_StringValue)(nil),
|
|
(*Value_BoolValue)(nil),
|
|
(*Value_StructValue)(nil),
|
|
(*Value_ListValue)(nil),
|
|
}
|
|
}
|
|
|
|
func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
|
|
m := msg.(*Value)
|
|
// kind
|
|
switch x := m.Kind.(type) {
|
|
case *Value_NullValue:
|
|
_ = b.EncodeVarint(1<<3 | proto.WireVarint)
|
|
_ = b.EncodeVarint(uint64(x.NullValue))
|
|
case *Value_NumberValue:
|
|
_ = b.EncodeVarint(2<<3 | proto.WireFixed64)
|
|
_ = b.EncodeFixed64(math.Float64bits(x.NumberValue))
|
|
case *Value_StringValue:
|
|
_ = b.EncodeVarint(3<<3 | proto.WireBytes)
|
|
_ = b.EncodeStringBytes(x.StringValue)
|
|
case *Value_BoolValue:
|
|
t := uint64(0)
|
|
if x.BoolValue {
|
|
t = 1
|
|
}
|
|
_ = b.EncodeVarint(4<<3 | proto.WireVarint)
|
|
_ = b.EncodeVarint(t)
|
|
case *Value_StructValue:
|
|
_ = b.EncodeVarint(5<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.StructValue); err != nil {
|
|
return err
|
|
}
|
|
case *Value_ListValue:
|
|
_ = b.EncodeVarint(6<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.ListValue); err != nil {
|
|
return err
|
|
}
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("Value.Kind has unexpected type %T", x)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
|
|
m := msg.(*Value)
|
|
switch tag {
|
|
case 1: // kind.null_value
|
|
if wire != proto.WireVarint {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeVarint()
|
|
m.Kind = &Value_NullValue{NullValue(x)}
|
|
return true, err
|
|
case 2: // kind.number_value
|
|
if wire != proto.WireFixed64 {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeFixed64()
|
|
m.Kind = &Value_NumberValue{math.Float64frombits(x)}
|
|
return true, err
|
|
case 3: // kind.string_value
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeStringBytes()
|
|
m.Kind = &Value_StringValue{x}
|
|
return true, err
|
|
case 4: // kind.bool_value
|
|
if wire != proto.WireVarint {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeVarint()
|
|
m.Kind = &Value_BoolValue{x != 0}
|
|
return true, err
|
|
case 5: // kind.struct_value
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(Struct)
|
|
err := b.DecodeMessage(msg)
|
|
m.Kind = &Value_StructValue{msg}
|
|
return true, err
|
|
case 6: // kind.list_value
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(ListValue)
|
|
err := b.DecodeMessage(msg)
|
|
m.Kind = &Value_ListValue{msg}
|
|
return true, err
|
|
default:
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
func _Value_OneofSizer(msg proto.Message) (n int) {
|
|
m := msg.(*Value)
|
|
// kind
|
|
switch x := m.Kind.(type) {
|
|
case *Value_NullValue:
|
|
n += proto.SizeVarint(1<<3 | proto.WireVarint)
|
|
n += proto.SizeVarint(uint64(x.NullValue))
|
|
case *Value_NumberValue:
|
|
n += proto.SizeVarint(2<<3 | proto.WireFixed64)
|
|
n += 8
|
|
case *Value_StringValue:
|
|
n += proto.SizeVarint(3<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(len(x.StringValue)))
|
|
n += len(x.StringValue)
|
|
case *Value_BoolValue:
|
|
n += proto.SizeVarint(4<<3 | proto.WireVarint)
|
|
n += 1
|
|
case *Value_StructValue:
|
|
s := proto.Size(x.StructValue)
|
|
n += proto.SizeVarint(5<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *Value_ListValue:
|
|
s := proto.Size(x.ListValue)
|
|
n += proto.SizeVarint(6<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
return n
|
|
}
|
|
|
|
// `ListValue` is a wrapper around a repeated field of values.
|
|
//
|
|
// The JSON representation for `ListValue` is JSON array.
|
|
type ListValue struct {
|
|
// Repeated field of dynamically typed values.
|
|
Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"`
|
|
}
|
|
|
|
func (m *ListValue) Reset() { *m = ListValue{} }
|
|
func (*ListValue) ProtoMessage() {}
|
|
func (*ListValue) Descriptor() ([]byte, []int) { return fileDescriptorStruct, []int{2} }
|
|
func (*ListValue) XXX_WellKnownType() string { return "ListValue" }
|
|
|
|
func (m *ListValue) GetValues() []*Value {
|
|
if m != nil {
|
|
return m.Values
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Struct)(nil), "google.protobuf.Struct")
|
|
proto.RegisterType((*Value)(nil), "google.protobuf.Value")
|
|
proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue")
|
|
proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value)
|
|
}
|
|
func (x NullValue) String() string {
|
|
s, ok := NullValue_name[int32(x)]
|
|
if ok {
|
|
return s
|
|
}
|
|
return strconv.Itoa(int(x))
|
|
}
|
|
func (this *Struct) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Struct)
|
|
if !ok {
|
|
that2, ok := that.(Struct)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if len(this.Fields) != len(that1.Fields) {
|
|
return false
|
|
}
|
|
for i := range this.Fields {
|
|
if !this.Fields[i].Equal(that1.Fields[i]) {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
func (this *Value) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Value)
|
|
if !ok {
|
|
that2, ok := that.(Value)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if that1.Kind == nil {
|
|
if this.Kind != nil {
|
|
return false
|
|
}
|
|
} else if this.Kind == nil {
|
|
return false
|
|
} else if !this.Kind.Equal(that1.Kind) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *Value_NullValue) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Value_NullValue)
|
|
if !ok {
|
|
that2, ok := that.(Value_NullValue)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if this.NullValue != that1.NullValue {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *Value_NumberValue) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Value_NumberValue)
|
|
if !ok {
|
|
that2, ok := that.(Value_NumberValue)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if this.NumberValue != that1.NumberValue {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *Value_StringValue) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Value_StringValue)
|
|
if !ok {
|
|
that2, ok := that.(Value_StringValue)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if this.StringValue != that1.StringValue {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *Value_BoolValue) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Value_BoolValue)
|
|
if !ok {
|
|
that2, ok := that.(Value_BoolValue)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if this.BoolValue != that1.BoolValue {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *Value_StructValue) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Value_StructValue)
|
|
if !ok {
|
|
that2, ok := that.(Value_StructValue)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if !this.StructValue.Equal(that1.StructValue) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *Value_ListValue) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Value_ListValue)
|
|
if !ok {
|
|
that2, ok := that.(Value_ListValue)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if !this.ListValue.Equal(that1.ListValue) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *ListValue) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*ListValue)
|
|
if !ok {
|
|
that2, ok := that.(ListValue)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if len(this.Values) != len(that1.Values) {
|
|
return false
|
|
}
|
|
for i := range this.Values {
|
|
if !this.Values[i].Equal(that1.Values[i]) {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
func (this *Struct) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := make([]string, 0, 5)
|
|
s = append(s, "&types.Struct{")
|
|
keysForFields := make([]string, 0, len(this.Fields))
|
|
for k := range this.Fields {
|
|
keysForFields = append(keysForFields, k)
|
|
}
|
|
github_com_gogo_protobuf_sortkeys.Strings(keysForFields)
|
|
mapStringForFields := "map[string]*Value{"
|
|
for _, k := range keysForFields {
|
|
mapStringForFields += fmt.Sprintf("%#v: %#v,", k, this.Fields[k])
|
|
}
|
|
mapStringForFields += "}"
|
|
if this.Fields != nil {
|
|
s = append(s, "Fields: "+mapStringForFields+",\n")
|
|
}
|
|
s = append(s, "}")
|
|
return strings.Join(s, "")
|
|
}
|
|
func (this *Value) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := make([]string, 0, 10)
|
|
s = append(s, "&types.Value{")
|
|
if this.Kind != nil {
|
|
s = append(s, "Kind: "+fmt.Sprintf("%#v", this.Kind)+",\n")
|
|
}
|
|
s = append(s, "}")
|
|
return strings.Join(s, "")
|
|
}
|
|
func (this *Value_NullValue) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&types.Value_NullValue{` +
|
|
`NullValue:` + fmt.Sprintf("%#v", this.NullValue) + `}`}, ", ")
|
|
return s
|
|
}
|
|
func (this *Value_NumberValue) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&types.Value_NumberValue{` +
|
|
`NumberValue:` + fmt.Sprintf("%#v", this.NumberValue) + `}`}, ", ")
|
|
return s
|
|
}
|
|
func (this *Value_StringValue) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&types.Value_StringValue{` +
|
|
`StringValue:` + fmt.Sprintf("%#v", this.StringValue) + `}`}, ", ")
|
|
return s
|
|
}
|
|
func (this *Value_BoolValue) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&types.Value_BoolValue{` +
|
|
`BoolValue:` + fmt.Sprintf("%#v", this.BoolValue) + `}`}, ", ")
|
|
return s
|
|
}
|
|
func (this *Value_StructValue) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&types.Value_StructValue{` +
|
|
`StructValue:` + fmt.Sprintf("%#v", this.StructValue) + `}`}, ", ")
|
|
return s
|
|
}
|
|
func (this *Value_ListValue) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&types.Value_ListValue{` +
|
|
`ListValue:` + fmt.Sprintf("%#v", this.ListValue) + `}`}, ", ")
|
|
return s
|
|
}
|
|
func (this *ListValue) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := make([]string, 0, 5)
|
|
s = append(s, "&types.ListValue{")
|
|
if this.Values != nil {
|
|
s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n")
|
|
}
|
|
s = append(s, "}")
|
|
return strings.Join(s, "")
|
|
}
|
|
func valueToGoStringStruct(v interface{}, typ string) string {
|
|
rv := reflect.ValueOf(v)
|
|
if rv.IsNil() {
|
|
return "nil"
|
|
}
|
|
pv := reflect.Indirect(rv).Interface()
|
|
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
|
|
}
|
|
func extensionToGoStringStruct(m github_com_gogo_protobuf_proto.Message) string {
|
|
e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m)
|
|
if e == nil {
|
|
return "nil"
|
|
}
|
|
s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{"
|
|
keys := make([]int, 0, len(e))
|
|
for k := range e {
|
|
keys = append(keys, int(k))
|
|
}
|
|
sort.Ints(keys)
|
|
ss := []string{}
|
|
for _, k := range keys {
|
|
ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString())
|
|
}
|
|
s += strings.Join(ss, ",") + "})"
|
|
return s
|
|
}
|
|
func (m *Struct) 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 *Struct) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Fields) > 0 {
|
|
for k := range m.Fields {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
v := m.Fields[k]
|
|
msgSize := 0
|
|
if v != nil {
|
|
msgSize = v.Size()
|
|
msgSize += 1 + sovStruct(uint64(msgSize))
|
|
}
|
|
mapSize := 1 + len(k) + sovStruct(uint64(len(k))) + msgSize
|
|
i = encodeVarintStruct(dAtA, i, uint64(mapSize))
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintStruct(dAtA, i, uint64(len(k)))
|
|
i += copy(dAtA[i:], k)
|
|
if v != nil {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintStruct(dAtA, i, uint64(v.Size()))
|
|
n1, err := v.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n1
|
|
}
|
|
}
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *Value) 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 *Value) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Kind != nil {
|
|
nn2, err := m.Kind.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += nn2
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *Value_NullValue) MarshalTo(dAtA []byte) (int, error) {
|
|
i := 0
|
|
dAtA[i] = 0x8
|
|
i++
|
|
i = encodeVarintStruct(dAtA, i, uint64(m.NullValue))
|
|
return i, nil
|
|
}
|
|
func (m *Value_NumberValue) MarshalTo(dAtA []byte) (int, error) {
|
|
i := 0
|
|
dAtA[i] = 0x11
|
|
i++
|
|
i = encodeFixed64Struct(dAtA, i, uint64(math.Float64bits(float64(m.NumberValue))))
|
|
return i, nil
|
|
}
|
|
func (m *Value_StringValue) MarshalTo(dAtA []byte) (int, error) {
|
|
i := 0
|
|
dAtA[i] = 0x1a
|
|
i++
|
|
i = encodeVarintStruct(dAtA, i, uint64(len(m.StringValue)))
|
|
i += copy(dAtA[i:], m.StringValue)
|
|
return i, nil
|
|
}
|
|
func (m *Value_BoolValue) MarshalTo(dAtA []byte) (int, error) {
|
|
i := 0
|
|
dAtA[i] = 0x20
|
|
i++
|
|
if m.BoolValue {
|
|
dAtA[i] = 1
|
|
} else {
|
|
dAtA[i] = 0
|
|
}
|
|
i++
|
|
return i, nil
|
|
}
|
|
func (m *Value_StructValue) MarshalTo(dAtA []byte) (int, error) {
|
|
i := 0
|
|
if m.StructValue != nil {
|
|
dAtA[i] = 0x2a
|
|
i++
|
|
i = encodeVarintStruct(dAtA, i, uint64(m.StructValue.Size()))
|
|
n3, err := m.StructValue.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n3
|
|
}
|
|
return i, nil
|
|
}
|
|
func (m *Value_ListValue) MarshalTo(dAtA []byte) (int, error) {
|
|
i := 0
|
|
if m.ListValue != nil {
|
|
dAtA[i] = 0x32
|
|
i++
|
|
i = encodeVarintStruct(dAtA, i, uint64(m.ListValue.Size()))
|
|
n4, err := m.ListValue.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n4
|
|
}
|
|
return i, nil
|
|
}
|
|
func (m *ListValue) 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 *ListValue) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Values) > 0 {
|
|
for _, msg := range m.Values {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintStruct(dAtA, i, uint64(msg.Size()))
|
|
n, err := msg.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n
|
|
}
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func encodeFixed64Struct(dAtA []byte, offset int, v uint64) int {
|
|
dAtA[offset] = uint8(v)
|
|
dAtA[offset+1] = uint8(v >> 8)
|
|
dAtA[offset+2] = uint8(v >> 16)
|
|
dAtA[offset+3] = uint8(v >> 24)
|
|
dAtA[offset+4] = uint8(v >> 32)
|
|
dAtA[offset+5] = uint8(v >> 40)
|
|
dAtA[offset+6] = uint8(v >> 48)
|
|
dAtA[offset+7] = uint8(v >> 56)
|
|
return offset + 8
|
|
}
|
|
func encodeFixed32Struct(dAtA []byte, offset int, v uint32) int {
|
|
dAtA[offset] = uint8(v)
|
|
dAtA[offset+1] = uint8(v >> 8)
|
|
dAtA[offset+2] = uint8(v >> 16)
|
|
dAtA[offset+3] = uint8(v >> 24)
|
|
return offset + 4
|
|
}
|
|
func encodeVarintStruct(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 NewPopulatedStruct(r randyStruct, easy bool) *Struct {
|
|
this := &Struct{}
|
|
if r.Intn(10) == 0 {
|
|
v1 := r.Intn(10)
|
|
this.Fields = make(map[string]*Value)
|
|
for i := 0; i < v1; i++ {
|
|
this.Fields[randStringStruct(r)] = NewPopulatedValue(r, easy)
|
|
}
|
|
}
|
|
if !easy && r.Intn(10) != 0 {
|
|
}
|
|
return this
|
|
}
|
|
|
|
func NewPopulatedValue(r randyStruct, easy bool) *Value {
|
|
this := &Value{}
|
|
oneofNumber_Kind := []int32{1, 2, 3, 4, 5, 6}[r.Intn(6)]
|
|
switch oneofNumber_Kind {
|
|
case 1:
|
|
this.Kind = NewPopulatedValue_NullValue(r, easy)
|
|
case 2:
|
|
this.Kind = NewPopulatedValue_NumberValue(r, easy)
|
|
case 3:
|
|
this.Kind = NewPopulatedValue_StringValue(r, easy)
|
|
case 4:
|
|
this.Kind = NewPopulatedValue_BoolValue(r, easy)
|
|
case 5:
|
|
this.Kind = NewPopulatedValue_StructValue(r, easy)
|
|
case 6:
|
|
this.Kind = NewPopulatedValue_ListValue(r, easy)
|
|
}
|
|
if !easy && r.Intn(10) != 0 {
|
|
}
|
|
return this
|
|
}
|
|
|
|
func NewPopulatedValue_NullValue(r randyStruct, easy bool) *Value_NullValue {
|
|
this := &Value_NullValue{}
|
|
this.NullValue = NullValue([]int32{0}[r.Intn(1)])
|
|
return this
|
|
}
|
|
func NewPopulatedValue_NumberValue(r randyStruct, easy bool) *Value_NumberValue {
|
|
this := &Value_NumberValue{}
|
|
this.NumberValue = float64(r.Float64())
|
|
if r.Intn(2) == 0 {
|
|
this.NumberValue *= -1
|
|
}
|
|
return this
|
|
}
|
|
func NewPopulatedValue_StringValue(r randyStruct, easy bool) *Value_StringValue {
|
|
this := &Value_StringValue{}
|
|
this.StringValue = string(randStringStruct(r))
|
|
return this
|
|
}
|
|
func NewPopulatedValue_BoolValue(r randyStruct, easy bool) *Value_BoolValue {
|
|
this := &Value_BoolValue{}
|
|
this.BoolValue = bool(bool(r.Intn(2) == 0))
|
|
return this
|
|
}
|
|
func NewPopulatedValue_StructValue(r randyStruct, easy bool) *Value_StructValue {
|
|
this := &Value_StructValue{}
|
|
this.StructValue = NewPopulatedStruct(r, easy)
|
|
return this
|
|
}
|
|
func NewPopulatedValue_ListValue(r randyStruct, easy bool) *Value_ListValue {
|
|
this := &Value_ListValue{}
|
|
this.ListValue = NewPopulatedListValue(r, easy)
|
|
return this
|
|
}
|
|
func NewPopulatedListValue(r randyStruct, easy bool) *ListValue {
|
|
this := &ListValue{}
|
|
if r.Intn(10) == 0 {
|
|
v2 := r.Intn(5)
|
|
this.Values = make([]*Value, v2)
|
|
for i := 0; i < v2; i++ {
|
|
this.Values[i] = NewPopulatedValue(r, easy)
|
|
}
|
|
}
|
|
if !easy && r.Intn(10) != 0 {
|
|
}
|
|
return this
|
|
}
|
|
|
|
type randyStruct interface {
|
|
Float32() float32
|
|
Float64() float64
|
|
Int63() int64
|
|
Int31() int32
|
|
Uint32() uint32
|
|
Intn(n int) int
|
|
}
|
|
|
|
func randUTF8RuneStruct(r randyStruct) rune {
|
|
ru := r.Intn(62)
|
|
if ru < 10 {
|
|
return rune(ru + 48)
|
|
} else if ru < 36 {
|
|
return rune(ru + 55)
|
|
}
|
|
return rune(ru + 61)
|
|
}
|
|
func randStringStruct(r randyStruct) string {
|
|
v3 := r.Intn(100)
|
|
tmps := make([]rune, v3)
|
|
for i := 0; i < v3; i++ {
|
|
tmps[i] = randUTF8RuneStruct(r)
|
|
}
|
|
return string(tmps)
|
|
}
|
|
func randUnrecognizedStruct(r randyStruct, maxFieldNumber int) (dAtA []byte) {
|
|
l := r.Intn(5)
|
|
for i := 0; i < l; i++ {
|
|
wire := r.Intn(4)
|
|
if wire == 3 {
|
|
wire = 5
|
|
}
|
|
fieldNumber := maxFieldNumber + r.Intn(100)
|
|
dAtA = randFieldStruct(dAtA, r, fieldNumber, wire)
|
|
}
|
|
return dAtA
|
|
}
|
|
func randFieldStruct(dAtA []byte, r randyStruct, fieldNumber int, wire int) []byte {
|
|
key := uint32(fieldNumber)<<3 | uint32(wire)
|
|
switch wire {
|
|
case 0:
|
|
dAtA = encodeVarintPopulateStruct(dAtA, uint64(key))
|
|
v4 := r.Int63()
|
|
if r.Intn(2) == 0 {
|
|
v4 *= -1
|
|
}
|
|
dAtA = encodeVarintPopulateStruct(dAtA, uint64(v4))
|
|
case 1:
|
|
dAtA = encodeVarintPopulateStruct(dAtA, uint64(key))
|
|
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
|
|
case 2:
|
|
dAtA = encodeVarintPopulateStruct(dAtA, uint64(key))
|
|
ll := r.Intn(100)
|
|
dAtA = encodeVarintPopulateStruct(dAtA, uint64(ll))
|
|
for j := 0; j < ll; j++ {
|
|
dAtA = append(dAtA, byte(r.Intn(256)))
|
|
}
|
|
default:
|
|
dAtA = encodeVarintPopulateStruct(dAtA, uint64(key))
|
|
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
|
|
}
|
|
return dAtA
|
|
}
|
|
func encodeVarintPopulateStruct(dAtA []byte, v uint64) []byte {
|
|
for v >= 1<<7 {
|
|
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
|
|
v >>= 7
|
|
}
|
|
dAtA = append(dAtA, uint8(v))
|
|
return dAtA
|
|
}
|
|
func (m *Struct) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if len(m.Fields) > 0 {
|
|
for k, v := range m.Fields {
|
|
_ = k
|
|
_ = v
|
|
l = 0
|
|
if v != nil {
|
|
l = v.Size()
|
|
l += 1 + sovStruct(uint64(l))
|
|
}
|
|
mapEntrySize := 1 + len(k) + sovStruct(uint64(len(k))) + l
|
|
n += mapEntrySize + 1 + sovStruct(uint64(mapEntrySize))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Value) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if m.Kind != nil {
|
|
n += m.Kind.Size()
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Value_NullValue) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
n += 1 + sovStruct(uint64(m.NullValue))
|
|
return n
|
|
}
|
|
func (m *Value_NumberValue) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
n += 9
|
|
return n
|
|
}
|
|
func (m *Value_StringValue) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
l = len(m.StringValue)
|
|
n += 1 + l + sovStruct(uint64(l))
|
|
return n
|
|
}
|
|
func (m *Value_BoolValue) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
n += 2
|
|
return n
|
|
}
|
|
func (m *Value_StructValue) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if m.StructValue != nil {
|
|
l = m.StructValue.Size()
|
|
n += 1 + l + sovStruct(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
func (m *Value_ListValue) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if m.ListValue != nil {
|
|
l = m.ListValue.Size()
|
|
n += 1 + l + sovStruct(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
func (m *ListValue) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if len(m.Values) > 0 {
|
|
for _, e := range m.Values {
|
|
l = e.Size()
|
|
n += 1 + l + sovStruct(uint64(l))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovStruct(x uint64) (n int) {
|
|
for {
|
|
n++
|
|
x >>= 7
|
|
if x == 0 {
|
|
break
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
func sozStruct(x uint64) (n int) {
|
|
return sovStruct(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (this *Struct) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
keysForFields := make([]string, 0, len(this.Fields))
|
|
for k := range this.Fields {
|
|
keysForFields = append(keysForFields, k)
|
|
}
|
|
github_com_gogo_protobuf_sortkeys.Strings(keysForFields)
|
|
mapStringForFields := "map[string]*Value{"
|
|
for _, k := range keysForFields {
|
|
mapStringForFields += fmt.Sprintf("%v: %v,", k, this.Fields[k])
|
|
}
|
|
mapStringForFields += "}"
|
|
s := strings.Join([]string{`&Struct{`,
|
|
`Fields:` + mapStringForFields + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Value) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Value{`,
|
|
`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Value_NullValue) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Value_NullValue{`,
|
|
`NullValue:` + fmt.Sprintf("%v", this.NullValue) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Value_NumberValue) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Value_NumberValue{`,
|
|
`NumberValue:` + fmt.Sprintf("%v", this.NumberValue) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Value_StringValue) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Value_StringValue{`,
|
|
`StringValue:` + fmt.Sprintf("%v", this.StringValue) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Value_BoolValue) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Value_BoolValue{`,
|
|
`BoolValue:` + fmt.Sprintf("%v", this.BoolValue) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Value_StructValue) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Value_StructValue{`,
|
|
`StructValue:` + strings.Replace(fmt.Sprintf("%v", this.StructValue), "Struct", "Struct", 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Value_ListValue) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Value_ListValue{`,
|
|
`ListValue:` + strings.Replace(fmt.Sprintf("%v", this.ListValue), "ListValue", "ListValue", 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *ListValue) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&ListValue{`,
|
|
`Values:` + strings.Replace(fmt.Sprintf("%v", this.Values), "Value", "Value", 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func valueToStringStruct(v interface{}) string {
|
|
rv := reflect.ValueOf(v)
|
|
if rv.IsNil() {
|
|
return "nil"
|
|
}
|
|
pv := reflect.Indirect(rv).Interface()
|
|
return fmt.Sprintf("*%v", pv)
|
|
}
|
|
func (m *Struct) 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 ErrIntOverflowStruct
|
|
}
|
|
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: Struct: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Struct: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthStruct
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
var keykey uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
keykey |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
var stringLenmapkey uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
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 ErrInvalidLengthStruct
|
|
}
|
|
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
|
if postStringIndexmapkey > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
mapkey := string(dAtA[iNdEx:postStringIndexmapkey])
|
|
iNdEx = postStringIndexmapkey
|
|
if m.Fields == nil {
|
|
m.Fields = make(map[string]*Value)
|
|
}
|
|
if iNdEx < postIndex {
|
|
var valuekey uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
valuekey |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
var mapmsglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
mapmsglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if mapmsglen < 0 {
|
|
return ErrInvalidLengthStruct
|
|
}
|
|
postmsgIndex := iNdEx + mapmsglen
|
|
if mapmsglen < 0 {
|
|
return ErrInvalidLengthStruct
|
|
}
|
|
if postmsgIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
mapvalue := &Value{}
|
|
if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postmsgIndex
|
|
m.Fields[mapkey] = mapvalue
|
|
} else {
|
|
var mapvalue *Value
|
|
m.Fields[mapkey] = mapvalue
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipStruct(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthStruct
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Value) 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 ErrIntOverflowStruct
|
|
}
|
|
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: Value: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Value: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NullValue", wireType)
|
|
}
|
|
var v NullValue
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
v |= (NullValue(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
m.Kind = &Value_NullValue{v}
|
|
case 2:
|
|
if wireType != 1 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NumberValue", wireType)
|
|
}
|
|
var v uint64
|
|
if (iNdEx + 8) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += 8
|
|
v = uint64(dAtA[iNdEx-8])
|
|
v |= uint64(dAtA[iNdEx-7]) << 8
|
|
v |= uint64(dAtA[iNdEx-6]) << 16
|
|
v |= uint64(dAtA[iNdEx-5]) << 24
|
|
v |= uint64(dAtA[iNdEx-4]) << 32
|
|
v |= uint64(dAtA[iNdEx-3]) << 40
|
|
v |= uint64(dAtA[iNdEx-2]) << 48
|
|
v |= uint64(dAtA[iNdEx-1]) << 56
|
|
m.Kind = &Value_NumberValue{float64(math.Float64frombits(v))}
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
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 ErrInvalidLengthStruct
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Kind = &Value_StringValue{string(dAtA[iNdEx:postIndex])}
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType)
|
|
}
|
|
var v int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
v |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
b := bool(v != 0)
|
|
m.Kind = &Value_BoolValue{b}
|
|
case 5:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field StructValue", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthStruct
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
v := &Struct{}
|
|
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
m.Kind = &Value_StructValue{v}
|
|
iNdEx = postIndex
|
|
case 6:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ListValue", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthStruct
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
v := &ListValue{}
|
|
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
m.Kind = &Value_ListValue{v}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipStruct(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthStruct
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *ListValue) 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 ErrIntOverflowStruct
|
|
}
|
|
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: ListValue: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: ListValue: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowStruct
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthStruct
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Values = append(m.Values, &Value{})
|
|
if err := m.Values[len(m.Values)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipStruct(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthStruct
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipStruct(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, ErrIntOverflowStruct
|
|
}
|
|
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, ErrIntOverflowStruct
|
|
}
|
|
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, ErrIntOverflowStruct
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
length |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx += length
|
|
if length < 0 {
|
|
return 0, ErrInvalidLengthStruct
|
|
}
|
|
return iNdEx, nil
|
|
case 3:
|
|
for {
|
|
var innerWire uint64
|
|
var start int = iNdEx
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowStruct
|
|
}
|
|
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 := skipStruct(dAtA[start:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
iNdEx = start + next
|
|
}
|
|
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 (
|
|
ErrInvalidLengthStruct = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowStruct = fmt.Errorf("proto: integer overflow")
|
|
)
|
|
|
|
func init() { proto.RegisterFile("struct.proto", fileDescriptorStruct) }
|
|
|
|
var fileDescriptorStruct = []byte{
|
|
// 432 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x6b, 0xd4, 0x40,
|
|
0x14, 0xc6, 0xf3, 0xb2, 0xdd, 0xe0, 0xbe, 0x94, 0x5a, 0x46, 0xd0, 0xa5, 0xc2, 0xb8, 0x6c, 0x2f,
|
|
0x41, 0x24, 0x87, 0xf5, 0x22, 0xae, 0x17, 0x03, 0xb5, 0x05, 0x43, 0x89, 0xd1, 0x56, 0xf0, 0xb2,
|
|
0x98, 0x6d, 0xba, 0x84, 0x4e, 0x67, 0x4a, 0x32, 0x51, 0xf6, 0xa6, 0xff, 0x85, 0x47, 0xf1, 0x24,
|
|
0x1e, 0xfd, 0x2b, 0x3c, 0xf6, 0xe8, 0xd1, 0xe4, 0xe4, 0xb1, 0x47, 0x8f, 0x32, 0x33, 0x49, 0x94,
|
|
0x2e, 0x7b, 0xcb, 0xfb, 0xf2, 0x7b, 0xdf, 0x7b, 0xdf, 0x1b, 0xdc, 0x2c, 0x64, 0x5e, 0xce, 0xa5,
|
|
0x7f, 0x91, 0x0b, 0x29, 0xc8, 0xcd, 0x85, 0x10, 0x0b, 0x96, 0x9a, 0x2a, 0x29, 0x4f, 0xc7, 0x9f,
|
|
0x00, 0x9d, 0x97, 0x9a, 0x20, 0x53, 0x74, 0x4e, 0xb3, 0x94, 0x9d, 0x14, 0x43, 0x18, 0xf5, 0x3c,
|
|
0x77, 0xb2, 0xeb, 0x5f, 0x83, 0x7d, 0x03, 0xfa, 0xcf, 0x34, 0xb5, 0xc7, 0x65, 0xbe, 0x8c, 0x9b,
|
|
0x96, 0x9d, 0x17, 0xe8, 0xfe, 0x27, 0x93, 0x6d, 0xec, 0x9d, 0xa5, 0xcb, 0x21, 0x8c, 0xc0, 0x1b,
|
|
0xc4, 0xea, 0x93, 0x3c, 0xc0, 0xfe, 0xbb, 0xb7, 0xac, 0x4c, 0x87, 0xf6, 0x08, 0x3c, 0x77, 0x72,
|
|
0x7b, 0xc5, 0xfc, 0x58, 0xfd, 0x8d, 0x0d, 0xf4, 0xd8, 0x7e, 0x04, 0xe3, 0xef, 0x36, 0xf6, 0xb5,
|
|
0x48, 0xa6, 0x88, 0xbc, 0x64, 0x6c, 0x66, 0x0c, 0x94, 0xe9, 0xd6, 0x64, 0x67, 0xc5, 0xe0, 0xb0,
|
|
0x64, 0x4c, 0xf3, 0x07, 0x56, 0x3c, 0xe0, 0x6d, 0x41, 0x76, 0x71, 0x93, 0x97, 0xe7, 0x49, 0x9a,
|
|
0xcf, 0xfe, 0xcd, 0x87, 0x03, 0x2b, 0x76, 0x8d, 0xda, 0x41, 0x85, 0xcc, 0x33, 0xbe, 0x68, 0xa0,
|
|
0x9e, 0x5a, 0x5c, 0x41, 0x46, 0x35, 0xd0, 0x3d, 0xc4, 0x44, 0x88, 0x76, 0x8d, 0x8d, 0x11, 0x78,
|
|
0x37, 0xd4, 0x28, 0xa5, 0x19, 0xe0, 0x49, 0x7b, 0xed, 0x06, 0xe9, 0xeb, 0xa8, 0x77, 0xd6, 0xdc,
|
|
0xb1, 0xb1, 0x2f, 0xe7, 0xb2, 0x4b, 0xc9, 0xb2, 0xa2, 0xed, 0x75, 0x74, 0xef, 0x6a, 0xca, 0x30,
|
|
0x2b, 0x64, 0x97, 0x92, 0xb5, 0x45, 0xe0, 0xe0, 0xc6, 0x59, 0xc6, 0x4f, 0xc6, 0x53, 0x1c, 0x74,
|
|
0x04, 0xf1, 0xd1, 0xd1, 0x66, 0xed, 0x8b, 0xae, 0x3b, 0x7a, 0x43, 0xdd, 0xbf, 0x8b, 0x83, 0xee,
|
|
0x88, 0x64, 0x0b, 0xf1, 0xf0, 0x28, 0x0c, 0x67, 0xc7, 0x4f, 0xc3, 0xa3, 0xbd, 0x6d, 0x2b, 0xf8,
|
|
0x08, 0x97, 0x15, 0xb5, 0x7e, 0x56, 0xd4, 0xba, 0xaa, 0x28, 0xfc, 0xa9, 0x28, 0x7c, 0xa8, 0x29,
|
|
0x7c, 0xad, 0x29, 0xfc, 0xa8, 0x29, 0x5c, 0xd6, 0x14, 0x7e, 0xd5, 0x14, 0x7e, 0xd7, 0xd4, 0xba,
|
|
0xaa, 0x29, 0xe0, 0xad, 0xb9, 0x38, 0xbf, 0x3e, 0x2e, 0x70, 0x4d, 0xf2, 0x48, 0xd5, 0x11, 0xbc,
|
|
0xe9, 0xcb, 0xe5, 0x45, 0x5a, 0x7c, 0x06, 0xf8, 0x62, 0xf7, 0xf6, 0xa3, 0xe0, 0x9b, 0x4d, 0xf7,
|
|
0x4d, 0x43, 0xd4, 0xee, 0xf7, 0x3a, 0x65, 0xec, 0x39, 0x17, 0xef, 0xf9, 0x2b, 0x45, 0x26, 0x8e,
|
|
0x76, 0x7a, 0xf8, 0x37, 0x00, 0x00, 0xff, 0xff, 0x52, 0x64, 0x2c, 0x57, 0xd5, 0x02, 0x00, 0x00,
|
|
}
|