Home | History | Annotate | Download | only in struct
      1 // Code generated by protoc-gen-go. DO NOT EDIT.
      2 // source: github.com/golang/protobuf/ptypes/struct/struct.proto
      3 
      4 /*
      5 Package structpb is a generated protocol buffer package.
      6 
      7 It is generated from these files:
      8 	github.com/golang/protobuf/ptypes/struct/struct.proto
      9 
     10 It has these top-level messages:
     11 	Struct
     12 	Value
     13 	ListValue
     14 */
     15 package structpb
     16 
     17 import proto "github.com/golang/protobuf/proto"
     18 import fmt "fmt"
     19 import math "math"
     20 
     21 // Reference imports to suppress errors if they are not otherwise used.
     22 var _ = proto.Marshal
     23 var _ = fmt.Errorf
     24 var _ = math.Inf
     25 
     26 // This is a compile-time assertion to ensure that this generated file
     27 // is compatible with the proto package it is being compiled against.
     28 // A compilation error at this line likely means your copy of the
     29 // proto package needs to be updated.
     30 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
     31 
     32 // `NullValue` is a singleton enumeration to represent the null value for the
     33 // `Value` type union.
     34 //
     35 //  The JSON representation for `NullValue` is JSON `null`.
     36 type NullValue int32
     37 
     38 const (
     39 	// Null value.
     40 	NullValue_NULL_VALUE NullValue = 0
     41 )
     42 
     43 var NullValue_name = map[int32]string{
     44 	0: "NULL_VALUE",
     45 }
     46 var NullValue_value = map[string]int32{
     47 	"NULL_VALUE": 0,
     48 }
     49 
     50 func (x NullValue) String() string {
     51 	return proto.EnumName(NullValue_name, int32(x))
     52 }
     53 func (NullValue) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
     54 func (NullValue) XXX_WellKnownType() string       { return "NullValue" }
     55 
     56 // `Struct` represents a structured data value, consisting of fields
     57 // which map to dynamically typed values. In some languages, `Struct`
     58 // might be supported by a native representation. For example, in
     59 // scripting languages like JS a struct is represented as an
     60 // object. The details of that representation are described together
     61 // with the proto support for the language.
     62 //
     63 // The JSON representation for `Struct` is JSON object.
     64 type Struct struct {
     65 	// Unordered map of dynamically typed values.
     66 	Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
     67 }
     68 
     69 func (m *Struct) Reset()                    { *m = Struct{} }
     70 func (m *Struct) String() string            { return proto.CompactTextString(m) }
     71 func (*Struct) ProtoMessage()               {}
     72 func (*Struct) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
     73 func (*Struct) XXX_WellKnownType() string   { return "Struct" }
     74 
     75 func (m *Struct) GetFields() map[string]*Value {
     76 	if m != nil {
     77 		return m.Fields
     78 	}
     79 	return nil
     80 }
     81 
     82 // `Value` represents a dynamically typed value which can be either
     83 // null, a number, a string, a boolean, a recursive struct value, or a
     84 // list of values. A producer of value is expected to set one of that
     85 // variants, absence of any variant indicates an error.
     86 //
     87 // The JSON representation for `Value` is JSON value.
     88 type Value struct {
     89 	// The kind of value.
     90 	//
     91 	// Types that are valid to be assigned to Kind:
     92 	//	*Value_NullValue
     93 	//	*Value_NumberValue
     94 	//	*Value_StringValue
     95 	//	*Value_BoolValue
     96 	//	*Value_StructValue
     97 	//	*Value_ListValue
     98 	Kind isValue_Kind `protobuf_oneof:"kind"`
     99 }
    100 
    101 func (m *Value) Reset()                    { *m = Value{} }
    102 func (m *Value) String() string            { return proto.CompactTextString(m) }
    103 func (*Value) ProtoMessage()               {}
    104 func (*Value) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
    105 func (*Value) XXX_WellKnownType() string   { return "Value" }
    106 
    107 type isValue_Kind interface {
    108 	isValue_Kind()
    109 }
    110 
    111 type Value_NullValue struct {
    112 	NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,enum=google.protobuf.NullValue,oneof"`
    113 }
    114 type Value_NumberValue struct {
    115 	NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,oneof"`
    116 }
    117 type Value_StringValue struct {
    118 	StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,oneof"`
    119 }
    120 type Value_BoolValue struct {
    121 	BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,oneof"`
    122 }
    123 type Value_StructValue struct {
    124 	StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,oneof"`
    125 }
    126 type Value_ListValue struct {
    127 	ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,oneof"`
    128 }
    129 
    130 func (*Value_NullValue) isValue_Kind()   {}
    131 func (*Value_NumberValue) isValue_Kind() {}
    132 func (*Value_StringValue) isValue_Kind() {}
    133 func (*Value_BoolValue) isValue_Kind()   {}
    134 func (*Value_StructValue) isValue_Kind() {}
    135 func (*Value_ListValue) isValue_Kind()   {}
    136 
    137 func (m *Value) GetKind() isValue_Kind {
    138 	if m != nil {
    139 		return m.Kind
    140 	}
    141 	return nil
    142 }
    143 
    144 func (m *Value) GetNullValue() NullValue {
    145 	if x, ok := m.GetKind().(*Value_NullValue); ok {
    146 		return x.NullValue
    147 	}
    148 	return NullValue_NULL_VALUE
    149 }
    150 
    151 func (m *Value) GetNumberValue() float64 {
    152 	if x, ok := m.GetKind().(*Value_NumberValue); ok {
    153 		return x.NumberValue
    154 	}
    155 	return 0
    156 }
    157 
    158 func (m *Value) GetStringValue() string {
    159 	if x, ok := m.GetKind().(*Value_StringValue); ok {
    160 		return x.StringValue
    161 	}
    162 	return ""
    163 }
    164 
    165 func (m *Value) GetBoolValue() bool {
    166 	if x, ok := m.GetKind().(*Value_BoolValue); ok {
    167 		return x.BoolValue
    168 	}
    169 	return false
    170 }
    171 
    172 func (m *Value) GetStructValue() *Struct {
    173 	if x, ok := m.GetKind().(*Value_StructValue); ok {
    174 		return x.StructValue
    175 	}
    176 	return nil
    177 }
    178 
    179 func (m *Value) GetListValue() *ListValue {
    180 	if x, ok := m.GetKind().(*Value_ListValue); ok {
    181 		return x.ListValue
    182 	}
    183 	return nil
    184 }
    185 
    186 // XXX_OneofFuncs is for the internal use of the proto package.
    187 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{}) {
    188 	return _Value_OneofMarshaler, _Value_OneofUnmarshaler, _Value_OneofSizer, []interface{}{
    189 		(*Value_NullValue)(nil),
    190 		(*Value_NumberValue)(nil),
    191 		(*Value_StringValue)(nil),
    192 		(*Value_BoolValue)(nil),
    193 		(*Value_StructValue)(nil),
    194 		(*Value_ListValue)(nil),
    195 	}
    196 }
    197 
    198 func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
    199 	m := msg.(*Value)
    200 	// kind
    201 	switch x := m.Kind.(type) {
    202 	case *Value_NullValue:
    203 		b.EncodeVarint(1<<3 | proto.WireVarint)
    204 		b.EncodeVarint(uint64(x.NullValue))
    205 	case *Value_NumberValue:
    206 		b.EncodeVarint(2<<3 | proto.WireFixed64)
    207 		b.EncodeFixed64(math.Float64bits(x.NumberValue))
    208 	case *Value_StringValue:
    209 		b.EncodeVarint(3<<3 | proto.WireBytes)
    210 		b.EncodeStringBytes(x.StringValue)
    211 	case *Value_BoolValue:
    212 		t := uint64(0)
    213 		if x.BoolValue {
    214 			t = 1
    215 		}
    216 		b.EncodeVarint(4<<3 | proto.WireVarint)
    217 		b.EncodeVarint(t)
    218 	case *Value_StructValue:
    219 		b.EncodeVarint(5<<3 | proto.WireBytes)
    220 		if err := b.EncodeMessage(x.StructValue); err != nil {
    221 			return err
    222 		}
    223 	case *Value_ListValue:
    224 		b.EncodeVarint(6<<3 | proto.WireBytes)
    225 		if err := b.EncodeMessage(x.ListValue); err != nil {
    226 			return err
    227 		}
    228 	case nil:
    229 	default:
    230 		return fmt.Errorf("Value.Kind has unexpected type %T", x)
    231 	}
    232 	return nil
    233 }
    234 
    235 func _Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
    236 	m := msg.(*Value)
    237 	switch tag {
    238 	case 1: // kind.null_value
    239 		if wire != proto.WireVarint {
    240 			return true, proto.ErrInternalBadWireType
    241 		}
    242 		x, err := b.DecodeVarint()
    243 		m.Kind = &Value_NullValue{NullValue(x)}
    244 		return true, err
    245 	case 2: // kind.number_value
    246 		if wire != proto.WireFixed64 {
    247 			return true, proto.ErrInternalBadWireType
    248 		}
    249 		x, err := b.DecodeFixed64()
    250 		m.Kind = &Value_NumberValue{math.Float64frombits(x)}
    251 		return true, err
    252 	case 3: // kind.string_value
    253 		if wire != proto.WireBytes {
    254 			return true, proto.ErrInternalBadWireType
    255 		}
    256 		x, err := b.DecodeStringBytes()
    257 		m.Kind = &Value_StringValue{x}
    258 		return true, err
    259 	case 4: // kind.bool_value
    260 		if wire != proto.WireVarint {
    261 			return true, proto.ErrInternalBadWireType
    262 		}
    263 		x, err := b.DecodeVarint()
    264 		m.Kind = &Value_BoolValue{x != 0}
    265 		return true, err
    266 	case 5: // kind.struct_value
    267 		if wire != proto.WireBytes {
    268 			return true, proto.ErrInternalBadWireType
    269 		}
    270 		msg := new(Struct)
    271 		err := b.DecodeMessage(msg)
    272 		m.Kind = &Value_StructValue{msg}
    273 		return true, err
    274 	case 6: // kind.list_value
    275 		if wire != proto.WireBytes {
    276 			return true, proto.ErrInternalBadWireType
    277 		}
    278 		msg := new(ListValue)
    279 		err := b.DecodeMessage(msg)
    280 		m.Kind = &Value_ListValue{msg}
    281 		return true, err
    282 	default:
    283 		return false, nil
    284 	}
    285 }
    286 
    287 func _Value_OneofSizer(msg proto.Message) (n int) {
    288 	m := msg.(*Value)
    289 	// kind
    290 	switch x := m.Kind.(type) {
    291 	case *Value_NullValue:
    292 		n += proto.SizeVarint(1<<3 | proto.WireVarint)
    293 		n += proto.SizeVarint(uint64(x.NullValue))
    294 	case *Value_NumberValue:
    295 		n += proto.SizeVarint(2<<3 | proto.WireFixed64)
    296 		n += 8
    297 	case *Value_StringValue:
    298 		n += proto.SizeVarint(3<<3 | proto.WireBytes)
    299 		n += proto.SizeVarint(uint64(len(x.StringValue)))
    300 		n += len(x.StringValue)
    301 	case *Value_BoolValue:
    302 		n += proto.SizeVarint(4<<3 | proto.WireVarint)
    303 		n += 1
    304 	case *Value_StructValue:
    305 		s := proto.Size(x.StructValue)
    306 		n += proto.SizeVarint(5<<3 | proto.WireBytes)
    307 		n += proto.SizeVarint(uint64(s))
    308 		n += s
    309 	case *Value_ListValue:
    310 		s := proto.Size(x.ListValue)
    311 		n += proto.SizeVarint(6<<3 | proto.WireBytes)
    312 		n += proto.SizeVarint(uint64(s))
    313 		n += s
    314 	case nil:
    315 	default:
    316 		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
    317 	}
    318 	return n
    319 }
    320 
    321 // `ListValue` is a wrapper around a repeated field of values.
    322 //
    323 // The JSON representation for `ListValue` is JSON array.
    324 type ListValue struct {
    325 	// Repeated field of dynamically typed values.
    326 	Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"`
    327 }
    328 
    329 func (m *ListValue) Reset()                    { *m = ListValue{} }
    330 func (m *ListValue) String() string            { return proto.CompactTextString(m) }
    331 func (*ListValue) ProtoMessage()               {}
    332 func (*ListValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
    333 func (*ListValue) XXX_WellKnownType() string   { return "ListValue" }
    334 
    335 func (m *ListValue) GetValues() []*Value {
    336 	if m != nil {
    337 		return m.Values
    338 	}
    339 	return nil
    340 }
    341 
    342 func init() {
    343 	proto.RegisterType((*Struct)(nil), "google.protobuf.Struct")
    344 	proto.RegisterType((*Value)(nil), "google.protobuf.Value")
    345 	proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue")
    346 	proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value)
    347 }
    348 
    349 func init() {
    350 	proto.RegisterFile("github.com/golang/protobuf/ptypes/struct/struct.proto", fileDescriptor0)
    351 }
    352 
    353 var fileDescriptor0 = []byte{
    354 	// 417 bytes of a gzipped FileDescriptorProto
    355 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x8b, 0xd3, 0x40,
    356 	0x14, 0x80, 0x3b, 0xc9, 0x36, 0x98, 0x17, 0x59, 0x97, 0x11, 0xb4, 0xac, 0xa0, 0xa1, 0x7b, 0x09,
    357 	0x22, 0x09, 0x56, 0x04, 0x31, 0x5e, 0x0c, 0xac, 0xbb, 0x60, 0x58, 0x62, 0x74, 0x57, 0xf0, 0x52,
    358 	0x9a, 0x34, 0x8d, 0xa1, 0xd3, 0x99, 0x90, 0xcc, 0x28, 0x3d, 0xfa, 0x2f, 0x3c, 0x7b, 0xf4, 0xe8,
    359 	0xaf, 0xf3, 0x28, 0x33, 0x93, 0x44, 0x69, 0x29, 0x78, 0x9a, 0xbe, 0x37, 0xdf, 0xfb, 0xe6, 0xbd,
    360 	0xd7, 0xc0, 0xf3, 0xb2, 0xe2, 0x9f, 0x45, 0xe6, 0xe7, 0x6c, 0x13, 0x94, 0x8c, 0x2c, 0x68, 0x19,
    361 	0xd4, 0x0d, 0xe3, 0x2c, 0x13, 0xab, 0xa0, 0xe6, 0xdb, 0xba, 0x68, 0x83, 0x96, 0x37, 0x22, 0xe7,
    362 	0xdd, 0xe1, 0xab, 0x5b, 0x7c, 0xa7, 0x64, 0xac, 0x24, 0x85, 0xdf, 0xb3, 0xd3, 0xef, 0x08, 0xac,
    363 	0xf7, 0x8a, 0xc0, 0x21, 0x58, 0xab, 0xaa, 0x20, 0xcb, 0x76, 0x82, 0x5c, 0xd3, 0x73, 0x66, 0x67,
    364 	0xfe, 0x0e, 0xec, 0x6b, 0xd0, 0x7f, 0xa3, 0xa8, 0x73, 0xca, 0x9b, 0x6d, 0xda, 0x95, 0x9c, 0xbe,
    365 	0x03, 0xe7, 0x9f, 0x34, 0x3e, 0x01, 0x73, 0x5d, 0x6c, 0x27, 0xc8, 0x45, 0x9e, 0x9d, 0xca, 0x9f,
    366 	0xf8, 0x09, 0x8c, 0xbf, 0x2c, 0x88, 0x28, 0x26, 0x86, 0x8b, 0x3c, 0x67, 0x76, 0x6f, 0x4f, 0x7e,
    367 	0x23, 0x6f, 0x53, 0x0d, 0xbd, 0x34, 0x5e, 0xa0, 0xe9, 0x2f, 0x03, 0xc6, 0x2a, 0x89, 0x43, 0x00,
    368 	0x2a, 0x08, 0x99, 0x6b, 0x81, 0x94, 0x1e, 0xcf, 0x4e, 0xf7, 0x04, 0x57, 0x82, 0x10, 0xc5, 0x5f,
    369 	0x8e, 0x52, 0x9b, 0xf6, 0x01, 0x3e, 0x83, 0xdb, 0x54, 0x6c, 0xb2, 0xa2, 0x99, 0xff, 0x7d, 0x1f,
    370 	0x5d, 0x8e, 0x52, 0x47, 0x67, 0x07, 0xa8, 0xe5, 0x4d, 0x45, 0xcb, 0x0e, 0x32, 0x65, 0xe3, 0x12,
    371 	0xd2, 0x59, 0x0d, 0x3d, 0x02, 0xc8, 0x18, 0xeb, 0xdb, 0x38, 0x72, 0x91, 0x77, 0x4b, 0x3e, 0x25,
    372 	0x73, 0x1a, 0x78, 0xa5, 0x2c, 0x22, 0xe7, 0x1d, 0x32, 0x56, 0xa3, 0xde, 0x3f, 0xb0, 0xc7, 0x4e,
    373 	0x2f, 0x72, 0x3e, 0x4c, 0x49, 0xaa, 0xb6, 0xaf, 0xb5, 0x54, 0xed, 0xfe, 0x94, 0x71, 0xd5, 0xf2,
    374 	0x61, 0x4a, 0xd2, 0x07, 0x91, 0x05, 0x47, 0xeb, 0x8a, 0x2e, 0xa7, 0x21, 0xd8, 0x03, 0x81, 0x7d,
    375 	0xb0, 0x94, 0xac, 0xff, 0x47, 0x0f, 0x2d, 0xbd, 0xa3, 0x1e, 0x3f, 0x00, 0x7b, 0x58, 0x22, 0x3e,
    376 	0x06, 0xb8, 0xba, 0x8e, 0xe3, 0xf9, 0xcd, 0xeb, 0xf8, 0xfa, 0xfc, 0x64, 0x14, 0x7d, 0x43, 0x70,
    377 	0x37, 0x67, 0x9b, 0x5d, 0x45, 0xe4, 0xe8, 0x69, 0x12, 0x19, 0x27, 0xe8, 0xd3, 0xd3, 0xff, 0xfd,
    378 	0x30, 0x43, 0x7d, 0xd4, 0xd9, 0x6f, 0x84, 0x7e, 0x18, 0xe6, 0x45, 0x12, 0xfd, 0x34, 0x1e, 0x5e,
    379 	0x68, 0x79, 0xd2, 0xf7, 0xf7, 0xb1, 0x20, 0xe4, 0x2d, 0x65, 0x5f, 0xe9, 0x07, 0x59, 0x99, 0x59,
    380 	0x4a, 0xf5, 0xec, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9b, 0x6e, 0x5d, 0x3c, 0xfe, 0x02, 0x00,
    381 	0x00,
    382 }
    383