Documentation
¶
Overview ¶
Package hclapi provides a type-safe, declarative HTTP API engine powered by HashiCorp HCL. It compiles HCL manifests into instant HTTP services backed by relational databases, Valkey/Redis caching, sandboxed Starlark transformations, and zero-drift OpenAPI 3.1 specifications.
Index ¶
- Variables
- type Args
- type ByteSize
- type Connection
- type Duration
- type Engine
- type Expr
- type Field
- type GoHandler
- type GoRequest
- type InvalidParam
- type Manifest
- type OpenAPI
- type Option
- type Parser
- type Problem
- type RecordSeq
- type Request
- type Route
- type Schema
- type Server
- type Spec
- type Step
- type StepDecoder
- type StepExecutionContext
- type StepExecutor
- type StepRegistry
- type StepValidator
- type Telemetry
- type TelemetryService
Constants ¶
This section is empty.
Variables ¶
var ErrPipelineHalted = manifest.ErrPipelineHalted
ErrPipelineHalted signals that a terminal step or error catch completed the response.
Functions ¶
This section is empty.
Types ¶
type Args ¶ added in v0.1.2
Args represents evaluated key-value arguments supplied to a native Go step handler.
type Connection ¶ added in v0.1.2
type Connection = manifest.Connection
Connection defines external database connection pools and cache instances.
type Engine ¶
Engine coordinates HTTP routing, connection pool lifecycles, and request execution. It implements the standard http.Handler interface.
type Expr ¶ added in v0.2.1
Expr represents a compiled HCL expression ready for evaluation against an execution scope.
type Field ¶ added in v0.1.2
Field specifies validation constraints and documentation metadata for a model attribute.
type GoHandler ¶ added in v0.2.1
GoHandler defines the function signature for custom Go step callbacks registered on the runtime.
type GoRequest ¶ added in v0.2.1
GoRequest encapsulates the input arguments and active HTTP request passed to a GoHandler.
type InvalidParam ¶
type InvalidParam = problem.InvalidParam
InvalidParam describes a single schema constraint violation for 422 Unprocessable Entity responses.
type Manifest ¶ added in v0.2.1
Manifest represents the compiled, validated AST for an entire API service.
type OpenAPI ¶ added in v0.2.1
OpenAPI holds document metadata exported into OpenAPI 3.1 specifications.
type Option ¶ added in v0.2.0
Option configures an Engine during initialization.
func WithGoHandler ¶ added in v0.2.1
WithGoHandler registers a custom native Go callback by its identifier.
func WithHTTPClient ¶ added in v0.2.1
WithHTTPClient overrides the default HTTP client used for outbound requests.
func WithStep ¶ added in v0.2.0
WithStep is an alias for WithGoHandler.
func WithTelemetry ¶ added in v0.2.1
func WithTelemetry(t *TelemetryService) Option
WithTelemetry overrides the default telemetry instance configured by the manifest.
type Parser ¶ added in v0.2.1
Parser coordinates file discovery, HCL parsing, and AST compilation using a configurable StepRegistry.
func NewParser ¶ added in v0.2.1
func NewParser(registry *StepRegistry) *Parser
NewParser constructs a Parser configured with the supplied StepRegistry.
type RecordSeq ¶ added in v0.2.1
RecordSeq defines the standard Go iterator yielding record items and potential errors.
type Request ¶ added in v0.2.1
Request defines validation constraints across incoming HTTP request coordinates.
type Route ¶ added in v0.2.1
Route binds an HTTP method and URL pattern to an ordered pipeline of steps.
type Schema ¶ added in v0.1.2
Schema represents a reusable domain model for payload validation and egress filtering.
type Spec ¶ added in v0.2.1
Spec represents a compiled, validated OpenAPI 3.1 specification ready for serving.
type StepDecoder ¶ added in v0.2.1
type StepDecoder = manifest.StepDecoder
StepDecoder decodes an HCL block into a concrete Step implementation.
type StepExecutionContext ¶ added in v0.2.1
type StepExecutionContext = manifest.StepExecutionContext
StepExecutionContext supplies runtime dependencies and request state to steps during execution.
type StepExecutor ¶ added in v0.2.1
type StepExecutor = manifest.StepExecutor
StepExecutor is implemented by steps that execute runtime request logic.
type StepRegistry ¶ added in v0.2.1
type StepRegistry = manifest.StepRegistry
StepRegistry manages step decoders and generates dynamic HCL block schemas without global state.
func DefaultStepRegistry ¶ added in v0.2.1
func DefaultStepRegistry() *StepRegistry
DefaultStepRegistry returns a pre-configured registry containing all standard built-in steps (sql, http, valkey, starlark, go, stream, respond, docs, spec).
func NewStepRegistry ¶ added in v0.2.1
func NewStepRegistry() *StepRegistry
NewStepRegistry returns an empty, isolated step registry for custom language extensions.
type StepValidator ¶ added in v0.2.1
type StepValidator = manifest.StepValidator
StepValidator is an optional interface implemented by AST step definitions that require semantic verification against the compiled manifest topology.
type Telemetry ¶ added in v0.2.1
Telemetry configures structured logging output, log level thresholds, and key redaction.
type TelemetryService ¶ added in v0.2.1
TelemetryService coordinates runtime logging, OpenTelemetry tracing, and panic recovery middleware.