plugin.pb.go 7.9 KB

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