Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Addr is the address to listen on (e.g., ":8080", "0.0.0.0:8080")
Addr string
// TLSCertFile is the path to the TLS certificate file (optional)
TLSCertFile string
// TLSKeyFile is the path to the TLS key file (optional)
TLSKeyFile string
// Handler is the HTTP handler for webhook requests
Handler http.Handler
// ReadTimeout is the maximum duration for reading requests (optional)
ReadTimeout time.Duration
// WriteTimeout is the maximum duration for writing responses (optional)
WriteTimeout time.Duration
// IdleTimeout is the maximum duration to wait for the next request (optional)
IdleTimeout time.Duration
// ShutdownTimeout is the maximum time to wait for graceful shutdown (optional)
ShutdownTimeout time.Duration
// Secret is the webhook secret for HMAC signature verification (optional but recommended)
Secret string
// RateLimit is the number of requests per minute allowed per IP (optional, default: 100)
RateLimit int
// MaxBodySize is the maximum request body size in bytes (optional, default: 1MB)
MaxBodySize int64
}
Config holds configuration for the webhook server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an HTTP server for receiving GitHub webhooks. It provides graceful shutdown, TLS support, health/readiness endpoints, signature verification, rate limiting, and request size limits.
func NewServer ¶
NewServer creates a new webhook server with the given configuration. The server must be started with Start() and stopped with Shutdown(). Returns an error if configuration is invalid.
Click to show internal directories.
Click to hide internal directories.