plugin.pb.go 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. // Code generated by protoc-gen-go.
  2. // source: google/protobuf/compiler/plugin.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package google_protobuf_compiler is a generated protocol buffer package.
  6. It is generated from these files:
  7. google/protobuf/compiler/plugin.proto
  8. It has these top-level messages:
  9. CodeGeneratorRequest
  10. CodeGeneratorResponse
  11. */
  12. package google_protobuf_compiler
  13. import proto "github.com/golang/protobuf/proto"
  14. import math "math"
  15. import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
  16. // Reference imports to suppress errors if they are not otherwise used.
  17. var _ = proto.Marshal
  18. var _ = math.Inf
  19. // An encoded CodeGeneratorRequest is written to the plugin's stdin.
  20. type CodeGeneratorRequest struct {
  21. // The .proto files that were explicitly listed on the command-line. The
  22. // code generator should generate code only for these files. Each file's
  23. // descriptor will be included in proto_file, below.
  24. FileToGenerate []string `protobuf:"bytes,1,rep,name=file_to_generate" json:"file_to_generate,omitempty"`
  25. // The generator parameter passed on the command-line.
  26. Parameter *string `protobuf:"bytes,2,opt,name=parameter" json:"parameter,omitempty"`
  27. // FileDescriptorProtos for all files in files_to_generate and everything
  28. // they import. The files will appear in topological order, so each file
  29. // appears before any file that imports it.
  30. //
  31. // protoc guarantees that all proto_files will be written after
  32. // the fields above, even though this is not technically guaranteed by the
  33. // protobuf wire format. This theoretically could allow a plugin to stream
  34. // in the FileDescriptorProtos and handle them one by one rather than read
  35. // the entire set into memory at once. However, as of this writing, this
  36. // is not similarly optimized on protoc's end -- it will store all fields in
  37. // memory at once before sending them to the plugin.
  38. ProtoFile []*google_protobuf.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file" json:"proto_file,omitempty"`
  39. XXX_unrecognized []byte `json:"-"`
  40. }
  41. func (m *CodeGeneratorRequest) Reset() { *m = CodeGeneratorRequest{} }
  42. func (m *CodeGeneratorRequest) String() string { return proto.CompactTextString(m) }
  43. func (*CodeGeneratorRequest) ProtoMessage() {}
  44. func (m *CodeGeneratorRequest) GetFileToGenerate() []string {
  45. if m != nil {
  46. return m.FileToGenerate
  47. }
  48. return nil
  49. }
  50. func (m *CodeGeneratorRequest) GetParameter() string {
  51. if m != nil && m.Parameter != nil {
  52. return *m.Parameter
  53. }
  54. return ""
  55. }
  56. func (m *CodeGeneratorRequest) GetProtoFile() []*google_protobuf.FileDescriptorProto {
  57. if m != nil {
  58. return m.ProtoFile
  59. }
  60. return nil
  61. }
  62. // The plugin writes an encoded CodeGeneratorResponse to stdout.
  63. type CodeGeneratorResponse struct {
  64. // Error message. If non-empty, code generation failed. The plugin process
  65. // should exit with status code zero even if it reports an error in this way.
  66. //
  67. // This should be used to indicate errors in .proto files which prevent the
  68. // code generator from generating correct code. Errors which indicate a
  69. // problem in protoc itself -- such as the input CodeGeneratorRequest being
  70. // unparseable -- should be reported by writing a message to stderr and
  71. // exiting with a non-zero status code.
  72. Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
  73. File []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"`
  74. XXX_unrecognized []byte `json:"-"`
  75. }
  76. func (m *CodeGeneratorResponse) Reset() { *m = CodeGeneratorResponse{} }
  77. func (m *CodeGeneratorResponse) String() string { return proto.CompactTextString(m) }
  78. func (*CodeGeneratorResponse) ProtoMessage() {}
  79. func (m *CodeGeneratorResponse) GetError() string {
  80. if m != nil && m.Error != nil {
  81. return *m.Error
  82. }
  83. return ""
  84. }
  85. func (m *CodeGeneratorResponse) GetFile() []*CodeGeneratorResponse_File {
  86. if m != nil {
  87. return m.File
  88. }
  89. return nil
  90. }
  91. // Represents a single generated file.
  92. type CodeGeneratorResponse_File struct {
  93. // The file name, relative to the output directory. The name must not
  94. // contain "." or ".." components and must be relative, not be absolute (so,
  95. // the file cannot lie outside the output directory). "/" must be used as
  96. // the path separator, not "\".
  97. //
  98. // If the name is omitted, the content will be appended to the previous
  99. // file. This allows the generator to break large files into small chunks,
  100. // and allows the generated text to be streamed back to protoc so that large
  101. // files need not reside completely in memory at one time. Note that as of
  102. // this writing protoc does not optimize for this -- it will read the entire
  103. // CodeGeneratorResponse before writing files to disk.
  104. Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
  105. // If non-empty, indicates that the named file should already exist, and the
  106. // content here is to be inserted into that file at a defined insertion
  107. // point. This feature allows a code generator to extend the output
  108. // produced by another code generator. The original generator may provide
  109. // insertion points by placing special annotations in the file that look
  110. // like:
  111. // @@protoc_insertion_point(NAME)
  112. // The annotation can have arbitrary text before and after it on the line,
  113. // which allows it to be placed in a comment. NAME should be replaced with
  114. // an identifier naming the point -- this is what other generators will use
  115. // as the insertion_point. Code inserted at this point will be placed
  116. // immediately above the line containing the insertion point (thus multiple
  117. // insertions to the same point will come out in the order they were added).
  118. // The double-@ is intended to make it unlikely that the generated code
  119. // could contain things that look like insertion points by accident.
  120. //
  121. // For example, the C++ code generator places the following line in the
  122. // .pb.h files that it generates:
  123. // // @@protoc_insertion_point(namespace_scope)
  124. // This line appears within the scope of the file's package namespace, but
  125. // outside of any particular class. Another plugin can then specify the
  126. // insertion_point "namespace_scope" to generate additional classes or
  127. // other declarations that should be placed in this scope.
  128. //
  129. // Note that if the line containing the insertion point begins with
  130. // whitespace, the same whitespace will be added to every line of the
  131. // inserted text. This is useful for languages like Python, where
  132. // indentation matters. In these languages, the insertion point comment
  133. // should be indented the same amount as any inserted code will need to be
  134. // in order to work correctly in that context.
  135. //
  136. // The code generator that generates the initial file and the one which
  137. // inserts into it must both run as part of a single invocation of protoc.
  138. // Code generators are executed in the order in which they appear on the
  139. // command line.
  140. //
  141. // If |insertion_point| is present, |name| must also be present.
  142. InsertionPoint *string `protobuf:"bytes,2,opt,name=insertion_point" json:"insertion_point,omitempty"`
  143. // The file contents.
  144. Content *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"`
  145. XXX_unrecognized []byte `json:"-"`
  146. }
  147. func (m *CodeGeneratorResponse_File) Reset() { *m = CodeGeneratorResponse_File{} }
  148. func (m *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(m) }
  149. func (*CodeGeneratorResponse_File) ProtoMessage() {}
  150. func (m *CodeGeneratorResponse_File) GetName() string {
  151. if m != nil && m.Name != nil {
  152. return *m.Name
  153. }
  154. return ""
  155. }
  156. func (m *CodeGeneratorResponse_File) GetInsertionPoint() string {
  157. if m != nil && m.InsertionPoint != nil {
  158. return *m.InsertionPoint
  159. }
  160. return ""
  161. }
  162. func (m *CodeGeneratorResponse_File) GetContent() string {
  163. if m != nil && m.Content != nil {
  164. return *m.Content
  165. }
  166. return ""
  167. }
  168. func init() {
  169. }