gitlab

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 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) ([]types.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) Returns a slice of Project structs containing path and name

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) ([]types.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