blob: 52bff88487962bade19ad48ac2db309b1718554e [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
David Symonds558f13f2014-11-24 10:28:53 +110017import proto "github.com/golang/protobuf/proto"
David Symonds59b73b32015-08-24 13:22:02 +100018import fmt "fmt"
David Symondsafbae882012-09-24 13:21:21 +100019import math "math"
David Symonds558f13f2014-11-24 10:28:53 +110020import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
Rob Pikeaaa3a622010-03-20 22:32:34 -070021
David Symondsf530f252014-04-14 09:53:00 +100022// Reference imports to suppress errors if they are not otherwise used.
David Symonds62539862012-08-04 10:06:55 +100023var _ = proto.Marshal
David Symonds59b73b32015-08-24 13:22:02 +100024var _ = fmt.Errorf
David Symondsfa6a18d2011-01-19 09:30:28 +110025var _ = math.Inf
David Symonds8935abf2011-07-04 15:53:16 +100026
David Symonds52925902013-07-26 19:20:20 +100027// An encoded CodeGeneratorRequest is written to the plugin's stdin.
Rob Pikeaaa3a622010-03-20 22:32:34 -070028type CodeGeneratorRequest struct {
David Symonds52925902013-07-26 19:20:20 +100029 // 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 Symonds8bb32ca2012-06-28 10:22:09 -070046 ProtoFile []*google_protobuf.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file" json:"proto_file,omitempty"`
47 XXX_unrecognized []byte `json:"-"`
Rob Pikeaaa3a622010-03-20 22:32:34 -070048}
David Symonds8935abf2011-07-04 15:53:16 +100049
David Symonds22e7eb42013-03-23 12:17:58 +110050func (m *CodeGeneratorRequest) Reset() { *m = CodeGeneratorRequest{} }
51func (m *CodeGeneratorRequest) String() string { return proto.CompactTextString(m) }
52func (*CodeGeneratorRequest) ProtoMessage() {}
Rob Pikeaaa3a622010-03-20 22:32:34 -070053
David Symonds22e7eb42013-03-23 12:17:58 +110054func (m *CodeGeneratorRequest) GetFileToGenerate() []string {
55 if m != nil {
56 return m.FileToGenerate
57 }
58 return nil
59}
60
61func (m *CodeGeneratorRequest) GetParameter() string {
62 if m != nil && m.Parameter != nil {
63 return *m.Parameter
David Symonds8bb32ca2012-06-28 10:22:09 -070064 }
65 return ""
66}
67
David Symonds22e7eb42013-03-23 12:17:58 +110068func (m *CodeGeneratorRequest) GetProtoFile() []*google_protobuf.FileDescriptorProto {
69 if m != nil {
70 return m.ProtoFile
71 }
72 return nil
73}
74
David Symonds52925902013-07-26 19:20:20 +100075// The plugin writes an encoded CodeGeneratorResponse to stdout.
Rob Pikeaaa3a622010-03-20 22:32:34 -070076type CodeGeneratorResponse struct {
David Symonds52925902013-07-26 19:20:20 +100077 // 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 Symonds8bb32ca2012-06-28 10:22:09 -070085 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 Pikeaaa3a622010-03-20 22:32:34 -070088}
Rob Pikeaaa3a622010-03-20 22:32:34 -070089
David Symonds22e7eb42013-03-23 12:17:58 +110090func (m *CodeGeneratorResponse) Reset() { *m = CodeGeneratorResponse{} }
91func (m *CodeGeneratorResponse) String() string { return proto.CompactTextString(m) }
92func (*CodeGeneratorResponse) ProtoMessage() {}
David Symonds8935abf2011-07-04 15:53:16 +100093
David Symonds22e7eb42013-03-23 12:17:58 +110094func (m *CodeGeneratorResponse) GetError() string {
95 if m != nil && m.Error != nil {
96 return *m.Error
David Symonds8bb32ca2012-06-28 10:22:09 -070097 }
98 return ""
99}
100
David Symonds22e7eb42013-03-23 12:17:58 +1100101func (m *CodeGeneratorResponse) GetFile() []*CodeGeneratorResponse_File {
102 if m != nil {
103 return m.File
104 }
105 return nil
106}
107
David Symonds52925902013-07-26 19:20:20 +1000108// Represents a single generated file.
Rob Pikeaaa3a622010-03-20 22:32:34 -0700109type CodeGeneratorResponse_File struct {
David Symonds52925902013-07-26 19:20:20 +1000110 // 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 Symonds8bb32ca2012-06-28 10:22:09 -0700161 Content *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"`
162 XXX_unrecognized []byte `json:"-"`
Rob Pikeaaa3a622010-03-20 22:32:34 -0700163}
David Symonds8935abf2011-07-04 15:53:16 +1000164
David Symonds22e7eb42013-03-23 12:17:58 +1100165func (m *CodeGeneratorResponse_File) Reset() { *m = CodeGeneratorResponse_File{} }
166func (m *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(m) }
167func (*CodeGeneratorResponse_File) ProtoMessage() {}
Rob Pikeaaa3a622010-03-20 22:32:34 -0700168
David Symonds22e7eb42013-03-23 12:17:58 +1100169func (m *CodeGeneratorResponse_File) GetName() string {
170 if m != nil && m.Name != nil {
171 return *m.Name
David Symonds8bb32ca2012-06-28 10:22:09 -0700172 }
173 return ""
174}
175
David Symonds22e7eb42013-03-23 12:17:58 +1100176func (m *CodeGeneratorResponse_File) GetInsertionPoint() string {
177 if m != nil && m.InsertionPoint != nil {
178 return *m.InsertionPoint
David Symonds8bb32ca2012-06-28 10:22:09 -0700179 }
180 return ""
181}
182
David Symonds22e7eb42013-03-23 12:17:58 +1100183func (m *CodeGeneratorResponse_File) GetContent() string {
184 if m != nil && m.Content != nil {
185 return *m.Content
David Symonds8bb32ca2012-06-28 10:22:09 -0700186 }
187 return ""
188}