Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateProjectsInGroups ¶
UpdateProjectsInGroups is the entry point for this package and will update any projects found within the groups defined in *Config.Groups.
Types ¶
type Config ¶
type Config struct { APIToken *string `json:"apitoken,omitempty"` APIURL *string `json:"apiurl,omitempty"` Defaults *Settings `json:"defaults,omitempty"` Groups []*Settings `json:"groups,omitempty"` DryRun bool }
Config represents the GitLab section of the config file.
func (*Config) LoadCreds ¶
LoadCreds accepts a token and url string; if these are empty it will attempt read the GITLAB_TOKEN and GITLAB_URL env vars as a source for credentials. If these are also empty it returns an error.
func (*Config) MergeRequestApprovalSettings ¶
MergeRequestApprovalSettings will return the Merge Request Approval settings for a project by looking up it's namespace in the config.
func (*Config) ProtectedBranchesSettings ¶
func (c *Config) ProtectedBranchesSettings(ns string) []*ProtectedBranchSetting
ProtectedBranchesSettings will return the Protected Branches settings for a project by looking up it's namespace in the config.
func (*Config) SlackSettings ¶
func (c *Config) SlackSettings(ns string) *SlackSettings
SlackSettings will return the Slack settings for a project by looking up it's namespace in the config.
type Groups ¶
type Groups []*gitlab.Group
Groups exists to provide helper methods to []*gitlab.Group
type ProtectedBranchSetting ¶
type Settings ¶
type Settings struct { Name string `json:"name,omitempty"` General struct { MergeRequestApprovals gitlab.ProjectApprovals `json:"merge_request_approvals,omitempty"` } `json:"general,omitempty"` Repository struct { ProtectedBranches []*ProtectedBranchSetting `json:"protected_branches,omitempty"` } `json:"repository,omitempty"` Integrations struct { Slack SlackSettings `json:"slack,omitempty"` } `json:"integrations,omitempty"` }
Settings represents a group's settings.
type SlackSettings ¶
type SlackSettings struct { Active bool `json:"active"` Events []string `json:"events"` Properties gitlab.SlackServiceProperties `json:"properties,omitempty"` }
SlackSettings represents a project's Slack settings.