pullrequest

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

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

func GetPullRequestIDs added in v0.7.0

func GetPullRequestIDs(context context.Context, cmd *cobra.Command, repository string, state string) []string

GetPullRequestIDs gets the pullrequest Ids for completion

func GetReviewerNicknames added in v0.11.0

func GetReviewerNicknames(context context.Context, cmd *cobra.Command, args []string, toComplete string) (nicknames []string, err error)

GetReviewerNicknames gets the reviewer nicknames for the current Workspace

Types

type Branch

type Branch struct {
	Name                 string   `json:"name"                             mapstructure:"name"`
	MergeStrategies      []string `json:"merge_strategies,omitempty"       mapstructure:"merge_strategies"`
	DefaultMergeStrategy string   `json:"default_merge_strategy,omitempty" mapstructure:"default_merge_strategy"`
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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