Documentation
¶
Index ¶
Constants ¶
const GitLabAPI = "/api/v3/"
Variables ¶
This section is empty.
Functions ¶
func RandomString ¶
RandomString generates a random string of a specified length.
Types ¶
type Client ¶
Client is a wrapper for the go-gitlab.Client object that provides additional methods and initializes with a URL.
type Labels ¶
type Labels struct { *gogitlab.LabelsService // contains filtered or unexported fields }
func (*Labels) CopyGlobalLabelsTo ¶
CopyGlobalLabelsTo copies the global labels to the given project id. Since there's no API in GitLab for accessing global labels, it creates a temporary project that should have all global labels copied into and then reads the labels from it. It deletes the temporary project when done.
If at least one label fails to copy, it will return an error.
func (*Labels) CopyLabels ¶
CopyLabels copies the labels from a project into another one, based on the given pid's.
If at least one label fails to copy, it will return an error.
func (*Labels) DeleteWithRegex ¶
DeleteWithRegex deletes labels from a project, optionally by matching against a Regexp pattern.
func (*Labels) UpdateWithRegex ¶
func (srv *Labels) UpdateWithRegex(pid interface{}, opts *gogitlab.UpdateLabelOptions) error
UpdateWithRegex updates label(s) by a given regex in a given project. The difference between *LabelsService.UpdateLabel() and this is that opts.Name is a regexp string, so you can do things like replace all labels like 'type:bug' with 'type/bug' using:
opts.Name: "(.+):(.+)" opts.NewName: "${1}/${2}"
If at least one label fails to update, it will return an error.