package main
import (
"context"
"log"
"log/slog"
"github.com/riza-io/riza-api-go"
"github.com/riza-io/riza-api-go/option"
)
func main() {
client := riza.NewClient(
option.WithAPIKey("My API Key"),
option.WithBaseURL("http://localhost:3003"),
)
params := riza.CommandExecParams{
Language: riza.F(riza.CommandExecParamsLanguagePython),
Code: riza.F("print('Hello, self-hosting!')"),
}
resp, err := client.Command.Exec(context.Background(), params)
if err != nil {
log.Fatal(err)
}
slog.Info(
resp.Stdout,
"code", resp.ExitCode,
"stderr", resp.Stderr,
)
}