provider

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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

func (g *GitHub) CheckToken(scm *api.SCMConfig) bool

CheckToken checks whether the token has the authority of repo by trying ListRepos with the token

func (*GitHub) GetToken added in v0.3.0

func (g *GitHub) GetToken(scm *api.SCMConfig) (string, error)

GetToken gets the token by the username and password of SCM config.

func (*GitHub) ListBranches added in v0.3.0

func (g *GitHub) ListBranches(scm *api.SCMConfig, repo string) ([]string, error)

ListBranches lists the branches for specified repo.

func (*GitHub) ListRepos added in v0.3.0

func (g *GitHub) ListRepos(scm *api.SCMConfig) ([]api.Repository, error)

ListRepos lists the repos by the SCM config.

type GitHubManager

type GitHubManager struct {
	DataStore *store.DataStore
}

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

func (g *GitLab) CheckToken(scm *api.SCMConfig) bool

CheckToken checks whether the token has the authority of repo by trying ListRepos with the token.

func (*GitLab) GetToken added in v0.3.0

func (g *GitLab) GetToken(scm *api.SCMConfig) (string, error)

GetToken gets the token by the username and password of SCM config.

func (*GitLab) ListBranches added in v0.3.0

func (g *GitLab) ListBranches(scm *api.SCMConfig, repo string) ([]string, error)

ListBranches lists the branches for specified repo.

func (*GitLab) ListRepos added in v0.3.0

func (g *GitLab) ListRepos(scm *api.SCMConfig) ([]api.Repository, error)

ListRepos lists the repos by the SCM config.

type GitLabManager

type GitLabManager struct {
	DataStore *store.DataStore
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL