gitlab

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package gitlab implements the read-only Source for GitLab.com and self-managed GitLab. Auth is a read-scoped access token (project, group, or personal). It has no mutating operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	BaseURL string // empty = gitlab.com; self-managed: https://gitlab.example.com
	Token   string // read-scoped access token
}

Options configures the GitLab source.

type Source

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

Source is a read-only GitLab backend.

func New

func New(opts Options, logger *slog.Logger) (*Source, error)

New builds a GitLab source from a read-scoped access token.

func (*Source) CloneURL

func (s *Source) CloneURL(_ context.Context, r source.Repo) (string, error)

CloneURL returns the HTTPS clone URL (no embedded credentials).

func (*Source) FetchMetadata

func (s *Source) FetchMetadata(ctx context.Context, r source.Repo) ([]byte, error)

FetchMetadata dumps per-resource project metadata as gitdr.meta/v1 JSON.

func (*Source) GitAuthHeader

func (s *Source) GitAuthHeader(_ context.Context) (string, error)

GitAuthHeader returns the token as Basic auth (username oauth2) for git over HTTPS, injected into git via env so it never hits argv.

func (*Source) ListRepos

func (s *Source) ListRepos(ctx context.Context, f source.Filter) ([]source.Repo, error)

ListRepos returns projects the token can access, filtered.

Jump to

Keyboard shortcuts

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