• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pusher / pusher-http-go / 12285846667

11 Dec 2024 10:17PM UTC coverage: 87.082%. Remained the same
12285846667

Pull #93

github

web-flow
Bump golang.org/x/crypto

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20200709230013-948cd5f35899 to 0.31.0.
- [Commits](https://github.com/golang/crypto/commits/v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #93: Bump golang.org/x/crypto from 0.0.0-20200709230013-948cd5f35899 to 0.31.0

573 of 658 relevant lines covered (87.08%)

1.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/webhook.go
1
package pusher
2

3
import (
4
        "encoding/json"
5
)
6

7
// Webhook is the parsed form of a valid webhook received by the server.
8
type Webhook struct {
9
        TimeMs int            `json:"time_ms"` // the timestamp of the request
10
        Events []WebhookEvent `json:"events"`  // the events associated with the webhook
11
}
12

13
// WebhookEvent is the parsed form of a valid webhook event received by the
14
// server.
15
type WebhookEvent struct {
16
        Name     string `json:"name"`                // the type of the event
17
        Channel  string `json:"channel"`             // the channel on which it was sent
18
        Event    string `json:"event,omitempty"`     // the name of the event
19
        Data     string `json:"data,omitempty"`      // the data associated with the event
20
        SocketID string `json:"socket_id,omitempty"` // the socket_id of the sending socket
21
        UserID   string `json:"user_id,omitempty"`   // the user_id of a member who has joined or vacated a presence-channel
22
}
23

24
func unmarshalledWebhook(requestBody []byte) (*Webhook, error) {
2✔
25
        webhook := &Webhook{}
2✔
26
        err := json.Unmarshal(requestBody, &webhook)
2✔
27
        if err != nil {
2✔
28
                return nil, err
×
29
        }
×
30
        return webhook, nil
2✔
31
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc