gitlab

package
v0.3.27 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package gitlab provides gitlab related code

templ: version: v0.3.906

Index

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(r *http.Request, secret string) (*vcs.EventPayload, error)

func Icon added in v0.3.24

func Icon() templ.Component

func NewOAuthClient added in v0.1.14

func NewTokenClient added in v0.1.14

func NewTokenClient(opts vcs.NewTokenClientOptions) (vcs.Client, error)

func RegisterOAuthHandler added in v0.3.24

func RegisterOAuthHandler(
	authenticatorService *authenticator.Service,
	hostname string,
	clientID, clientSecret string,
	skipTLSVerification bool,
) error

func RegisterVCSKind added in v0.3.24

func RegisterVCSKind(vcsService *vcs.Service, hostname string, skipTLSVerification bool)

Types

type Client

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

func NewClient

func NewClient(cfg ClientOptions) (*Client, error)

func (*Client) CreateWebhook

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

func (*Client) DeleteWebhook

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

func (*Client) GetCommit added in v0.1.8

func (g *Client) GetCommit(ctx context.Context, repo vcs.Repo, ref string) (vcs.Commit, error)

func (*Client) GetCurrentUser added in v0.1.8

func (g *Client) GetCurrentUser(ctx context.Context) (authenticator.UserInfo, error)

func (*Client) GetDefaultBranch added in v0.3.24

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

func (*Client) GetRepoTarball

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

func (*Client) GetWebhook

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

func (*Client) ListPullRequestFiles added in v0.1.4

func (g *Client) ListPullRequestFiles(ctx context.Context, repo vcs.Repo, pull int) ([]string, error)

func (*Client) ListRepositories

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

func (*Client) ListTags

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

func (*Client) SetStatus

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

func (*Client) UpdateWebhook

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

type ClientOptions added in v0.1.14

type ClientOptions struct {
	Hostname            string
	SkipTLSVerification bool

	OAuthToken    *oauth2.Token
	PersonalToken *string
}

Jump to

Keyboard shortcuts

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