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

Scorfly / gokick / 13478084300

23 Feb 2025 12:47AM UTC coverage: 96.5% (-0.07%) from 96.57%
13478084300

push

github

web-flow
feat: add function to get URL to redirect on KICK for authentication (#21)

44 of 46 new or added lines in 2 files covered. (95.65%)

579 of 600 relevant lines covered (96.5%)

10.8 hits per line

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

93.75
/scope_enum.go
1
package gokick
2

3
import "fmt"
4

5
type Scope int
6

7
const (
8
        ScopeUserRead       Scope = iota // user:read
9
        ScopeChannelRead                 // channel:read
10
        ScopeChannelWrite                // channel:write
11
        ScopeChatWrite                   // chat:write
12
        ScopeStremkeyRead                // streamkey:read
13
        ScopeEventSubscribe              // events:subscribe
14
)
15

16
func NewScope(scope string) (Scope, error) {
8✔
17
        switch scope {
8✔
18
        case "user:read":
1✔
19
                return ScopeUserRead, nil
1✔
20
        case "channel:read":
1✔
21
                return ScopeChannelRead, nil
1✔
22
        case "channel:write":
1✔
23
                return ScopeChannelWrite, nil
1✔
24
        case "chat:write":
1✔
25
                return ScopeChatWrite, nil
1✔
26
        case "streamkey:read":
1✔
27
                return ScopeStremkeyRead, nil
1✔
28
        case "events:subscribe":
1✔
29
                return ScopeEventSubscribe, nil
1✔
30
        default:
2✔
31
                return 0, fmt.Errorf("unknown scope: %s", scope)
2✔
32
        }
33
}
34

35
func (s Scope) String() string {
8✔
36
        switch s {
8✔
37
        case ScopeUserRead:
2✔
38
                return "user:read"
2✔
39
        case ScopeChannelRead:
2✔
40
                return "channel:read"
2✔
41
        case ScopeChannelWrite:
1✔
42
                return "channel:write"
1✔
43
        case ScopeChatWrite:
1✔
44
                return "chat:write"
1✔
45
        case ScopeStremkeyRead:
1✔
46
                return "streamkey:read"
1✔
47
        case ScopeEventSubscribe:
1✔
48
                return "events:subscribe"
1✔
NEW
49
        default:
×
NEW
50
                return "unknown"
×
51
        }
52
}
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

© 2026 Coveralls, Inc