github

package
v0.0.0-...-b067df3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package github provides a github client with functions tailored to the PSL's needs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	// Owner is the github account of the repository to query. If
	// empty, defaults to "publicsuffix".
	Owner string
	// Repo is the repository to query. If empty, defaults to "list".
	Repo string
	// contains filtered or unexported fields
}

Client is a GitHub API client that performs PSL-specific operations. The zero value is a client that interacts with the official publicsuffix/list repository.

func (*Repo) PSLForHash

func (c *Repo) PSLForHash(ctx context.Context, hash string) ([]byte, error)

PSLForHash returns the PSL file at the given git commit hash.

func (*Repo) PSLForPullRequest

func (c *Repo) PSLForPullRequest(ctx context.Context, prNum int) (withoutPR, withPR []byte, err error)

PSLForPullRequest fetches the PSL files needed to validate the given pull request. Returns the PSL file for the target branch, and the same but with the PR's changes applied.

Jump to

Keyboard shortcuts

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