github

package
v0.0.0-...-badb76c Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("creator pull request not found")
)

Functions

func ParseRepoURL

func ParseRepoURL(repoURL string) (owner, repo string, err error)

Types

type Client

type Client struct {
	Owner     string
	Repo      string
	Token     string
	ForkOwner string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token, repoURL, forkOwner string) (*Client, error)

func (*Client) AssignReviewers

func (c *Client) AssignReviewers(ctx context.Context, prNumber int, team string) error

func (*Client) CreatePullRequest

func (c *Client) CreatePullRequest(ctx context.Context, title, body, head, base string) (string, int, error)

func (*Client) FindPRURLByBranch

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

func (*Client) GetCreatorPR

func (c *Client) GetCreatorPR(ctx context.Context, prNumber int) (*CreatorPR, error)

func (*Client) GetPRQuickstartFiles

func (c *Client) GetPRQuickstartFiles(ctx context.Context, pr *CreatorPR) (string, []File, error)

func (*Client) ListCreatorPRs

func (c *Client) ListCreatorPRs(ctx context.Context) ([]CreatorPR, error)

type CreatorPR

type CreatorPR struct {
	Number     int
	Title      string
	HTMLURL    string
	UpdatedAt  time.Time
	BranchName string
	Slug       string
	HeadSHA    string
	HeadOwner  string
	HeadRepo   string
	Body       string
}

type File

type File struct {
	Name    string
	Content string
}

type GitHubOperations

type GitHubOperations interface {
	CreatePullRequest(ctx context.Context, title, body, head, base string) (string, int, error)
	AssignReviewers(ctx context.Context, prNumber int, team string) error
	ListCreatorPRs(ctx context.Context) ([]CreatorPR, error)
	GetCreatorPR(ctx context.Context, prNumber int) (*CreatorPR, error)
	GetPRQuickstartFiles(ctx context.Context, pr *CreatorPR) (string, []File, error)
	FindPRURLByBranch(ctx context.Context, branchName string) (string, error)
}

type PRCreator

type PRCreator = GitHubOperations

PRCreator is kept as an alias so existing handler construction still compiles during the rename; prefer GitHubOperations.

Jump to

Keyboard shortcuts

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