#Ok Thanks Erik So do I need to write
1 messages · Page 1 of 1 (latest)
Writing an extension is probably not necessary to start out here. I think the simplest way to start right now would be to write a script for each out the steps you want to support (tidy and build), just with one of the languages we currently support (javascript/typescript or go). There's an example in javascript here: https://github.com/dagger/todoapp/blob/cloak/scripts/kick-the-tires/index.mjs
There, the local source code is loaded up into a container and then yarn command are run on top of it. In your case, you'd do something similar except with running go commands.
At the end you will want to export the result of the commands back to your local dir, which can be done using a query something like this:
{
host {
workdir {
write(path: "some/subpath", contents: $some_fs_id)
}
}
}
So while it will be a bit verbose, I think you can accomplish your goal with just a script.
Extensions are useful once you start wanting to re-use existing code, similar to how you can re-use libraries rather than implement everything yourself. But since we don't yet have a pre-built go extension for you to re-use, it's probably best to just start with a script.
Great. It is clear for me now.
Hi. I'm trying to write my script but the go sdk seems not to have the same interfaces like the typescript one .
I'm looking for something similar to client.request in the typescript sdk
Hey James, yeah there's an example of doing that in Go here: https://github.com/sipsma/cloak/blob/92555b341dae8dcdb0b3bc828f93f2c6a13036c6/examples/alpine/main.go#L32-L101
It's a bit more verbose than doing it in typescript, but is the exact same idea. In the longer term we plan to have nice generated clients for go
I can’t access the file. I think the repo is private @plucky nest
Ah sorry, this link should work: https://github.com/dagger/cloak/blob/62310f84a076202280fcc2f7b6b000c5cb8098db/examples/alpine/main.go#L32-L101
I've updated my script but I wondering how i can call it with cloak client : https://github.com/freemanpolys/cloak-workspace/blob/main/goapp/scripts/dependencies/main.go