gitlab

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps the GitLab API client and implements GitLabClient interface

func New

func New(url, token string, timeout time.Duration) (*Client, error)

New creates a new GitLab client with timeout

func (*Client) FetchAllProjects

func (c *Client) FetchAllProjects(since *time.Time, membership bool) ([]model.Project, error)

FetchAllProjects fetches all accessible projects from GitLab using parallel pagination If since is provided, only fetches projects with last_activity_after >= since (incremental sync) If membership is true, only fetches projects where the user is a member Returns a slice of Project structs containing path, name, starred, and archived information

func (*Client) FetchMemberProjects added in v0.3.2

func (c *Client) FetchMemberProjects() (map[string]bool, error)

FetchMemberProjects fetches all projects where the current user is a member Returns a map of project PathWithNamespace → true for O(1) lookup

func (*Client) FetchStarredProjects added in v0.2.9

func (c *Client) FetchStarredProjects() (map[string]bool, error)

FetchStarredProjects fetches all projects starred by the current user Returns a map of project PathWithNamespace → true for O(1) lookup

func (*Client) GetCurrentUsername

func (c *Client) GetCurrentUsername() (string, error)

GetCurrentUsername fetches the username of the authenticated user

func (*Client) TestConnection

func (c *Client) TestConnection() error

TestConnection tests the connection to GitLab by fetching current user

type GitLabClient added in v0.1.0

type GitLabClient interface {
	FetchAllProjects(since *time.Time, membership bool) ([]model.Project, error)
	TestConnection() error
	GetCurrentUsername() (string, error)
}

GitLabClient defines the interface for GitLab API operations This interface enables mocking in tests while maintaining production functionality

Jump to

Keyboard shortcuts

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