Documentation ¶
Overview ¶
branch wrappers.
Merge request wrappers.
Package wrapper provides a wrapper for the go-gitlab package for common functions.
Index ¶
- type CommitAction
- func ChmodFileAction(path string, executeFilemode bool) *CommitAction
- func CreateFileAction(path, content string) *CommitAction
- func DeleteFileAction(path string) *CommitAction
- func MoveFileAction(path, previousPath string) *CommitAction
- func NewDirectoryAction(path string) *CommitAction
- func UpdateFileAction(path, content string) *CommitAction
- type Wrapper
- func (w *Wrapper) ClearBranch(branch, commitMessage string) (*gl.Commit, error)
- func (w *Wrapper) Commit(actions []*CommitAction, branch, commitMessage string) (*gl.Commit, error)
- func (w *Wrapper) CreateBranch(branch string, refBranch string) (*gl.Branch, error)
- func (w *Wrapper) CreateMerge(title, description, srcBranch, destBranch string, squash bool) (*gl.MergeRequest, error)
- func (w *Wrapper) CreateMergeRequestNote(mergeRequestID int, noteBody string) (*gl.Note, error)
- func (w *Wrapper) DeleteMergeRequestNote(mergeRequestID, noteID int) error
- func (w *Wrapper) ListMergeRequestNotes(mergeRequestID int) ([]*gl.Note, error)
- func (w *Wrapper) ListMergeRequests(srcBranch, destBranch string) ([]*gl.MergeRequest, error)
- func (w *Wrapper) ListProjectMergeRequests(srcBranch, destBranch string) ([]*gl.MergeRequest, error)
- func (w *Wrapper) ListRepo(path, branch string) ([]*gl.TreeNode, error)
- func (w *Wrapper) NewFile(branch, commitMsg, fileName string, content []byte) (*gl.FileInfo, error)
- func (w *Wrapper) UpdateMergeRequestNote(mergeRequestID, noteID int, noteBody string) (*gl.Note, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitAction ¶
type CommitAction = gl.CommitActionOptions
CommitAction is an alias of CommitActionOptions.
func ChmodFileAction ¶
func ChmodFileAction(path string, executeFilemode bool) *CommitAction
ChmodFileAction returns a CommitActionOptions that changes the executable status of the file at path to execute_filemode.
func CreateFileAction ¶
func CreateFileAction(path, content string) *CommitAction
CreateFileAction returns a CommitActionOptions to create a new file at path with content.
func DeleteFileAction ¶
func DeleteFileAction(path string) *CommitAction
DeleteFileAction returns a CommitActionOptions to delete the file at path.
func MoveFileAction ¶
func MoveFileAction(path, previousPath string) *CommitAction
MoveFileAction returns a CommitActionOptions to move a file from previousPath to path.
func NewDirectoryAction ¶
func NewDirectoryAction(path string) *CommitAction
NewDirectoryAction returns a CommitActionOptions to create a .gitkeep file in the new directory. This tells git to create the directory and store that file there.
path: Just supply the path to the directory. .gitkeep will be added by the function.
func UpdateFileAction ¶
func UpdateFileAction(path, content string) *CommitAction
UpdateFileAction returns a CommitActionOptions to update the file at path with content.
type Wrapper ¶
A Wrapper is a go-gitlab and communicates with the GitLab endpoint.
func (*Wrapper) ClearBranch ¶
ClearBranch deletes everything in branch with a single commit.
func (*Wrapper) Commit ¶
Commit creates a new commit with the included array of CommitActionOptions.
func (*Wrapper) CreateBranch ¶
CreateBranch creates a new branch in the target repository. branch: name of the new branch. refBranch: name of the parent branch. Cannot be empty.
func (*Wrapper) CreateMerge ¶
func (w *Wrapper) CreateMerge(title, description, srcBranch, destBranch string, squash bool) (*gl.MergeRequest, error)
CreateMerge creates a merge request from srcBranch to destBranch.
func (*Wrapper) CreateMergeRequestNote ¶
CreateMergeRequestNote adds a note/comment to mergeRequestID.
func (*Wrapper) DeleteMergeRequestNote ¶
DeleteMergeRequestNote deletes mergeRequestID's noteID.
func (*Wrapper) ListMergeRequestNotes ¶
ListMergeRequestNotes lists all notes for mergeRequestID.
func (*Wrapper) ListMergeRequests ¶
func (w *Wrapper) ListMergeRequests(srcBranch, destBranch string) ([]*gl.MergeRequest, error)
ListMergeRequests lists all merge requests from srcBranch to destBranch across all projects. Pass an empty value to search everything. E.g., ListMergeRequests("", "") displays all merge requests.
func (*Wrapper) ListProjectMergeRequests ¶
func (w *Wrapper) ListProjectMergeRequests(srcBranch, destBranch string) ([]*gl.MergeRequest, error)
ListProjectMergeRequests lists all merge requests for a project. Pass empty values to show everything.
func (*Wrapper) ListRepo ¶
ListRepo list all files in the repository. path is the path inside the repository to list. branch is the target branch.