ghtap

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0, MIT Imports: 7 Imported by: 0

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

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 New

func New(client *github.Client) *Client

New constructs a Client around an already-authenticated go-github client.

func NewAuthenticated

func NewAuthenticated(token rel.Secret, apiURL, serverURL string) (*Client, error)

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.

Directories

Path Synopsis
Package mocks contains generated test doubles for Homebrew tap repository ports.
Package mocks contains generated test doubles for Homebrew tap repository ports.

Jump to

Keyboard shortcuts

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