elek / docker-storj-extension

Highly experimental docker-desktop extension to pull/push from/to Storj DCS
Apache License 2.0
5 stars 1 forks source link

Streaming console output to the frontend #2

Open elek opened 2 years ago

elek commented 2 years ago

Backend calls good old CLI commands under the hood (see backend/service.go). If it fails, it returns with an error (including stdout).

But some of the commands (like docker push) are quite slow.

It would be better to start the command and continuously streaming the output to the frontend which would show new lines immediately.

In the current, very simple prototype, we just wait until the response is received.

Ajax-Light commented 1 year ago

Hey @elek I'd like to work on this. I'm new to go so I wanna take this up as a challenge. A quick search has led me to io.Reader and io.Writer. So the plan is to use c.Stdout which is an io.Writer according to Go docs and use it to write to logs instead of zap.String("output", string(out)). Does this look okay?