-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌿 Add local generation configuration (#14)
* Add local generation configuration * Add demo application in local/ * Add local executable to .gitignore * Revise local generation setup
- Loading branch information
Showing
7 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
.DS_Store | ||
|
||
local/go/generated/hookdeck-go-sdk/ | ||
local/go/go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module github.com/hookdeck/hookdeck-api-schema/local/go | ||
|
||
go 1.19 | ||
|
||
require github.com/hookdeck/hookdeck-go-sdk v0.0.0 | ||
|
||
replace github.com/hookdeck/hookdeck-go-sdk v0.0.0 => ./generated/hookdeck-go-sdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
go 1.19 | ||
|
||
use ( | ||
. | ||
./generated/hookdeck-go-sdk | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"os" | ||
|
||
hookdeck "github.com/hookdeck/hookdeck-go-sdk" | ||
hookdeckclient "github.com/hookdeck/hookdeck-go-sdk/client" | ||
) | ||
|
||
func main() { | ||
if err := run(); err != nil { | ||
os.Stderr.WriteString(err.Error()) | ||
os.Exit(1) | ||
} | ||
} | ||
|
||
func run() error { | ||
client := hookdeckclient.NewClient( | ||
hookdeckclient.ClientWithBaseURL("http://localhost:9000/2023-07-01"), | ||
hookdeckclient.ClientWithAuthToken(os.Getenv("HOOKDECK_AUTH_TOKEN")), | ||
) | ||
issueTriggersResponse, err := client.IssueTrigger.List( | ||
context.TODO(), | ||
new(hookdeck.IssueTriggerListRequest), | ||
) | ||
if err != nil { | ||
return err | ||
} | ||
fmt.Printf("Got %d issue triggers\n", len(issueTriggersResponse.Models)) | ||
return nil | ||
} |