-
Notifications
You must be signed in to change notification settings - Fork 0
/
remote.go
34 lines (20 loc) · 875 Bytes
/
remote.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
package model
import (
"github.com/rancher/types/apis/project.cattle.io/v3"
)
type Remote interface {
Type() string
CanLogin() bool
CanRepos() bool
CanHook() bool
//Login handle oauth login
Login(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
GetPipelineFileInRepo(repoURL string, ref string, accessToken string) ([]byte, error)
SetPipelineFileInRepo(repoURL string, ref string, accessToken string, content []byte) error
GetDefaultBranch(repoURL string, accessToken string) (string, error)
GetBranches(repoURL string, accessToken string) ([]string, error)
GetHeadInfo(repoURL string, branch string, accessToken string) (*BuildInfo, error)
}