cmd

package
v0.0.0-...-67bb5b8 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseBranch string

The branch that we wish to merge to

View Source
var RootCmd = &cobra.Command{
	Use:   "backlog-cli",
	Short: "Use Backlog from the command line.",
	Long:  `Use Backlog from the command line to create pull requests, check issue status, access web pages, etc.`,
}

RootCmd ... The primary main cobra command

Functions

func CheckIfBacklogRepo

func CheckIfBacklogRepo()

func Endpoint

func Endpoint(apiURL string) string

Endpoint .. returns an endpoint

func ErrorCheck

func ErrorCheck(err error)

ErrorCheck .. Checks for error != nil

func ErrorPanic

func ErrorPanic(err error)

ErrorPanic .. Checks for errors, panics if found

func Execute

func Execute()

Execute ... runs the command

func GetCurrentBranch

func GetCurrentBranch() string

CurrentBranch .. Gets current branch name.

func PrintResponse

func PrintResponse(responseData []byte)

PrintResponse .. Prints out a []byte

func ProjectKey

func ProjectKey() string

ProjectKey ... Returns the project key for the configuration (e.g "MARKETING")

func Repository

func Repository() *git.Repository

Repository .. Returns current repository

func RepositoryName

func RepositoryName() string

RepositoryName ... returns current repository name

func Truncate

func Truncate(s string) string

Truncate .. truncates a string to its max

Types

type Config

type Config struct {
	User           User
	BaseURL        string
	APIKey         string
	ProjectKey     string
	Repository     *git.Repository
	RepositoryName string
	CurrentBranch  string
	CurrentIssue   Issue
	DebugMode      bool
}

Config .. the configuration struct for backlog-cli

var GlobalConfig Config

GlobalConfig .. the global configuration for backlog-cli

type CurrentUser

type CurrentUser User

CurrentUser ..

type Issue

type Issue struct {
	ID          int    `json:"id"`
	IssueKey    string `json:"issueKey"`
	Description string `json:"description"`
	Summary     string `json:"summary"`
}

Issue .. the configuration struct for backlog-cli

func CurrentIssue

func CurrentIssue() Issue

CurrentIssue .. Returns the current issue

func (*Issue) Key

func (i *Issue) Key() string

Key .. Returns the issue's key (e.g. "BLG-123") as a string

type Notification

type Notification struct {
	ID                 int                            `json:"id"`
	Sender             notificationSender             `json:"sender"`
	Comment            notificationComment            `json:"comment"`
	PullRequestComment notificationPullRequestComment `json:"pullRequestComment"`
	Reason             int                            `json:"reason"`
	Content            string
}

Notification .. a PARTIAL struct for a Notification

type PullRequest

type PullRequest struct {
	Number      int               `json:"number"`
	Summary     string            `json:"summary"`
	Description string            `json:"description"`
	Base        string            `json:"base"`
	Branch      string            `json:"branch"`
	Issue       Issue             `json:"issue"`
	Status      pullRequestStatus `json:"status"`
}

PullRequest .. a PARTIAL struct for a PullRequest on Backlog

type User

type User struct {
	ID       int    `json:"id"`
	Username string `json:"userId"`
	Name     string `json:"name"`
	Email    string `json:"mailAddress"`
	Language string `json:"lang"`
}

User .. represents the current Backlog user

func GetCurrentUser

func GetCurrentUser() User

GetCurrentUser .. Returns the current user

Jump to

Keyboard shortcuts

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