Documentation
¶
Overview ¶
Forked from https://github.com/cli/cli/blob/929e082c13909044e2585af292ae952c9ca6f25c/pkg/cmd/factory/default.go
Index ¶
- Constants
- Variables
- func DescriptionPrompt(response *string, templateContent, editorCommand string) error
- func EnableRepoOverride(cmd *cobra.Command, f *Factory)
- func GetEditor(cf func() (config.Config, error)) (string, error)
- func HTTPClientFactory(f *Factory)
- func IDsFromUsers(users []*gitlab.User) []int
- func LabClientFunc(repoHost string, cfg config.Config, isGraphQL bool) (*gitlab.Client, error)
- func LabelsPrompt(response *[]string, apiClient *gitlab.Client, repoRemote *glrepo.Remote) (err error)
- func ListGitLabTemplates(tmplType string) ([]string, error)
- func LoadGitLabTemplate(tmplType, tmplName string) (string, error)
- func OverrideAPIProtocol(cfg config.Config, repo glrepo.Interface)
- type Action
- type Factory
- type FlagError
Constants ¶
View Source
const ( IssueTemplate = "issue_templates" MergeRequestTemplate = "merge_request_templates" )
Variables ¶
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
Functions ¶
func DescriptionPrompt ¶ added in v1.12.0
func EnableRepoOverride ¶
func HTTPClientFactory ¶
func HTTPClientFactory(f *Factory)
func IDsFromUsers ¶ added in v1.13.0
func IDsFromUsers(users []*gitlab.User) []int
IDsFromUsers collects all user IDs from a slice of users
func LabClientFunc ¶ added in v1.12.0
func LabelsPrompt ¶ added in v1.12.0
func ListGitLabTemplates ¶ added in v1.12.0
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
LoadGitLabTemplate finds and loads the GitLab template from the working git directory Follows the format officially supported by GitLab https://docs.gitlab.com/ee/user/project/description_templates.html#setting-a-default-template-for-issues-and-merge-requests.
TODO: load from remote repository if repo is overriden by -R flag
Types ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.