gitlabclient

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: MIT Package gitlabclient retrieves commits from GitLab and normalizes them into the shared model types used by sting.

SPDX-License-Identifier: MIT

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 retrieves commits from GitLab for an author over a time window.

func New

func New(token, baseURL string, perPage int, opts ...Option) (*Client, error)

New builds a Client. token may be empty for public data. baseURL, when set, targets a GitLab API v4 root (e.g. "https://gitlab.example.com/api/v4/"). perPage is clamped to the API's 1-100 range. WithRequestBudget can install a fixed client ceiling; without it, Collect meters against Query.MaxRequests.

func (*Client) Collect

func (c *Client) Collect(ctx context.Context, q model.Query) (model.Result, error)

Collect runs a query using its scope and returns the normalized result.

func (*Client) Cost added in v1.2.0

func (c *Client) Cost() model.CostReport

Cost reports requests consumed when the client was constructed with WithRequestBudget. Query results always carry their per-call cost, including the compatibility path for three-argument New calls.

type Option added in v1.2.0

type Option func(*Client)

Option configures a Client at construction time. New takes options variadically so existing three-argument callers remain source-compatible.

func WithRequestBudget added in v1.2.0

func WithRequestBudget(ceiling int) Option

WithRequestBudget caps provider requests and enables cost accounting. A ceiling of 0 is intentionally uncapped but still accounted.

Jump to

Keyboard shortcuts

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