Comments (9)
We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.
The labels on this github issue will be updated when the story is started.
from brokerapi.
We use an automated deploy and build for all of our go code. So the suggestion I've seen in other locations for exposed vendored api is not really workable. The workaround is to manually delete the vendored package out of brokerapi after download it. This would be a big pain in our automated process. Everything is just go get and then build.
from brokerapi.
Hi @rlk833. We could certainly remove vendoring for 3rd party libraries in brokerapi. However, is that what you really need? You will still need to use the gorilla/mux router created in New() or pass one in using AttachRoutes(). Currently we don't support other router other than mux.Router
.
from brokerapi.
The problem is I can't pass in gorilla/mux router because GO won't accept it. The problem is because you vendor it, GO will only accept a mux router that is created through your internal vendored packaged. But since it is internal vendored I can't create such an instance because that package is hidden. It is a catch-22. Same goes for lager logger.
Anything that you expose as a parameter in the API must be for packages that are not vendored. Otherwise it is impossible to call your API since we can't create objects of the internal vendored type.
from brokerapi.
Thanks for your quick response.
I am not sure I understand. Please can you give us an example of your code?
You can see how we use the brokerapi
package here: https://github.com/pivotal-cf/on-demand-service-broker/blob/master/apiserver/apiserver.go#L45. As you can see we are passing a mux.Router
created at line 43.
from brokerapi.
The problem is this: I have a router from package
"github.com/gorilla/mux"
.
But the router GO thinks you expose in the API is
"github.com/pivotal-cf/brokerapi/vendor/github.com/gorilla/mux"
This is a completely different package to Go. They are not compatible. I can't pass an instance of my router because it is not of the type of your router.
GO will not let me create a router of an internal vender package like that. And you wouldn't want too either because then I would have to use your internal router everywhere else in my code.
I don't know why your GO is not complaining. Mine is, GO 1.9
your on-demand vendor folder contains brokerapi, but the brokerapi that was vendored DID NOT INCLUDE a vendor folder itself. However doing straight normal go get -d ./...
on my code GO pulls your brokerapi AND pulls the packaged vendor folder under brokerapi. This is what causes the conflict. We can't develop because of this.
from brokerapi.
Vendor is typically not used on packages which are meant to be used by someone else. They are typically only used for:
a) top level applications that are not included somewhere else
b) internal imported packages that you want to lock down on a version
Any package meant to be imported somewhere else should not vendor any exposed internal vendored packages.
from brokerapi.
Hey @rlk833,
Fair enough, we have updated brokerapi
to not commit the vendor
folder. We have also tried to use it as a library and it seems to work now.
Please, let us now if it works for you.
Thanks!
from brokerapi.
Thanks @nodo, that worked great.
from brokerapi.
Related Issues (20)
- Binding struct is missing support for Endpoint? HOT 4
- Audit log by the APIHandler type HOT 3
- Missing metadata field in ProvisionedServiceSpec HOT 4
- Missing allow_context_updates field HOT 7
- Unversioned handlers shouldn't not use versioned domain/apiresponses HOT 2
- Use of authentication methods other than Basic Auth HOT 6
- v8 backwards compatiblity HOT 7
- Is the FailureResponse status code used? HOT 4
- test issgu HOT 1
- Incorrect type for metadata fields in Get/Provision/Deprovision responses HOT 3
- Broker does not accept url-encoded forward slash in instance_id HOT 6
- Ability to implement custom ServicePlanCost? HOT 1
- Feature request: Simple way to add prometheus exporter HOT 3
- Support for Binding rotation HOT 3
- Requirement to expose additional API endpoints HOT 3
- Setting CF labels not supported? HOT 4
- Use chi.Router interface for AttachRoutes method HOT 3
- for v11: NewFailureResponse() should return error not *apiresponses.FailureResponse HOT 3
- Replace lager.Logger with log/slog.Logger HOT 4
- Possibility to register a custom middle ware HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brokerapi.