Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
ListenAddr string
Logger zerolog.Logger
MetricsAddr string
Platform platforms.Platform
ProbeAddr string
WebhookSecret string
Workers int
}
Config hold configuration to run a server
type Server ¶
type Server struct {
CancelWorker chan struct{}
Config *Config
Srv *http.Server
WorkerPool *workers.WorkerPool
}
Server hold a server instance
type WebhookHandler ¶
type WebhookHandler struct {
JobQueue chan *workers.Job
Platform platforms.Platform
WebhookSecret string
}
WebhookHandler hold webhook configuration
func NewWebhookHandler ¶
func NewWebhookHandler(platform platforms.Platform, webhookSecret string, jobQueue chan *workers.Job) *WebhookHandler
NewWebhookHandler returns an instance of WebhookHandler
func (*WebhookHandler) GithubHandler ¶
func (h *WebhookHandler) GithubHandler(w http.ResponseWriter, r *http.Request)
GithubHandler handle Github webhook requests
func (*WebhookHandler) GitlabHandler ¶
func (h *WebhookHandler) GitlabHandler(w http.ResponseWriter, r *http.Request)
GitlabHandler handle Gitlab webhook requests
Click to show internal directories.
Click to hide internal directories.