gitlab

package
v0.0.48 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package gitlab provides gitlab related code

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Defaults

func Defaults() cloud.Config

func NewTestServer

func NewTestServer(t *testing.T, opts ...TestGitlabServerOption) *httptest.Server

func OAuthDefaults

func OAuthDefaults() *oauth2.Config

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, cfg cloud.ClientOptions) (*Client, error)

func (*Client) CreateWebhook

func (g *Client) CreateWebhook(ctx context.Context, opts cloud.CreateWebhookOptions) (string, error)

func (*Client) DeleteWebhook

func (g *Client) DeleteWebhook(ctx context.Context, opts cloud.DeleteWebhookOptions) error

func (*Client) GetRepoTarball

func (g *Client) GetRepoTarball(ctx context.Context, opts cloud.GetRepoTarballOptions) ([]byte, error)

func (*Client) GetRepository

func (g *Client) GetRepository(ctx context.Context, identifier string) (string, error)

func (*Client) GetUser

func (g *Client) GetUser(ctx context.Context) (*cloud.User, error)

GetUser retrieves a user. Their team memberships are determined based on their access level in their gitlab groups, e.g. a user with owners access level on group acme maps to a user in the owners team in the acme organization.

func (*Client) GetWebhook

func (g *Client) GetWebhook(ctx context.Context, opts cloud.GetWebhookOptions) (cloud.Webhook, error)

func (*Client) ListRepositories

func (g *Client) ListRepositories(ctx context.Context, lopts cloud.ListRepositoriesOptions) ([]string, error)

func (*Client) ListTags

func (g *Client) ListTags(ctx context.Context, opts cloud.ListTagsOptions) ([]string, error)

func (*Client) SetStatus

func (g *Client) SetStatus(ctx context.Context, opts cloud.SetStatusOptions) error

func (*Client) UpdateWebhook

func (g *Client) UpdateWebhook(ctx context.Context, id string, opts cloud.UpdateWebhookOptions) error

type Cloud

type Cloud struct{}

func (Cloud) HandleEvent

func (*Cloud) NewClient

func (g *Cloud) NewClient(ctx context.Context, opts cloud.ClientOptions) (cloud.Client, error)

type TestGitlabServerOption

type TestGitlabServerOption func(*testServerDB)

func WithGitlabRepo

func WithGitlabRepo(repo string) TestGitlabServerOption

func WithGitlabTarball

func WithGitlabTarball(tarball []byte) TestGitlabServerOption

func WithGitlabUser

func WithGitlabUser(user *cloud.User) TestGitlabServerOption

Jump to

Keyboard shortcuts

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