github

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGithubClient

func NewGithubClient(cfg *config.Github, limiter *RateLimiter) *github.Client

Types

type Client added in v0.7.0

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

func NewClient added in v0.7.0

func NewClient(client *github.Client, logger *slog.Logger) *Client

func (*Client) GetMostUpdatedIssues added in v0.7.0

func (p *Client) GetMostUpdatedIssues(ctx context.Context, owner, repo string, count int, since time.Time) ([]*github.Issue, *github.Response, error)

GetMostUpdatedIssues fetches issues from the given repository, sorted by update time (oldest first).

The client is stateless per repository — owner and repo are explicit parameters. Rate limiting is handled transparently by the underlying http.RoundTripper.

Parameters:

  • owner: repository owner (e.g. "thumbrise").
  • repo: repository name (e.g. "autosolve").
  • count: maximum number of issues to return per page. Values < 1 default to 50.
  • since: only issues updated after this time are returned. Zero value fetches all.

Errors are classified via mapError: transient failures (network, rate limit, 5xx) carry httperr sentinels, permanent failures (401, 404, 422) are returned as-is. The original GitHub error is preserved in the chain for errors.As access.

On success, resp carries HTTP metadata (rate limit headers, pagination). On error, both issues and resp are nil.

func (*Client) GetRepository added in v0.12.0

func (p *Client) GetRepository(ctx context.Context, owner, repo string) (*github.Repository, error)

GetRepository fetches repository metadata from GitHub API. Used by preflight to validate repository existence and accessibility.

type RateLimiter added in v0.12.0

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

RateLimiter wraps rate.Limiter to avoid binding a generic stdlib type in Wire. Burst is always 1 — requests are serialized with a guaranteed minimum interval.

func NewRateLimiter added in v0.12.0

func NewRateLimiter(cfg *config.Github) *RateLimiter

NewRateLimiter creates a RateLimiter from config. Rate is computed as 1/MinInterval.

Jump to

Keyboard shortcuts

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