Documentation
¶
Index ¶
- Variables
- func GetBranchNames(context context.Context, cmd *cobra.Command, args []string, toComplete string) ([]string, error)
- func GetPullRequestIDs(context context.Context, cmd *cobra.Command, repository string, state string) []string
- func GetReviewerNicknames(context context.Context, cmd *cobra.Command, args []string, toComplete string) (nicknames []string, err error)
- type Branch
- type Endpoint
- type PullRequest
- type PullRequestCreator
- type PullRequests
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "pullrequest", Aliases: []string{"pr", "pull-request"}, Short: "Manage pull requests", Run: func(cmd *cobra.Command, args []string) { fmt.Println("Pullrequest requires a subcommand:") for _, command := range cmd.Commands() { fmt.Println(command.Name()) } }, }
Command represents this folder's command
Functions ¶
func GetBranchNames ¶ added in v0.11.0
func GetBranchNames(context context.Context, cmd *cobra.Command, args []string, toComplete string) ([]string, error)
GetBranchNames gets the branch names of a repository
Types ¶
type Endpoint ¶
type Endpoint struct { Branch Branch `json:"branch" mapstructure:"branch"` Commit *commit.Commit `json:"commit,omitempty" mapstructure:"commit"` Repository *repository.Repository `json:"repository,omitempty" mapstructure:"repository"` }
type PullRequest ¶
type PullRequest struct { Type string `json:"type" mapstructure:"type"` ID uint64 `json:"id" mapstructure:"id"` Title string `json:"title" mapstructure:"title"` Description string `json:"description" mapstructure:"description"` Summary common.RenderedText `json:"summary" mapstructure:"summary"` State string `json:"state" mapstructure:"state"` MergeCommit *commit.Commit `json:"merge_commit,omitempty" mapstructure:"merge_commit"` CloseSourceBranch bool `json:"close_source_branch" mapstructure:"close_source_branch"` ClosedBy user.User `json:"closed_by" mapstructure:"closed_by"` Author user.User `json:"author" mapstructure:"author"` Reason string `json:"reason" mapstructure:"reason"` Destination Endpoint `json:"destination" mapstructure:"destination"` Source Endpoint `json:"source" mapstructure:"source"` Links common.Links `json:"links" mapstructure:"links"` CommentCount uint64 `json:"comment_count" mapstructure:"comment_count"` TaskCount uint64 `json:"task_count" mapstructure:"task_count"` CreatedOn time.Time `json:"created_on" mapstructure:"created_on"` UpdatedOn time.Time `json:"updated_on" mapstructure:"updated_on"` }
func (PullRequest) GetHeader ¶ added in v0.3.0
func (pullrequest PullRequest) GetHeader(short bool) []string
GetHeader gets the header for a table
implements common.Tableable
func (PullRequest) GetRow ¶ added in v0.3.0
func (pullrequest PullRequest) GetRow(headers []string) []string
GetRow gets the row for a table
implements common.Tableable
func (PullRequest) MarshalJSON ¶
func (pullrequest PullRequest) MarshalJSON() (data []byte, err error)
MarshalJSON implements the json.Marshaler interface.
func (PullRequest) String ¶
func (pullrequest PullRequest) String() string
String gets a string representation of this pullrequest
implements fmt.Stringer
func (*PullRequest) Validate ¶
func (pullrequest *PullRequest) Validate() error
Validate validates a PullRequest
type PullRequestCreator ¶
type PullRequestCreator struct { Title string `json:"title"` Description string `json:"description,omitempty"` Source Endpoint `json:"source"` Destination *Endpoint `json:"destination,omitempty"` Reviewers []user.User `json:"reviewers,omitempty"` CloseSourceBranch bool `json:"close_source_branch,omitempty"` }
type PullRequests ¶ added in v0.3.0
type PullRequests []PullRequest
func (PullRequests) GetHeader ¶ added in v0.3.0
func (pullrequests PullRequests) GetHeader() []string
GetHeader gets the header for a table
implements common.Tableables
func (PullRequests) GetRowAt ¶ added in v0.3.0
func (pullrequests PullRequests) GetRowAt(index int, headers []string) []string
GetRowAt gets the row for a table
implements common.Tableables
func (PullRequests) Size ¶ added in v0.3.0
func (pullrequests PullRequests) Size() int
Size gets the number of elements
implements common.Tableables
Source Files
¶
Click to show internal directories.
Click to hide internal directories.