api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIURL

func APIURL(host string) string

APIURL returns the API base URL for a given host.

func RefreshOAuthTokenIfNeeded added in v0.0.14

func RefreshOAuthTokenIfNeeded(host, currentToken string) string

RefreshOAuthTokenIfNeeded checks if the OAuth token is expired (or about to expire) and refreshes it. Returns the refreshed token on success, or the original token on failure.

func WebURL

func WebURL(host, path string) string

WebURL returns the web URL for a given host and path.

Types

type Client

type Client struct {
	*gitlab.Client
	// contains filtered or unexported fields
}

Client wraps the GitLab API client.

func NewClient

func NewClient(host string) (*Client, error)

NewClient creates a new authenticated GitLab API client. It automatically selects the correct client type based on the stored auth method.

func NewClientFromHosts added in v0.0.9

func NewClientFromHosts() (*Client, error)

NewClientFromHosts creates a client using the first authenticated host found in hosts.json.

func NewClientWithToken

func NewClientWithToken(host, token string) (*Client, error)

NewClientWithToken creates a new GitLab API client with the given token.

func NewOAuthClient added in v0.0.2

func NewOAuthClient(host, token string) (*Client, error)

NewOAuthClient creates a new GitLab API client using an OAuth token.

func (*Client) Host

func (c *Client) Host() string

Host returns the hostname of the GitLab instance.

Jump to

Keyboard shortcuts

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