client

package
v0.0.0-...-3fc36a1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an implementation of platform.Client

func New

func New(
	ctx context.Context,
	owner string,
	repo string,
	number int,
) *Client

New GitHub client

func NewWithHeadBranch

func NewWithHeadBranch(
	ctx context.Context,
	owner string,
	repo string,
	headBranch string,
) (*Client, error)

NewWithHeadBranch create GitHub client with head branch

func (*Client) AddLabel

func (c *Client) AddLabel(
	ctx context.Context,
	label constant.Label,
) error

AddLabel adds label to PR

func (*Client) AddLabelToOtherPR

func (c *Client) AddLabelToOtherPR(
	ctx context.Context,
	label constant.Label,
	number int,
) error

AddLabelToOtherPR adds label to other PR

func (*Client) CreateComment

func (c *Client) CreateComment(
	ctx context.Context,
	body string,
) error

CreateComment creates a comment

func (*Client) DeleteComment

func (c *Client) DeleteComment(
	ctx context.Context,
	commentID int64,
) error

DeleteComment deletes a comment

func (*Client) GetOpenPullRequests

func (c *Client) GetOpenPullRequests(ctx context.Context) ([]platform.PullRequest, error)

GetOpenPullRequests gets open PRs

func (*Client) GetPullRequest

func (c *Client) GetPullRequest(ctx context.Context) (*platform.PullRequest, error)

GetPullRequest gets the PR

func (*Client) ListComments

func (c *Client) ListComments(
	ctx context.Context,
) ([]platform.Comment, error)

ListComments gets comments order by posted asc

func (*Client) MergePullRequest

func (c *Client) MergePullRequest(ctx context.Context, message string) error

MergePullRequest merges PR

func (*Client) RemoveLabel

func (c *Client) RemoveLabel(
	ctx context.Context,
	label constant.Label,
) error

RemoveLabel removes label from PR

func (*Client) SetStatus

func (c *Client) SetStatus(
	ctx context.Context,
	state constant.State,
	description string,
) error

SetStatus set status of latest commit

Jump to

Keyboard shortcuts

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