github

package
v0.0.0-...-78730a9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound checks if an error is a 404 Not Found error

Types

type Client

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

Client implements the models.GitPlatform interface for GitHub

func NewClient

func NewClient(cfg *config.Config) (*Client, error)

NewClient creates a new GitHub client

func (*Client) CheckRateLimit

func (c *Client) CheckRateLimit(ctx context.Context)

CheckRateLimit logs the current rate limit status

func (*Client) CompareCommits

func (c *Client) CompareCommits(ctx context.Context, owner, repo, base, head string) ([]*models.CommitFile, []*models.Commit, error)

CompareCommits compares two commits and returns the files that changed

func (*Client) CreatePRComment

func (c *Client) CreatePRComment(ctx context.Context, owner, repo string, number int, body string) error

CreatePRComment creates a comment on a pull request

func (*Client) CreateReview

func (c *Client) CreateReview(ctx context.Context, owner, repo string, number int, commitID string, comments []*models.ReviewComment, body string) error

CreateReview creates a review on a pull request

func (*Client) GetPullRequest

func (c *Client) GetPullRequest(ctx context.Context, owner, repo string, number int) (*models.PullRequest, error)

GetPullRequest gets a pull request by number

func (*Client) GetPullRequestLabels

func (c *Client) GetPullRequestLabels(ctx context.Context, owner, repo string, number int) ([]string, error)

GetPullRequestLabels gets the labels of a pull request

func (*Client) GetRepoVariable

func (c *Client) GetRepoVariable(ctx context.Context, owner, repo, name string) (string, error)

GetRepoVariable gets a repository variable

type EventHandler

type EventHandler func(payload interface{}) error

EventHandler is a function that handles a specific GitHub event

type WebhookHandler

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

WebhookHandler handles GitHub webhook events

func NewWebhookHandler

func NewWebhookHandler(secret string) *WebhookHandler

NewWebhookHandler creates a new webhook handler

func (*WebhookHandler) HandleWebhook

func (h *WebhookHandler) HandleWebhook(w http.ResponseWriter, r *http.Request)

HandleWebhook handles incoming webhook requests

func (*WebhookHandler) On

func (h *WebhookHandler) On(event string, handler EventHandler)

On registers a handler for a specific event

Jump to

Keyboard shortcuts

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