-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.go
137 lines (110 loc) · 4.23 KB
/
notes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package main
/*
Notes of the types a proto plugin will give me
// An encoded CodeGeneratorRequest is written to the plugin's stdin.
type CodeGeneratorRequest struct {
// The .proto files that were explicitly listed on the command-line. The
// code generator should generate code only for these files. Each file's
// descriptor will be included in proto_file, below.
FileToGenerate []string
// The generator parameter passed on the command-line.
Parameter *string
ProtoFile []*google_protobuf.FileDescriptorProto
// The version number of protocol compiler.
CompilerVersion *Version
}
type FileDescriptorProto struct {
Name *string
Package *string
// Names of files imported by this file.
Dependency []string
// Indexes of the public imported files in the dependency list above.
PublicDependency []int32
// All top-level definitions in this file.
MessageType []*DescriptorProto
EnumType []*EnumDescriptorProto
Service []*ServiceDescriptorProto
Extension []*FieldDescriptorProto
Options *FileOptions
// This field contains optional information about the original source code.
// You may safely remove this entire field without harming runtime
// functionality of the descriptors -- the information is needed only by
// development tools.
SourceCodeInfo *SourceCodeInfo
// The syntax of the proto file.
// The supported values are "proto2" and "proto3".
Syntax *string
}
// describes a message type
type DescriptorProto struct {
Name *string
Field []*FieldDescriptorProto
Extension []*FieldDescriptorProto
NestedType []*DescriptorProto
EnumType []*EnumDescriptorProto
ExtensionRange []*DescriptorProto_ExtensionRange
OneofDecl []*OneofDescriptorProto
Options *MessageOptions
ReservedRange []*DescriptorProto_ReservedRange
// Reserved field names, which may not be used by fields in the same message.
// A given name may only be reserved once.
ReservedName []string
}
// Describes a field within a message.
type FieldDescriptorProto struct {
Name *string
Number *int32
Label *FieldDescriptorProto_Label
// If type_name is set, this need not be set. If both this and type_name
// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
Type *FieldDescriptorProto_Type
// For message and enum types, this is the name of the type. If the name
// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
// rules are used to find the type (i.e. first the nested types within this
// message are searched, then within the parent, on up to the root
// namespace).
TypeName *string
// For extensions, this is the name of the type being extended. It is
// resolved in the same manner as type_name.
Extendee *string
// For numeric types, contains the original text representation of the value.
// For booleans, "true" or "false".
// For strings, contains the default text contents (not escaped in any way).
// For bytes, contains the C escaped value. All bytes >= 128 are escaped
DefaultValue *string
// If set, gives the index of a oneof in the containing type's oneof_decl
// list. This field is a member of that oneof.
OneofIndex *int32
// JSON name of this field. The value is set by protocol compiler. If the
// user has set a "json_name" option on this field, that option's value
// will be used. Otherwise, it's deduced from the field's name by converting
// it to camelCase.
JsonName *string
Options *FieldOptions
}
// Describes a service.
type ServiceDescriptorProto struct {
Name *string
Method []*MethodDescriptorProto
Options *ServiceOptions
}
// Describes a method of a service.
type MethodDescriptorProto struct {
Name *string
// Input and output type names. These are resolved in the same way as
// FieldDescriptorProto.type_name, but must refer to a message type.
InputType *string
OutputType *string
Options *MethodOptions
// Identifies if client streams multiple client messages
ClientStreaming *bool
// Identifies if server streams multiple server messages
ServerStreaming *bool
}
// Describes an enum type.
type EnumDescriptorProto struct {
Name *string
Value []*EnumValueDescriptorProto
Options *EnumOptions
}
*/