Versions in this module Expand all Collapse all v0 v0.2.5 Nov 1, 2026 v0.2.4 Oct 31, 2026 v0.2.3 Oct 29, 2026 v0.2.2 Oct 29, 2026 v0.2.1 Oct 26, 2026 Changes in this version + var ErrInvalidRepository = errors.New("github: repository must be owner/name") + var ErrUnauthorized = errors.New("github: unauthorized") + func ParseEvent(event string, body []byte) (any, error) + func ParsePrivateKey(pemBytes []byte) (*rsa.PrivateKey, error) + type Account struct + HTMLURL string + ID int64 + Login string + type App struct + ClientID string + ClientSecret string + ID int64 + PrivateKey *rsa.PrivateKey + WebhookSecret []byte + type AuthorizationEvent struct + Action string + UserID int64 + type Client struct + func New(app App, options ...Option) (*Client, error) + func (c *Client) AppSlug(ctx context.Context) (string, error) + func (c *Client) AuthorizeURL(state, redirectURI string) string + func (c *Client) Exchange(ctx context.Context, code, redirectURI string) (UserToken, error) + func (c *Client) InstallationToken(ctx context.Context, installationID int64, repositoryIDs []int64, ...) (Token, error) + func (c *Client) OpenPullRequests(ctx context.Context, installationID int64, fullName string) ([]PullRequest, error) + func (c *Client) PullRequest(ctx context.Context, installationID int64, fullName string, number int) (PullRequest, error) + func (c *Client) Refresh(ctx context.Context, refreshToken string) (UserToken, error) + func (c *Client) User(ctx context.Context, accessToken string) (Account, error) + func (c *Client) UserRepositories(ctx context.Context, accessToken string) ([]Repository, error) + func (c *Client) VerifyWebhook(body []byte, signature256 string) bool + type Error struct + Message string + Status int + func (err *Error) Error() string + func (err *Error) Is(target error) bool + type InstallationEvent struct + Action string + InstallationID int64 + type InstallationRepositoriesEvent struct + Action string + Added []Repository + InstallationID int64 + Removed []Repository + type Option func(*Client) + func WithAPIURL(url string) Option + func WithHTTPClient(httpClient *http.Client) Option + func WithWebURL(url string) Option + type PullRequest struct + Author Account + Base Ref + Body string + CreatedAt time.Time + Draft bool + HTMLURL string + Head Ref + Merged bool + Number int + State string + Title string + UpdatedAt time.Time + type PullRequestEvent struct + Action string + InstallationID int64 + Number int + Repository Repository + type Ref struct + Ref string + Repository Repository + SHA string + type Repository struct + CloneURL string + FullName string + ID int64 + InstallationID int64 + Private bool + type Token struct + ExpiresAt time.Time + Value string + type UserToken struct + AccessToken string + ExpiresAt time.Time + RefreshExpiresAt time.Time + RefreshToken string