Documentation
¶
Overview ¶
Package server provides HTTP routes and webhook handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeployRequest ¶
type DeployRequest struct {
Service string `json:"service"`
HeadRef string `json:"head_ref"`
CommitSha string `json:"commit_sha"`
PRAuthor string `json:"pr_author"`
PRURL string `json:"pr_url"`
PRNumber string `json:"pr_number"`
WorkflowRunURL string `json:"workflow_run_url"`
}
DeployRequest is the body of POST /v1/deploy. All fields are required; the server stamps timestamp from time.Now() so retries don't drift.
type DeployResponse ¶
type DeployResponse struct {
PreviewSlug string `json:"preview_slug"`
GitOpsCommitURL string `json:"gitops_commit_url"`
Warnings []string `json:"warnings,omitempty"`
}
DeployResponse is the success body. Warnings is populated when the values write succeeded but the comment fan-out had partial failures.
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse is the failure body for every non-2xx response.
type Option ¶
type Option func(*Server)
Option configures a Server built by NewServer.
func WithArgoCDToken ¶
WithArgoCDToken enables POST /webhooks/argocd, authenticated by the Bearer token. An empty token leaves the route unregistered.
func WithMetrics ¶
WithMetrics records webhook deliveries and lifecycle outcomes in m.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer( webhook WebhookValidator, gitops gitopsAPI, deployToken string, allowedInstallationID int64, opts ...Option, ) *Server