gitlab

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 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) 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) 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 GroupMembers added in v1.1.0

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

GroupMembers maps group IDs to their direct members.

type Resources

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

Jump to

Keyboard shortcuts

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