githubclient

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package githubclient is a wrapper around the GitHub App for common operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.1.4

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

Client is a wrapper around a GitHub HTTP client and an authenticated GitHub App.

func New

func New(ctx context.Context, c *Config) (*Client, error)

New creates a new Client from the given config.

func (*Client) App added in v0.1.4

func (c *Client) App() *githubauth.App

App returns the underlying githubauth.App.

func (*Client) GitHubClientFromTokenSource added in v0.1.4

func (c *Client) GitHubClientFromTokenSource(ctx context.Context, ts oauth2.TokenSource) (*github.Client, error)

GitHubClientFromTokenSource creates a new GitHub client from the given token source. It inherits any configuration from the GitHub config (like enterprise URL).

func (*Client) ListDeliveries added in v0.1.4

func (c *Client) ListDeliveries(ctx context.Context, opts *github.ListCursorOptions) ([]*github.HookDelivery, *github.Response, error)

ListDeliveries lists a paginated result of event deliveries.

func (*Client) RedeliverEvent added in v0.1.4

func (c *Client) RedeliverEvent(ctx context.Context, deliveryID int64) error

RedeliverEvent redelivers a failed event which will be picked up by the webhook service.

type Config added in v0.1.4

type Config struct {
	// GitHubEnterpriseServerURL tis he GitHub Enterprise Server instance URL, in
	// the format "https://[hostname]".
	GitHubEnterpriseServerURL string

	// GitHubAppID is the GitHub App ID. This comes from the GitHub API.
	GitHubAppID string

	// GitHubPrivateKey is the GitHub App private key.
	GitHubPrivateKey string

	// GitHubPrivateKeyKMSKeyID is the KMS key ID to use for the GitHub App
	// private key. This is mutually-exclusive with [GitHubPrivateKey].
	GitHubPrivateKeyKMSKeyID string
}

Config represents the shared GitHub App configuration.

func (*Config) ToFlags added in v0.1.4

func (c *Config) ToFlags(set *cli.FlagSet)

ToFlags registers the GitHub flags.

func (*Config) Validate added in v0.1.4

func (c *Config) Validate(ctx context.Context) error

Validate does sanity checking on the configuration.

Jump to

Keyboard shortcuts

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