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: 1

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