Documentation ¶
Index ¶
- type GoogleGithubClient
- type GoogleGithubRepoService
- type Platform
- func (g *Platform) CheckoutCode(ctx context.Context, event *v1alpha1.KrokEvent, ...) (string, error)
- func (g *Platform) CreateHook(ctx context.Context, repo *v1alpha1.KrokRepository, ...) error
- func (g *Platform) GetEventID(ctx context.Context, r *http.Request) (string, error)
- func (g *Platform) GetEventType(ctx context.Context, r *http.Request) (string, error)
- func (g *Platform) GetRefIfPresent(ctx context.Context, event *v1alpha1.KrokEvent) (string, string, error)
- func (g *Platform) ValidateRequest(ctx context.Context, req *http.Request, secret string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoogleGithubClient ¶
type GoogleGithubClient struct { Repositories GoogleGithubRepoService *ggithub.Client }
GoogleGithubClient is a client that has the ability to replace the actual git client.
func NewGoogleGithubClient ¶
func NewGoogleGithubClient(httpClient *http.Client, repoMock GoogleGithubRepoService) GoogleGithubClient
NewGoogleGithubClient creates a wrapper around the GitHub client.
type GoogleGithubRepoService ¶
type GoogleGithubRepoService interface {
CreateHook(ctx context.Context, owner, repo string, hook *ggithub.Hook) (*ggithub.Hook, *ggithub.Response, error)
}
GoogleGithubRepoService is an interface defining the Wrapper Interface needed to test the GitHub client.
type Platform ¶
Platform is a GitHub based platform implementation.
func NewGithubPlatformProvider ¶
NewGithubPlatformProvider creates a new hook platform provider for GitHub.
func (*Platform) CheckoutCode ¶
func (g *Platform) CheckoutCode(ctx context.Context, event *v1alpha1.KrokEvent, repository *v1alpha1.KrokRepository, location string) (string, error)
CheckoutCode will get the code given an event which needs the codebase. It will create a ZIP file from the source code which is offered by a server running a file-server with given URLs for each artifact.
func (*Platform) CreateHook ¶
func (g *Platform) CreateHook(ctx context.Context, repo *v1alpha1.KrokRepository, platformToken, secret string) error
CreateHook can create a hook for the GitHub platform.
func (*Platform) GetEventID ¶
GetEventID Based on the platform, retrieve the ID of the event.
func (*Platform) GetEventType ¶
GetEventType Based on the platform, retrieve the Type of the event.