Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Ping event name. Ping = "ping" // IssueComment event name. IssueComment = "issue_comment" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot interface {
Hook(ctx context.Context) echo.HandlerFunc
}
Bot represents the capabilities of a Gaia bot.
type Comment ¶
type Comment struct {
URL string `json:"url"`
}
Comment is information about the comment including the URL which has to be GET in order to retrieve the actual comment.
type Config ¶
type Config struct {
HookSecret string
}
Config defines configuration which this bot needs to Run.
type Dependencies ¶
type Dependencies struct { Logger zerolog.Logger Processor providers.Processor Converter providers.EnvironmentConverter }
Dependencies defines the dependencies of this server.
type GaiaBot ¶
type GaiaBot struct { Dependencies Config }
GaiaBot is the bot's main handler.
func NewBot ¶
func NewBot(cfg Config, deps Dependencies) *GaiaBot
NewBot creates a new bot to listen for PR created events.
type Issue ¶
type Issue struct {
PullRequest PullRequest `json:"pull_request,omitempty"`
}
Issue is information about the context of the comment. It should be checked if it's a PR.
type Payload ¶
type Payload struct { Action string `json:"action"` Issue Issue `json:"issue"` Comment Comment `json:"comment"` Sender Sender `json:"sender"` }
Payload contains information about the event like, user, commit id and so on.
type PullRequest ¶
type PullRequest struct {
URL string `json:"url,omitempty"`
}
PullRequest is the pull request context of an issue comment if the comment happened on a PR.
Click to show internal directories.
Click to hide internal directories.