gitlab

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(token, baseURL, group string) (*Client, error)

func NewClientFromAPI added in v1.4.0

func NewClientFromAPI(api *gl.Client, group string) *Client

func (*Client) CommitDriftFiles added in v1.4.0

func (c *Client) CommitDriftFiles(ctx context.Context, project, branchName, generatedDir, repoPath string) (bool, error)

CommitDriftFiles commits generated .tf files to the given branch. Returns true if a commit was created, false if all files are identical.

func (*Client) CreateDriftMR added in v1.4.0

func (c *Client) CreateDriftMR(ctx context.Context, project, branchName, defaultBranch string) (*gl.MergeRequest, error)

CreateDriftMR creates a new merge request for the drift branch.

func (*Client) EnsureBranch added in v1.4.0

func (c *Client) EnsureBranch(ctx context.Context, project, branchName, defaultBranch string) error

EnsureBranch creates the branch if it does not already exist.

func (*Client) FetchAll

func (c *Client) FetchAll(ctx context.Context, skipSet skip.Set) (*Resources, error)

func (*Client) FindExistingDriftMR added in v1.4.0

func (c *Client) FindExistingDriftMR(ctx context.Context, project string) (*gl.BasicMergeRequest, error)

FindExistingDriftMR searches for an open MR with a "drift/" source branch prefix. Returns nil, nil if no matching MR is found.

func (*Client) GetDefaultBranch added in v1.4.0

func (c *Client) GetDefaultBranch(ctx context.Context, project string) (string, error)

GetDefaultBranch returns the default branch for the given project. Falls back to "main" if the project has no default branch configured.

func (*Client) ListGroupLabels added in v1.5.0

func (c *Client) ListGroupLabels(ctx context.Context, groups []*gl.Group) (GroupLabels, error)

func (*Client) ListGroupMembers added in v1.1.0

func (c *Client) ListGroupMembers(ctx context.Context, groups []*gl.Group) (GroupMembers, error)

func (*Client) ListGroups

func (c *Client) ListGroups(ctx context.Context) ([]*gl.Group, error)

func (*Client) ListProjectLabels added in v1.5.0

func (c *Client) ListProjectLabels(ctx context.Context, projects []*gl.Project) (ProjectLabels, error)

func (*Client) ListProjects

func (c *Client) ListProjects(ctx context.Context) ([]*gl.Project, error)

type DriftMRResult added in v1.4.0

type DriftMRResult struct {
	WebURL  string
	Created bool // true = new MR, false = existing MR updated
}

DriftMRResult holds the outcome of the MR creation/update workflow.

type GroupLabels added in v1.5.0

type GroupLabels = map[int64][]*gl.GroupLabel

GroupLabels maps group IDs to their labels.

type GroupMembers added in v1.1.0

type GroupMembers = map[int64][]*gl.GroupMember

GroupMembers maps group IDs to their direct members.

type ProjectLabels added in v1.5.0

type ProjectLabels = map[int64][]*gl.Label

ProjectLabels maps project IDs to their labels.

type Resources

type Resources struct {
	Groups        []*gl.Group
	Projects      []*gl.Project
	GroupMembers  GroupMembers
	GroupLabels   GroupLabels
	ProjectLabels ProjectLabels
}

Jump to

Keyboard shortcuts

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