Documentation
¶
Overview ¶
Package github provides github related code
Index ¶
- Constants
- func Defaults() cloud.Config
- func HandleEvent(w http.ResponseWriter, r *http.Request, opts cloud.HandleEventOptions) cloud.VCSEvent
- func NewEnterpriseClient(hostname string, httpClient *http.Client) (*github.Client, error)
- func OAuthDefaults() *oauth2.Config
- type Client
- func (g *Client) CreateWebhook(ctx context.Context, opts cloud.CreateWebhookOptions) (string, error)
- func (g *Client) DeleteWebhook(ctx context.Context, opts cloud.DeleteWebhookOptions) error
- func (g *Client) GetRepoTarball(ctx context.Context, topts cloud.GetRepoTarballOptions) ([]byte, error)
- func (g *Client) GetRepository(ctx context.Context, identifier string) (cloud.Repo, error)
- func (g *Client) GetUser(ctx context.Context) (*cloud.User, error)
- func (g *Client) GetWebhook(ctx context.Context, opts cloud.GetWebhookOptions) (cloud.Webhook, error)
- func (g *Client) ListRepositories(ctx context.Context, opts cloud.ListRepositoriesOptions) ([]cloud.Repo, error)
- func (g *Client) ListTags(ctx context.Context, opts cloud.ListTagsOptions) ([]string, error)
- func (g *Client) SetStatus(ctx context.Context, opts cloud.SetStatusOptions) error
- func (g *Client) UpdateWebhook(ctx context.Context, opts cloud.UpdateWebhookOptions) error
- type Cloud
- type TestServer
- type TestServerOption
Constants ¶
View Source
const (
DefaultGithubHostname string = "github.com"
)
Variables ¶
This section is empty.
Functions ¶
func HandleEvent ¶
func HandleEvent(w http.ResponseWriter, r *http.Request, opts cloud.HandleEventOptions) cloud.VCSEvent
HandleEvent handles incoming events from github
func NewEnterpriseClient ¶
func OAuthDefaults ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateWebhook ¶
func (g *Client) CreateWebhook(ctx context.Context, opts cloud.CreateWebhookOptions) (string, error)
CreateWebhook creates a webhook on a github repository.
func (*Client) DeleteWebhook ¶
func (*Client) GetRepoTarball ¶
func (*Client) GetRepository ¶
func (*Client) GetWebhook ¶
func (*Client) ListRepositories ¶
func (*Client) UpdateWebhook ¶
type Cloud ¶
type Cloud struct{}
func (Cloud) HandleEvent ¶
func (Cloud) HandleEvent(w http.ResponseWriter, r *http.Request, opts cloud.HandleEventOptions) cloud.VCSEvent
type TestServer ¶
type TestServer struct {
WebhookURL *string // populated once a webhook is created
WebhookSecret *string // populated once a webhook is created
*httptest.Server
// contains filtered or unexported fields
}
func NewTestServer ¶
func NewTestServer(t *testing.T, opts ...TestServerOption) *TestServer
type TestServerOption ¶
type TestServerOption func(*TestServer)
func WithArchive ¶
func WithArchive(tarball []byte) TestServerOption
func WithRefs ¶
func WithRefs(refs ...string) TestServerOption
func WithRepo ¶
func WithRepo(repo cloud.Repo) TestServerOption
func WithStatusCallback ¶
func WithStatusCallback(callback statusCallback) TestServerOption
func WithUser ¶
func WithUser(user *cloud.User) TestServerOption
Click to show internal directories.
Click to hide internal directories.