lab

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

README

lab

Build Status GoDoc

lab is a command line interface to Gitlab.

Installation

Release
  1. Download the latest release for your platform.
  2. Make it executable, e.g. chmod +x lab_linux_amd64
  3. Put it somewhere on your path, e.g. mv lab_linux_amd64 /usr/local/bin/lab
From source
$ go get -u github.com/joshbohde/lab
$ go install github.com/joshbohde/lab/cmd/lab

Commands

auth

Will configure access tokens for the current project, if none exist.

$ lab auth

This will open your browser to your Gitlab access tokens page, for either https://gitlab.com, or your self-hosted instance. Create a new token with API scope, and paste it back into your terminal.

issue

Opens an issue in the current project.

$ lab issue

This will open your editor so that you can fill in the title and description of the issue.

Flags are available for command line scripting. To see a full list of available flags, run lab issue --help.

merge-request

Opens a merge request from the current branch to the default branch.

$ lab merge-request

This will open your editor so that you can fill in the title and description of the merge request.

Flags are available for command line scripting. To see a full list of available flags, run lab merge-request --help.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	Git     Git
	Browser Browser
	Reader  io.Reader
	Writer  io.Writer
}

func (*AuthService) RemoteProject

func (service *AuthService) RemoteProject() (RemoteProject, error)

AuthService will ensure the user logs in if the remote project requires it

type Body

type Body struct {
	Title       string
	Description string
}

func (*Body) ParseContent

func (body *Body) ParseContent(content string)

type Browser

type Browser interface {
	Open(string) error
}

type CreateIssueOptions

type CreateIssueOptions struct {
	Message string
	File    string
	Edit    bool
}

func (*CreateIssueOptions) Issue

func (opts *CreateIssueOptions) Issue() Issue

type CreateMergeRequestOptions

type CreateMergeRequestOptions struct {
	Message      string
	File         string
	Edit         bool
	SourceBranch string
	TargetBranch string
	KeepSource   bool
}

func (*CreateMergeRequestOptions) MergeRequest

func (opts *CreateMergeRequestOptions) MergeRequest() MergeRequest

type Git

type Git interface {
	LocalBranch() (string, error)
	RemoteProject() (RemoteProject, error)
	SetAccessToken(RemoteProject, string) error
}

type Gitlab

type Gitlab interface {
	Project(RemoteProject) (Project, error)
	CreateMergeRequest(RemoteProject, *MergeRequest) error
	CreateIssue(RemoteProject, *Issue) error
}

type Issue

type Issue struct {
	Body
	URL string
}

type IssueService

type IssueService struct {
	Git     Git
	Gitlab  Gitlab
	Message Message
	Writer  io.Writer
}

func (*IssueService) Create

func (service *IssueService) Create(opts *CreateIssueOptions) error

type MergeRequest

type MergeRequest struct {
	Body
	URL          string
	SourceBranch string
	TargetBranch string
	KeepSource   bool
}

type MergeRequestService

type MergeRequestService struct {
	Git     Git
	Gitlab  Gitlab
	Message Message
	Writer  io.Writer
}

func (*MergeRequestService) Create

func (service *MergeRequestService) Create(opts *CreateMergeRequestOptions) error

type Message

type Message interface {
	GetMessage(*string, MessageOpts) (func() error, error)
}

type MessageOpts

type MessageOpts struct {
	Edit      bool
	InputFile string
	EditFile  string
	Topic     string
	Comment   string
}

type MissingToken

type MissingToken struct {
	Host string
}

func (MissingToken) Error

func (m MissingToken) Error() string

type Project

type Project struct {
	DefaultBranch string
}

type RemoteProject

type RemoteProject struct {
	Host  string
	Path  string
	Token string
}

func ParseRemoteProject

func ParseRemoteProject(url url.URL) RemoteProject

Directories

Path Synopsis
cmd
lab command

Jump to

Keyboard shortcuts

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