plugin.pb.go 7.7 KB

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