forked from rancher/rancher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
model.go
33 lines (20 loc) · 792 Bytes
/
model.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
package model
import (
"github.com/rancher/types/apis/management.cattle.io/v3"
"net/http"
)
type Remote interface {
Type() string
CanLogin() bool
CanRepos() bool
CanHook() bool
//Login handle oauth login
Login(redirectURL string, code string) (*v3.SourceCodeCredential, error)
Repos(account *v3.SourceCodeCredential) ([]v3.SourceCodeRepository, error)
CreateHook(pipeline *v3.Pipeline, accessToken string) (string, error)
DeleteHook(pipeline *v3.Pipeline, accessToken string) error
ParseHook(r *http.Request)
GetPipelineFileInRepo(repoURL string, ref string, accessToken string) ([]byte, error)
GetDefaultBranch(repoURL string, accessToken string) (string, error)
GetHeadCommit(repoURL string, branch string, credential *v3.SourceCodeCredential) (string, error)
}