Documentation ¶
Overview ¶
Package github package
Index ¶
- type Provider
- func (p *Provider) BuildOAuthAuthorizationURL(input *types.BuildOAuthAuthorizationURLInput) (string, error)
- func (p *Provider) BuildRepositoryURL(input *types.BuildRepositoryURLInput) (string, error)
- func (p *Provider) CreateAccessToken(ctx context.Context, input *types.CreateAccessTokenInput) (*types.AccessTokenPayload, error)
- func (p *Provider) DefaultURL() url.URL
- func (p *Provider) GetArchive(ctx context.Context, input *types.GetArchiveInput) (*http.Response, error)
- func (p *Provider) TestConnection(ctx context.Context, input *types.TestConnectionInput) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider represents a particular VCS provider.
func (*Provider) BuildOAuthAuthorizationURL ¶
func (p *Provider) BuildOAuthAuthorizationURL(input *types.BuildOAuthAuthorizationURLInput) (string, error)
BuildOAuthAuthorizationURL build the authorization code URL which is used to redirect the user to the VCS provider to complete OAuth flow.
func (*Provider) BuildRepositoryURL ¶
func (p *Provider) BuildRepositoryURL(input *types.BuildRepositoryURLInput) (string, error)
BuildRepositoryURL returns the repository URL associated with the provider.
func (*Provider) CreateAccessToken ¶
func (p *Provider) CreateAccessToken(ctx context.Context, input *types.CreateAccessTokenInput) (*types.AccessTokenPayload, error)
CreateAccessToken sends a POST request to the provider to create an access and refresh tokens that can be used to further interact with the provider's API. https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps#web-application-flow
func (*Provider) DefaultURL ¶
DefaultURL returns the default API URL for this provider.
func (*Provider) GetArchive ¶
func (p *Provider) GetArchive(ctx context.Context, input *types.GetArchiveInput) (*http.Response, error)
GetArchive downloads the entire repository archive for a branch or tag. https://docs.github.com/en/rest/repos/contents#download-a-repository-archive-tar
func (*Provider) TestConnection ¶
TestConnection simply queries for the user metadata that's associated with the access token to verify validity. https://docs.github.com/en/rest/users/users#get-the-authenticated-user