diff options
| author | 2025-03-09 17:47:56 +0100 | |
|---|---|---|
| committer | 2025-12-01 22:08:04 +0100 | |
| commit | b1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch) | |
| tree | 9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/github.com/SherClockHolmes/webpush-go/README.md | |
| parent | [chore] update URLs to forked source (diff) | |
| download | gotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz | |
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/SherClockHolmes/webpush-go/README.md')
| -rw-r--r-- | vendor/github.com/SherClockHolmes/webpush-go/README.md | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/vendor/github.com/SherClockHolmes/webpush-go/README.md b/vendor/github.com/SherClockHolmes/webpush-go/README.md deleted file mode 100644 index c313fc6b1..000000000 --- a/vendor/github.com/SherClockHolmes/webpush-go/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# webpush-go - -[](https://goreportcard.com/report/github.com/SherClockHolmes/webpush-go) -[](https://godoc.org/github.com/SherClockHolmes/webpush-go) - -Web Push API Encryption with VAPID support. - -```bash -go get -u github.com/SherClockHolmes/webpush-go -``` - -## Example - -For a full example, refer to the code in the [example](example/) directory. - -```go -package main - -import ( - "encoding/json" - - webpush "github.com/SherClockHolmes/webpush-go" -) - -func main() { - // Decode subscription - s := &webpush.Subscription{} - json.Unmarshal([]byte("<YOUR_SUBSCRIPTION>"), s) - - // Send Notification - resp, err := webpush.SendNotification([]byte("Test"), s, &webpush.Options{ - Subscriber: "example@example.com", - VAPIDPublicKey: "<YOUR_VAPID_PUBLIC_KEY>", - VAPIDPrivateKey: "<YOUR_VAPID_PRIVATE_KEY>", - TTL: 30, - }) - if err != nil { - // TODO: Handle error - } - defer resp.Body.Close() -} -``` - -### Generating VAPID Keys - -Use the helper method `GenerateVAPIDKeys` to generate the VAPID key pair. - -```golang -privateKey, publicKey, err := webpush.GenerateVAPIDKeys() -if err != nil { - // TODO: Handle error -} -``` - -## Development - -1. Install [Go 1.11+](https://golang.org/) -2. `go mod vendor` -3. `go test` - -#### For other language implementations visit: - -[WebPush Libs](https://github.com/web-push-libs) |
