Documentation
¶
Index ¶
- func GitHubWebhookHandler(opts *githubhandleroptions.HTTPHandler) fasthttp.RequestHandler
- func HealthCheckHandler(ctx *fasthttp.RequestCtx)
- func Run() error
- type HTTPServer
- type MethodHandler
- type Option
- func WithHTTPHandler(method, path string, handler fasthttp.RequestHandler) Option
- func WithIdleTimeout(d time.Duration) Option
- func WithKafkaBrokers(brokers []string) Option
- func WithKafkaGitHubTopic(s kafkaconsumer.KafkaTopicIdentifier) Option
- func WithListenAddr(addr string) Option
- func WithLogger(l *slog.Logger) Option
- func WithReadTimeout(d time.Duration) Option
- func WithWriteTimeout(d time.Duration) Option
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GitHubWebhookHandler ¶
func GitHubWebhookHandler(opts *githubhandleroptions.HTTPHandler) fasthttp.RequestHandler
GitHubWebhookHandler handles GitHub webhooks.
func HealthCheckHandler ¶
func HealthCheckHandler(ctx *fasthttp.RequestCtx)
HealthCheckHandler handles health check functionality.
Types ¶
type HTTPServer ¶
HTTPServer defines the basic operations for managing an HTTP server's lifecycle.
type MethodHandler ¶
type MethodHandler map[string]fasthttp.RequestHandler
MethodHandler holds http method and http handler function information.
type Option ¶
Option represents option function type.
func WithHTTPHandler ¶
func WithHTTPHandler(method, path string, handler fasthttp.RequestHandler) Option
WithHTTPHandler adds http handler.
func WithIdleTimeout ¶
WithIdleTimeout sets idle timeout.
func WithKafkaBrokers ¶
WithKafkaBrokers sets kafka brokers list.
func WithKafkaGitHubTopic ¶
func WithKafkaGitHubTopic(s kafkaconsumer.KafkaTopicIdentifier) Option
WithKafkaGitHubTopic sets kafka topic name for github webhooks.
func WithReadTimeout ¶
WithReadTimeout sets read timeout.
func WithWriteTimeout ¶
WithWriteTimeout sets write timeout.
type Server ¶
type Server struct {
Logger *slog.Logger
FastHTTP *fasthttp.Server
Handlers map[string]MethodHandler
ListenAddr string
KafkaGitHubTopic kafkaconsumer.KafkaTopicIdentifier
KafkaBrokers []string
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
}
Server represents server configuration. Must implements HTTPServer interface.
Click to show internal directories.
Click to hide internal directories.