Documentation ¶
Index ¶
- Constants
- func AddMetadataToIssueParams(client *api.Client, baseRepo ghrepo.Interface, params map[string]interface{}, ...) error
- func BodySurvey(state *IssueMetadataState, templateContent, editorCommand string) error
- func ColorForPR(pr api.PullRequest) string
- func ColorForState(state string) string
- func CommentList(io *iostreams.IOStreams, comments api.Comments, reviews api.PullRequestReviews, ...) (string, error)
- func CommentableConfirmSubmitSurvey() (bool, error)
- func CommentableEditSurvey(cf func() (config.Config, error), io *iostreams.IOStreams) func() (string, error)
- func CommentableInteractiveEditSurvey(cf func() (config.Config, error), io *iostreams.IOStreams) func() (string, error)
- func CommentablePreRun(cmd *cobra.Command, opts *CommentableOptions) error
- func CommentableRun(opts *CommentableOptions) error
- func EditFieldsSurvey(editable *Editable, editorCommand string) error
- func FetchOptions(client *api.Client, repo ghrepo.Interface, editable *Editable) error
- func FieldsToEditSurvey(editable *Editable) error
- func FillFromJSON(io *iostreams.IOStreams, recoverFile string, state *IssueMetadataState) error
- func FindTemplates(dir, path string) ([]string, string)
- func ListHeader(repoName string, itemName string, matchCount int, totalMatchCount int, ...) string
- func ListURLWithQuery(listURL string, options FilterOptions) (string, error)
- func MetadataSurvey(io *iostreams.IOStreams, baseRepo ghrepo.Interface, ...) error
- func NewMockFinder(selector string, pr *api.PullRequest, repo ghrepo.Interface) *mockFinder
- func NewTemplateManager(httpClient *http.Client, repo ghrepo.Interface, dir string, allowFS bool, ...) *templateManager
- func PreserveInput(io *iostreams.IOStreams, state *IssueMetadataState, createErr *error) func()
- func PrintHeader(io *iostreams.IOStreams, s string)
- func PrintMessage(io *iostreams.IOStreams, s string)
- func QueryHasStateClause(searchQuery string) bool
- func RawCommentList(comments api.Comments, reviews api.PullRequestReviews) string
- func ReactionGroupList(rgs api.ReactionGroups) string
- func RunCommandFinder(selector string, pr *api.PullRequest, repo ghrepo.Interface) *mockFinder
- func SearchQueryBuild(options FilterOptions) string
- func StateTitleWithColor(cs *iostreams.ColorScheme, pr api.PullRequest) string
- func TitleSurvey(state *IssueMetadataState) error
- func WithPrAndIssueQueryParams(client *api.Client, baseRepo ghrepo.Interface, baseURL string, ...) (string, error)
- type Action
- type Comment
- type Commentable
- type CommentableOptions
- type Editable
- func (e Editable) AssigneeIds(client *api.Client, repo ghrepo.Interface) (*[]string, error)
- func (e Editable) BodyValue() *string
- func (e Editable) Dirty() bool
- func (e Editable) LabelIds() (*[]string, error)
- func (e Editable) MilestoneId() (*string, error)
- func (e Editable) ProjectIds() (*[]string, error)
- func (e Editable) ReviewerIds() (*[]string, *[]string, error)
- func (e Editable) TitleValue() *string
- type EditableSlice
- type EditableString
- type FilterOptions
- type FindOptions
- type InputType
- type IssueMetadataState
- type MeReplacer
- type MetadataFetcher
- type NotFoundError
- type PRFinder
- type RepoMetadataFetcher
- type Template
Constants ¶
View Source
const ( IssueMetadata metadataStateType = iota PRMetadata )
Variables ¶
This section is empty.
Functions ¶
func BodySurvey ¶ added in v1.3.0
func BodySurvey(state *IssueMetadataState, templateContent, editorCommand string) error
func ColorForPR ¶ added in v1.2.1
func ColorForPR(pr api.PullRequest) string
func ColorForState ¶ added in v1.2.1
ColorForState returns a color constant for a PR/Issue state
func CommentList ¶ added in v1.4.0
func CommentableConfirmSubmitSurvey ¶ added in v1.5.0
func CommentableEditSurvey ¶ added in v1.5.0
func CommentableInteractiveEditSurvey ¶ added in v1.5.0
func CommentablePreRun ¶ added in v1.5.0
func CommentablePreRun(cmd *cobra.Command, opts *CommentableOptions) error
func CommentableRun ¶ added in v1.5.0
func CommentableRun(opts *CommentableOptions) error
func EditFieldsSurvey ¶ added in v1.6.0
func FetchOptions ¶ added in v1.6.0
func FieldsToEditSurvey ¶ added in v1.6.0
func FillFromJSON ¶ added in v1.3.0
func FillFromJSON(io *iostreams.IOStreams, recoverFile string, state *IssueMetadataState) error
func FindTemplates ¶ added in v1.3.0
func ListHeader ¶
func ListURLWithQuery ¶
func ListURLWithQuery(listURL string, options FilterOptions) (string, error)
func MetadataSurvey ¶ added in v1.3.0
func MetadataSurvey(io *iostreams.IOStreams, baseRepo ghrepo.Interface, fetcher RepoMetadataFetcher, state *IssueMetadataState) error
func NewMockFinder ¶ added in v1.10.0
func NewMockFinder(selector string, pr *api.PullRequest, repo ghrepo.Interface) *mockFinder
func NewTemplateManager ¶ added in v1.6.0
func PreserveInput ¶ added in v1.3.0
func PreserveInput(io *iostreams.IOStreams, state *IssueMetadataState, createErr *error) func()
func PrintHeader ¶
func PrintMessage ¶
func QueryHasStateClause ¶ added in v1.11.0
func RawCommentList ¶ added in v1.4.0
func RawCommentList(comments api.Comments, reviews api.PullRequestReviews) string
func ReactionGroupList ¶ added in v1.4.0
func ReactionGroupList(rgs api.ReactionGroups) string
func RunCommandFinder ¶ added in v1.10.0
func RunCommandFinder(selector string, pr *api.PullRequest, repo ghrepo.Interface) *mockFinder
RunCommandFinder is the NewMockFinder substitute to be used ONLY in runCommand-style tests.
func SearchQueryBuild ¶ added in v1.8.0
func SearchQueryBuild(options FilterOptions) string
func StateTitleWithColor ¶
func StateTitleWithColor(cs *iostreams.ColorScheme, pr api.PullRequest) string
func TitleSurvey ¶ added in v1.3.0
func TitleSurvey(state *IssueMetadataState) error
Types ¶
type Commentable ¶ added in v1.5.0
type CommentableOptions ¶ added in v1.5.0
type CommentableOptions struct { IO *iostreams.IOStreams HttpClient func() (*http.Client, error) RetrieveCommentable func() (Commentable, ghrepo.Interface, error) EditSurvey func() (string, error) InteractiveEditSurvey func() (string, error) ConfirmSubmitSurvey func() (bool, error) OpenInBrowser func(string) error Interactive bool InputType InputType Body string }
type Editable ¶ added in v1.6.0
type Editable struct { Title EditableString Body EditableString Base EditableString Reviewers EditableSlice Assignees EditableSlice Labels EditableSlice Projects EditableSlice Milestone EditableString Metadata api.RepoMetadataResult }
func (Editable) AssigneeIds ¶ added in v1.6.0
func (Editable) MilestoneId ¶ added in v1.6.0
func (Editable) ProjectIds ¶ added in v1.6.0
func (Editable) ReviewerIds ¶ added in v1.6.0
func (Editable) TitleValue ¶ added in v1.6.0
type EditableSlice ¶ added in v1.6.0
type EditableString ¶ added in v1.6.0
type FilterOptions ¶
type FilterOptions struct { Entity string State string Assignee string Labels []string Author string BaseBranch string Mention string Milestone string Search string Fields []string }
func (*FilterOptions) IsDefault ¶ added in v1.8.0
func (opts *FilterOptions) IsDefault() bool
type FindOptions ¶ added in v1.10.0
type FindOptions struct { // Selector can be a number with optional `#` prefix, a branch name with optional `<owner>:` prefix, or // a PR URL. Selector string // Fields lists the GraphQL fields to fetch for the PullRequest. Fields []string // BaseBranch is the name of the base branch to scope the PR-for-branch lookup to. BaseBranch string // States lists the possible PR states to scope the PR-for-branch lookup to. States []string }
type IssueMetadataState ¶
type IssueMetadataState struct { Type metadataStateType Draft bool Body string Title string Metadata []string Reviewers []string Assignees []string Labels []string Projects []string Milestones []string MetadataResult *api.RepoMetadataResult // contains filtered or unexported fields }
func (*IssueMetadataState) HasMetadata ¶
func (tb *IssueMetadataState) HasMetadata() bool
func (*IssueMetadataState) IsDirty ¶ added in v1.3.0
func (tb *IssueMetadataState) IsDirty() bool
func (*IssueMetadataState) MarkDirty ¶ added in v1.3.0
func (tb *IssueMetadataState) MarkDirty()
type MeReplacer ¶ added in v1.6.0
type MeReplacer struct {
// contains filtered or unexported fields
}
MeReplacer resolves usages of `@me` to the handle of the currently logged in user.
func NewMeReplacer ¶ added in v1.6.0
func NewMeReplacer(apiClient *api.Client, hostname string) *MeReplacer
func (*MeReplacer) Replace ¶ added in v1.6.0
func (r *MeReplacer) Replace(handle string) (string, error)
func (*MeReplacer) ReplaceSlice ¶ added in v1.6.0
func (r *MeReplacer) ReplaceSlice(handles []string) ([]string, error)
type MetadataFetcher ¶ added in v1.3.1
type MetadataFetcher struct { IO *iostreams.IOStreams APIClient *api.Client Repo ghrepo.Interface State *IssueMetadataState }
func (*MetadataFetcher) RepoMetadataFetch ¶ added in v1.3.1
func (mf *MetadataFetcher) RepoMetadataFetch(input api.RepoMetadataInput) (*api.RepoMetadataResult, error)
type NotFoundError ¶ added in v1.10.0
type NotFoundError struct {
// contains filtered or unexported fields
}
func (*NotFoundError) Unwrap ¶ added in v1.10.0
func (err *NotFoundError) Unwrap() error
type PRFinder ¶ added in v1.10.0
type PRFinder interface {
Find(opts FindOptions) (*api.PullRequest, ghrepo.Interface, error)
}
type RepoMetadataFetcher ¶ added in v1.3.1
type RepoMetadataFetcher interface {
RepoMetadataFetch(api.RepoMetadataInput) (*api.RepoMetadataResult, error)
}
Click to show internal directories.
Click to hide internal directories.