forked from rancher/rancher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
remote.go
30 lines (19 loc) · 838 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
package model
import (
v3 "github.com/rancher/types/apis/project.cattle.io/v3"
)
type Remote interface {
Type() string
//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
GetBranches(repoURL string, accessToken string) ([]string, error)
GetHeadInfo(repoURL string, branch string, accessToken string) (*BuildInfo, error)
}
type Refresher interface {
Refresh(cred *v3.SourceCodeCredential) (bool, error)
}