githubapi

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessComment

func ProcessComment(event *github.IssueCommentEvent, client *github.Client, logger *slog.Logger)

func RegisterEventHandlers

func RegisterEventHandlers(r *gin.Engine, client *github.Client, logger *slog.Logger, processComment func(*github.IssueCommentEvent, *github.Client, *slog.Logger)) func(string, []byte)

Types

type ProwGitHubClient

type ProwGitHubClient interface {
	GetClient(logger *slog.Logger) *github.Client
	CreateCheckRun(ctx context.Context, owner, repo string, opt github.CreateCheckRunOptions) (*github.CheckRun, *github.Response, error)
}

ProwGitHubClient is an interface for the GitHub client

type ProwLiteGitHubClient

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

ProwLiteGitHubClient is a struct for the GitHub client

func NewGithubClient

func NewGithubClient(logger *slog.Logger) (*ProwLiteGitHubClient, error)

func (*ProwLiteGitHubClient) AddComment

func (g *ProwLiteGitHubClient) AddComment(owner, repo string, prNumber int, commentText string, logger *slog.Logger)

func (*ProwLiteGitHubClient) AddLabelsToIssue

func (g *ProwLiteGitHubClient) AddLabelsToIssue(owner, repo string, prNumber int, labels []string, logger *slog.Logger)

func (*ProwLiteGitHubClient) CreateCheckRun

func (*ProwLiteGitHubClient) CreateLabel

func (g *ProwLiteGitHubClient) CreateLabel(owner, repo, name, color, description string, logger *slog.Logger)

func (*ProwLiteGitHubClient) GetClient

func (g *ProwLiteGitHubClient) GetClient(logger *slog.Logger) *github.Client

func (*ProwLiteGitHubClient) GetPRSHA

func (g *ProwLiteGitHubClient) GetPRSHA(owner, repo string, prNumber int, logger *slog.Logger) string

func (*ProwLiteGitHubClient) RemoveLabel

func (g *ProwLiteGitHubClient) RemoveLabel(owner, repo string, prNumber int, label string, logger *slog.Logger)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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