scm

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyGithubWebhookSignature

func VerifyGithubWebhookSignature(secret []byte, signature string, body []byte) bool

func VerifyGitlabWebhookSignature

func VerifyGitlabWebhookSignature(secret []byte, signature string, body []byte) bool

Types

type GithubAccount

type GithubAccount struct {
	Login       string `json:"login,omitempty"`
	Name        string `json:"name,omitempty"`
	AvatarURL   string `json:"avatar_url,omitempty"`
	HTMLURL     string `json:"html_url,omitempty"`
	AccessToken string `json:"accessToken,omitempty"`
}

type GithubManager

type GithubManager struct {
	// contains filtered or unexported fields
}

func (GithubManager) Config

func (g GithubManager) Config(setting *model.SCMSetting) model.SCManager

func (GithubManager) CreateWebhook

func (g GithubManager) CreateWebhook(p *model.Pipeline, token string, ciWebhookEndpoint string) error

func (GithubManager) DeleteWebhook

func (g GithubManager) DeleteWebhook(p *model.Pipeline, token string) error

func (GithubManager) GetAccount

func (g GithubManager) GetAccount(accessToken string) (*model.GitAccount, error)

func (GithubManager) GetRepos

func (g GithubManager) GetRepos(account *model.GitAccount) ([]*model.GitRepository, error)

func (GithubManager) GetType

func (g GithubManager) GetType() string

func (GithubManager) OAuth

func (g GithubManager) OAuth(redirectURL string, clientID string, clientSecret string, code string) (*model.GitAccount, error)

func (GithubManager) VerifyWebhookPayload

func (g GithubManager) VerifyWebhookPayload(p *model.Pipeline, req *http.Request) bool

type GitlabManager

type GitlabManager struct {
	// contains filtered or unexported fields
}

func (GitlabManager) Config

func (g GitlabManager) Config(setting *model.SCMSetting) model.SCManager

func (GitlabManager) CreateWebhook

func (g GitlabManager) CreateWebhook(p *model.Pipeline, token string, ciWebhookEndpoint string) error

func (GitlabManager) DeleteWebhook

func (g GitlabManager) DeleteWebhook(p *model.Pipeline, token string) error

func (GitlabManager) GetAccount

func (g GitlabManager) GetAccount(accessToken string) (*model.GitAccount, error)

func (GitlabManager) GetRepos

func (g GitlabManager) GetRepos(account *model.GitAccount) ([]*model.GitRepository, error)

func (GitlabManager) GetType

func (g GitlabManager) GetType() string

func (GitlabManager) OAuth

func (g GitlabManager) OAuth(redirectURL string, clientID string, clientSecret string, code string) (*model.GitAccount, error)

func (GitlabManager) VerifyWebhookPayload

func (g GitlabManager) VerifyWebhookPayload(p *model.Pipeline, req *http.Request) bool

Jump to

Keyboard shortcuts

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