gitlab

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: Unlicense Imports: 15 Imported by: 0

Documentation

Overview

Package gitlab is an internal wrapper for the go-gitlab package

Most functions serve to expose debug logging if set and accept a project name string over an ID

Index

Constants

View Source
const (
	TmplMR    = "merge_request_templates/default.md"
	TmplIssue = "issue_templates/default.md"
)

Defines filepath for default GitLab templates

Variables

View Source
var (
	ErrProjectNotFound = errors.New("gitlab project not found")
)

Functions

func BranchPushed added in v0.5.2

func BranchPushed(project, branch string) bool

BranchPushed checks if a branch exists on a GitLab Project

func ClonePath

func ClonePath(project string) (string, error)

ClonePath returns the ssh url to the GitLab project

func FindProject

func FindProject(project string) (*gitlab.Project, error)

FindProject looks up the Gitlab project. If the namespace is not provided in the project string it will search for projects in the users namespace

func Fork

func Fork(project string) (string, error)

Fork creates a user fork of a GitLab project

func Host added in v0.6.0

func Host() string

Host exposes the GitLab scheme://hostname used to interact with the API

func Init added in v0.6.0

func Init()

Init handles all of the credential setup and prompts for user input when not present. At the end it initializes a gitlab client for use throughout lab.

func IssueCreate

func IssueCreate(project string, opts *gitlab.CreateIssueOptions) (string, error)

IssueCreate opens a new issue on a GitLab Project

func IssueList

func IssueList(project string, opts *gitlab.ListProjectIssuesOptions) ([]*gitlab.Issue, error)

IssueList gets a list of issues on a GitLab Project

func ListMRs

func ListMRs(project string, opts *gitlab.ListProjectMergeRequestsOptions) ([]*gitlab.MergeRequest, error)

ListMRs lists the MRs on a GitLab project

func LoadGitLabTmpl added in v0.5.1

func LoadGitLabTmpl(tmplName string) string

LoadGitLabTmpl loads gitlab templates for use in creating Issues and MRs

https://gitlab.com/help/user/project/description_templates.md#setting-a-default-template-for-issues-and-merge-requests

func MergeRequest

func MergeRequest(project string, opts *gitlab.CreateMergeRequestOptions) (string, error)

MergeRequest opens a merge request on GitLab

func ProjectSnippetCreate added in v0.6.0

func ProjectSnippetCreate(pid interface{}, opts *gitlab.CreateProjectSnippetOptions) (*gitlab.Snippet, error)

ProjectSnippetCreate creates a snippet in a project

func ProjectSnippetDelete added in v0.6.0

func ProjectSnippetDelete(pid interface{}, id int) error

ProjectSnippetDelete deletes a project snippet

func ProjectSnippetList added in v0.6.0

func ProjectSnippetList(pid interface{}, opts *gitlab.ListProjectSnippetsOptions) ([]*gitlab.Snippet, error)

ProjectSnippetList lists snippets on a project

func SnippetCreate added in v0.6.0

func SnippetCreate(opts *gitlab.CreateSnippetOptions) (*gitlab.Snippet, error)

SnippetCreate creates a personal snippet

func SnippetDelete added in v0.6.0

func SnippetDelete(id int) error

SnippetDelete deletes a personal snippet

func SnippetList added in v0.6.0

func SnippetList(opts *gitlab.ListSnippetsOptions) ([]*gitlab.Snippet, error)

SnippetList lists snippets on a project

func User

func User() string

User exposes the configured GitLab user

Types

This section is empty.

Jump to

Keyboard shortcuts

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