gitlab

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.26.0

type Config struct {
	IncludeSubgroups bool
	SSHAuth          bool
}

Config includes extra config parameters for the GitLab client

type Gitlab

type Gitlab struct {
	RepositoryListing
	Config Config
	// contains filtered or unexported fields
}

Gitlab contain gitlab configuration

func New

func New(token, baseURL string, repoListing RepositoryListing, config Config) (*Gitlab, error)

New create a new Gitlab client

func (*Gitlab) ClosePullRequest

func (g *Gitlab) ClosePullRequest(ctx context.Context, pullReq scm.PullRequest) error

ClosePullRequest closes a pull request

func (*Gitlab) CreatePullRequest

func (g *Gitlab) CreatePullRequest(ctx context.Context, repo scm.Repository, prRepo scm.Repository, newPR scm.NewPullRequest) (scm.PullRequest, error)

CreatePullRequest creates a pull request

func (*Gitlab) ForkRepository added in v0.27.0

func (g *Gitlab) ForkRepository(ctx context.Context, repo scm.Repository, newOwner string) (scm.Repository, error)

ForkRepository forks a project

func (*Gitlab) GetOpenPullRequest added in v0.37.0

func (g *Gitlab) GetOpenPullRequest(ctx context.Context, repo scm.Repository, branchName string) (scm.PullRequest, error)

GetOpenPullRequest gets a pull request for one specific repository

func (*Gitlab) GetPullRequests

func (g *Gitlab) GetPullRequests(ctx context.Context, branchName string) ([]scm.PullRequest, error)

GetPullRequests gets all pull requests of with a specific branch

func (*Gitlab) GetRepositories

func (g *Gitlab) GetRepositories(ctx context.Context) ([]scm.Repository, error)

GetRepositories fetches repositories from all sources (groups/user/specific project)

func (*Gitlab) MergePullRequest

func (g *Gitlab) MergePullRequest(ctx context.Context, pullReq scm.PullRequest) error

MergePullRequest merges a pull request

func (*Gitlab) UpdatePullRequest added in v0.50.0

func (g *Gitlab) UpdatePullRequest(ctx context.Context, repo scm.Repository, pullReq scm.PullRequest, updatedPR scm.NewPullRequest) (scm.PullRequest, error)

UpdatePullRequest updates an existing pull request

type ProjectReference

type ProjectReference struct {
	OwnerName string
	Name      string
}

ProjectReference contains information to be able to reference a repository

func ParseProjectReference

func ParseProjectReference(val string) (ProjectReference, error)

ParseProjectReference parses a repository reference from the format "ownerName/repoName"

type RepositoryListing

type RepositoryListing struct {
	Groups    []string
	Users     []string
	Projects  []ProjectReference
	Topics    []string
	SkipForks bool
}

RepositoryListing contains information about which repositories that should be fetched

Jump to

Keyboard shortcuts

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