http

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 11 Imported by: 0

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
}

Client calls external HTTP approvers.

func (Client) Approve

func (c Client) Approve(ctx context.Context, req approver.Request) (approver.Decision, error)

Approve sends a request to the HTTP approver and parses the decision.

func (Client) Name

func (c Client) Name() string

Name returns approver name for audit and logging.

type Request

type Request struct {
	// CorrelationID links related requests.
	CorrelationID string `json:"correlation_id"`
	// Tool is the tool name.
	Tool string `json:"tool"`
	// Arguments are sanitized tool arguments.
	Arguments map[string]any `json:"arguments"`
}

Request is the payload sent to HTTP approvers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL