Skip to content

Commit

Permalink
feat: Add languages to features endpoint (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jagger De Leo authored Jun 13, 2022
1 parent 69082ac commit f43a677
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,5 @@ func TestBuilderFeatures(t *testing.T) {
t.Fatal(err)
}

t.Log(features.Features)
t.Log(features)
}
2 changes: 1 addition & 1 deletion examples/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func main() {
client.PromoteDraft(runnable)

// Execute the function
result, _ := client.ExecString(runnable, "world!")
result, _, _ := client.ExecString(runnable, "world!")

// Log the execution output
log.Println(string(result))
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func main() {
payload := "world!"

log.Printf("Executing runnable with payload: '%s'\n", payload)
output, _ := client.ExecString(helloRunnable, payload)
output, _, _ := client.ExecString(helloRunnable, payload)

log.Println(string(output))
}
Expand Down
9 changes: 8 additions & 1 deletion response_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@ type ExecMetadata struct {
Error ExecError `json:"error"`
}

type FeatureLanguage struct {
ID string `json:"identifier"`
Short string `json:"short"`
Pretty string `json:"pretty"`
}

type FeaturesResponse struct {
Features []string `json:"features"`
Features []string `json:"features"`
Langauges []FeatureLanguage `json:"languages"`
}

// TestPayload is a single test for a Runnable
Expand Down

0 comments on commit f43a677

Please sign in to comment.