@@ -145,8 +145,46 @@ impl<'a> OutputFile<'a> {
145
145
Language :: Golang => {
146
146
// All packages are already published
147
147
148
+ let output_dir = output_dir. join ( "internal" ) ;
149
+
150
+ let ( output_dir, config) = match self . output_file {
151
+ "db_response" => {
152
+ let config = serde_generate:: CodeGeneratorConfig :: new (
153
+ "internal_db_response" . to_string ( ) ,
154
+ )
155
+ . with_encodings ( vec ! [ serde_generate:: Encoding :: Bincode ] ) ;
156
+ ( output_dir. join ( "db_response" ) , config)
157
+ }
158
+ "db_query" => {
159
+ let config = serde_generate:: CodeGeneratorConfig :: new (
160
+ "internal_db_query" . to_string ( ) ,
161
+ )
162
+ . with_encodings ( vec ! [ serde_generate:: Encoding :: Bincode ] ) ;
163
+ ( output_dir. join ( "db_query" ) , config)
164
+ }
165
+ "ai_response" => {
166
+ let config = serde_generate:: CodeGeneratorConfig :: new (
167
+ "internal_ai_response" . to_string ( ) ,
168
+ )
169
+ . with_encodings ( vec ! [ serde_generate:: Encoding :: Bincode ] ) ;
170
+ ( output_dir. join ( "ai_response" ) , config)
171
+ }
172
+ "ai_query" => {
173
+ let config = serde_generate:: CodeGeneratorConfig :: new (
174
+ "internal_ai_query" . to_string ( ) ,
175
+ )
176
+ . with_encodings ( vec ! [ serde_generate:: Encoding :: Bincode ] ) ;
177
+ ( output_dir. join ( "ai_query" ) , config)
178
+ }
179
+ _ => panic ! ( "Incorrect query type" ) ,
180
+ } ;
181
+ // create all and ignore the errors if they exists
182
+ let _ = std:: fs:: create_dir_all ( & output_dir) ;
183
+
184
+ // shadow default output_file
185
+ let output_file = output_dir. join ( format ! ( "{}.{extension}" , self . output_file) ) ;
148
186
let mut buffer = self . get_output_buffer ( output_file) ;
149
- serde_generate:: golang:: CodeGenerator :: new ( config) . output ( & mut buffer, registry)
187
+ serde_generate:: golang:: CodeGenerator :: new ( & config) . output ( & mut buffer, registry)
150
188
}
151
189
Language :: Typescript => {
152
190
let mut buffer = self . get_output_buffer ( output_file) ;
0 commit comments