Documentation ¶
Overview ¶
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0
Index ¶
- Constants
- type CheckRun
- type CheckRunAnnotation
- type CheckRunOutput
- type Checker
- type CheckerImpl
- type CommandLineArgParser
- type CommandLineArgParserImpl
- type Console
- type ConsoleImpl
- type ConsoleMock
- type EventHandler
- type EventHandlerImpl
- type FieldValuesParsed
- type File
- type Files
- type GitHubClient
- type GitHubClientImpl
- func (this *GitHubClientImpl) CreateCheckRun(tokenSupplier TokenSupplier, webhook *Webhook, headSha string) (string, error)
- func (this *GitHubClientImpl) GetFileContentFromGithub(token string, file *File) (string, error)
- func (this *GitHubClientImpl) GetFilesChanged(token string, baseUrl string) ([]File, error)
- func (this *GitHubClientImpl) GetNewToken(accessUrl string, githubAuthToken string) (tokenResponse InstallationToken, err error)
- func (this *GitHubClientImpl) LogHttpPayload(jsonBytes []byte)
- func (this *GitHubClientImpl) UpdateCheckRun(tokenSupplier TokenSupplier, webhook *Webhook, checkRunURL string, ...) error
- type InstallationToken
- type StringIterator
- type StringIteratorImpl
- type TokenSupplier
- type TokenSupplierImpl
- type TokenSupplierMock
- type Webhook
- type WebhookCheckRun
- type WebhookCheckSuite
- type WebhookInstallation
- type WebhookPullRequest
- type WebhookPullRequestHead
- type WebhookRepository
Constants ¶
const ( COMMAND_FLAG_GITHUB_AUTH_KEY_FILE = "--githubAuthKeyFile" COMMAND_FLAG_DEBUG = "--debug" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckRunAnnotation ¶
type CheckRunOutput ¶
type CheckRunOutput struct { Title string `json:"title"` Summary string `json:"summary"` Annotations *[]CheckRunAnnotation `json:"annotations,omitempty"` }
type Checker ¶
type Checker interface { CheckFilesChanged(token string, url string) ([]checkTypes.CheckError, error) CheckFile(token string, file *File) *checkTypes.CheckError }
func NewChecker ¶
func NewChecker(client GitHubClient) (Checker, error)
type CheckerImpl ¶
type CheckerImpl struct {
// contains filtered or unexported fields
}
func (*CheckerImpl) CheckFile ¶
func (this *CheckerImpl) CheckFile(token string, file *File) *checkTypes.CheckError
func (*CheckerImpl) CheckFilesChanged ¶
func (this *CheckerImpl) CheckFilesChanged(token string, url string) ([]checkTypes.CheckError, error)
type CommandLineArgParser ¶
type CommandLineArgParser interface {
Parse() (*FieldValuesParsed, error)
}
func NewCommandLineArgParserImpl ¶
func NewCommandLineArgParserImpl(args []string, console Console) (CommandLineArgParser, error)
type CommandLineArgParserImpl ¶
type CommandLineArgParserImpl struct {
// contains filtered or unexported fields
}
func (*CommandLineArgParserImpl) Parse ¶
func (this *CommandLineArgParserImpl) Parse() (*FieldValuesParsed, error)
type ConsoleImpl ¶
type ConsoleImpl struct { }
func (*ConsoleImpl) Write ¶
func (*ConsoleImpl) Write(message string)
type ConsoleMock ¶
type ConsoleMock struct {
// contains filtered or unexported fields
}
func NewConsoleMock ¶
func NewConsoleMock() *ConsoleMock
func (*ConsoleMock) Write ¶
func (this *ConsoleMock) Write(message string)
type EventHandler ¶
type EventHandler interface {
HandleEvent(w http.ResponseWriter, r *http.Request)
}
func NewEventHandlerImpl ¶
func NewEventHandlerImpl(gitHubClient GitHubClient, checker Checker, tokenSupplier TokenSupplier) (EventHandler, error)
type EventHandlerImpl ¶
type EventHandlerImpl struct {
// contains filtered or unexported fields
}
func (*EventHandlerImpl) HandleEvent ¶
func (this *EventHandlerImpl) HandleEvent(w http.ResponseWriter, r *http.Request)
type FieldValuesParsed ¶
type GitHubClient ¶
type GitHubClient interface { UpdateCheckRun(tokenSupplier TokenSupplier, webhook *Webhook, checkRunURL string, checkErrors []checkTypes.CheckError, fatalError string) error GetFilesChanged(token string, baseUrl string) ([]File, error) GetFileContentFromGithub(token string, file *File) (string, error) CreateCheckRun(tokenSupplier TokenSupplier, webhook *Webhook, headSha string) (string, error) GetNewToken(accessUrl string, githubAuthToken string) (tokenResponse InstallationToken, err error) LogHttpPayload(jsonBytes []byte) }
func NewGitHubClient ¶
func NewGitHubClient(isHttpTrafficLogged bool) GitHubClient
type GitHubClientImpl ¶
type GitHubClientImpl struct {
// contains filtered or unexported fields
}
func (*GitHubClientImpl) CreateCheckRun ¶
func (this *GitHubClientImpl) CreateCheckRun(tokenSupplier TokenSupplier, webhook *Webhook, headSha string) (string, error)
Create a 'check run' on github.
func (*GitHubClientImpl) GetFileContentFromGithub ¶
func (this *GitHubClientImpl) GetFileContentFromGithub(token string, file *File) (string, error)
func (*GitHubClientImpl) GetFilesChanged ¶
func (this *GitHubClientImpl) GetFilesChanged(token string, baseUrl string) ([]File, error)
func (*GitHubClientImpl) GetNewToken ¶
func (this *GitHubClientImpl) GetNewToken(accessUrl string, githubAuthToken string) (tokenResponse InstallationToken, err error)
func (*GitHubClientImpl) LogHttpPayload ¶
func (this *GitHubClientImpl) LogHttpPayload(jsonBytes []byte)
func (*GitHubClientImpl) UpdateCheckRun ¶
func (this *GitHubClientImpl) UpdateCheckRun( tokenSupplier TokenSupplier, webhook *Webhook, checkRunURL string, checkErrors []checkTypes.CheckError, fatalError string, ) error
Update the status of a previously-created 'check run' which exists at the end of a URL in github.
type InstallationToken ¶
type StringIterator ¶
type StringIterator interface { // Gets the next string from the input slice. If we run out of input, we return "" Next() (string, bool) }
func NewStringIterator ¶
func NewStringIterator(args []string) (StringIterator, error)
type StringIteratorImpl ¶
type StringIteratorImpl struct {
// contains filtered or unexported fields
}
func (*StringIteratorImpl) Next ¶
func (this *StringIteratorImpl) Next() (string, bool)
type TokenSupplier ¶
func NewTokenSupplier ¶
func NewTokenSupplier(gitHubClient GitHubClient, keyFilePath string) (TokenSupplier, error)
func NewTokenSupplierMock ¶
func NewTokenSupplierMock() (TokenSupplier, error)
type TokenSupplierImpl ¶
type TokenSupplierImpl struct {
// contains filtered or unexported fields
}
type TokenSupplierMock ¶
type TokenSupplierMock struct {
// contains filtered or unexported fields
}
type Webhook ¶
type Webhook struct { Action string `json:"action"` CheckSuite *WebhookCheckSuite `json:"check_suite,omitempty"` CheckRun *WebhookCheckRun `json:"check_run,omitempty"` Installation WebhookInstallation `json:"installation"` Repository WebhookRepository `json:"repository"` PullRequest *WebhookPullRequest `json:"pull_request,omitempty"` }
type WebhookCheckRun ¶
type WebhookCheckRun struct { Id int `json:"id"` HeadSha string `json:"head_sha"` Url string `json:"url"` CheckSuite WebhookCheckSuite `json:"check_suite"` }
type WebhookCheckSuite ¶
type WebhookCheckSuite struct { Id int `json:"id"` HeadSha string `json:"head_sha"` PullRequests *[]WebhookPullRequest `json:"pull_requests"` Before *string `json:"before,omitempty"` After *string `json:"after,omitempty"` }
type WebhookInstallation ¶
type WebhookPullRequest ¶
type WebhookPullRequest struct { Number int `json:"number"` Url string `json:"url"` Head WebhookPullRequestHead `json:"head"` Base WebhookPullRequestHead `json:"base"` }
type WebhookPullRequestHead ¶
type WebhookPullRequestHead struct { Sha string `json:"sha"` Repo WebhookRepository `json:"repo"` }