forked from drone/go-scm
-
Notifications
You must be signed in to change notification settings - Fork 83
/
app.go
41 lines (34 loc) · 1.06 KB
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package scm
import (
"context"
"time"
)
type (
// InstallationToken is the token used for interacting with the app
InstallationToken struct {
Token string
ExpiresAt *time.Time
}
// Installation represents a GitHub app install
Installation struct {
ID int64
AppID int64
TargetID int64
TargetType string
RepositorySelection string
Account Account
AccessTokensLink string
RepositoriesURL string
Link string
Events []string
CreatedAt *time.Time
UpdatedAt *time.Time
}
// AppService for GitHub App support
AppService interface {
CreateInstallationToken(ctx context.Context, id int64) (*InstallationToken, *Response, error)
GetRepositoryInstallation(ctx context.Context, fullName string) (*Installation, *Response, error)
GetOrganisationInstallation(ctx context.Context, organisation string) (*Installation, *Response, error)
GetUserInstallation(ctx context.Context, user string) (*Installation, *Response, error)
}
)