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 ColorForIssueState(issue api.Issue) string
- func ColorForPRState(pr api.PullRequest) 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) (string, error)
- func CommentableInteractiveEditSurvey(cf func() (config.Config, error), io *iostreams.IOStreams) func(string) (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 ListHeader(repoName string, itemName string, matchCount int, totalMatchCount int, ...) string
- func ListNoResults(repoName string, itemName string, hasFilters bool) error
- 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 PrCheckStatusSummaryWithColor(cs *iostreams.ColorScheme, checks api.PullRequestChecksStatus) string
- 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 UpdateIssue(httpClient *http.Client, repo ghrepo.Interface, id string, isPR bool, ...) error
- func ValidURL(urlStr string) bool
- 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) 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 ¶
func BodySurvey(state *IssueMetadataState, templateContent, editorCommand string) error
func ColorForIssueState ¶
func ColorForPRState ¶
func ColorForPRState(pr api.PullRequest) string
func CommentList ¶
func CommentableEditSurvey ¶
func CommentablePreRun ¶
func CommentablePreRun(cmd *cobra.Command, opts *CommentableOptions) error
func CommentableRun ¶
func CommentableRun(opts *CommentableOptions) error
func EditFieldsSurvey ¶
func FetchOptions ¶
func FieldsToEditSurvey ¶
func FillFromJSON ¶
func FillFromJSON(io *iostreams.IOStreams, recoverFile string, state *IssueMetadataState) error
func ListHeader ¶
func ListURLWithQuery ¶
func ListURLWithQuery(listURL string, options FilterOptions) (string, error)
func MetadataSurvey ¶
func MetadataSurvey(io *iostreams.IOStreams, baseRepo ghrepo.Interface, fetcher RepoMetadataFetcher, state *IssueMetadataState) error
func NewMockFinder ¶
func NewMockFinder(selector string, pr *api.PullRequest, repo ghrepo.Interface) *mockFinder
func NewTemplateManager ¶
func PrCheckStatusSummaryWithColor ¶
func PrCheckStatusSummaryWithColor(cs *iostreams.ColorScheme, checks api.PullRequestChecksStatus) string
func PreserveInput ¶
func PreserveInput(io *iostreams.IOStreams, state *IssueMetadataState, createErr *error) func()
func PrintHeader ¶
func PrintMessage ¶
func QueryHasStateClause ¶
func RawCommentList ¶
func RawCommentList(comments api.Comments, reviews api.PullRequestReviews) string
func ReactionGroupList ¶
func ReactionGroupList(rgs api.ReactionGroups) string
func RunCommandFinder ¶
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 ¶
func SearchQueryBuild(options FilterOptions) string
func StateTitleWithColor ¶
func StateTitleWithColor(cs *iostreams.ColorScheme, pr api.PullRequest) string
func TitleSurvey ¶
func TitleSurvey(state *IssueMetadataState) error
func UpdateIssue ¶
Types ¶
type Commentable ¶
type CommentableOptions ¶
type CommentableOptions struct { IO *iostreams.IOStreams HttpClient func() (*http.Client, error) RetrieveCommentable func() (Commentable, ghrepo.Interface, error) EditSurvey func(string) (string, error) InteractiveEditSurvey func(string) (string, error) ConfirmSubmitSurvey func() (bool, error) OpenInBrowser func(string) error Interactive bool InputType InputType Body string EditLast bool Quiet bool Host string }
type Editable ¶
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 ¶
func (Editable) MilestoneId ¶
func (Editable) ProjectIds ¶
func (Editable) TitleValue ¶
type EditableSlice ¶
type EditableString ¶
type FilterOptions ¶
type FilterOptions struct { Assignee string Author string BaseBranch string Draft *bool Entity string Fields []string HeadBranch string Labels []string Mention string Milestone string Repo string Search string State string }
func (*FilterOptions) IsDefault ¶
func (opts *FilterOptions) IsDefault() bool
type FindOptions ¶
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 ¶
func (tb *IssueMetadataState) IsDirty() bool
func (*IssueMetadataState) MarkDirty ¶
func (tb *IssueMetadataState) MarkDirty()
type MeReplacer ¶
type MeReplacer struct {
// contains filtered or unexported fields
}
MeReplacer resolves usages of `@me` to the handle of the currently logged in user.
func NewMeReplacer ¶
func NewMeReplacer(apiClient *api.Client, hostname string) *MeReplacer
func (*MeReplacer) ReplaceSlice ¶
func (r *MeReplacer) ReplaceSlice(handles []string) ([]string, error)
type MetadataFetcher ¶
type MetadataFetcher struct { IO *iostreams.IOStreams APIClient *api.Client Repo ghrepo.Interface State *IssueMetadataState }
func (*MetadataFetcher) RepoMetadataFetch ¶
func (mf *MetadataFetcher) RepoMetadataFetch(input api.RepoMetadataInput) (*api.RepoMetadataResult, error)
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
func (*NotFoundError) Unwrap ¶
func (err *NotFoundError) Unwrap() error
type PRFinder ¶
type PRFinder interface {
Find(opts FindOptions) (*api.PullRequest, ghrepo.Interface, error)
}
type RepoMetadataFetcher ¶
type RepoMetadataFetcher interface {
RepoMetadataFetch(api.RepoMetadataInput) (*api.RepoMetadataResult, error)
}
Click to show internal directories.
Click to hide internal directories.