Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CommitStatus ¶
type CommitStatus string
const ( CommitStatusPending CommitStatus = "pending" CommitStatusSuccess CommitStatus = "success" CommitStatusError CommitStatus = "error" CommitStatusFailed CommitStatus = "failed" )
type GitSource ¶
type GitSource interface { GetRepoInfo(repopath string) (*RepoInfo, error) GetFile(repopath, commit, file string) ([]byte, error) DeleteDeployKey(repopath, title string) error CreateDeployKey(repopath, title, pubKey string, readonly bool) error UpdateDeployKey(repopath, title, pubKey string, readonly bool) error DeleteRepoWebhook(repopath, url string) error CreateRepoWebhook(repopath, url, secret string) error ParseWebhook(r *http.Request, secret string) (*types.WebhookData, error) CreateCommitStatus(repopath, commitSHA string, status CommitStatus, targetURL, description, context string) (bool, error) // ListUserRepos report repos where the user has the permission to create deploy keys and webhooks ListUserRepos() ([]*RepoInfo, error) GetRef(repopath, ref string) (*Ref, error) // RefType returns the ref type and the related name (branch, tag, pr id) RefType(ref string) (RefType, string, error) GetCommit(repopath, commitSHA string) (*Commit, error) BranchRef(branch string) string TagRef(tag string) string PullRequestRef(prID string) string CommitLink(repoInfo *RepoInfo, commitSHA string) string BranchLink(repoInfo *RepoInfo, branch string) string TagLink(repoInfo *RepoInfo, tag string) string PullRequestLink(repoInfo *RepoInfo, prID string) string }
type Oauth2Client ¶ added in v0.8.0
type Oauth2Client interface { // GetOauth2AuthorizationURL return the authorization request URL to the // authorization server GetOauth2AuthorizationURL(callbackURL, state string) (redirectURL string, err error) // RequestOauth2Token requests the oauth2 token to the authorization server RequestOauth2Token(callbackURL, code string) (*oauth2.Token, error) // RefreshOauth2Token refreshed the oauth2 token RefreshOauth2Token(refreshToken string) (*oauth2.Token, error) }
type Oauth2Source ¶
type Oauth2Source interface { UserSource }
type PasswordSource ¶
type PasswordSource interface { UserSource CreateAccessToken(tokenName string) (string, error) }
type UserSource ¶
Click to show internal directories.
Click to hide internal directories.