Documentation ¶
Overview ¶
Package gitlab provides gitlab related code
Index ¶
- Constants
- Variables
- func HandleEvent(w http.ResponseWriter, r *http.Request, secret string) *vcs.EventPayload
- func NewOAuthClient(cfg authenticator.OAuthConfig, token *oauth2.Token) (authenticator.IdentityProviderClient, error)
- func NewTestServer(t *testing.T, opts ...TestGitlabServerOption) *httptest.Server
- func NewTokenClient(opts vcs.NewTokenClientOptions) (vcs.Client, error)
- type Client
- func (g *Client) CreateWebhook(ctx context.Context, opts vcs.CreateWebhookOptions) (string, error)
- func (g *Client) DeleteWebhook(ctx context.Context, opts vcs.DeleteWebhookOptions) error
- func (g *Client) GetCommit(ctx context.Context, repo, ref string) (vcs.Commit, error)
- func (g *Client) GetCurrentUser(ctx context.Context) (string, error)
- func (g *Client) GetRepoTarball(ctx context.Context, opts vcs.GetRepoTarballOptions) ([]byte, string, error)
- func (g *Client) GetRepository(ctx context.Context, identifier string) (vcs.Repository, error)
- func (g *Client) GetWebhook(ctx context.Context, opts vcs.GetWebhookOptions) (vcs.Webhook, error)
- func (g *Client) ListPullRequestFiles(ctx context.Context, repo string, pull int) ([]string, error)
- func (g *Client) ListRepositories(ctx context.Context, lopts vcs.ListRepositoriesOptions) ([]string, error)
- func (g *Client) ListTags(ctx context.Context, opts vcs.ListTagsOptions) ([]string, error)
- func (g *Client) SetStatus(ctx context.Context, opts vcs.SetStatusOptions) error
- func (g *Client) UpdateWebhook(ctx context.Context, id string, opts vcs.UpdateWebhookOptions) error
- type ClientOptions
- type TestGitlabServerOption
Constants ¶
View Source
const (
DefaultHostname string = "gitlab.com"
)
Variables ¶
View Source
var ( OAuthEndpoint = oauth2gitlab.Endpoint OAuthScopes = []string{"read_user", "read_api"} )
Functions ¶
func HandleEvent ¶
func HandleEvent(w http.ResponseWriter, r *http.Request, secret string) *vcs.EventPayload
func NewOAuthClient ¶ added in v0.1.14
func NewOAuthClient(cfg authenticator.OAuthConfig, token *oauth2.Token) (authenticator.IdentityProviderClient, error)
func NewTestServer ¶
func NewTestServer(t *testing.T, opts ...TestGitlabServerOption) *httptest.Server
func NewTokenClient ¶ added in v0.1.14
func NewTokenClient(opts vcs.NewTokenClientOptions) (vcs.Client, error)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cfg ClientOptions) (*Client, error)
func (*Client) CreateWebhook ¶
func (*Client) DeleteWebhook ¶
func (*Client) GetCurrentUser ¶ added in v0.1.8
func (*Client) GetRepoTarball ¶
func (*Client) GetRepository ¶
func (*Client) GetWebhook ¶
func (*Client) ListPullRequestFiles ¶ added in v0.1.4
func (*Client) ListRepositories ¶
func (*Client) UpdateWebhook ¶
type ClientOptions ¶ added in v0.1.14
type TestGitlabServerOption ¶
type TestGitlabServerOption func(*testServerDB)
func WithGitlabRepo ¶
func WithGitlabRepo(repo, defaultBranch string) TestGitlabServerOption
func WithGitlabTarball ¶
func WithGitlabTarball(tarball []byte) TestGitlabServerOption
func WithGitlabUser ¶
func WithGitlabUser(username string) TestGitlabServerOption
Click to show internal directories.
Click to hide internal directories.