Documentation
¶
Overview ¶
Package ghtap implements Homebrew tap repository reads and writes with the GitHub REST API.
The adapter maps remote metadata into pubbrew snapshots. Publication policy, reconciliation, and retry decisions remain in the pubbrew stage package.
Index ¶
- type Client
- func (c *Client) CreateBranch(ctx context.Context, repository pubbrew.Repository, branch pubbrew.BranchName, ...) error
- func (c *Client) CreatePullRequest(ctx context.Context, repository pubbrew.Repository, ...) (string, error)
- func (c *Client) PutFile(ctx context.Context, repository pubbrew.Repository, branch pubbrew.BranchName, ...) error
- func (c *Client) ReadBase(ctx context.Context, repository pubbrew.Repository, path pubbrew.FilePath) (pubbrew.BaseSnapshot, error)
- func (c *Client) ReadBranch(ctx context.Context, repository pubbrew.Repository, branch pubbrew.BranchName, ...) (pubbrew.BranchSnapshot, error)
- func (c *Client) ReadPullRequest(ctx context.Context, repository pubbrew.Repository, base pubbrew.BranchName, ...) (pubbrew.PullRequest, error)
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 reads and mutates one GitHub tap through go-github.
func NewAuthenticated ¶
NewAuthenticated constructs a Client for token at the given GitHub API.
An empty apiURL selects public GitHub. Token text is applied only to the Authorization header and is never retained separately or returned in errors.
func (*Client) CreateBranch ¶
func (c *Client) CreateBranch( ctx context.Context, repository pubbrew.Repository, branch pubbrew.BranchName, from pubbrew.CommitSHA, ) error
CreateBranch implements pubbrew.RepositoryWriter.
func (*Client) CreatePullRequest ¶
func (c *Client) CreatePullRequest( ctx context.Context, repository pubbrew.Repository, input pubbrew.PullRequestInput, ) (string, error)
CreatePullRequest implements pubbrew.RepositoryWriter.
func (*Client) PutFile ¶
func (c *Client) PutFile( ctx context.Context, repository pubbrew.Repository, branch pubbrew.BranchName, path pubbrew.FilePath, previous pubbrew.BlobSHA, content []byte, message string, ) error
PutFile implements pubbrew.RepositoryWriter.
func (*Client) ReadBase ¶
func (c *Client) ReadBase( ctx context.Context, repository pubbrew.Repository, path pubbrew.FilePath, ) (pubbrew.BaseSnapshot, error)
ReadBase implements pubbrew.RepositoryReader.
func (*Client) ReadBranch ¶
func (c *Client) ReadBranch( ctx context.Context, repository pubbrew.Repository, branch pubbrew.BranchName, path pubbrew.FilePath, ) (pubbrew.BranchSnapshot, error)
ReadBranch implements pubbrew.RepositoryReader.
func (*Client) ReadPullRequest ¶
func (c *Client) ReadPullRequest( ctx context.Context, repository pubbrew.Repository, base pubbrew.BranchName, head pubbrew.BranchName, ) (pubbrew.PullRequest, error)
ReadPullRequest implements pubbrew.RepositoryReader.