gitlab

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient(disableTLSVerify bool) *http.Client

NewHTTPClient ..

Types

type Client

type Client struct {
	*goGitlab.Client

	Readiness struct {
		URL        string
		HTTPClient *http.Client
	}

	RateLimiter       ratelimit.Limiter
	RateCounter       *ratecounter.RateCounter
	RequestsCounter   atomic.Uint64
	RequestsLimit     int
	RequestsRemaining int
	// contains filtered or unexported fields
}

Client ..

func NewClient

func NewClient(cfg ClientConfig) (*Client, error)

NewClient ..

func (*Client) GetBranchLatestCommit

func (c *Client) GetBranchLatestCommit(ctx context.Context, project, branch string) (string, float64, error)

GetBranchLatestCommit ..

func (*Client) GetCommitCountBetweenRefs

func (c *Client) GetCommitCountBetweenRefs(ctx context.Context, project, from, to string) (int, error)

GetCommitCountBetweenRefs ..

func (*Client) GetEnvironment

func (c *Client) GetEnvironment(
	ctx context.Context,
	project string,
	environmentID int,
) (
	environment schemas.Environment,
	err error,
)

GetEnvironment ..

func (*Client) GetProject

func (c *Client) GetProject(ctx context.Context, name string) (*goGitlab.Project, error)

GetProject ..

func (*Client) GetProjectBranches

func (c *Client) GetProjectBranches(ctx context.Context, p schemas.Project) (
	refs schemas.Refs,
	err error,
)

GetProjectBranches ..

func (*Client) GetProjectEnvironments

func (c *Client) GetProjectEnvironments(ctx context.Context, p schemas.Project) (
	envs schemas.Environments,
	err error,
)

GetProjectEnvironments ..

func (*Client) GetProjectMostRecentTagCommit

func (c *Client) GetProjectMostRecentTagCommit(ctx context.Context, projectName, filterRegexp string) (string, float64, error)

GetProjectMostRecentTagCommit ..

func (*Client) GetProjectPipelines

func (c *Client) GetProjectPipelines(
	ctx context.Context,
	projectName string,
	options *goGitlab.ListProjectPipelinesOptions,
) (
	[]*goGitlab.PipelineInfo,
	*goGitlab.Response,
	error,
)

GetProjectPipelines ..

func (*Client) GetProjectTags

func (c *Client) GetProjectTags(ctx context.Context, p schemas.Project) (
	refs schemas.Refs,
	err error,
)

GetProjectTags ..

func (*Client) GetRefPipeline

func (c *Client) GetRefPipeline(ctx context.Context, ref schemas.Ref, pipelineID int) (p schemas.Pipeline, err error)

GetRefPipeline ..

func (*Client) GetRefPipelineTestReport added in v0.5.5

func (c *Client) GetRefPipelineTestReport(ctx context.Context, ref schemas.Ref) (schemas.TestReport, error)

GetRefPipelineTestReport ..

func (*Client) GetRefPipelineVariablesAsConcatenatedString

func (c *Client) GetRefPipelineVariablesAsConcatenatedString(ctx context.Context, ref schemas.Ref) (string, error)

GetRefPipelineVariablesAsConcatenatedString ..

func (*Client) GetRefsFromPipelines

func (c *Client) GetRefsFromPipelines(ctx context.Context, p schemas.Project, refKind schemas.RefKind) (refs schemas.Refs, err error)

GetRefsFromPipelines ..

func (*Client) ListPipelineBridges added in v0.4.6

func (c *Client) ListPipelineBridges(ctx context.Context, projectNameOrID string, pipelineID int) (bridges []*goGitlab.Bridge, err error)

ListPipelineBridges ..

func (*Client) ListPipelineChildJobs added in v0.4.6

func (c *Client) ListPipelineChildJobs(ctx context.Context, projectNameOrID string, parentPipelineID int) (jobs []schemas.Job, err error)

ListPipelineChildJobs ..

func (*Client) ListPipelineJobs added in v0.4.6

func (c *Client) ListPipelineJobs(ctx context.Context, projectNameOrID string, pipelineID int) (jobs []schemas.Job, err error)

ListPipelineJobs ..

func (*Client) ListProjects

func (c *Client) ListProjects(ctx context.Context, w config.Wildcard) ([]schemas.Project, error)

ListProjects ..

func (*Client) ListRefMostRecentJobs

func (c *Client) ListRefMostRecentJobs(ctx context.Context, ref schemas.Ref) (jobs []schemas.Job, err error)

ListRefMostRecentJobs ..

func (*Client) ListRefPipelineJobs

func (c *Client) ListRefPipelineJobs(ctx context.Context, ref schemas.Ref) (jobs []schemas.Job, err error)

ListRefPipelineJobs ..

func (*Client) ReadinessCheck

func (c *Client) ReadinessCheck(ctx context.Context) healthcheck.Check

ReadinessCheck ..

func (*Client) UpdateVersion added in v0.5.6

func (c *Client) UpdateVersion(version GitLabVersion)

func (*Client) Version added in v0.5.6

func (c *Client) Version() GitLabVersion

type ClientConfig

type ClientConfig struct {
	URL              string
	Token            string
	UserAgentVersion string
	DisableTLSVerify bool
	ReadinessURL     string

	RateLimiter ratelimit.Limiter
}

ClientConfig ..

type GitLabVersion added in v0.5.6

type GitLabVersion struct {
	Version string
}

func NewGitLabVersion added in v0.5.6

func NewGitLabVersion(version string) GitLabVersion

func (GitLabVersion) PipelineJobsKeysetPaginationSupported added in v0.5.6

func (v GitLabVersion) PipelineJobsKeysetPaginationSupported() bool

PipelineJobsKeysetPaginationSupported returns true if the GitLab instance is running 15.9 or later.

Jump to

Keyboard shortcuts

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