Documentation
¶
Overview ¶
Package http provides HTTP server implementation for the protocol adapter.
Index ¶
Constants ¶
View Source
const (
// AgenkitVersion is the current version of the Agenkit library
AgenkitVersion = "0.44.0"
)
Variables ¶
This section is empty.
Functions ¶
func ParseHTTPEndpoint ¶
ParseHTTPEndpoint parses an HTTP endpoint string. Format: http://host:port or https://host:port
Types ¶
type HTTPAgent ¶
type HTTPAgent struct {
// contains filtered or unexported fields
}
HTTPAgent is an HTTP server wrapper for exposing agents over HTTP.
func NewHTTPAgent ¶
NewHTTPAgent creates a new HTTP agent server with default options (HTTP/1.1 only). Security: Default middleware (rate limiting, timeout) is enabled for protection.
Args:
- agent: The local agent to expose
- addr: HTTP server address (e.g., "localhost:8080")
func NewHTTPAgentWithOptions ¶
func NewHTTPAgentWithOptions(agent agenkit.Agent, addr string, options ServerOptions) *HTTPAgent
NewHTTPAgentWithOptions creates a new HTTP agent server with custom options.
Args:
- agent: The local agent to expose
- addr: HTTP server address (e.g., "localhost:8080")
- options: Server configuration options
type ServerOptions ¶
type ServerOptions struct {
// EnableHTTP2 enables HTTP/2 support (both h2 and h2c)
EnableHTTP2 bool
// EnableHTTP3 enables HTTP/3 over QUIC (requires TLS)
EnableHTTP3 bool
// TLSConfig for HTTPS, HTTP/2 over TLS, and HTTP/3
TLSConfig *tls.Config
// HTTP3Addr is the UDP address for HTTP/3 (defaults to HTTP addr)
HTTP3Addr string
// EnableDefaultMiddleware enables default security middleware (rate limiting, timeout)
// Defaults to true for secure-by-default operation
EnableDefaultMiddleware bool
// RateLimitConfig custom rate limiter configuration (uses secure defaults if nil)
RateLimitConfig *middleware.RateLimiterConfig
// TimeoutConfig custom timeout configuration (uses 30s default if nil)
TimeoutConfig *middleware.TimeoutConfig
}
ServerOptions configures HTTP server behavior.
Click to show internal directories.
Click to hide internal directories.