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