Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependencies ¶
type Dependencies struct {
Logger zerolog.Logger
PlatformTokenProvider providers.PlatformTokenProvider
AuthProvider providers.RepositoryAuth
}
Dependencies defines the dependencies for the plugin provider.
type Github ¶
type Github struct {
Dependencies
// contains filtered or unexported fields
}
Github is a github based platform implementation.
func NewGithubPlatformProvider ¶
func NewGithubPlatformProvider(deps Dependencies) *Github
NewGithubPlatformProvider creates a new hook platform provider for Github.
func (*Github) CreateHook ¶
CreateHook can create a hook for the Github platform.
func (*Github) GetEventID ¶
GetEventID Based on the platform, retrieve the ID of the event.
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 Payload ¶
type Payload struct {
Repo Repository `json:"repository"`
}
Payload contains information about the event like, user, commit id and so on. All we care about for the sake of identification is the repository.
type Repository ¶
type Repository struct {
GitURL string `json:"git_url"`
SSHURL string `json:"ssh_url"`
HTMLURL string `json:"html_url"`
}
Repository contains information about the repository. All we care about here are the possible urls for identification.