Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptKMS ¶
DecryptKMS decrypts base64 text encrypted by AWS KMS to plain text.
Types ¶
type Assignees ¶
type Assignees struct {
// contains filtered or unexported fields
}
Assignees has GitHub users.
func (*Assignees) HasAssignees ¶
HasAssignees checks if at least one user is exists or not.
func (*Assignees) RemoveFromList ¶
RemoveFromList removes users from the list.
type Comment ¶
type Comment struct {
// contains filtered or unexported fields
}
Comment contains comments to add to pull request.
func (*Comment) HasComment ¶
HasComment checks if at least one comment is exists or not.
type Config ¶
type Config struct {
RepositoryList map[string]*Repository `yaml:"repository"`
APIToken string `yaml:"api_token"`
APITokenKMS string `yaml:"api_token_kms"`
BotID int64 `yaml:"bot_id"`
WebHookSecret string `yaml:"webhook_secret"`
// If `AddComment` is true, comment is created each push event.
// If `AddComment` is false, comment is edited each push event.
AddComment bool `yaml:"add_comment"`
Timeout time.Duration `yaml:"timeout"`
}
Config contains settings.
func (Config) GetAPIToken ¶
GetAPIToken gets api token for GitHub.
func (Config) GetRepository ¶
func (c Config) GetRepository(name string) *Repository
GetRepository gets Repository setting to manage pull request.
func (Config) HasAPIToken ¶
HasAPIToken checks if api token is exists or not.
type File ¶
type File struct {
Name string `yaml:"name"`
Regexp []string `yaml:"regexp"`
Comment string `yaml:"comment"`
Assignees []string `yaml:"assignees"`
Reviewers []string `yaml:"reviewers"`
ShowFiles bool `yaml:"show_files"`
// contains filtered or unexported fields
}
File has rules to check changed file and manage comment/assignees/reviwers of pull request.
type Repository ¶
type Repository struct {
Files []*File
}
Repository has settings to check changed files.
type WebhookHandler ¶
type WebhookHandler struct {
Config Config
// contains filtered or unexported fields
}
WebhookHandler handles webhook request.
func NewWithConfig ¶
func NewWithConfig(conf Config) (*WebhookHandler, error)
NewWithConfig creates WebhookHandler from given Config.
func (*WebhookHandler) HandleRequest ¶
func (h *WebhookHandler) HandleRequest(r *http.Request) error
HandleRequest handles webhook request and run PullRequestChecker.