blob: fc8fd566b7008df4a85783970599ea313d5e0437 [file] [log] [blame]
David Symondsafbae882012-09-24 13:21:21 +10001// Code generated by protoc-gen-go.
2// source: google/protobuf/compiler/plugin.proto
Rob Pikeaaa3a622010-03-20 22:32:34 -07003// DO NOT EDIT!
4
David Symonds7d640de2014-01-13 16:01:41 +11005/*
6Package google_protobuf_compiler is a generated protocol buffer package.
7
8It is generated from these files:
9 google/protobuf/compiler/plugin.proto
10
11It has these top-level messages:
12 CodeGeneratorRequest
13 CodeGeneratorResponse
14*/
Rob Pikeaaa3a622010-03-20 22:32:34 -070015package google_protobuf_compiler
16
Rob Pike3f6f2d82011-12-18 13:55:35 -080017import proto "code.google.com/p/goprotobuf/proto"
David Symondsafbae882012-09-24 13:21:21 +100018import math "math"
Rob Pikeb7907bf2012-02-13 14:25:20 +110019import google_protobuf "code.google.com/p/goprotobuf/protoc-gen-go/descriptor"
Rob Pikeaaa3a622010-03-20 22:32:34 -070020
David Symondsf530f252014-04-14 09:53:00 +100021// Reference imports to suppress errors if they are not otherwise used.
David Symonds62539862012-08-04 10:06:55 +100022var _ = proto.Marshal
David Symondsfa6a18d2011-01-19 09:30:28 +110023var _ = math.Inf
David Symonds8935abf2011-07-04 15:53:16 +100024
David Symonds52925902013-07-26 19:20:20 +100025// An encoded CodeGeneratorRequest is written to the plugin's stdin.
Rob Pikeaaa3a622010-03-20 22:32:34 -070026type CodeGeneratorRequest struct {
David Symonds52925902013-07-26 19:20:20 +100027 // The .proto files that were explicitly listed on the command-line. The
28 // code generator should generate code only for these files. Each file's
29 // descriptor will be included in proto_file, below.
30 FileToGenerate []string `protobuf:"bytes,1,rep,name=file_to_generate" json:"file_to_generate,omitempty"`
31 // The generator parameter passed on the command-line.
32 Parameter *string `protobuf:"bytes,2,opt,name=parameter" json:"parameter,omitempty"`
33 // FileDescriptorProtos for all files in files_to_generate and everything
34 // they import. The files will appear in topological order, so each file
35 // appears before any file that imports it.
36 //
37 // protoc guarantees that all proto_files will be written after
38 // the fields above, even though this is not technically guaranteed by the
39 // protobuf wire format. This theoretically could allow a plugin to stream
40 // in the FileDescriptorProtos and handle them one by one rather than read
41 // the entire set into memory at once. However, as of this writing, this
42 // is not similarly optimized on protoc's end -- it will store all fields in
43 // memory at once before sending them to the plugin.
David Symonds8bb32ca2012-06-28 10:22:09 -070044 ProtoFile []*google_protobuf.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file" json:"proto_file,omitempty"`
45 XXX_unrecognized []byte `json:"-"`
Rob Pikeaaa3a622010-03-20 22:32:34 -070046}
David Symonds8935abf2011-07-04 15:53:16 +100047
David Symonds22e7eb42013-03-23 12:17:58 +110048func (m *CodeGeneratorRequest) Reset() { *m = CodeGeneratorRequest{} }
49func (m *CodeGeneratorRequest) String() string { return proto.CompactTextString(m) }
50func (*CodeGeneratorRequest) ProtoMessage() {}
Rob Pikeaaa3a622010-03-20 22:32:34 -070051
David Symonds22e7eb42013-03-23 12:17:58 +110052func (m *CodeGeneratorRequest) GetFileToGenerate() []string {
53 if m != nil {
54 return m.FileToGenerate
55 }
56 return nil
57}
58
59func (m *CodeGeneratorRequest) GetParameter() string {
60 if m != nil && m.Parameter != nil {
61 return *m.Parameter
David Symonds8bb32ca2012-06-28 10:22:09 -070062 }
63 return ""
64}
65
David Symonds22e7eb42013-03-23 12:17:58 +110066func (m *CodeGeneratorRequest) GetProtoFile() []*google_protobuf.FileDescriptorProto {
67 if m != nil {
68 return m.ProtoFile
69 }
70 return nil
71}
72
David Symonds52925902013-07-26 19:20:20 +100073// The plugin writes an encoded CodeGeneratorResponse to stdout.
Rob Pikeaaa3a622010-03-20 22:32:34 -070074type CodeGeneratorResponse struct {
David Symonds52925902013-07-26 19:20:20 +100075 // Error message. If non-empty, code generation failed. The plugin process
76 // should exit with status code zero even if it reports an error in this way.
77 //
78 // This should be used to indicate errors in .proto files which prevent the
79 // code generator from generating correct code. Errors which indicate a
80 // problem in protoc itself -- such as the input CodeGeneratorRequest being
81 // unparseable -- should be reported by writing a message to stderr and
82 // exiting with a non-zero status code.
David Symonds8bb32ca2012-06-28 10:22:09 -070083 Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
84 File []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"`
85 XXX_unrecognized []byte `json:"-"`
Rob Pikeaaa3a622010-03-20 22:32:34 -070086}
Rob Pikeaaa3a622010-03-20 22:32:34 -070087
David Symonds22e7eb42013-03-23 12:17:58 +110088func (m *CodeGeneratorResponse) Reset() { *m = CodeGeneratorResponse{} }
89func (m *CodeGeneratorResponse) String() string { return proto.CompactTextString(m) }
90func (*CodeGeneratorResponse) ProtoMessage() {}
David Symonds8935abf2011-07-04 15:53:16 +100091
David Symonds22e7eb42013-03-23 12:17:58 +110092func (m *CodeGeneratorResponse) GetError() string {
93 if m != nil && m.Error != nil {
94 return *m.Error
David Symonds8bb32ca2012-06-28 10:22:09 -070095 }
96 return ""
97}
98
David Symonds22e7eb42013-03-23 12:17:58 +110099func (m *CodeGeneratorResponse) GetFile() []*CodeGeneratorResponse_File {
100 if m != nil {
101 return m.File
102 }
103 return nil
104}
105
David Symonds52925902013-07-26 19:20:20 +1000106// Represents a single generated file.
Rob Pikeaaa3a622010-03-20 22:32:34 -0700107type CodeGeneratorResponse_File struct {
David Symonds52925902013-07-26 19:20:20 +1000108 // The file name, relative to the output directory. The name must not
109 // contain "." or ".." components and must be relative, not be absolute (so,
110 // the file cannot lie outside the output directory). "/" must be used as
111 // the path separator, not "\".
112 //
113 // If the name is omitted, the content will be appended to the previous
114 // file. This allows the generator to break large files into small chunks,
115 // and allows the generated text to be streamed back to protoc so that large
116 // files need not reside completely in memory at one time. Note that as of
117 // this writing protoc does not optimize for this -- it will read the entire
118 // CodeGeneratorResponse before writing files to disk.
119 Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
120 // If non-empty, indicates that the named file should already exist, and the
121 // content here is to be inserted into that file at a defined insertion
122 // point. This feature allows a code generator to extend the output
123 // produced by another code generator. The original generator may provide
124 // insertion points by placing special annotations in the file that look
125 // like:
126 // @@protoc_insertion_point(NAME)
127 // The annotation can have arbitrary text before and after it on the line,
128 // which allows it to be placed in a comment. NAME should be replaced with
129 // an identifier naming the point -- this is what other generators will use
130 // as the insertion_point. Code inserted at this point will be placed
131 // immediately above the line containing the insertion point (thus multiple
132 // insertions to the same point will come out in the order they were added).
133 // The double-@ is intended to make it unlikely that the generated code
134 // could contain things that look like insertion points by accident.
135 //
136 // For example, the C++ code generator places the following line in the
137 // .pb.h files that it generates:
138 // // @@protoc_insertion_point(namespace_scope)
139 // This line appears within the scope of the file's package namespace, but
140 // outside of any particular class. Another plugin can then specify the
141 // insertion_point "namespace_scope" to generate additional classes or
142 // other declarations that should be placed in this scope.
143 //
144 // Note that if the line containing the insertion point begins with
145 // whitespace, the same whitespace will be added to every line of the
146 // inserted text. This is useful for languages like Python, where
147 // indentation matters. In these languages, the insertion point comment
148 // should be indented the same amount as any inserted code will need to be
149 // in order to work correctly in that context.
150 //
151 // The code generator that generates the initial file and the one which
152 // inserts into it must both run as part of a single invocation of protoc.
153 // Code generators are executed in the order in which they appear on the
154 // command line.
155 //
156 // If |insertion_point| is present, |name| must also be present.
157 InsertionPoint *string `protobuf:"bytes,2,opt,name=insertion_point" json:"insertion_point,omitempty"`
158 // The file contents.
David Symonds8bb32ca2012-06-28 10:22:09 -0700159 Content *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"`
160 XXX_unrecognized []byte `json:"-"`
Rob Pikeaaa3a622010-03-20 22:32:34 -0700161}
David Symonds8935abf2011-07-04 15:53:16 +1000162
David Symonds22e7eb42013-03-23 12:17:58 +1100163func (m *CodeGeneratorResponse_File) Reset() { *m = CodeGeneratorResponse_File{} }
164func (m *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(m) }
165func (*CodeGeneratorResponse_File) ProtoMessage() {}
Rob Pikeaaa3a622010-03-20 22:32:34 -0700166
David Symonds22e7eb42013-03-23 12:17:58 +1100167func (m *CodeGeneratorResponse_File) GetName() string {
168 if m != nil && m.Name != nil {
169 return *m.Name
David Symonds8bb32ca2012-06-28 10:22:09 -0700170 }
171 return ""
172}
173
David Symonds22e7eb42013-03-23 12:17:58 +1100174func (m *CodeGeneratorResponse_File) GetInsertionPoint() string {
175 if m != nil && m.InsertionPoint != nil {
176 return *m.InsertionPoint
David Symonds8bb32ca2012-06-28 10:22:09 -0700177 }
178 return ""
179}
180
David Symonds22e7eb42013-03-23 12:17:58 +1100181func (m *CodeGeneratorResponse_File) GetContent() string {
182 if m != nil && m.Content != nil {
183 return *m.Content
David Symonds8bb32ca2012-06-28 10:22:09 -0700184 }
185 return ""
186}
187
Rob Pikeaaa3a622010-03-20 22:32:34 -0700188func init() {
189}