github

package
v0.0.0-...-9f68bf4 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package github provices guru business logic related to GitHub.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstallationClientRetriever

type InstallationClientRetriever interface {
	Client(id int64) *github.Client
}

InstallationClientRetriever is an interface for retrieving a GitHub client for a given installation ID.

type Installations

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

Installations represents a cache repository for GitHub App installations. wihin the context of the application. The token source is used to create a new GitHub client. It provides the necessary application authentication for the GitHub API.

func NewInstallations

func NewInstallations(src oauth2.TokenSource) *Installations

NewInstallations creates a new cache repository for GitHub App installations.

func (*Installations) Client

func (i *Installations) Client(id int64) *github.Client

Client returns a GitHub client for the given installation ID. If the client is not already cached, it will be created and stored. The client is created using the provided token source.

type PullRequest

type PullRequest struct {
	Owner  string
	Repo   string
	Number int
}

PullRequest represents a GitHub pull request.

func (*PullRequest) Review

func (pr *PullRequest) Review() error

Review reviews a pull request.

type PullRequestFirstReviewEvent

type PullRequestFirstReviewEvent struct {
	Logger                      *slog.Logger
	AssistantID                 string
	OpenAI                      *openai.Client
	InstallationClientRetriever InstallationClientRetriever
}

PullRequestFirstReviewEvent is a handler for the pull request first review event.

func (*PullRequestFirstReviewEvent) Handle

func (e *PullRequestFirstReviewEvent) Handle(deliveryID string, eventName string, event *github.PullRequestEvent) error

Handle handles the pull request first review event.

type PullRequestWelcomeEvent

type PullRequestWelcomeEvent struct {
	Logger                      *slog.Logger
	InstallationClientRetriever InstallationClientRetriever
}

PullRequestWelcomeEvent is a handler for the pull request opened event. It will create the first comment on the pull request with a welcome message.

func (*PullRequestWelcomeEvent) Handle

func (e *PullRequestWelcomeEvent) Handle(deliveryID string, eventName string, event *github.PullRequestEvent) error

Handle handles the pull request opened event.

Jump to

Keyboard shortcuts

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