Documentation
¶
Index ¶
- func NewClient(ctx context.Context, appID int, installationID int64, keyPEM []byte) (*github.Client, error)
- type CheckRunsClient
- type CheckRunsClientFactory
- type MockCheckRunsClient
- func (m *MockCheckRunsClient) CreateCheckRun(ctx context.Context, owner string, repo string, ...) (*github.CheckRun, *github.Response, error)
- func (m *MockCheckRunsClient) UpdateCheckRun(ctx context.Context, owner string, repo string, checkRunID int64, ...) (*github.CheckRun, *github.Response, error)
- type MockCheckRunsClientFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient( ctx context.Context, appID int, installationID int64, keyPEM []byte, ) (*github.Client, error)
NewClient returns a new GitHub API client. This function abstracts the onerous process of authenticating as an installation. It uses the provided appID and ASCII-armored x509 certificate key to create a JWT (JSON web token) that is used to authenticate to the GitHub Apps API. Using that API, an installation token is obtained for the given installationID. This token is ultimately used by the returned client to authenticate as the specified installation.
See the following for further details: https://docs.github.com/en/developers/apps/authenticating-with-github-apps
Types ¶
type CheckRunsClient ¶
type CheckRunsClient interface {
CreateCheckRun(
ctx context.Context,
owner string,
repo string,
opts github.CreateCheckRunOptions,
) (*github.CheckRun, *github.Response, error)
UpdateCheckRun(
ctx context.Context,
owner string,
repo string,
checkRunID int64,
opts github.UpdateCheckRunOptions,
) (*github.CheckRun, *github.Response, error)
}
type CheckRunsClientFactory ¶
type CheckRunsClientFactory interface {
NewCheckRunsClient(
ctx context.Context,
appID int,
installationID int64,
apiKey []byte,
) (CheckRunsClient, error)
}
func NewCheckRunsClientFactory ¶
func NewCheckRunsClientFactory() CheckRunsClientFactory
type MockCheckRunsClient ¶
type MockCheckRunsClient struct {
CreateCheckRunFn func(
ctx context.Context,
owner string,
repo string,
opts github.CreateCheckRunOptions,
) (*github.CheckRun, *github.Response, error)
UpdateCheckRunFn func(
ctx context.Context,
owner string,
repo string,
checkRunID int64,
opts github.UpdateCheckRunOptions,
) (*github.CheckRun, *github.Response, error)
}
func (*MockCheckRunsClient) CreateCheckRun ¶
func (*MockCheckRunsClient) UpdateCheckRun ¶
type MockCheckRunsClientFactory ¶
type MockCheckRunsClientFactory struct {
NewCheckRunsClientFn func(
ctx context.Context,
appID int,
installationID int64,
apiKey []byte,
) (CheckRunsClient, error)
}
func (*MockCheckRunsClientFactory) NewCheckRunsClient ¶
func (m *MockCheckRunsClientFactory) NewCheckRunsClient( ctx context.Context, appID int, installationID int64, apiKey []byte, ) (CheckRunsClient, error)
Click to show internal directories.
Click to hide internal directories.