github

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a minimal GitHub API client.

func NewClient

func NewClient() *Client

NewClient creates a new GitHub API client.

func (*Client) ConvertManifest

func (c *Client) ConvertManifest(ctx context.Context, code string) (*ManifestConversion, error)

ConvertManifest exchanges a manifest code for App credentials.

func (*Client) ExchangeCode

func (c *Client) ExchangeCode(ctx context.Context, clientID, clientSecret, code string) (map[string]interface{}, error)

ExchangeCode exchanges an OAuth code for an access token.

func (*Client) GenerateInstallationToken

func (c *Client) GenerateInstallationToken(ctx context.Context, appID int64, privateKeyPEM string, installationID int64) (string, error)

GenerateInstallationToken generates an access token for a specific installation.

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, token string) (map[string]interface{}, error)

GetUser fetches information about the authenticated user.

func (*Client) ListRepositories

func (c *Client) ListRepositories(ctx context.Context, token string) ([]map[string]interface{}, error)

ListRepositories lists repositories for a specific installation.

func (*Client) ListUserRepositories

func (c *Client) ListUserRepositories(ctx context.Context, token string) ([]map[string]interface{}, error)

ListUserRepositories lists repositories for the authenticated user (OAuth flow).

type ManifestConversion

type ManifestConversion struct {
	ID            int64  `json:"id"`
	ClientID      string `json:"client_id"`
	ClientSecret  string `json:"client_secret"`
	WebhookSecret string `json:"webhook_secret"`
	PEM           string `json:"pem"`
	Name          string `json:"name"`
	Slug          string `json:"slug"`
}

ManifestConversion represents the result of a GitHub App manifest conversion.

Jump to

Keyboard shortcuts

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