Update protoc-gen-micro
This commit is contained in:
		| @@ -12,6 +12,7 @@ import ( | ||||
|  | ||||
| import ( | ||||
| 	context "context" | ||||
| 	api "github.com/micro/go-micro/v2/api" | ||||
| 	client "github.com/micro/go-micro/v2/client" | ||||
| 	server "github.com/micro/go-micro/v2/server" | ||||
| ) | ||||
| @@ -28,10 +29,25 @@ var _ = math.Inf | ||||
| const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package | ||||
|  | ||||
| // Reference imports to suppress errors if they are not otherwise used. | ||||
| var _ api.Endpoint | ||||
| var _ context.Context | ||||
| var _ client.Option | ||||
| var _ server.Option | ||||
|  | ||||
| // Api Endpoints for Test service | ||||
|  | ||||
| func NewTestEndpoints() []*api.Endpoint { | ||||
| 	return []*api.Endpoint{ | ||||
| 		&api.Endpoint{ | ||||
| 			Name:    "Test.Call", | ||||
| 			Path:    []string{"/api/v0/test/call/{uuid}"}, | ||||
| 			Method:  []string{"POST"}, | ||||
| 			Body:    "*", | ||||
| 			Handler: "rpc", | ||||
| 		}, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // Client API for Test service | ||||
|  | ||||
| type TestService interface { | ||||
| @@ -74,6 +90,13 @@ func RegisterTestHandler(s server.Server, hdlr TestHandler, opts ...server.Handl | ||||
| 		test | ||||
| 	} | ||||
| 	h := &testHandler{hdlr} | ||||
| 	opts = append(opts, api.WithEndpoint(&api.Endpoint{ | ||||
| 		Name:    "Test.Call", | ||||
| 		Path:    []string{"/api/v0/test/call/{uuid}"}, | ||||
| 		Method:  []string{"POST"}, | ||||
| 		Body:    "*", | ||||
| 		Handler: "rpc", | ||||
| 	})) | ||||
| 	return s.Handle(s.NewHandler(&Test{h}, opts...)) | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user