Hi <@U044LPUQ602> currently not as a separate pack...
# help
u
Hi @Taha Sadiki currently not as a separate package. Check-out the lakeFS project source code, you can see how the API is used by our cli (lakectl). Alternative, you can just make a copy of the
api/swagger.yml
to you project and use oapi-codegen to build client side code to access lakefs.
u
okey! thank you!
u
here is a quick way to add it to your project:
u
Copy code
//go:generate go run <http://github.com/deepmap/oapi-codegen/cmd/oapi-codegen|github.com/deepmap/oapi-codegen/cmd/oapi-codegen> -config oapi.yml <https://raw.githubusercontent.com/treeverse/lakeFS/master/api/swagger.yml>
u
^ have this one in your .go file and use
go generate
it will create lakefs.gen.go that include the client go code
u
The above code assumes the code found in package
main
feel free to change, use and reuse. Also note that I am pointing to the latest swagger yaml API on GitHub, you can download or point to a specific version as a better practice.
u
awesome! that’s suuper helpful! thank you
u
sure, update the oapi.yaml - I missed
client: true