githubclient

package
v0.0.0-...-71c47e0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 8 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidGitHubConfig = errors.New("invalid GitHub configuration")
	ErrGitHubAPIError      = errors.New("GitHub API error")
)

Functions

func FormatSubjectID

func FormatSubjectID(repoID string, prNumber any) string

Types

type Client

type Client interface {
	// Methods used by Worker
	ListRepos(ctx context.Context) ([]*store.GitHubRepo, error)
	ListPRs(ctx context.Context, repoID string) ([]*PullRequest, error)
	ListComments(ctx context.Context, repoID string, prNumber int, since time.Time) ([]*github.IssueComment, error)
	GetPRDiff(ctx context.Context, repoID string, prNumber int) (string, error)
	// Methods used by Processor
	PostComment(ctx context.Context, repoID string, prNumber int, comment string) error
}

Client defines the minimal GitHub API operations needed by our system

func New

func New(db libdb.DBManager, githubClient *github.Client) Client

type PullRequest

type PullRequest struct {
	ID          int64      `json:"id"`
	Number      int        `json:"number"`
	Title       string     `json:"title"`
	State       string     `json:"state"`
	URL         string     `json:"url"`
	CreatedAt   time.Time  `json:"createdAt"`
	UpdatedAt   time.Time  `json:"updatedAt"`
	AuthorLogin string     `json:"authorLogin"`
	ClosedAt    *time.Time `json:"closedAt,omitempty"`
	MergedAt    *time.Time `json:"mergedAt,omitempty"`
}

Jump to

Keyboard shortcuts

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