Documentation
¶
Index ¶
- type Client
- func (c *Client) CommitDriftFiles(ctx context.Context, project, branchName, generatedDir, repoPath string) (bool, error)
- func (c *Client) CreateDriftMR(ctx context.Context, project, branchName, defaultBranch string) (*gl.MergeRequest, error)
- func (c *Client) EnsureBranch(ctx context.Context, project, branchName, defaultBranch string) error
- func (c *Client) FetchAll(ctx context.Context, skipSet skip.Set) (*Resources, error)
- func (c *Client) FindExistingDriftMR(ctx context.Context, project string) (*gl.BasicMergeRequest, error)
- func (c *Client) GetDefaultBranch(ctx context.Context, project string) (string, error)
- func (c *Client) ListGroupLabels(ctx context.Context, groups []*gl.Group) (GroupLabels, error)
- func (c *Client) ListGroupMembers(ctx context.Context, groups []*gl.Group) (GroupMembers, error)
- func (c *Client) ListGroups(ctx context.Context) ([]*gl.Group, error)
- func (c *Client) ListProjectLabels(ctx context.Context, projects []*gl.Project) (ProjectLabels, error)
- func (c *Client) ListProjects(ctx context.Context) ([]*gl.Project, error)
- type DriftMRResult
- type GroupLabels
- type GroupMembers
- type ProjectLabels
- type Resources
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 (*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
EnsureBranch creates the branch if it does not already exist.
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
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 (*Client) ListGroupMembers ¶ added in v1.1.0
func (*Client) ListProjectLabels ¶ added in v1.5.0
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
ProjectLabels maps project IDs to their labels.
type Resources ¶
type Resources struct {
Groups []*gl.Group
Projects []*gl.Project
GroupMembers GroupMembers
GroupLabels GroupLabels
ProjectLabels ProjectLabels
}