gitlab

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTokenFromNetrc

func ExtractTokenFromNetrc(instance string) (string, error)

ExtractTokenFromNetrc attempts to find credentials for the given host in .netrc file

func NormalizeInstanceURL

func NormalizeInstanceURL(instance string) string

NormalizeInstanceURL ensures the instance URL has a proper format

Types

type APIError

type APIError struct {
	Message string `json:"message"`
}

APIError represents an error from the GitLab API

type Client

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

Client represents a GitLab API client

func NewClient

func NewClient(instance, token string, timeout time.Duration) *Client

NewClient creates a new GitLab API client

func (*Client) Lint

func (c *Client) Lint(ctx context.Context, content []byte, projectRef string) (*LintResponse, error)

Lint validates a CI configuration using the GitLab API

func (*Client) ValidateToken

func (c *Client) ValidateToken(ctx context.Context) error

ValidateToken checks if the current token is valid by making a simple API call

type LintRequest

type LintRequest struct {
	Content     string `json:"content"`
	DryRun      bool   `json:"dry_run,omitempty"`
	IncludeJobs bool   `json:"include_jobs,omitempty"`
}

LintRequest represents the request body for the GitLab CI lint API

type LintResponse

type LintResponse struct {
	Valid      bool       `json:"valid"`
	Errors     []APIError `json:"errors,omitempty"`
	Warnings   []string   `json:"warnings,omitempty"`
	MergedYaml string     `json:"merged_yaml,omitempty"`
}

LintResponse represents the response from the GitLab CI lint API

Jump to

Keyboard shortcuts

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