gitlabclient

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactInfo

type ArtifactInfo struct {
	JobID    int
	JobName  string
	Filename string
	Size     int64
	ExpireAt string
}

ArtifactInfo contains artifact information

type Client

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

Client wraps the GitLab client

func NewClient

func NewClient(url, token string) (*Client, error)

NewClient creates a new GitLab client

func (*Client) GetJobArtifacts

func (c *Client) GetJobArtifacts(projectID string, jobID int) (*ArtifactInfo, error)

GetJobArtifacts gets artifacts for a job

func (*Client) GetLatestPipeline

func (c *Client) GetLatestPipeline(projectID, ref string) (*PipelineInfo, error)

GetLatestPipeline gets the latest pipeline for a ref

func (*Client) GetPipelineStats

func (c *Client) GetPipelineStats(projectID string) (*PipelineStats, error)

GetPipelineStats gets pipeline statistics

func (*Client) GetProject

func (c *Client) GetProject(projectID string) (*ProjectInfo, error)

GetProject gets project information

func (*Client) ListEnvironments

func (c *Client) ListEnvironments(projectID string) ([]EnvironmentInfo, error)

ListEnvironments lists project environments

func (*Client) ListPipelineArtifacts

func (c *Client) ListPipelineArtifacts(projectID string, pipelineID int) ([]ArtifactInfo, error)

ListPipelineArtifacts lists all artifacts from a pipeline

func (*Client) ListPipelineJobs

func (c *Client) ListPipelineJobs(projectID string, pipelineID int, filter JobFilter) ([]JobInfo, error)

ListPipelineJobs lists pipeline jobs

func (*Client) ListPipelines

func (c *Client) ListPipelines(projectID string, filter PipelineFilter) ([]PipelineInfo, error)

ListPipelines lists pipelines

func (*Client) TriggerPipeline

func (c *Client) TriggerPipeline(projectID, ref string, variables map[string]string) (*PipelineInfo, error)

TriggerPipeline triggers a new pipeline

func (*Client) WaitForPipeline

func (c *Client) WaitForPipeline(projectID string, pipelineID int) (*PipelineInfo, error)

WaitForPipeline waits for pipeline to complete

type EnvironmentInfo

type EnvironmentInfo struct {
	ID             int
	Name           string
	State          string
	ExternalURL    string
	LastDeployment string
}

EnvironmentInfo contains environment information

type JobFilter

type JobFilter struct {
	Status string
	Stage  string
}

JobFilter contains job filter options

type JobInfo

type JobInfo struct {
	ID        int
	Name      string
	Stage     string
	Status    string
	Duration  string
	StartedAt string
	WebURL    string
}

JobInfo contains job information

type PipelineFilter

type PipelineFilter struct {
	Status string
	Ref    string
	Limit  int
}

PipelineFilter contains filter options

type PipelineInfo

type PipelineInfo struct {
	ID        int
	Status    string
	Ref       string
	SHA       string
	WebURL    string
	CreatedAt string
	Duration  string
}

PipelineInfo contains pipeline information

type PipelineStats

type PipelineStats struct {
	Success     int
	Failed      int
	Other       int
	AvgDuration string
}

PipelineStats contains pipeline statistics

type ProjectInfo

type ProjectInfo struct {
	ID                int
	Name              string
	PathWithNamespace string
	DefaultBranch     string
	WebURL            string
}

ProjectInfo contains project information

Jump to

Keyboard shortcuts

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