Documentation
¶
Overview ¶
Package app provides the core application logic for the GitHub bot. coordinates webhook processing, Okta sync, and PR compliance checks.
Package app provides HTTP handlers for webhook and status endpoints.
Index ¶
- type App
- func (a *App) ConfigHandler(w http.ResponseWriter, r *http.Request)
- func (a *App) GetStatus() StatusResponse
- func (a *App) ProcessScheduledEvent(ctx context.Context, evt ScheduledEvent) error
- func (a *App) ProcessWebhook(ctx context.Context, payload []byte, eventType string) error
- func (a *App) StatusHandler(w http.ResponseWriter, r *http.Request)
- func (a *App) WebhookHandler(w http.ResponseWriter, r *http.Request)
- type ScheduledEvent
- type StatusResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Config *config.Config
Logger *slog.Logger
GitHubClient *github.Client
OktaClient *okta.Client
Notifier *notifiers.SlackNotifier
}
App is the main application instance containing all clients and configuration.
func New ¶
New creates a new App instance with configured clients. initializes GitHub, Okta, and Slack clients based on config.
func (*App) ConfigHandler ¶
func (a *App) ConfigHandler(w http.ResponseWriter, r *http.Request)
ConfigHandler returns the application configuration with secrets redacted. useful for debugging and verifying environment settings.
func (*App) GetStatus ¶
func (a *App) GetStatus() StatusResponse
GetStatus returns current application status and enabled features.
func (*App) ProcessScheduledEvent ¶
func (a *App) ProcessScheduledEvent(ctx context.Context, evt ScheduledEvent) error
ProcessScheduledEvent handles scheduled events (e.g., cron jobs). routes to appropriate handlers based on event action.
func (*App) ProcessWebhook ¶
ProcessWebhook handles incoming GitHub webhook events. supports pull_request, team, and membership events.
func (*App) StatusHandler ¶
func (a *App) StatusHandler(w http.ResponseWriter, r *http.Request)
StatusHandler returns the application status and feature flags. responds with JSON containing configuration state and enabled features.
func (*App) WebhookHandler ¶
func (a *App) WebhookHandler(w http.ResponseWriter, r *http.Request)
WebhookHandler processes incoming GitHub webhook POST requests. validates webhook signatures before processing events.
type ScheduledEvent ¶
type ScheduledEvent struct {
Action string `json:"action"`
Data json.RawMessage `json:"data,omitempty"`
}
ScheduledEvent represents a generic scheduled event.
type StatusResponse ¶
type StatusResponse struct {
Status string `json:"status"`
GitHubConfigured bool `json:"github_configured"`
OktaSyncEnabled bool `json:"okta_sync_enabled"`
PRComplianceCheck bool `json:"pr_compliance_check"`
SlackEnabled bool `json:"slack_enabled"`
}
StatusResponse contains application status and feature flags.