server

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetricsServer added in v0.7.0

func NewMetricsServer(addr string) (*http.Server, func(next echo.HandlerFunc) echo.HandlerFunc)

func NewProbeServer added in v0.7.0

func NewProbeServer(addr string) *http.Server

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
	MainServer    *http.Server
	MetricsServer *http.Server
	ProbeServer   *http.Server
	WorkerPool    *workers.WorkerPool
}

Server hold a server instance

func NewServer

func NewServer(config *Config) *Server

NewServer returns an instance of server

func (*Server) Start

func (s *Server) Start()

Start all components required to run a server

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(c echo.Context) error

func (*WebhookHandler) GitlabHandler

func (h *WebhookHandler) GitlabHandler(c echo.Context) error

GitlabHandler handle Gitlab webhook requests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL