Documentation
¶
Overview ¶
Package http implements an HTTP-based approver client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// Label is a human-friendly name.
Label string
// URL is the approver endpoint.
URL string
// Method overrides HTTP method.
Method string
// Headers adds HTTP headers.
Headers map[string]string
// Timeout is the HTTP timeout.
Timeout time.Duration
// Async enables webhook-based async approvals.
Async bool
// WebhookURL is the yaml-mcp-server callback URL.
WebhookURL string
// Lang defines the preferred language for approver messages.
Lang string
// Markup selects approval message markup (markdown/html).
Markup string
// Pending stores async approvals.
Pending *PendingStore
}
Client calls external HTTP approvers.
type PendingStore ¶ added in v1.1.0
type PendingStore struct {
// contains filtered or unexported fields
}
PendingStore keeps async approval results.
func NewPendingStore ¶ added in v1.1.0
func NewPendingStore() *PendingStore
NewPendingStore creates a new async approval store.
func (*PendingStore) Cancel ¶ added in v1.1.0
func (s *PendingStore) Cancel(correlationID string)
Cancel removes a pending approval without a decision.
type WebhookHandler ¶ added in v1.1.0
type WebhookHandler struct {
Store *PendingStore
Logger *slog.Logger
}
WebhookHandler handles async approval callbacks.
func (*WebhookHandler) ServeHTTP ¶ added in v1.1.0
func (h *WebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP processes webhook callbacks from async approvers.
Click to show internal directories.
Click to hide internal directories.