github

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RepoRoot

func RepoRoot() (string, error)

Types

type Client

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

func NewClient

func NewClient(token string) *Client

func (*Client) CurrentUser

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

func (*Client) GetPullRequest

func (c *Client) GetPullRequest(ctx context.Context, owner, repo string, number uint32) (*PullRequest, error)

func (*Client) RequestReview

func (c *Client) RequestReview(ctx context.Context, owner, repo string, number uint32, reviewer ...string) error

RequestReview requests a review for the specified pull request. If no reviewer is specified, the current user is used.

func (*Client) SubmitReview

func (c *Client) SubmitReview(ctx context.Context, req SubmitReviewRequest) error

type File

type File struct {
	Name   string
	Status string
}

type PullRequest

type PullRequest struct {
	Number    int
	Title     string
	Body      string
	Author    string
	Reviewers []string
	State     string
	Draft     bool
	Files     []*File
}

type SubmitEvent

type SubmitEvent string
const (
	SubmitEventApprove        SubmitEvent = "APPROVE"
	SubmitEventRequestChanges SubmitEvent = "REQUEST_CHANGES"
	SubmitEventComment        SubmitEvent = "COMMENT"
)

func (SubmitEvent) IsValid

func (e SubmitEvent) IsValid() bool

type SubmitReviewRequest

type SubmitReviewRequest struct {
	Owner  string      // required
	Repo   string      // required
	Number int         // required
	Body   string      // +optional
	Event  SubmitEvent // required
}

Jump to

Keyboard shortcuts

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