githubread

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package githubread is the GitHub read baseline adapter (WP5.2): issue and pull-request counts over a window from the search API, through the WP2.3 client (rate limits, call budget, and no way to write without an actions log), with its own read-only key from [integrations.github].

Index

Constants

View Source
const DefaultURL = "https://api.github.com"

DefaultURL is the GitHub REST API (GHES is unsupported in 0.1).

Variables

View Source
var Metrics = []string{"issues_opened", "issues_closed", "prs_opened", "prs_merged"}

Metrics this adapter answers.

Functions

This section is empty.

Types

type Client

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

Client reads one repository.

func New

func New(c integrations.Conn, repo string, rt http.RoundTripper, now func() time.Time) (*Client, error)

New returns a client for a resolved [integrations.github]; repo is the repository to read (its project, else the current repository).

func (*Client) Baseline

Baseline checks the token's scope, then counts the metric's search results.

func (*Client) Scope

func (c *Client) Scope(ctx context.Context) (integrations.Scope, error)

Scope reports a classic token's scopes from X-OAuth-Scopes on GET /user. Only read:* scopes and user:email are read-only. Fine-grained and App tokens have no scope header, so their scope cannot be verified here.

func (*Client) Search

func (c *Client) Search(q integrations.Query) (string, error)

Search returns the search query a baseline runs.

Jump to

Keyboard shortcuts

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