https://github.com/koalificationio/go-webhookrelay
Webhookrelay API Client in Go
https://github.com/koalificationio/go-webhookrelay
webhookrelay
Last synced: 3 months ago
JSON representation
Webhookrelay API Client in Go
- Host: GitHub
- URL: https://github.com/koalificationio/go-webhookrelay
- Owner: koalificationio
- License: mpl-2.0
- Created: 2019-10-16T12:51:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-11T15:30:19.000Z (over 5 years ago)
- Last Synced: 2025-08-14T14:38:37.601Z (10 months ago)
- Topics: webhookrelay
- Language: Go
- Homepage: https://pkg.go.dev/github.com/koalificationio/go-webhookrelay?tab=overview
- Size: 178 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-webhookrelay
[Webhookrelay](https://webhookrelay.com/api-reference/) API client for Go
## Example usage
``` go
package main
import (
"fmt"
"os"
"github.com/koalificationio/go-webhookrelay/pkg/client"
api "github.com/koalificationio/go-webhookrelay/pkg/openapi/client/buckets"
"github.com/koalificationio/go-webhookrelay/pkg/openapi/models"
)
func main() {
cfg := client.Config{
APIKey: os.Getenv("RELAY_KEY"),
APISecret: os.Getenv("RELAY_SECRET"),
}
client := client.New(&cfg)
// get some bukets
buckets, err := client.Buckets.GetV1Buckets(api.NewGetV1BucketsParams())
if err != nil {
fmt.Printf("Error geting bucktes: %v", err)
os.Exit(1)
}
fmt.Printf("First bucket name: %v", buckets.GetPayload()[0].Name)
// create bucket and get input url
params := api.NewPostV1BucketsParams().WithBody(&models.BucketRequest{Name: "test_bucket"})
resp, err := client.Buckets.PostV1Buckets(params)
if err != nil {
fmt.Printf("Error creating bucktes: %v", err)
os.Exit(1)
}
fmt.Printf("New bucket input url: https://my.webhookrelay.com/v1/webhooks/%s", resp.GetPayload().Inputs[0].ID)
}
```