Documentation ¶
Index ¶
- type GitHub
- type GitHubManager
- func (g *GitHubManager) Authcallback(code, state string) (string, error)
- func (g *GitHubManager) GetAuthCodeURL(projectID string) (string, error)
- func (g *GitHubManager) GetRepos(projectID string) (Repos []api.Repository, username, avatarURL string, err error)
- func (g *GitHubManager) LogOut(projectID string) error
- type GitLab
- type GitLabManager
- func (g *GitLabManager) Authcallback(code, state string) (string, error)
- func (g *GitLabManager) GetAuthCodeURL(projectID string) (string, error)
- func (g *GitLabManager) GetRepos(projectID string) (repos []api.Repository, username string, avatarURL string, err error)
- func (g *GitLabManager) LogOut(projectID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHub ¶ added in v0.3.0
type GitHub struct{}
GitHub represents the SCM provider of GitHub.
func (*GitHub) CheckToken ¶ added in v0.3.1
CheckToken checks whether the token has the authority of repo by trying ListRepos with the token
func (*GitHub) GetToken ¶ added in v0.3.0
GetToken gets the token by the username and password of SCM config.
func (*GitHub) ListBranches ¶ added in v0.3.0
ListBranches lists the branches for specified repo.
type GitHubManager ¶
GitHubManager represents the manager for github.
func (*GitHubManager) Authcallback ¶
func (g *GitHubManager) Authcallback(code, state string) (string, error)
Authcallback is the callback handler.
func (*GitHubManager) GetAuthCodeURL ¶
func (g *GitHubManager) GetAuthCodeURL(projectID string) (string, error)
GetAuthCodeURL gets the URL for token request.
func (*GitHubManager) GetRepos ¶
func (g *GitHubManager) GetRepos(projectID string) (Repos []api.Repository, username, avatarURL string, err error)
GetRepos gets the list of repositories with token from github.
func (*GitHubManager) LogOut ¶
func (g *GitHubManager) LogOut(projectID string) error
LogOut logs out and deletes the token.
type GitLab ¶ added in v0.3.0
type GitLab struct{}
GitLab represents the SCM provider of GitLab.
func (*GitLab) CheckToken ¶ added in v0.3.1
CheckToken checks whether the token has the authority of repo by trying ListRepos with the token.
func (*GitLab) GetToken ¶ added in v0.3.0
GetToken gets the token by the username and password of SCM config.
func (*GitLab) ListBranches ¶ added in v0.3.0
ListBranches lists the branches for specified repo.
type GitLabManager ¶
GitLabManager represents the manager for gitlab.
func (*GitLabManager) Authcallback ¶
func (g *GitLabManager) Authcallback(code, state string) (string, error)
Authcallback is the callback handler.
func (*GitLabManager) GetAuthCodeURL ¶
func (g *GitLabManager) GetAuthCodeURL(projectID string) (string, error)
GetAuthCodeURL gets the URL for token request.
func (*GitLabManager) GetRepos ¶
func (g *GitLabManager) GetRepos(projectID string) (repos []api.Repository, username string, avatarURL string, err error)
GetRepos gets the list of repositories with token from gitlab.
func (*GitLabManager) LogOut ¶
func (g *GitLabManager) LogOut(projectID string) error
LogOut logs out and deletes the token.