Improve imports support (imports lookup)
* Add `--single-package-mode option`
    * Add `getMessageType` helper
    * Add `getProtoFile` helper
    * Add `examples/single-package-mode` example
			
			
This commit is contained in:
		
							
								
								
									
										12
									
								
								examples/single-package-mode/proto/aaa/aaa.proto
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								examples/single-package-mode/proto/aaa/aaa.proto
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| syntax = "proto3"; | ||||
|  | ||||
| option go_package = "github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/aaa"; | ||||
|  | ||||
| package the.aaa.package; | ||||
|  | ||||
| message AaaRequest { | ||||
|   string blah = 1; | ||||
| } | ||||
| message AaaReply { | ||||
|   string error = 1; | ||||
| } | ||||
							
								
								
									
										19
									
								
								examples/single-package-mode/proto/bbb/bbb.proto
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								examples/single-package-mode/proto/bbb/bbb.proto
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| syntax = "proto3"; | ||||
|  | ||||
| package the.bbb.package; | ||||
|  | ||||
| option go_package = "github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/bbb"; | ||||
|  | ||||
| import "aaa/aaa.proto"; | ||||
|  | ||||
| service BbbService { | ||||
|   rpc Aaa(the.aaa.package.AaaRequest) returns (the.aaa.package.AaaReply); | ||||
|   rpc Bbb(BbbRequest) returns (BbbReply); | ||||
| } | ||||
|  | ||||
| message BbbRequest { | ||||
|   bool enable = 1; | ||||
| } | ||||
| message BbbReply { | ||||
|   bool done = 1; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user