Documentation
¶
Overview ¶
Package gitlab implements the provider interface for GitLab.
This package provides GitLab-specific API integration for repository operations including listing, cloning, and group management.
Features ¶
- Repository listing (group and user)
- Subgroup support (flat and nested modes)
- Custom SSH port configuration
- Self-hosted instance support
- Token validation
Usage ¶
provider, err := gitlab.NewProvider(token, "https://gitlab.example.com") repos, err := provider.ListOrganizationRepos(ctx, "mygroup")
Index ¶
- type Provider
- func (p *Provider) CreatePullRequest(ctx context.Context, in provider.CreatePullRequestInput) (*provider.PullRequest, error)
- func (p *Provider) FindPullRequest(ctx context.Context, owner, repo, head, base string) (*provider.PullRequest, error)
- func (p *Provider) GetRateLimit(ctx context.Context) (*provider.RateLimit, error)
- func (p *Provider) GetRepository(ctx context.Context, owner, repo string) (*provider.Repository, error)
- func (p *Provider) ListOrganizationRepos(ctx context.Context, group string) ([]*provider.Repository, error)
- func (p *Provider) ListOrganizations(ctx context.Context) ([]*provider.Organization, error)
- func (p *Provider) ListUserRepos(ctx context.Context, user string) ([]*provider.Repository, error)
- func (p *Provider) Name() string
- func (p *Provider) SSHPort() int
- func (p *Provider) SetToken(token string) error
- func (p *Provider) ValidateToken(ctx context.Context) (bool, error)
- type ProviderOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the provider.Provider interface for GitLab.
func NewProvider ¶
NewProvider creates a new GitLab provider.
func NewProviderWithOptions ¶
func NewProviderWithOptions(opts ProviderOptions) (*Provider, error)
NewProviderWithOptions creates a new GitLab provider with custom options.
func (*Provider) CreatePullRequest ¶
func (p *Provider) CreatePullRequest(ctx context.Context, in provider.CreatePullRequestInput) (*provider.PullRequest, error)
CreatePullRequest creates a GitLab merge request.
func (*Provider) FindPullRequest ¶
func (p *Provider) FindPullRequest(ctx context.Context, owner, repo, head, base string) (*provider.PullRequest, error)
FindPullRequest returns the open MR for head/base, or ErrPullRequestNotFound.
func (*Provider) GetRateLimit ¶
GetRateLimit returns current rate limit status GitLab doesn't have a dedicated rate limit API, so we return estimated values.
func (*Provider) GetRepository ¶
func (p *Provider) GetRepository(ctx context.Context, owner, repo string) (*provider.Repository, error)
GetRepository gets a single repository from GitLab.
func (*Provider) ListOrganizationRepos ¶
func (p *Provider) ListOrganizationRepos(ctx context.Context, group string) ([]*provider.Repository, error)
ListOrganizationRepos lists all repositories in a GitLab group.
func (*Provider) ListOrganizations ¶
ListOrganizations lists groups the authenticated user belongs to.
func (*Provider) ListUserRepos ¶
ListUserRepos lists all repositories for a user.
func (*Provider) SSHPort ¶
SSHPort returns the configured custom SSH port (0 means the default, 22). It makes the SSH-port wiring observable so callers/tests can confirm the port survived provider construction — the field that historically drifted between the forge-sync and doctor provider-creation paths.
type ProviderOptions ¶
type ProviderOptions struct {
Token string
BaseURL string // API endpoint (http/https only)
SSHPort int // Custom SSH port (0 = default 22)
}
ProviderOptions configures the GitLab Provider.