Documentation
¶
Overview ¶
Package server hosts the HTTP server for the branch-out application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HealthResponse ¶
HealthResponse represents the health check response
type Option ¶
type Option func(*options)
Option is a functional option that configures the server. Default options are used if no options are provided.
func WithConfig ¶
WithConfig sets the config for the server. Default config is used if no config is provided.
func WithGitHubClient ¶
WithGitHubClient sets the GitHub client for the server. This overrides using the config to create a client. Useful for testing.
func WithJiraClient ¶
WithJiraClient sets the Jira client for the server. This overrides using the config to create a client. Useful for testing.
func WithLogger ¶
WithLogger sets the logger for the server.
func WithTrunkClient ¶
WithTrunkClient sets the Trunk client for the server. This overrides using the config to create a client. Useful for testing.
type Server ¶
Server is the HTTP server for the branch-out application.
func (*Server) Error ¶
Error returns the error that occurred during server startup. It is nil if the server started successfully.
func (*Server) Health ¶
func (s *Server) Health() (HealthResponse, error)
Health checks the health of the server and returns health status.
func (*Server) ReceiveWebhook ¶
func (s *Server) ReceiveWebhook(req *http.Request) (*WebhookResponse, error)
ReceiveWebhook processes webhook data and returns the result.
func (*Server) Start ¶
Start starts the server and blocks until shutdown. It handles both programmatic shutdown (via context) and OS signals.
type WebhookResponse ¶
type WebhookResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
Error error `json:"error,omitempty"`
}
WebhookResponse represents the response from webhook processing