https://lakefs.io/ logo
Title
b

Barak Amar

09/30/2022, 5:26 PM
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.
t

Taha Sadiki

09/30/2022, 5:36 PM
okey! thank you!
b

Barak Amar

09/30/2022, 5:40 PM
here is a quick way to add it to your project:
//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>
^ have this one in your .go file and use
go generate
it will create lakefs.gen.go that include the client go code
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.
t

Taha Sadiki

09/30/2022, 5:52 PM
awesome! that’s suuper helpful! thank you
b

Barak Amar

09/30/2022, 5:54 PM
sure, update the oapi.yaml - I missed
client: true
👍 1