Documentation
¶
Overview ¶
Package githubclient is a wrapper around the GitHub App for common operations.
Index ¶
- type Client
- func (c *Client) App() *githubauth.App
- func (c *Client) GitHubClientFromTokenSource(ctx context.Context, ts oauth2.TokenSource) (*github.Client, error)
- func (c *Client) ListDeliveries(ctx context.Context, opts *github.ListCursorOptions) ([]*github.HookDelivery, *github.Response, error)
- func (c *Client) RedeliverEvent(ctx context.Context, deliveryID int64) error
- type Config
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 (*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.
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.
Click to show internal directories.
Click to hide internal directories.