v1.12.1 Latest Latest

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 19 Imported by: 1



Forked from



View Source
const (
	IssueTemplate        = "issue_templates"
	MergeRequestTemplate = "merge_request_templates"


View Source
var (
	CachedConfig config.Config
	ConfigError  error
View Source
var SilentError = errors.New("SilentError")

SilentError is an error that triggers exit code 1 without any error messaging


func DescriptionPrompt added in v1.12.0

func DescriptionPrompt(response *string, templateContent, editorCommand string) error

func EnableRepoOverride

func EnableRepoOverride(cmd *cobra.Command, f *Factory)

func GetEditor added in v1.12.0

func GetEditor(cf func() (config.Config, error)) (string, error)

func HTTPClientFactory

func HTTPClientFactory(f *Factory)

func LabClientFunc added in v1.12.0

func LabClientFunc(repoHost string, cfg config.Config, isGraphQL bool) (*gitlab.Client, error)

func LabelsPrompt added in v1.12.0

func LabelsPrompt(response *string, apiClient *gitlab.Client, repoRemote *glrepo.Remote) (err error)

func ListGitLabTemplates added in v1.12.0

func ListGitLabTemplates(tmplType string) ([]string, error)

TODO: properly handle errors in this function.

For now, it returns nil and empty slice if there's an error

func LoadGitLabTemplate added in v1.12.0

func LoadGitLabTemplate(tmplType, tmplName string) (string, error)

LoadGitLabTemplate finds and loads the GitLab template from the working git directory Follows the format officially supported by GitLab

TODO: load from remote repository if repo is overriden by -R flag

func OverrideAPIProtocol

func OverrideAPIProtocol(cfg config.Config, repo glrepo.Interface)

OverrideAPIProtocol sets api protocol for host to initialize http client


type Factory

type Factory struct {
	HttpClient func() (*gitlab.Client, error)
	BaseRepo   func() (glrepo.Interface, error)
	Remotes    func() (glrepo.Remotes, error)
	Config     func() (config.Config, error)
	Branch     func() (string, error)
	IO         *utils.IOStreams

func NewFactory

func NewFactory() *Factory

func (*Factory) RepoOverride

func (f *Factory) RepoOverride(repo string) error

type FlagError

type FlagError struct {
	Err error

FlagError is the kind of error raised in flag processing

func (FlagError) Error

func (fe FlagError) Error() string

func (FlagError) Unwrap

func (fe FlagError) Unwrap() error

Jump to

Keyboard shortcuts

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