Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
8f79df77
Commit
8f79df77
authored
Nov 15, 2015
by
Jeromy
Browse files
vendor in gogo protobuf
parent
f3d96ac5
Changes
152
Hide whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
152 of 152+
files are displayed.
Plain diff
Email patch
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/imp.pb.go.golden
0 → 100644
View file @
8f79df77
//
Code
generated
by
protoc
-
gen
-
go
.
//
source
:
imp
.
proto
//
DO
NOT
EDIT
!
package
imp
import
proto
"github.com/golang/protobuf/proto"
import
"math"
import
"os"
import
imp1
"imp2.pb"
//
Reference
proto
&
math
imports
to
suppress
error
if
they
are
not
otherwise
used
.
var
_
=
proto
.
GetString
var
_
=
math
.
Inf
//
Types
from
public
import
imp2
.
proto
type
PubliclyImportedMessage
imp1
.
PubliclyImportedMessage
func
(
this
*
PubliclyImportedMessage
)
Reset
()
{
(*
imp1
.
PubliclyImportedMessage
)(
this
).
Reset
()
}
func
(
this
*
PubliclyImportedMessage
)
String
()
string
{
return
(*
imp1
.
PubliclyImportedMessage
)(
this
).
String
()
}
//
PubliclyImportedMessage
from
public
import
imp
.
proto
type
ImportedMessage_Owner
int32
const
(
ImportedMessage_DAVE
ImportedMessage_Owner
=
1
ImportedMessage_MIKE
ImportedMessage_Owner
=
2
)
var
ImportedMessage_Owner_name
=
map
[
int32
]
string
{
1
:
"DAVE"
,
2
:
"MIKE"
,
}
var
ImportedMessage_Owner_value
=
map
[
string
]
int32
{
"DAVE"
:
1
,
"MIKE"
:
2
,
}
//
NewImportedMessage_Owner
is
deprecated
.
Use
x
.
Enum
()
instead
.
func
NewImportedMessage_Owner
(
x
ImportedMessage_Owner
)
*
ImportedMessage_Owner
{
e
:=
ImportedMessage_Owner
(
x
)
return
&
e
}
func
(
x
ImportedMessage_Owner
)
Enum
()
*
ImportedMessage_Owner
{
p
:=
new
(
ImportedMessage_Owner
)
*
p
=
x
return
p
}
func
(
x
ImportedMessage_Owner
)
String
()
string
{
return
proto
.
EnumName
(
ImportedMessage_Owner_name
,
int32
(
x
))
}
type
ImportedMessage
struct
{
Field
*
int64
`
protobuf
:
"varint,1,req,name=field"
json
:
"field,omitempty"
`
XXX_extensions
map
[
int32
][]
byte
`
json
:
",omitempty"
`
XXX_unrecognized
[]
byte
`
json
:
",omitempty"
`
}
func
(
this
*
ImportedMessage
)
Reset
()
{
*
this
=
ImportedMessage
{}
}
func
(
this
*
ImportedMessage
)
String
()
string
{
return
proto
.
CompactTextString
(
this
)
}
var
extRange_ImportedMessage
=
[]
proto
.
ExtensionRange
{
proto
.
ExtensionRange
{
90
,
100
},
}
func
(*
ImportedMessage
)
ExtensionRangeArray
()
[]
proto
.
ExtensionRange
{
return
extRange_ImportedMessage
}
func
(
this
*
ImportedMessage
)
ExtensionMap
()
map
[
int32
][]
byte
{
if
this
.
XXX_extensions
==
nil
{
this
.
XXX_extensions
=
make
(
map
[
int32
][]
byte
)
}
return
this
.
XXX_extensions
}
type
ImportedExtendable
struct
{
XXX_extensions
map
[
int32
][]
byte
`
json
:
",omitempty"
`
XXX_unrecognized
[]
byte
`
json
:
",omitempty"
`
}
func
(
this
*
ImportedExtendable
)
Reset
()
{
*
this
=
ImportedExtendable
{}
}
func
(
this
*
ImportedExtendable
)
String
()
string
{
return
proto
.
CompactTextString
(
this
)
}
func
(
this
*
ImportedExtendable
)
Marshal
()
([]
byte
,
error
)
{
return
proto
.
MarshalMessageSet
(
this
.
ExtensionMap
())
}
func
(
this
*
ImportedExtendable
)
Unmarshal
(
buf
[]
byte
)
error
{
return
proto
.
UnmarshalMessageSet
(
buf
,
this
.
ExtensionMap
())
}
//
ensure
ImportedExtendable
satisfies
proto
.
Marshaler
and
proto
.
Unmarshaler
var
_
proto
.
Marshaler
=
(*
ImportedExtendable
)(
nil
)
var
_
proto
.
Unmarshaler
=
(*
ImportedExtendable
)(
nil
)
var
extRange_ImportedExtendable
=
[]
proto
.
ExtensionRange
{
proto
.
ExtensionRange
{
100
,
536870911
},
}
func
(*
ImportedExtendable
)
ExtensionRangeArray
()
[]
proto
.
ExtensionRange
{
return
extRange_ImportedExtendable
}
func
(
this
*
ImportedExtendable
)
ExtensionMap
()
map
[
int32
][]
byte
{
if
this
.
XXX_extensions
==
nil
{
this
.
XXX_extensions
=
make
(
map
[
int32
][]
byte
)
}
return
this
.
XXX_extensions
}
func
init
()
{
proto
.
RegisterEnum
(
"imp.ImportedMessage_Owner"
,
ImportedMessage_Owner_name
,
ImportedMessage_Owner_value
)
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/imp.proto
0 → 100644
View file @
8f79df77
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax
=
"proto2"
;
package
imp
;
import
"imp2.proto"
;
import
"imp3.proto"
;
message
ImportedMessage
{
required
int64
field
=
1
;
// The forwarded getters for these fields are fiddly to get right.
optional
ImportedMessage2
local_msg
=
2
;
optional
ForeignImportedMessage
foreign_msg
=
3
;
// in imp3.proto
optional
Owner
enum_field
=
4
;
repeated
string
name
=
5
;
repeated
Owner
boss
=
6
;
repeated
ImportedMessage2
memo
=
7
;
map
<
string
,
ImportedMessage2
>
msg_map
=
8
;
enum
Owner
{
DAVE
=
1
;
MIKE
=
2
;
}
extensions
90
to
100
;
}
message
ImportedMessage2
{
}
message
ImportedExtendable
{
option
message_set_wire_format
=
true
;
extensions
100
to
max
;
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/imp2.proto
0 → 100644
View file @
8f79df77
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2011 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax
=
"proto2"
;
package
imp
;
message
PubliclyImportedMessage
{
optional
int64
field
=
1
;
}
enum
PubliclyImportedEnum
{
GLASSES
=
1
;
HAIR
=
2
;
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/imp3.proto
0 → 100644
View file @
8f79df77
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2012 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax
=
"proto2"
;
package
imp
;
message
ForeignImportedMessage
{
optional
string
tuber
=
1
;
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/main_test.go
0 → 100644
View file @
8f79df77
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A simple binary to link together the protocol buffers in this test.
package
testdata
import
(
"testing"
multipb
"./multi"
mytestpb
"./my_test"
)
func
TestLink
(
t
*
testing
.
T
)
{
_
=
&
multipb
.
Multi1
{}
_
=
&
mytestpb
.
Request
{}
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/multi/.gitignore
0 → 100644
View file @
8f79df77
*.pb.go
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/multi/multi1.proto
0 → 100644
View file @
8f79df77
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax
=
"proto2"
;
import
"multi/multi2.proto"
;
import
"multi/multi3.proto"
;
package
multitest
;
message
Multi1
{
required
Multi2
multi2
=
1
;
optional
Multi2.Color
color
=
2
;
optional
Multi3.HatType
hat_type
=
3
;
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/multi/multi2.proto
0 → 100644
View file @
8f79df77
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax
=
"proto2"
;
package
multitest
;
message
Multi2
{
required
int32
required_value
=
1
;
enum
Color
{
BLUE
=
1
;
GREEN
=
2
;
RED
=
3
;
};
optional
Color
color
=
2
;
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/multi/multi3.proto
0 → 100644
View file @
8f79df77
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax
=
"proto2"
;
package
multitest
;
message
Multi3
{
enum
HatType
{
FEDORA
=
1
;
FEZ
=
2
;
};
optional
HatType
hat_type
=
1
;
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/my_test/test.pb.go
0 → 100644
View file @
8f79df77
// Code generated by protoc-gen-gogo.
// source: my_test/test.proto
// DO NOT EDIT!
/*
Package my_test is a generated protocol buffer package.
This package holds interesting messages.
It is generated from these files:
my_test/test.proto
It has these top-level messages:
Request
Reply
OtherBase
ReplyExtensions
OtherReplyExtensions
OldReply
Communique
*/
package
my_test
import
proto
"QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/proto"
import
fmt
"fmt"
import
math
"math"
// discarding unused import multitest2 "multi"
// Reference imports to suppress errors if they are not otherwise used.
var
_
=
proto
.
Marshal
var
_
=
fmt
.
Errorf
var
_
=
math
.
Inf
type
HatType
int32
const
(
// deliberately skipping 0
HatType_FEDORA
HatType
=
1
HatType_FEZ
HatType
=
2
)
var
HatType_name
=
map
[
int32
]
string
{
1
:
"FEDORA"
,
2
:
"FEZ"
,
}
var
HatType_value
=
map
[
string
]
int32
{
"FEDORA"
:
1
,
"FEZ"
:
2
,
}
func
(
x
HatType
)
Enum
()
*
HatType
{
p
:=
new
(
HatType
)
*
p
=
x
return
p
}
func
(
x
HatType
)
String
()
string
{
return
proto
.
EnumName
(
HatType_name
,
int32
(
x
))
}
func
(
x
*
HatType
)
UnmarshalJSON
(
data
[]
byte
)
error
{
value
,
err
:=
proto
.
UnmarshalJSONEnum
(
HatType_value
,
data
,
"HatType"
)
if
err
!=
nil
{
return
err
}
*
x
=
HatType
(
value
)
return
nil
}
// This enum represents days of the week.
type
Days
int32
const
(
Days_MONDAY
Days
=
1
Days_TUESDAY
Days
=
2
Days_LUNDI
Days
=
1
)
var
Days_name
=
map
[
int32
]
string
{
1
:
"MONDAY"
,
2
:
"TUESDAY"
,
// Duplicate value: 1: "LUNDI",
}
var
Days_value
=
map
[
string
]
int32
{
"MONDAY"
:
1
,
"TUESDAY"
:
2
,
"LUNDI"
:
1
,
}
func
(
x
Days
)
Enum
()
*
Days
{
p
:=
new
(
Days
)
*
p
=
x
return
p
}
func
(
x
Days
)
String
()
string
{
return
proto
.
EnumName
(
Days_name
,
int32
(
x
))
}
func
(
x
*
Days
)
UnmarshalJSON
(
data
[]
byte
)
error
{
value
,
err
:=
proto
.
UnmarshalJSONEnum
(
Days_value
,
data
,
"Days"
)
if
err
!=
nil
{
return
err
}
*
x
=
Days
(
value
)
return
nil
}
type
Request_Color
int32
const
(
Request_RED
Request_Color
=
0
Request_GREEN
Request_Color
=
1
Request_BLUE
Request_Color
=
2
)
var
Request_Color_name
=
map
[
int32
]
string
{
0
:
"RED"
,
1
:
"GREEN"
,
2
:
"BLUE"
,
}
var
Request_Color_value
=
map
[
string
]
int32
{
"RED"
:
0
,
"GREEN"
:
1
,
"BLUE"
:
2
,
}
func
(
x
Request_Color
)
Enum
()
*
Request_Color
{
p
:=
new
(
Request_Color
)
*
p
=
x
return
p
}
func
(
x
Request_Color
)
String
()
string
{
return
proto
.
EnumName
(
Request_Color_name
,
int32
(
x
))
}
func
(
x
*
Request_Color
)
UnmarshalJSON
(
data
[]
byte
)
error
{
value
,
err
:=
proto
.
UnmarshalJSONEnum
(
Request_Color_value
,
data
,
"Request_Color"
)
if
err
!=
nil
{
return
err
}
*
x
=
Request_Color
(
value
)
return
nil
}
type
Reply_Entry_Game
int32
const
(
Reply_Entry_FOOTBALL
Reply_Entry_Game
=
1
Reply_Entry_TENNIS
Reply_Entry_Game
=
2
)
var
Reply_Entry_Game_name
=
map
[
int32
]
string
{
1
:
"FOOTBALL"
,
2
:
"TENNIS"
,
}
var
Reply_Entry_Game_value
=
map
[
string
]
int32
{
"FOOTBALL"
:
1
,
"TENNIS"
:
2
,
}
func
(
x
Reply_Entry_Game
)
Enum
()
*
Reply_Entry_Game
{
p
:=
new
(
Reply_Entry_Game
)
*
p
=
x
return
p
}
func
(
x
Reply_Entry_Game
)
String
()
string
{
return
proto
.
EnumName
(
Reply_Entry_Game_name
,
int32
(
x
))
}
func
(
x
*
Reply_Entry_Game
)
UnmarshalJSON
(
data
[]
byte
)
error
{
value
,
err
:=
proto
.
UnmarshalJSONEnum
(
Reply_Entry_Game_value
,
data
,
"Reply_Entry_Game"
)
if
err
!=
nil
{
return
err
}
*
x
=
Reply_Entry_Game
(
value
)
return
nil
}
// This is a message that might be sent somewhere.
type
Request
struct
{
Key
[]
int64
`protobuf:"varint,1,rep,name=key" json:"key,omitempty"`
// optional imp.ImportedMessage imported_message = 2;
Hue
*
Request_Color
`protobuf:"varint,3,opt,name=hue,enum=my.test.Request_Color" json:"hue,omitempty"`
Hat
*
HatType
`protobuf:"varint,4,opt,name=hat,enum=my.test.HatType,def=1" json:"hat,omitempty"`
// optional imp.ImportedMessage.Owner owner = 6;
Deadline
*
float32
`protobuf:"fixed32,7,opt,name=deadline,def=inf" json:"deadline,omitempty"`
Somegroup
*
Request_SomeGroup
`protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"`
// This is a map field. It will generate map[int32]string.
NameMapping
map
[
int32
]
string
`protobuf:"bytes,14,rep,name=name_mapping" json:"name_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// This is a map field whose value type is a message.
MsgMapping
map
[
int64
]
*
Reply
`protobuf:"bytes,15,rep,name=msg_mapping" json:"msg_mapping,omitempty" protobuf_key:"zigzag64,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
Reset_
*
int32
`protobuf:"varint,12,opt,name=reset" json:"reset,omitempty"`
// This field should not conflict with any getters.
GetKey_
*
string
`protobuf:"bytes,16,opt,name=get_key" json:"get_key,omitempty"`
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
Request
)
Reset
()
{
*
m
=
Request
{}
}
func
(
m
*
Request
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Request
)
ProtoMessage
()
{}
const
Default_Request_Hat
HatType
=
HatType_FEDORA
var
Default_Request_Deadline
float32
=
float32
(
math
.
Inf
(
1
))
func
(
m
*
Request
)
GetKey
()
[]
int64
{
if
m
!=
nil
{
return
m
.
Key
}
return
nil
}
func
(
m
*
Request
)
GetHue
()
Request_Color
{
if
m
!=
nil
&&
m
.
Hue
!=
nil
{
return
*
m
.
Hue
}
return
Request_RED
}
func
(
m
*
Request
)
GetHat
()
HatType
{
if
m
!=
nil
&&
m
.
Hat
!=
nil
{
return
*
m
.
Hat
}
return
Default_Request_Hat
}
func
(
m
*
Request
)
GetDeadline
()
float32
{
if
m
!=
nil
&&
m
.
Deadline
!=
nil
{
return
*
m
.
Deadline
}
return
Default_Request_Deadline
}
func
(
m
*
Request
)
GetSomegroup
()
*
Request_SomeGroup
{
if
m
!=
nil
{
return
m
.
Somegroup
}
return
nil
}
func
(
m
*
Request
)
GetNameMapping
()
map
[
int32
]
string
{
if
m
!=
nil
{
return
m
.
NameMapping
}
return
nil
}
func
(
m
*
Request
)
GetMsgMapping
()
map
[
int64
]
*
Reply
{
if
m
!=
nil
{
return
m
.
MsgMapping
}
return
nil
}
func
(
m
*
Request
)
GetReset_
()
int32
{
if
m
!=
nil
&&
m
.
Reset_
!=
nil
{
return
*
m
.
Reset_
}
return
0
}
func
(
m
*
Request
)
GetGetKey_
()
string
{
if
m
!=
nil
&&
m
.
GetKey_
!=
nil
{
return
*
m
.
GetKey_
}
return
""
}
type
Request_SomeGroup
struct
{
GroupField
*
int32
`protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"`
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
Request_SomeGroup
)
Reset
()
{
*
m
=
Request_SomeGroup
{}
}
func
(
m
*
Request_SomeGroup
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Request_SomeGroup
)
ProtoMessage
()
{}
func
(
m
*
Request_SomeGroup
)
GetGroupField
()
int32
{
if
m
!=
nil
&&
m
.
GroupField
!=
nil
{
return
*
m
.
GroupField
}
return
0
}
type
Reply
struct
{
Found
[]
*
Reply_Entry
`protobuf:"bytes,1,rep,name=found" json:"found,omitempty"`
CompactKeys
[]
int32
`protobuf:"varint,2,rep,packed,name=compact_keys" json:"compact_keys,omitempty"`
XXX_extensions
map
[
int32
]
proto
.
Extension
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
Reply
)
Reset
()
{
*
m
=
Reply
{}
}
func
(
m
*
Reply
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Reply
)
ProtoMessage
()
{}
var
extRange_Reply
=
[]
proto
.
ExtensionRange
{
{
100
,
536870911
},
}
func
(
*
Reply
)
ExtensionRangeArray
()
[]
proto
.
ExtensionRange
{
return
extRange_Reply
}
func
(
m
*
Reply
)
ExtensionMap
()
map
[
int32
]
proto
.
Extension
{
if
m
.
XXX_extensions
==
nil
{
m
.
XXX_extensions
=
make
(
map
[
int32
]
proto
.
Extension
)
}
return
m
.
XXX_extensions
}
func
(
m
*
Reply
)
GetFound
()
[]
*
Reply_Entry
{
if
m
!=
nil
{
return
m
.
Found
}
return
nil
}
func
(
m
*
Reply
)
GetCompactKeys
()
[]
int32
{
if
m
!=
nil
{
return
m
.
CompactKeys
}
return
nil
}
type
Reply_Entry
struct
{
KeyThatNeeds_1234Camel_CasIng
*
int64
`protobuf:"varint,1,req,name=key_that_needs_1234camel_CasIng" json:"key_that_needs_1234camel_CasIng,omitempty"`
Value
*
int64
`protobuf:"varint,2,opt,name=value,def=7" json:"value,omitempty"`
XMyFieldName_2
*
int64
`protobuf:"varint,3,opt,name=_my_field_name_2" json:"_my_field_name_2,omitempty"`
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
Reply_Entry
)
Reset
()
{
*
m
=
Reply_Entry
{}
}
func
(
m
*
Reply_Entry
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Reply_Entry
)
ProtoMessage
()
{}
const
Default_Reply_Entry_Value
int64
=
7
func
(
m
*
Reply_Entry
)
GetKeyThatNeeds_1234Camel_CasIng
()
int64
{
if
m
!=
nil
&&
m
.
KeyThatNeeds_1234Camel_CasIng
!=
nil
{
return
*
m
.
KeyThatNeeds_1234Camel_CasIng
}
return
0
}
func
(
m
*
Reply_Entry
)
GetValue
()
int64
{
if
m
!=
nil
&&
m
.
Value
!=
nil
{
return
*
m
.
Value
}
return
Default_Reply_Entry_Value
}
func
(
m
*
Reply_Entry
)
GetXMyFieldName_2
()
int64
{
if
m
!=
nil
&&
m
.
XMyFieldName_2
!=
nil
{
return
*
m
.
XMyFieldName_2
}
return
0
}
type
OtherBase
struct
{
Name
*
string
`protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
XXX_extensions
map
[
int32
]
proto
.
Extension
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
OtherBase
)
Reset
()
{
*
m
=
OtherBase
{}
}
func
(
m
*
OtherBase
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
OtherBase
)
ProtoMessage
()
{}
var
extRange_OtherBase
=
[]
proto
.
ExtensionRange
{
{
100
,
536870911
},
}
func
(
*
OtherBase
)
ExtensionRangeArray
()
[]
proto
.
ExtensionRange
{
return
extRange_OtherBase
}
func
(
m
*
OtherBase
)
ExtensionMap
()
map
[
int32
]
proto
.
Extension
{
if
m
.
XXX_extensions
==
nil
{
m
.
XXX_extensions
=
make
(
map
[
int32
]
proto
.
Extension
)
}
return
m
.
XXX_extensions
}
func
(
m
*
OtherBase
)
GetName
()
string
{
if
m
!=
nil
&&
m
.
Name
!=
nil
{
return
*
m
.
Name
}
return
""
}
type
ReplyExtensions
struct
{
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
ReplyExtensions
)
Reset
()
{
*
m
=
ReplyExtensions
{}
}
func
(
m
*
ReplyExtensions
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
ReplyExtensions
)
ProtoMessage
()
{}
var
E_ReplyExtensions_Time
=
&
proto
.
ExtensionDesc
{
ExtendedType
:
(
*
Reply
)(
nil
),
ExtensionType
:
(
*
float64
)(
nil
),
Field
:
101
,
Name
:
"my.test.ReplyExtensions.time"
,
Tag
:
"fixed64,101,opt,name=time"
,
}
var
E_ReplyExtensions_Carrot
=
&
proto
.
ExtensionDesc
{
ExtendedType
:
(
*
Reply
)(
nil
),
ExtensionType
:
(
*
ReplyExtensions
)(
nil
),
Field
:
105
,
Name
:
"my.test.ReplyExtensions.carrot"
,
Tag
:
"bytes,105,opt,name=carrot"
,
}
var
E_ReplyExtensions_Donut
=
&
proto
.
ExtensionDesc
{
ExtendedType
:
(
*
OtherBase
)(
nil
),
ExtensionType
:
(
*
ReplyExtensions
)(
nil
),
Field
:
101
,
Name
:
"my.test.ReplyExtensions.donut"
,
Tag
:
"bytes,101,opt,name=donut"
,
}
type
OtherReplyExtensions
struct
{
Key
*
int32
`protobuf:"varint,1,opt,name=key" json:"key,omitempty"`
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
OtherReplyExtensions
)
Reset
()
{
*
m
=
OtherReplyExtensions
{}
}
func
(
m
*
OtherReplyExtensions
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
OtherReplyExtensions
)
ProtoMessage
()
{}
func
(
m
*
OtherReplyExtensions
)
GetKey
()
int32
{
if
m
!=
nil
&&
m
.
Key
!=
nil
{
return
*
m
.
Key
}
return
0
}
type
OldReply
struct
{
XXX_extensions
map
[
int32
]
proto
.
Extension
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
OldReply
)
Reset
()
{
*
m
=
OldReply
{}
}
func
(
m
*
OldReply
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
OldReply
)
ProtoMessage
()
{}
func
(
m
*
OldReply
)
Marshal
()
([]
byte
,
error
)
{
return
proto
.
MarshalMessageSet
(
m
.
ExtensionMap
())
}
func
(
m
*
OldReply
)
Unmarshal
(
buf
[]
byte
)
error
{
return
proto
.
UnmarshalMessageSet
(
buf
,
m
.
ExtensionMap
())
}
func
(
m
*
OldReply
)
MarshalJSON
()
([]
byte
,
error
)
{
return
proto
.
MarshalMessageSetJSON
(
m
.
XXX_extensions
)
}
func
(
m
*
OldReply
)
UnmarshalJSON
(
buf
[]
byte
)
error
{
return
proto
.
UnmarshalMessageSetJSON
(
buf
,
m
.
XXX_extensions
)
}
// ensure OldReply satisfies proto.Marshaler and proto.Unmarshaler
var
_
proto
.
Marshaler
=
(
*
OldReply
)(
nil
)
var
_
proto
.
Unmarshaler
=
(
*
OldReply
)(
nil
)
var
extRange_OldReply
=
[]
proto
.
ExtensionRange
{
{
100
,
2147483646
},
}
func
(
*
OldReply
)
ExtensionRangeArray
()
[]
proto
.
ExtensionRange
{
return
extRange_OldReply
}
func
(
m
*
OldReply
)
ExtensionMap
()
map
[
int32
]
proto
.
Extension
{
if
m
.
XXX_extensions
==
nil
{
m
.
XXX_extensions
=
make
(
map
[
int32
]
proto
.
Extension
)
}
return
m
.
XXX_extensions
}
type
Communique
struct
{
MakeMeCry
*
bool
`protobuf:"varint,1,opt,name=make_me_cry" json:"make_me_cry,omitempty"`
// This is a oneof, called "union".
//
// Types that are valid to be assigned to Union:
// *Communique_Number
// *Communique_Name
// *Communique_Data
// *Communique_TempC
// *Communique_Height
// *Communique_Today
// *Communique_Maybe
// *Communique_Delta_
// *Communique_Msg
// *Communique_Somegroup
Union
isCommunique_Union
`protobuf_oneof:"union"`
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
Communique
)
Reset
()
{
*
m
=
Communique
{}
}
func
(
m
*
Communique
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Communique
)
ProtoMessage
()
{}
type
isCommunique_Union
interface
{
isCommunique_Union
()
}
type
Communique_Number
struct
{
Number
int32
`protobuf:"varint,5,opt,name=number,oneof"`
}
type
Communique_Name
struct
{
Name
string
`protobuf:"bytes,6,opt,name=name,oneof"`
}
type
Communique_Data
struct
{
Data
[]
byte
`protobuf:"bytes,7,opt,name=data,oneof"`
}
type
Communique_TempC
struct
{
TempC
float64
`protobuf:"fixed64,8,opt,name=temp_c,oneof"`
}
type
Communique_Height
struct
{
Height
float32
`protobuf:"fixed32,9,opt,name=height,oneof"`
}
type
Communique_Today
struct
{
Today
Days
`protobuf:"varint,10,opt,name=today,enum=my.test.Days,oneof"`
}
type
Communique_Maybe
struct
{
Maybe
bool
`protobuf:"varint,11,opt,name=maybe,oneof"`
}
type
Communique_Delta_
struct
{
Delta
int32
`protobuf:"zigzag32,12,opt,name=delta,oneof"`
}
type
Communique_Msg
struct
{
Msg
*
Reply
`protobuf:"bytes,13,opt,name=msg,oneof"`
}
type
Communique_Somegroup
struct
{
Somegroup
*
Communique_SomeGroup
`protobuf:"group,14,opt,name=SomeGroup,oneof"`
}
func
(
*
Communique_Number
)
isCommunique_Union
()
{}
func
(
*
Communique_Name
)
isCommunique_Union
()
{}
func
(
*
Communique_Data
)
isCommunique_Union
()
{}
func
(
*
Communique_TempC
)
isCommunique_Union
()
{}
func
(
*
Communique_Height
)
isCommunique_Union
()
{}
func
(
*
Communique_Today
)
isCommunique_Union
()
{}
func
(
*
Communique_Maybe
)
isCommunique_Union
()
{}
func
(
*
Communique_Delta_
)
isCommunique_Union
()
{}
func
(
*
Communique_Msg
)
isCommunique_Union
()
{}
func
(
*
Communique_Somegroup
)
isCommunique_Union
()
{}
func
(
m
*
Communique
)
GetUnion
()
isCommunique_Union
{
if
m
!=
nil
{
return
m
.
Union
}
return
nil
}
func
(
m
*
Communique
)
GetMakeMeCry
()
bool
{
if
m
!=
nil
&&
m
.
MakeMeCry
!=
nil
{
return
*
m
.
MakeMeCry
}
return
false
}
func
(
m
*
Communique
)
GetNumber
()
int32
{
if
x
,
ok
:=
m
.
GetUnion
()
.
(
*
Communique_Number
);
ok
{
return
x
.
Number
}
return
0
}
func
(
m
*
Communique
)
GetName
()
string
{
if
x
,
ok
:=
m
.
GetUnion
()
.
(
*
Communique_Name
);
ok
{
return
x
.
Name
}
return
""
}
func
(
m
*
Communique
)
GetData
()
[]
byte
{
if
x
,
ok
:=
m
.
GetUnion
()
.
(
*
Communique_Data
);
ok
{
return
x
.
Data
}
return
nil
}
func
(
m
*
Communique
)
GetTempC
()
float64
{
if
x
,
ok
:=
m
.
GetUnion
()
.
(
*
Communique_TempC
);
ok
{
return
x
.
TempC
}
return
0
}
func
(
m
*
Communique
)
GetHeight
()
float32
{
if
x
,
ok
:=
m
.
GetUnion
()
.
(
*
Communique_Height
);
ok
{
return
x
.
Height
}
return
0
}
func
(
m
*
Communique
)
GetToday
()
Days
{
if
x
,
ok
:=
m
.
GetUnion
()
.
(
*
Communique_Today
);
ok
{
return
x
.
Today
}
return
Days_MONDAY
}
func
(
m
*
Communique
)
GetMaybe
()
bool
{
if
x
,
ok
:=
m
.
GetUnion
()
.
(
*
Communique_Maybe
);
ok
{
return
x
.
Maybe
}
return
false
}
func
(
m
*
Communique
)
GetDelta
()
int32
{
if
x
,
ok
:=
m
.
GetUnion
()
.
(
*
Communique_Delta_
);
ok
{
return
x
.
Delta
}
return
0
}
func
(
m
*
Communique
)
GetMsg
()
*
Reply
{
if
x
,
ok
:=
m
.
GetUnion
()
.
(
*
Communique_Msg
);
ok
{
return
x
.
Msg
}
return
nil
}
func
(
m
*
Communique
)
GetSomegroup
()
*
Communique_SomeGroup
{
if
x
,
ok
:=
m
.
GetUnion
()
.
(
*
Communique_Somegroup
);
ok
{
return
x
.
Somegroup
}
return
nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func
(
*
Communique
)
XXX_OneofFuncs
()
(
func
(
msg
proto
.
Message
,
b
*
proto
.
Buffer
)
error
,
func
(
msg
proto
.
Message
,
tag
,
wire
int
,
b
*
proto
.
Buffer
)
(
bool
,
error
),
[]
interface
{})
{
return
_Communique_OneofMarshaler
,
_Communique_OneofUnmarshaler
,
[]
interface
{}{
(
*
Communique_Number
)(
nil
),
(
*
Communique_Name
)(
nil
),
(
*
Communique_Data
)(
nil
),
(
*
Communique_TempC
)(
nil
),
(
*
Communique_Height
)(
nil
),
(
*
Communique_Today
)(
nil
),
(
*
Communique_Maybe
)(
nil
),
(
*
Communique_Delta_
)(
nil
),
(
*
Communique_Msg
)(
nil
),
(
*
Communique_Somegroup
)(
nil
),
}
}
func
_Communique_OneofMarshaler
(
msg
proto
.
Message
,
b
*
proto
.
Buffer
)
error
{
m
:=
msg
.
(
*
Communique
)
// union
switch
x
:=
m
.
Union
.
(
type
)
{
case
*
Communique_Number
:
_
=
b
.
EncodeVarint
(
5
<<
3
|
proto
.
WireVarint
)
_
=
b
.
EncodeVarint
(
uint64
(
x
.
Number
))
case
*
Communique_Name
:
_
=
b
.
EncodeVarint
(
6
<<
3
|
proto
.
WireBytes
)
_
=
b
.
EncodeStringBytes
(
x
.
Name
)
case
*
Communique_Data
:
_
=
b
.
EncodeVarint
(
7
<<
3
|
proto
.
WireBytes
)
_
=
b
.
EncodeRawBytes
(
x
.
Data
)
case
*
Communique_TempC
:
_
=
b
.
EncodeVarint
(
8
<<
3
|
proto
.
WireFixed64
)
_
=
b
.
EncodeFixed64
(
math
.
Float64bits
(
x
.
TempC
))
case
*
Communique_Height
:
_
=
b
.
EncodeVarint
(
9
<<
3
|
proto
.
WireFixed32
)
_
=
b
.
EncodeFixed32
(
uint64
(
math
.
Float32bits
(
x
.
Height
)))
case
*
Communique_Today
:
_
=
b
.
EncodeVarint
(
10
<<
3
|
proto
.
WireVarint
)
_
=
b
.
EncodeVarint
(
uint64
(
x
.
Today
))
case
*
Communique_Maybe
:
t
:=
uint64
(
0
)
if
x
.
Maybe
{
t
=
1
}
_
=
b
.
EncodeVarint
(
11
<<
3
|
proto
.
WireVarint
)
_
=
b
.
EncodeVarint
(
t
)
case
*
Communique_Delta_
:
_
=
b
.
EncodeVarint
(
12
<<
3
|
proto
.
WireVarint
)
_
=
b
.
EncodeZigzag32
(
uint64
(
x
.
Delta
))
case
*
Communique_Msg
:
_
=
b
.
EncodeVarint
(
13
<<
3
|
proto
.
WireBytes
)
if
err
:=
b
.
EncodeMessage
(
x
.
Msg
);
err
!=
nil
{
return
err
}
case
*
Communique_Somegroup
:
_
=
b
.
EncodeVarint
(
14
<<
3
|
proto
.
WireStartGroup
)
if
err
:=
b
.
Marshal
(
x
.
Somegroup
);
err
!=
nil
{
return
err
}
_
=
b
.
EncodeVarint
(
14
<<
3
|
proto
.
WireEndGroup
)
case
nil
:
default
:
return
fmt
.
Errorf
(
"Communique.Union has unexpected type %T"
,
x
)
}
return
nil
}
func
_Communique_OneofUnmarshaler
(
msg
proto
.
Message
,
tag
,
wire
int
,
b
*
proto
.
Buffer
)
(
bool
,
error
)
{
m
:=
msg
.
(
*
Communique
)
switch
tag
{
case
5
:
// union.number
if
wire
!=
proto
.
WireVarint
{
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeVarint
()
m
.
Union
=
&
Communique_Number
{
int32
(
x
)}
return
true
,
err
case
6
:
// union.name
if
wire
!=
proto
.
WireBytes
{
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeStringBytes
()
m
.
Union
=
&
Communique_Name
{
x
}
return
true
,
err
case
7
:
// union.data
if
wire
!=
proto
.
WireBytes
{
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeRawBytes
(
true
)
m
.
Union
=
&
Communique_Data
{
x
}
return
true
,
err
case
8
:
// union.temp_c
if
wire
!=
proto
.
WireFixed64
{
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeFixed64
()
m
.
Union
=
&
Communique_TempC
{
math
.
Float64frombits
(
x
)}
return
true
,
err
case
9
:
// union.height
if
wire
!=
proto
.
WireFixed32
{
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeFixed32
()
m
.
Union
=
&
Communique_Height
{
math
.
Float32frombits
(
uint32
(
x
))}
return
true
,
err
case
10
:
// union.today
if
wire
!=
proto
.
WireVarint
{
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeVarint
()
m
.
Union
=
&
Communique_Today
{
Days
(
x
)}
return
true
,
err
case
11
:
// union.maybe
if
wire
!=
proto
.
WireVarint
{
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeVarint
()
m
.
Union
=
&
Communique_Maybe
{
x
!=
0
}
return
true
,
err
case
12
:
// union.delta
if
wire
!=
proto
.
WireVarint
{
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeZigzag32
()
m
.
Union
=
&
Communique_Delta_
{
int32
(
x
)}
return
true
,
err
case
13
:
// union.msg
if
wire
!=
proto
.
WireBytes
{
return
true
,
proto
.
ErrInternalBadWireType
}
msg
:=
new
(
Reply
)
err
:=
b
.
DecodeMessage
(
msg
)
m
.
Union
=
&
Communique_Msg
{
msg
}
return
true
,
err
case
14
:
// union.somegroup
if
wire
!=
proto
.
WireStartGroup
{
return
true
,
proto
.
ErrInternalBadWireType
}
msg
:=
new
(
Communique_SomeGroup
)
err
:=
b
.
DecodeGroup
(
msg
)
m
.
Union
=
&
Communique_Somegroup
{
msg
}
return
true
,
err
default
:
return
false
,
nil
}
}
type
Communique_SomeGroup
struct
{
Member
*
string
`protobuf:"bytes,15,opt,name=member" json:"member,omitempty"`
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
Communique_SomeGroup
)
Reset
()
{
*
m
=
Communique_SomeGroup
{}
}
func
(
m
*
Communique_SomeGroup
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Communique_SomeGroup
)
ProtoMessage
()
{}
func
(
m
*
Communique_SomeGroup
)
GetMember
()
string
{
if
m
!=
nil
&&
m
.
Member
!=
nil
{
return
*
m
.
Member
}
return
""
}
type
Communique_Delta
struct
{
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
Communique_Delta
)
Reset
()
{
*
m
=
Communique_Delta
{}
}
func
(
m
*
Communique_Delta
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Communique_Delta
)
ProtoMessage
()
{}
var
E_Tag
=
&
proto
.
ExtensionDesc
{
ExtendedType
:
(
*
Reply
)(
nil
),
ExtensionType
:
(
*
string
)(
nil
),
Field
:
103
,
Name
:
"my.test.tag"
,
Tag
:
"bytes,103,opt,name=tag"
,
}
var
E_Donut
=
&
proto
.
ExtensionDesc
{
ExtendedType
:
(
*
Reply
)(
nil
),
ExtensionType
:
(
*
OtherReplyExtensions
)(
nil
),
Field
:
106
,
Name
:
"my.test.donut"
,
Tag
:
"bytes,106,opt,name=donut"
,
}
func
init
()
{
proto
.
RegisterEnum
(
"my.test.HatType"
,
HatType_name
,
HatType_value
)
proto
.
RegisterEnum
(
"my.test.Days"
,
Days_name
,
Days_value
)
proto
.
RegisterEnum
(
"my.test.Request_Color"
,
Request_Color_name
,
Request_Color_value
)
proto
.
RegisterEnum
(
"my.test.Reply_Entry_Game"
,
Reply_Entry_Game_name
,
Reply_Entry_Game_value
)
proto
.
RegisterExtension
(
E_ReplyExtensions_Time
)
proto
.
RegisterExtension
(
E_ReplyExtensions_Carrot
)
proto
.
RegisterExtension
(
E_ReplyExtensions_Donut
)
proto
.
RegisterExtension
(
E_Tag
)
proto
.
RegisterExtension
(
E_Donut
)
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/my_test/test.pb.go.golden
0 → 100644
View file @
8f79df77
//
Code
generated
by
protoc
-
gen
-
gogo
.
//
source
:
my_test
/
test
.
proto
//
DO
NOT
EDIT
!
/*
Package
my_test
is
a
generated
protocol
buffer
package
.
This
package
holds
interesting
messages
.
It
is
generated
from
these
files
:
my_test
/
test
.
proto
It
has
these
top
-
level
messages
:
Request
Reply
OtherBase
ReplyExtensions
OtherReplyExtensions
OldReply
Communique
*/
package
my_test
import
proto
"github.com/gogo/protobuf/proto"
import
fmt
"fmt"
import
math
"math"
//
discarding
unused
import
multitest2
"multi"
//
Reference
imports
to
suppress
errors
if
they
are
not
otherwise
used
.
var
_
=
proto
.
Marshal
var
_
=
fmt
.
Errorf
var
_
=
math
.
Inf
type
HatType
int32
const
(
//
deliberately
skipping
0
HatType_FEDORA
HatType
=
1
HatType_FEZ
HatType
=
2
)
var
HatType_name
=
map
[
int32
]
string
{
1
:
"FEDORA"
,
2
:
"FEZ"
,
}
var
HatType_value
=
map
[
string
]
int32
{
"FEDORA"
:
1
,
"FEZ"
:
2
,
}
func
(
x
HatType
)
Enum
()
*
HatType
{
p
:=
new
(
HatType
)
*
p
=
x
return
p
}
func
(
x
HatType
)
String
()
string
{
return
proto
.
EnumName
(
HatType_name
,
int32
(
x
))
}
func
(
x
*
HatType
)
UnmarshalJSON
(
data
[]
byte
)
error
{
value
,
err
:=
proto
.
UnmarshalJSONEnum
(
HatType_value
,
data
,
"HatType"
)
if
err
!= nil {
return
err
}
*
x
=
HatType
(
value
)
return
nil
}
//
This
enum
represents
days
of
the
week
.
type
Days
int32
const
(
Days_MONDAY
Days
=
1
Days_TUESDAY
Days
=
2
Days_LUNDI
Days
=
1
)
var
Days_name
=
map
[
int32
]
string
{
1
:
"MONDAY"
,
2
:
"TUESDAY"
,
//
Duplicate
value
:
1
:
"LUNDI"
,
}
var
Days_value
=
map
[
string
]
int32
{
"MONDAY"
:
1
,
"TUESDAY"
:
2
,
"LUNDI"
:
1
,
}
func
(
x
Days
)
Enum
()
*
Days
{
p
:=
new
(
Days
)
*
p
=
x
return
p
}
func
(
x
Days
)
String
()
string
{
return
proto
.
EnumName
(
Days_name
,
int32
(
x
))
}
func
(
x
*
Days
)
UnmarshalJSON
(
data
[]
byte
)
error
{
value
,
err
:=
proto
.
UnmarshalJSONEnum
(
Days_value
,
data
,
"Days"
)
if
err
!= nil {
return
err
}
*
x
=
Days
(
value
)
return
nil
}
type
Request_Color
int32
const
(
Request_RED
Request_Color
=
0
Request_GREEN
Request_Color
=
1
Request_BLUE
Request_Color
=
2
)
var
Request_Color_name
=
map
[
int32
]
string
{
0
:
"RED"
,
1
:
"GREEN"
,
2
:
"BLUE"
,
}
var
Request_Color_value
=
map
[
string
]
int32
{
"RED"
:
0
,
"GREEN"
:
1
,
"BLUE"
:
2
,
}
func
(
x
Request_Color
)
Enum
()
*
Request_Color
{
p
:=
new
(
Request_Color
)
*
p
=
x
return
p
}
func
(
x
Request_Color
)
String
()
string
{
return
proto
.
EnumName
(
Request_Color_name
,
int32
(
x
))
}
func
(
x
*
Request_Color
)
UnmarshalJSON
(
data
[]
byte
)
error
{
value
,
err
:=
proto
.
UnmarshalJSONEnum
(
Request_Color_value
,
data
,
"Request_Color"
)
if
err
!= nil {
return
err
}
*
x
=
Request_Color
(
value
)
return
nil
}
type
Reply_Entry_Game
int32
const
(
Reply_Entry_FOOTBALL
Reply_Entry_Game
=
1
Reply_Entry_TENNIS
Reply_Entry_Game
=
2
)
var
Reply_Entry_Game_name
=
map
[
int32
]
string
{
1
:
"FOOTBALL"
,
2
:
"TENNIS"
,
}
var
Reply_Entry_Game_value
=
map
[
string
]
int32
{
"FOOTBALL"
:
1
,
"TENNIS"
:
2
,
}
func
(
x
Reply_Entry_Game
)
Enum
()
*
Reply_Entry_Game
{
p
:=
new
(
Reply_Entry_Game
)
*
p
=
x
return
p
}
func
(
x
Reply_Entry_Game
)
String
()
string
{
return
proto
.
EnumName
(
Reply_Entry_Game_name
,
int32
(
x
))
}
func
(
x
*
Reply_Entry_Game
)
UnmarshalJSON
(
data
[]
byte
)
error
{
value
,
err
:=
proto
.
UnmarshalJSONEnum
(
Reply_Entry_Game_value
,
data
,
"Reply_Entry_Game"
)
if
err
!= nil {
return
err
}
*
x
=
Reply_Entry_Game
(
value
)
return
nil
}
//
This
is
a
message
that
might
be
sent
somewhere
.
type
Request
struct
{
Key
[]
int64
`
protobuf
:
"varint,1,rep,name=key"
json
:
"key,omitempty"
`
//
optional
imp
.
ImportedMessage
imported_message
=
2
;
Hue
*
Request_Color
`
protobuf
:
"varint,3,opt,name=hue,enum=my.test.Request_Color"
json
:
"hue,omitempty"
`
Hat
*
HatType
`
protobuf
:
"varint,4,opt,name=hat,enum=my.test.HatType,def=1"
json
:
"hat,omitempty"
`
//
optional
imp
.
ImportedMessage
.
Owner
owner
=
6
;
Deadline
*
float32
`
protobuf
:
"fixed32,7,opt,name=deadline,def=inf"
json
:
"deadline,omitempty"
`
Somegroup
*
Request_SomeGroup
`
protobuf
:
"group,8,opt,name=SomeGroup"
json
:
"somegroup,omitempty"
`
//
This
is
a
map
field
.
It
will
generate
map
[
int32
]
string
.
NameMapping
map
[
int32
]
string
`
protobuf
:
"bytes,14,rep,name=name_mapping"
json
:
"name_mapping,omitempty"
protobuf_key
:
"varint,1,opt,name=key"
protobuf_val
:
"bytes,2,opt,name=value"
`
//
This
is
a
map
field
whose
value
type
is
a
message
.
MsgMapping
map
[
int64
]*
Reply
`
protobuf
:
"bytes,15,rep,name=msg_mapping"
json
:
"msg_mapping,omitempty"
protobuf_key
:
"zigzag64,1,opt,name=key"
protobuf_val
:
"bytes,2,opt,name=value"
`
Reset_
*
int32
`
protobuf
:
"varint,12,opt,name=reset"
json
:
"reset,omitempty"
`
//
This
field
should
not
conflict
with
any
getters
.
GetKey_
*
string
`
protobuf
:
"bytes,16,opt,name=get_key"
json
:
"get_key,omitempty"
`
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
Request
)
Reset
()
{
*
m
=
Request
{}
}
func
(
m
*
Request
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
Request
)
ProtoMessage
()
{}
const
Default_Request_Hat
HatType
=
HatType_FEDORA
var
Default_Request_Deadline
float32
=
float32
(
math
.
Inf
(
1
))
func
(
m
*
Request
)
GetKey
()
[]
int64
{
if
m
!= nil {
return
m
.
Key
}
return
nil
}
func
(
m
*
Request
)
GetHue
()
Request_Color
{
if
m
!= nil && m.Hue != nil {
return
*
m
.
Hue
}
return
Request_RED
}
func
(
m
*
Request
)
GetHat
()
HatType
{
if
m
!= nil && m.Hat != nil {
return
*
m
.
Hat
}
return
Default_Request_Hat
}
func
(
m
*
Request
)
GetDeadline
()
float32
{
if
m
!= nil && m.Deadline != nil {
return
*
m
.
Deadline
}
return
Default_Request_Deadline
}
func
(
m
*
Request
)
GetSomegroup
()
*
Request_SomeGroup
{
if
m
!= nil {
return
m
.
Somegroup
}
return
nil
}
func
(
m
*
Request
)
GetNameMapping
()
map
[
int32
]
string
{
if
m
!= nil {
return
m
.
NameMapping
}
return
nil
}
func
(
m
*
Request
)
GetMsgMapping
()
map
[
int64
]*
Reply
{
if
m
!= nil {
return
m
.
MsgMapping
}
return
nil
}
func
(
m
*
Request
)
GetReset_
()
int32
{
if
m
!= nil && m.Reset_ != nil {
return
*
m
.
Reset_
}
return
0
}
func
(
m
*
Request
)
GetGetKey_
()
string
{
if
m
!= nil && m.GetKey_ != nil {
return
*
m
.
GetKey_
}
return
""
}
type
Request_SomeGroup
struct
{
GroupField
*
int32
`
protobuf
:
"varint,9,opt,name=group_field"
json
:
"group_field,omitempty"
`
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
Request_SomeGroup
)
Reset
()
{
*
m
=
Request_SomeGroup
{}
}
func
(
m
*
Request_SomeGroup
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
Request_SomeGroup
)
ProtoMessage
()
{}
func
(
m
*
Request_SomeGroup
)
GetGroupField
()
int32
{
if
m
!= nil && m.GroupField != nil {
return
*
m
.
GroupField
}
return
0
}
type
Reply
struct
{
Found
[]*
Reply_Entry
`
protobuf
:
"bytes,1,rep,name=found"
json
:
"found,omitempty"
`
CompactKeys
[]
int32
`
protobuf
:
"varint,2,rep,packed,name=compact_keys"
json
:
"compact_keys,omitempty"
`
XXX_extensions
map
[
int32
]
proto
.
Extension
`
json
:
"-"
`
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
Reply
)
Reset
()
{
*
m
=
Reply
{}
}
func
(
m
*
Reply
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
Reply
)
ProtoMessage
()
{}
var
extRange_Reply
=
[]
proto
.
ExtensionRange
{
{
100
,
536870911
},
}
func
(*
Reply
)
ExtensionRangeArray
()
[]
proto
.
ExtensionRange
{
return
extRange_Reply
}
func
(
m
*
Reply
)
ExtensionMap
()
map
[
int32
]
proto
.
Extension
{
if
m
.
XXX_extensions
==
nil
{
m
.
XXX_extensions
=
make
(
map
[
int32
]
proto
.
Extension
)
}
return
m
.
XXX_extensions
}
func
(
m
*
Reply
)
GetFound
()
[]*
Reply_Entry
{
if
m
!= nil {
return
m
.
Found
}
return
nil
}
func
(
m
*
Reply
)
GetCompactKeys
()
[]
int32
{
if
m
!= nil {
return
m
.
CompactKeys
}
return
nil
}
type
Reply_Entry
struct
{
KeyThatNeeds_1234Camel_CasIng
*
int64
`
protobuf
:
"varint,1,req,name=key_that_needs_1234camel_CasIng"
json
:
"key_that_needs_1234camel_CasIng,omitempty"
`
Value
*
int64
`
protobuf
:
"varint,2,opt,name=value,def=7"
json
:
"value,omitempty"
`
XMyFieldName_2
*
int64
`
protobuf
:
"varint,3,opt,name=_my_field_name_2"
json
:
"_my_field_name_2,omitempty"
`
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
Reply_Entry
)
Reset
()
{
*
m
=
Reply_Entry
{}
}
func
(
m
*
Reply_Entry
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
Reply_Entry
)
ProtoMessage
()
{}
const
Default_Reply_Entry_Value
int64
=
7
func
(
m
*
Reply_Entry
)
GetKeyThatNeeds_1234Camel_CasIng
()
int64
{
if
m
!= nil && m.KeyThatNeeds_1234Camel_CasIng != nil {
return
*
m
.
KeyThatNeeds_1234Camel_CasIng
}
return
0
}
func
(
m
*
Reply_Entry
)
GetValue
()
int64
{
if
m
!= nil && m.Value != nil {
return
*
m
.
Value
}
return
Default_Reply_Entry_Value
}
func
(
m
*
Reply_Entry
)
GetXMyFieldName_2
()
int64
{
if
m
!= nil && m.XMyFieldName_2 != nil {
return
*
m
.
XMyFieldName_2
}
return
0
}
type
OtherBase
struct
{
Name
*
string
`
protobuf
:
"bytes,1,opt,name=name"
json
:
"name,omitempty"
`
XXX_extensions
map
[
int32
]
proto
.
Extension
`
json
:
"-"
`
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
OtherBase
)
Reset
()
{
*
m
=
OtherBase
{}
}
func
(
m
*
OtherBase
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
OtherBase
)
ProtoMessage
()
{}
var
extRange_OtherBase
=
[]
proto
.
ExtensionRange
{
{
100
,
536870911
},
}
func
(*
OtherBase
)
ExtensionRangeArray
()
[]
proto
.
ExtensionRange
{
return
extRange_OtherBase
}
func
(
m
*
OtherBase
)
ExtensionMap
()
map
[
int32
]
proto
.
Extension
{
if
m
.
XXX_extensions
==
nil
{
m
.
XXX_extensions
=
make
(
map
[
int32
]
proto
.
Extension
)
}
return
m
.
XXX_extensions
}
func
(
m
*
OtherBase
)
GetName
()
string
{
if
m
!= nil && m.Name != nil {
return
*
m
.
Name
}
return
""
}
type
ReplyExtensions
struct
{
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
ReplyExtensions
)
Reset
()
{
*
m
=
ReplyExtensions
{}
}
func
(
m
*
ReplyExtensions
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
ReplyExtensions
)
ProtoMessage
()
{}
var
E_ReplyExtensions_Time
=
&
proto
.
ExtensionDesc
{
ExtendedType
:
(*
Reply
)(
nil
),
ExtensionType
:
(*
float64
)(
nil
),
Field
:
101
,
Name
:
"my.test.ReplyExtensions.time"
,
Tag
:
"fixed64,101,opt,name=time"
,
}
var
E_ReplyExtensions_Carrot
=
&
proto
.
ExtensionDesc
{
ExtendedType
:
(*
Reply
)(
nil
),
ExtensionType
:
(*
ReplyExtensions
)(
nil
),
Field
:
105
,
Name
:
"my.test.ReplyExtensions.carrot"
,
Tag
:
"bytes,105,opt,name=carrot"
,
}
var
E_ReplyExtensions_Donut
=
&
proto
.
ExtensionDesc
{
ExtendedType
:
(*
OtherBase
)(
nil
),
ExtensionType
:
(*
ReplyExtensions
)(
nil
),
Field
:
101
,
Name
:
"my.test.ReplyExtensions.donut"
,
Tag
:
"bytes,101,opt,name=donut"
,
}
type
OtherReplyExtensions
struct
{
Key
*
int32
`
protobuf
:
"varint,1,opt,name=key"
json
:
"key,omitempty"
`
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
OtherReplyExtensions
)
Reset
()
{
*
m
=
OtherReplyExtensions
{}
}
func
(
m
*
OtherReplyExtensions
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
OtherReplyExtensions
)
ProtoMessage
()
{}
func
(
m
*
OtherReplyExtensions
)
GetKey
()
int32
{
if
m
!= nil && m.Key != nil {
return
*
m
.
Key
}
return
0
}
type
OldReply
struct
{
XXX_extensions
map
[
int32
]
proto
.
Extension
`
json
:
"-"
`
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
OldReply
)
Reset
()
{
*
m
=
OldReply
{}
}
func
(
m
*
OldReply
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
OldReply
)
ProtoMessage
()
{}
func
(
m
*
OldReply
)
Marshal
()
([]
byte
,
error
)
{
return
proto
.
MarshalMessageSet
(
m
.
ExtensionMap
())
}
func
(
m
*
OldReply
)
Unmarshal
(
buf
[]
byte
)
error
{
return
proto
.
UnmarshalMessageSet
(
buf
,
m
.
ExtensionMap
())
}
func
(
m
*
OldReply
)
MarshalJSON
()
([]
byte
,
error
)
{
return
proto
.
MarshalMessageSetJSON
(
m
.
XXX_extensions
)
}
func
(
m
*
OldReply
)
UnmarshalJSON
(
buf
[]
byte
)
error
{
return
proto
.
UnmarshalMessageSetJSON
(
buf
,
m
.
XXX_extensions
)
}
//
ensure
OldReply
satisfies
proto
.
Marshaler
and
proto
.
Unmarshaler
var
_
proto
.
Marshaler
=
(*
OldReply
)(
nil
)
var
_
proto
.
Unmarshaler
=
(*
OldReply
)(
nil
)
var
extRange_OldReply
=
[]
proto
.
ExtensionRange
{
{
100
,
2147483646
},
}
func
(*
OldReply
)
ExtensionRangeArray
()
[]
proto
.
ExtensionRange
{
return
extRange_OldReply
}
func
(
m
*
OldReply
)
ExtensionMap
()
map
[
int32
]
proto
.
Extension
{
if
m
.
XXX_extensions
==
nil
{
m
.
XXX_extensions
=
make
(
map
[
int32
]
proto
.
Extension
)
}
return
m
.
XXX_extensions
}
type
Communique
struct
{
MakeMeCry
*
bool
`
protobuf
:
"varint,1,opt,name=make_me_cry"
json
:
"make_me_cry,omitempty"
`
//
This
is
a
oneof
,
called
"union"
.
//
//
Types
that
are
valid
to
be
assigned
to
Union
:
//
*
Communique_Number
//
*
Communique_Name
//
*
Communique_Data
//
*
Communique_TempC
//
*
Communique_Height
//
*
Communique_Today
//
*
Communique_Maybe
//
*
Communique_Delta_
//
*
Communique_Msg
//
*
Communique_Somegroup
Union
isCommunique_Union
`
protobuf_oneof
:
"union"
`
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
Communique
)
Reset
()
{
*
m
=
Communique
{}
}
func
(
m
*
Communique
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
Communique
)
ProtoMessage
()
{}
type
isCommunique_Union
interface
{
isCommunique_Union
()
}
type
Communique_Number
struct
{
Number
int32
`
protobuf
:
"varint,5,opt,name=number,oneof"
`
}
type
Communique_Name
struct
{
Name
string
`
protobuf
:
"bytes,6,opt,name=name,oneof"
`
}
type
Communique_Data
struct
{
Data
[]
byte
`
protobuf
:
"bytes,7,opt,name=data,oneof"
`
}
type
Communique_TempC
struct
{
TempC
float64
`
protobuf
:
"fixed64,8,opt,name=temp_c,oneof"
`
}
type
Communique_Height
struct
{
Height
float32
`
protobuf
:
"fixed32,9,opt,name=height,oneof"
`
}
type
Communique_Today
struct
{
Today
Days
`
protobuf
:
"varint,10,opt,name=today,enum=my.test.Days,oneof"
`
}
type
Communique_Maybe
struct
{
Maybe
bool
`
protobuf
:
"varint,11,opt,name=maybe,oneof"
`
}
type
Communique_Delta_
struct
{
Delta
int32
`
protobuf
:
"zigzag32,12,opt,name=delta,oneof"
`
}
type
Communique_Msg
struct
{
Msg
*
Reply
`
protobuf
:
"bytes,13,opt,name=msg,oneof"
`
}
type
Communique_Somegroup
struct
{
Somegroup
*
Communique_SomeGroup
`
protobuf
:
"group,14,opt,name=SomeGroup,oneof"
`
}
func
(*
Communique_Number
)
isCommunique_Union
()
{}
func
(*
Communique_Name
)
isCommunique_Union
()
{}
func
(*
Communique_Data
)
isCommunique_Union
()
{}
func
(*
Communique_TempC
)
isCommunique_Union
()
{}
func
(*
Communique_Height
)
isCommunique_Union
()
{}
func
(*
Communique_Today
)
isCommunique_Union
()
{}
func
(*
Communique_Maybe
)
isCommunique_Union
()
{}
func
(*
Communique_Delta_
)
isCommunique_Union
()
{}
func
(*
Communique_Msg
)
isCommunique_Union
()
{}
func
(*
Communique_Somegroup
)
isCommunique_Union
()
{}
func
(
m
*
Communique
)
GetUnion
()
isCommunique_Union
{
if
m
!= nil {
return
m
.
Union
}
return
nil
}
func
(
m
*
Communique
)
GetMakeMeCry
()
bool
{
if
m
!= nil && m.MakeMeCry != nil {
return
*
m
.
MakeMeCry
}
return
false
}
func
(
m
*
Communique
)
GetNumber
()
int32
{
if
x
,
ok
:=
m
.
GetUnion
().(*
Communique_Number
);
ok
{
return
x
.
Number
}
return
0
}
func
(
m
*
Communique
)
GetName
()
string
{
if
x
,
ok
:=
m
.
GetUnion
().(*
Communique_Name
);
ok
{
return
x
.
Name
}
return
""
}
func
(
m
*
Communique
)
GetData
()
[]
byte
{
if
x
,
ok
:=
m
.
GetUnion
().(*
Communique_Data
);
ok
{
return
x
.
Data
}
return
nil
}
func
(
m
*
Communique
)
GetTempC
()
float64
{
if
x
,
ok
:=
m
.
GetUnion
().(*
Communique_TempC
);
ok
{
return
x
.
TempC
}
return
0
}
func
(
m
*
Communique
)
GetHeight
()
float32
{
if
x
,
ok
:=
m
.
GetUnion
().(*
Communique_Height
);
ok
{
return
x
.
Height
}
return
0
}
func
(
m
*
Communique
)
GetToday
()
Days
{
if
x
,
ok
:=
m
.
GetUnion
().(*
Communique_Today
);
ok
{
return
x
.
Today
}
return
Days_MONDAY
}
func
(
m
*
Communique
)
GetMaybe
()
bool
{
if
x
,
ok
:=
m
.
GetUnion
().(*
Communique_Maybe
);
ok
{
return
x
.
Maybe
}
return
false
}
func
(
m
*
Communique
)
GetDelta
()
int32
{
if
x
,
ok
:=
m
.
GetUnion
().(*
Communique_Delta_
);
ok
{
return
x
.
Delta
}
return
0
}
func
(
m
*
Communique
)
GetMsg
()
*
Reply
{
if
x
,
ok
:=
m
.
GetUnion
().(*
Communique_Msg
);
ok
{
return
x
.
Msg
}
return
nil
}
func
(
m
*
Communique
)
GetSomegroup
()
*
Communique_SomeGroup
{
if
x
,
ok
:=
m
.
GetUnion
().(*
Communique_Somegroup
);
ok
{
return
x
.
Somegroup
}
return
nil
}
//
XXX_OneofFuncs
is
for
the
internal
use
of
the
proto
package
.
func
(*
Communique
)
XXX_OneofFuncs
()
(
func
(
msg
proto
.
Message
,
b
*
proto
.
Buffer
)
error
,
func
(
msg
proto
.
Message
,
tag
,
wire
int
,
b
*
proto
.
Buffer
)
(
bool
,
error
),
[]
interface
{})
{
return
_Communique_OneofMarshaler
,
_Communique_OneofUnmarshaler
,
[]
interface
{}{
(*
Communique_Number
)(
nil
),
(*
Communique_Name
)(
nil
),
(*
Communique_Data
)(
nil
),
(*
Communique_TempC
)(
nil
),
(*
Communique_Height
)(
nil
),
(*
Communique_Today
)(
nil
),
(*
Communique_Maybe
)(
nil
),
(*
Communique_Delta_
)(
nil
),
(*
Communique_Msg
)(
nil
),
(*
Communique_Somegroup
)(
nil
),
}
}
func
_Communique_OneofMarshaler
(
msg
proto
.
Message
,
b
*
proto
.
Buffer
)
error
{
m
:=
msg
.(*
Communique
)
//
union
switch
x
:=
m
.
Union
.(
type
)
{
case
*
Communique_Number
:
_
=
b
.
EncodeVarint
(
5
<<
3
|
proto
.
WireVarint
)
_
=
b
.
EncodeVarint
(
uint64
(
x
.
Number
))
case
*
Communique_Name
:
_
=
b
.
EncodeVarint
(
6
<<
3
|
proto
.
WireBytes
)
_
=
b
.
EncodeStringBytes
(
x
.
Name
)
case
*
Communique_Data
:
_
=
b
.
EncodeVarint
(
7
<<
3
|
proto
.
WireBytes
)
_
=
b
.
EncodeRawBytes
(
x
.
Data
)
case
*
Communique_TempC
:
_
=
b
.
EncodeVarint
(
8
<<
3
|
proto
.
WireFixed64
)
_
=
b
.
EncodeFixed64
(
math
.
Float64bits
(
x
.
TempC
))
case
*
Communique_Height
:
_
=
b
.
EncodeVarint
(
9
<<
3
|
proto
.
WireFixed32
)
_
=
b
.
EncodeFixed32
(
uint64
(
math
.
Float32bits
(
x
.
Height
)))
case
*
Communique_Today
:
_
=
b
.
EncodeVarint
(
10
<<
3
|
proto
.
WireVarint
)
_
=
b
.
EncodeVarint
(
uint64
(
x
.
Today
))
case
*
Communique_Maybe
:
t
:=
uint64
(
0
)
if
x
.
Maybe
{
t
=
1
}
_
=
b
.
EncodeVarint
(
11
<<
3
|
proto
.
WireVarint
)
_
=
b
.
EncodeVarint
(
t
)
case
*
Communique_Delta_
:
_
=
b
.
EncodeVarint
(
12
<<
3
|
proto
.
WireVarint
)
_
=
b
.
EncodeZigzag32
(
uint64
(
x
.
Delta
))
case
*
Communique_Msg
:
_
=
b
.
EncodeVarint
(
13
<<
3
|
proto
.
WireBytes
)
if
err
:=
b
.
EncodeMessage
(
x
.
Msg
);
err
!= nil {
return
err
}
case
*
Communique_Somegroup
:
_
=
b
.
EncodeVarint
(
14
<<
3
|
proto
.
WireStartGroup
)
if
err
:=
b
.
Marshal
(
x
.
Somegroup
);
err
!= nil {
return
err
}
_
=
b
.
EncodeVarint
(
14
<<
3
|
proto
.
WireEndGroup
)
case
nil
:
default
:
return
fmt
.
Errorf
(
"Communique.Union has unexpected type %T"
,
x
)
}
return
nil
}
func
_Communique_OneofUnmarshaler
(
msg
proto
.
Message
,
tag
,
wire
int
,
b
*
proto
.
Buffer
)
(
bool
,
error
)
{
m
:=
msg
.(*
Communique
)
switch
tag
{
case
5
:
//
union
.
number
if
wire
!= proto.WireVarint {
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeVarint
()
m
.
Union
=
&
Communique_Number
{
int32
(
x
)}
return
true
,
err
case
6
:
//
union
.
name
if
wire
!= proto.WireBytes {
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeStringBytes
()
m
.
Union
=
&
Communique_Name
{
x
}
return
true
,
err
case
7
:
//
union
.
data
if
wire
!= proto.WireBytes {
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeRawBytes
(
true
)
m
.
Union
=
&
Communique_Data
{
x
}
return
true
,
err
case
8
:
//
union
.
temp_c
if
wire
!= proto.WireFixed64 {
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeFixed64
()
m
.
Union
=
&
Communique_TempC
{
math
.
Float64frombits
(
x
)}
return
true
,
err
case
9
:
//
union
.
height
if
wire
!= proto.WireFixed32 {
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeFixed32
()
m
.
Union
=
&
Communique_Height
{
math
.
Float32frombits
(
uint32
(
x
))}
return
true
,
err
case
10
:
//
union
.
today
if
wire
!= proto.WireVarint {
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeVarint
()
m
.
Union
=
&
Communique_Today
{
Days
(
x
)}
return
true
,
err
case
11
:
//
union
.
maybe
if
wire
!= proto.WireVarint {
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeVarint
()
m
.
Union
=
&
Communique_Maybe
{
x
!= 0}
return
true
,
err
case
12
:
//
union
.
delta
if
wire
!= proto.WireVarint {
return
true
,
proto
.
ErrInternalBadWireType
}
x
,
err
:=
b
.
DecodeZigzag32
()
m
.
Union
=
&
Communique_Delta_
{
int32
(
x
)}
return
true
,
err
case
13
:
//
union
.
msg
if
wire
!= proto.WireBytes {
return
true
,
proto
.
ErrInternalBadWireType
}
msg
:=
new
(
Reply
)
err
:=
b
.
DecodeMessage
(
msg
)
m
.
Union
=
&
Communique_Msg
{
msg
}
return
true
,
err
case
14
:
//
union
.
somegroup
if
wire
!= proto.WireStartGroup {
return
true
,
proto
.
ErrInternalBadWireType
}
msg
:=
new
(
Communique_SomeGroup
)
err
:=
b
.
DecodeGroup
(
msg
)
m
.
Union
=
&
Communique_Somegroup
{
msg
}
return
true
,
err
default
:
return
false
,
nil
}
}
type
Communique_SomeGroup
struct
{
Member
*
string
`
protobuf
:
"bytes,15,opt,name=member"
json
:
"member,omitempty"
`
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
Communique_SomeGroup
)
Reset
()
{
*
m
=
Communique_SomeGroup
{}
}
func
(
m
*
Communique_SomeGroup
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
Communique_SomeGroup
)
ProtoMessage
()
{}
func
(
m
*
Communique_SomeGroup
)
GetMember
()
string
{
if
m
!= nil && m.Member != nil {
return
*
m
.
Member
}
return
""
}
type
Communique_Delta
struct
{
XXX_unrecognized
[]
byte
`
json
:
"-"
`
}
func
(
m
*
Communique_Delta
)
Reset
()
{
*
m
=
Communique_Delta
{}
}
func
(
m
*
Communique_Delta
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(*
Communique_Delta
)
ProtoMessage
()
{}
var
E_Tag
=
&
proto
.
ExtensionDesc
{
ExtendedType
:
(*
Reply
)(
nil
),
ExtensionType
:
(*
string
)(
nil
),
Field
:
103
,
Name
:
"my.test.tag"
,
Tag
:
"bytes,103,opt,name=tag"
,
}
var
E_Donut
=
&
proto
.
ExtensionDesc
{
ExtendedType
:
(*
Reply
)(
nil
),
ExtensionType
:
(*
OtherReplyExtensions
)(
nil
),
Field
:
106
,
Name
:
"my.test.donut"
,
Tag
:
"bytes,106,opt,name=donut"
,
}
func
init
()
{
proto
.
RegisterEnum
(
"my.test.HatType"
,
HatType_name
,
HatType_value
)
proto
.
RegisterEnum
(
"my.test.Days"
,
Days_name
,
Days_value
)
proto
.
RegisterEnum
(
"my.test.Request_Color"
,
Request_Color_name
,
Request_Color_value
)
proto
.
RegisterEnum
(
"my.test.Reply_Entry_Game"
,
Reply_Entry_Game_name
,
Reply_Entry_Game_value
)
proto
.
RegisterExtension
(
E_ReplyExtensions_Time
)
proto
.
RegisterExtension
(
E_ReplyExtensions_Carrot
)
proto
.
RegisterExtension
(
E_ReplyExtensions_Donut
)
proto
.
RegisterExtension
(
E_Tag
)
proto
.
RegisterExtension
(
E_Donut
)
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/my_test/test.proto
0 → 100644
View file @
8f79df77
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax
=
"proto2"
;
// This package holds interesting messages.
package
my
.
test
;
// dotted package name
//import "imp.proto";
import
"multi/multi1.proto"
;
// unused import
enum
HatType
{
// deliberately skipping 0
FEDORA
=
1
;
FEZ
=
2
;
}
// This enum represents days of the week.
enum
Days
{
option
allow_alias
=
true
;
MONDAY
=
1
;
TUESDAY
=
2
;
LUNDI
=
1
;
// same value as MONDAY
}
// This is a message that might be sent somewhere.
message
Request
{
enum
Color
{
RED
=
0
;
GREEN
=
1
;
BLUE
=
2
;
}
repeated
int64
key
=
1
;
// optional imp.ImportedMessage imported_message = 2;
optional
Color
hue
=
3
;
// no default
optional
HatType
hat
=
4
[
default
=
FEDORA
];
// optional imp.ImportedMessage.Owner owner = 6;
optional
float
deadline
=
7
[
default
=
inf
];
optional
group
SomeGroup
=
8
{
optional
int32
group_field
=
9
;
}
// These foreign types are in imp2.proto,
// which is publicly imported by imp.proto.
// optional imp.PubliclyImportedMessage pub = 10;
// optional imp.PubliclyImportedEnum pub_enum = 13 [default=HAIR];
// This is a map field. It will generate map[int32]string.
map
<
int32
,
string
>
name_mapping
=
14
;
// This is a map field whose value type is a message.
map
<
sint64
,
Reply
>
msg_mapping
=
15
;
optional
int32
reset
=
12
;
// This field should not conflict with any getters.
optional
string
get_key
=
16
;
}
message
Reply
{
message
Entry
{
required
int64
key_that_needs_1234camel_CasIng
=
1
;
optional
int64
value
=
2
[
default
=
7
];
optional
int64
_my_field_name_2
=
3
;
enum
Game
{
FOOTBALL
=
1
;
TENNIS
=
2
;
}
}
repeated
Entry
found
=
1
;
repeated
int32
compact_keys
=
2
[
packed
=
true
];
extensions
100
to
max
;
}
message
OtherBase
{
optional
string
name
=
1
;
extensions
100
to
max
;
}
message
ReplyExtensions
{
extend
Reply
{
optional
double
time
=
101
;
optional
ReplyExtensions
carrot
=
105
;
}
extend
OtherBase
{
optional
ReplyExtensions
donut
=
101
;
}
}
message
OtherReplyExtensions
{
optional
int32
key
=
1
;
}
// top-level extension
extend
Reply
{
optional
string
tag
=
103
;
optional
OtherReplyExtensions
donut
=
106
;
// optional imp.ImportedMessage elephant = 107; // extend with message from another file.
}
message
OldReply
{
// Extensions will be encoded in MessageSet wire format.
option
message_set_wire_format
=
true
;
extensions
100
to
max
;
}
message
Communique
{
optional
bool
make_me_cry
=
1
;
// This is a oneof, called "union".
oneof
union
{
int32
number
=
5
;
string
name
=
6
;
bytes
data
=
7
;
double
temp_c
=
8
;
float
height
=
9
;
Days
today
=
10
;
bool
maybe
=
11
;
sint32
delta
=
12
;
// name will conflict with Delta below
Reply
msg
=
13
;
group
SomeGroup
=
14
{
optional
string
member
=
15
;
}
}
message
Delta
{}
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogo/testdata/proto3.proto
0 → 100644
View file @
8f79df77
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2014 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax
=
"proto3"
;
package
proto3
;
message
Request
{
enum
Flavour
{
SWEET
=
0
;
SOUR
=
1
;
UMAMI
=
2
;
GOPHERLICIOUS
=
3
;
}
string
name
=
1
;
repeated
int64
key
=
2
;
Flavour
taste
=
3
;
Book
book
=
4
;
}
message
Book
{
string
title
=
1
;
bytes
raw_data
=
2
;
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogofast/main.go
0 → 100644
View file @
8f79df77
// Extensions for Protocol Buffers to create more go like structures.
//
// Copyright (c) 2015, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf/gogoproto
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package
main
import
(
"QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/vanity"
"QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/vanity/command"
)
func
main
()
{
req
:=
command
.
Read
()
files
:=
req
.
GetProtoFile
()
files
=
vanity
.
FilterFiles
(
files
,
vanity
.
NotInPackageGoogleProtobuf
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnMarshalerAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnSizerAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnUnmarshalerAll
)
resp
:=
command
.
Generate
(
req
)
command
.
Write
(
resp
)
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogofaster/main.go
0 → 100644
View file @
8f79df77
// Extensions for Protocol Buffers to create more go like structures.
//
// Copyright (c) 2015, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf/gogoproto
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package
main
import
(
"QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/vanity"
"QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/vanity/command"
)
func
main
()
{
req
:=
command
.
Read
()
files
:=
req
.
GetProtoFile
()
files
=
vanity
.
FilterFiles
(
files
,
vanity
.
NotInPackageGoogleProtobuf
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnMarshalerAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnSizerAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnUnmarshalerAll
)
vanity
.
ForEachFieldInFilesExcludingExtensions
(
vanity
.
OnlyProto2
(
files
),
vanity
.
TurnOffNullableForNativeTypesWithoutDefaultsOnly
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOffGoUnrecognizedAll
)
resp
:=
command
.
Generate
(
req
)
command
.
Write
(
resp
)
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-gen-gogoslick/main.go
0 → 100644
View file @
8f79df77
// Extensions for Protocol Buffers to create more go like structures.
//
// Copyright (c) 2015, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf/gogoproto
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package
main
import
(
"QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/vanity"
"QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/vanity/command"
)
func
main
()
{
req
:=
command
.
Read
()
files
:=
req
.
GetProtoFile
()
files
=
vanity
.
FilterFiles
(
files
,
vanity
.
NotInPackageGoogleProtobuf
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnMarshalerAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnSizerAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnUnmarshalerAll
)
vanity
.
ForEachFieldInFilesExcludingExtensions
(
vanity
.
OnlyProto2
(
files
),
vanity
.
TurnOffNullableForNativeTypesWithoutDefaultsOnly
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOffGoUnrecognizedAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOffGoEnumPrefixAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOffGoEnumStringerAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnEnumStringerAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnEqualAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnGoStringAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOffGoStringerAll
)
vanity
.
ForEachFile
(
files
,
vanity
.
TurnOnStringerAll
)
resp
:=
command
.
Generate
(
req
)
command
.
Write
(
resp
)
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/protoc-min-version/minversion.go
0 → 100644
View file @
8f79df77
// Extensions for Protocol Buffers to create more go like structures.
//
// Copyright (c) 2013, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf/gogoproto
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package
main
import
(
"QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/version"
"fmt"
"os"
"os/exec"
"strings"
)
func
filter
(
ss
[]
string
,
flag
string
)
([]
string
,
string
)
{
s
:=
make
([]
string
,
0
,
len
(
ss
))
var
v
string
for
i
:=
range
ss
{
if
strings
.
Contains
(
ss
[
i
],
flag
)
{
vs
:=
strings
.
Split
(
ss
[
i
],
"="
)
v
=
vs
[
1
]
continue
}
s
=
append
(
s
,
ss
[
i
])
}
return
s
,
v
}
func
main
()
{
args
,
min
:=
filter
(
os
.
Args
[
1
:
],
"-version"
)
if
!
version
.
AtLeast
(
min
)
{
fmt
.
Printf
(
"protoc version not high enough to parse this proto file
\n
"
)
return
}
gen
:=
exec
.
Command
(
"protoc"
,
args
...
)
out
,
err
:=
gen
.
CombinedOutput
()
if
err
!=
nil
{
fmt
.
Printf
(
"%s
\n
"
,
string
(
out
))
panic
(
err
)
}
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/sortkeys/sortkeys.go
0 → 100644
View file @
8f79df77
// Copyright (c) 2013, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package
sortkeys
import
(
"sort"
)
func
Strings
(
l
[]
string
)
{
sort
.
Strings
(
l
)
}
func
Float64s
(
l
[]
float64
)
{
sort
.
Float64s
(
l
)
}
func
Float32s
(
l
[]
float32
)
{
sort
.
Sort
(
Float32Slice
(
l
))
}
func
Int64s
(
l
[]
int64
)
{
sort
.
Sort
(
Int64Slice
(
l
))
}
func
Int32s
(
l
[]
int32
)
{
sort
.
Sort
(
Int32Slice
(
l
))
}
func
Uint64s
(
l
[]
uint64
)
{
sort
.
Sort
(
Uint64Slice
(
l
))
}
func
Uint32s
(
l
[]
uint32
)
{
sort
.
Sort
(
Uint32Slice
(
l
))
}
func
Bools
(
l
[]
bool
)
{
sort
.
Sort
(
BoolSlice
(
l
))
}
type
BoolSlice
[]
bool
func
(
p
BoolSlice
)
Len
()
int
{
return
len
(
p
)
}
func
(
p
BoolSlice
)
Less
(
i
,
j
int
)
bool
{
return
p
[
j
]
}
func
(
p
BoolSlice
)
Swap
(
i
,
j
int
)
{
p
[
i
],
p
[
j
]
=
p
[
j
],
p
[
i
]
}
type
Int64Slice
[]
int64
func
(
p
Int64Slice
)
Len
()
int
{
return
len
(
p
)
}
func
(
p
Int64Slice
)
Less
(
i
,
j
int
)
bool
{
return
p
[
i
]
<
p
[
j
]
}
func
(
p
Int64Slice
)
Swap
(
i
,
j
int
)
{
p
[
i
],
p
[
j
]
=
p
[
j
],
p
[
i
]
}
type
Int32Slice
[]
int32
func
(
p
Int32Slice
)
Len
()
int
{
return
len
(
p
)
}
func
(
p
Int32Slice
)
Less
(
i
,
j
int
)
bool
{
return
p
[
i
]
<
p
[
j
]
}
func
(
p
Int32Slice
)
Swap
(
i
,
j
int
)
{
p
[
i
],
p
[
j
]
=
p
[
j
],
p
[
i
]
}
type
Uint64Slice
[]
uint64
func
(
p
Uint64Slice
)
Len
()
int
{
return
len
(
p
)
}
func
(
p
Uint64Slice
)
Less
(
i
,
j
int
)
bool
{
return
p
[
i
]
<
p
[
j
]
}
func
(
p
Uint64Slice
)
Swap
(
i
,
j
int
)
{
p
[
i
],
p
[
j
]
=
p
[
j
],
p
[
i
]
}
type
Uint32Slice
[]
uint32
func
(
p
Uint32Slice
)
Len
()
int
{
return
len
(
p
)
}
func
(
p
Uint32Slice
)
Less
(
i
,
j
int
)
bool
{
return
p
[
i
]
<
p
[
j
]
}
func
(
p
Uint32Slice
)
Swap
(
i
,
j
int
)
{
p
[
i
],
p
[
j
]
=
p
[
j
],
p
[
i
]
}
type
Float32Slice
[]
float32
func
(
p
Float32Slice
)
Len
()
int
{
return
len
(
p
)
}
func
(
p
Float32Slice
)
Less
(
i
,
j
int
)
bool
{
return
p
[
i
]
<
p
[
j
]
}
func
(
p
Float32Slice
)
Swap
(
i
,
j
int
)
{
p
[
i
],
p
[
j
]
=
p
[
j
],
p
[
i
]
}
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/test/.gitignore
0 → 100644
View file @
8f79df77
*.dat
vendor/QmfH4HuZyN1p2wQLWWkXC91Z76435xKrBVfLQ2MY8ayG5R/gogo-protobuf/test/Makefile
0 → 100644
View file @
8f79df77
# Extensions for Protocol Buffers to create more go like structures.
#
# Copyright (c) 2013, Vastech SA (PTY) LTD. All rights reserved.
# http://github.com/gogo/protobuf/gogoproto
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
regenerate
:
go
install
github.com/gogo/protobuf/protoc-gen-combo
protoc
--gogo_out
=
.
--proto_path
=
../:../../../../:../protobuf/:. thetest.proto
protoc-gen-combo
--default
=
false
--proto_path
=
../:../../../../:../protobuf/:. thetest.proto
cp
uuid.go ./combos/both/
cp
uuid.go ./combos/marshaler/
cp
uuid.go ./combos/unmarshaler/
cp
uuid.go ./combos/unsafeboth/
cp
uuid.go ./combos/unsafemarshaler/
cp
uuid.go ./combos/unsafeunmarshaler/
cp
bug_test.go ./combos/both/
cp
bug_test.go ./combos/marshaler/
cp
bug_test.go ./combos/unmarshaler/
cp
bug_test.go ./combos/unsafeboth/
cp
bug_test.go ./combos/unsafemarshaler/
cp
bug_test.go ./combos/unsafeunmarshaler/
Prev
1
…
3
4
5
6
7
8
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment