Documentation
¶
Index ¶
- type Connection
- type Contact
- type Definition
- type Endpoint
- type Field
- type GoStep
- type Handler
- type License
- type OpenAPI
- type OpenAPIHandler
- type OpenAPIServer
- type OpenAPITag
- type PipelineHandler
- type PoolConfig
- type Problem
- type RequestRules
- type RespondStep
- type SQLCatch
- type SQLStep
- type Schema
- type Server
- type StarlarkStep
- type Step
- type StepType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
Driver string
Name string
Source string
Pool PoolConfig
}
Connection represents a relational database or connection pool declaration.
func (Connection) Key ¶
func (c Connection) Key() string
Key returns the short identifier for the pool (e.g., "postgres.primary").
func (Connection) Reference ¶
func (c Connection) Reference() string
Reference returns the full manifest reference path (e.g., "connection.postgres.primary").
type Definition ¶
type Definition struct {
Server Server
OpenAPI OpenAPI
Problem Problem
Connections []Connection
Schemas map[string]Schema
Endpoints []Endpoint
}
Definition represents the verified, immutable runtime specification for an API service.
func Build ¶
func Build(m *manifest.Manifest, evalCtx *hcl.EvalContext) (*Definition, error)
Build lowers a raw HCL Manifest into an immutable, fully validated service definition.
type Endpoint ¶
type Endpoint struct {
Method string
Path string
RoutePattern string
Description string
RequestRules RequestRules
Handler Handler
}
Endpoint represents an HTTP route with ingress rules and a terminal handler.
type Field ¶
type Field struct {
Name string
Type string
Required bool
Default any
Description string
Enum []any
Format string
Pattern string
MinLength *int
MaxLength *int
Min *float64
Max *float64
MinItems *int
MaxItems *int
UniqueItems bool
}
Field defines validation rules and bounds for an input property.
type GoStep ¶
type GoStep struct {
Use string
Args hcl.Expression
}
GoStep defines invocation parameters for a native Go callback function.
type Handler ¶
type Handler interface {
// contains filtered or unexported methods
}
Handler is a sealed interface guaranteed to be either PipelineHandler or OpenAPIHandler.
type OpenAPI ¶
type OpenAPI struct {
Title string
Version string
Description string
Servers []OpenAPIServer
Tags []OpenAPITag
Contact *Contact
License *License
}
OpenAPI holds document metadata for OpenAPI 3.1 specification generation.
type OpenAPIHandler ¶
type OpenAPIHandler struct {
Mode string
Format string
Renderer string
SpecURL string
Template string
Title string
Version string
Description string
}
OpenAPIHandler represents an endpoint serving specifications or documentation UIs.
type OpenAPIServer ¶
OpenAPIServer defines a target deployment host in the specification.
type OpenAPITag ¶
OpenAPITag defines an operation category tag.
type PipelineHandler ¶
type PipelineHandler struct {
Steps []Step
}
PipelineHandler represents an endpoint executed through sequential pipeline steps.
type PoolConfig ¶
type PoolConfig struct {
MaxOpen int
MaxIdle int
MaxLifetime time.Duration
IdleTimeout time.Duration
}
PoolConfig defines sizing and lifecycle limits for a connection pool.
type Problem ¶
type Problem struct {
TypePrefix string
}
Problem configures RFC 9457 Problem Details error type URI formatting.
func (Problem) FormatType ¶
FormatType returns the fully qualified error type URI for a given slug.
type RequestRules ¶
type RequestRules struct {
PathFields []Field
QueryFields []Field
HeaderFields []Field
BodyFields []Field
}
RequestRules holds verified field validation constraints for an endpoint.
type RespondStep ¶
type RespondStep struct {
Condition hcl.Expression
Status hcl.Expression
Headers hcl.Expression
Body hcl.Expression
}
RespondStep defines the status code, headers, and body to return to the HTTP client.
type SQLCatch ¶
type SQLCatch struct {
Code string
Status hcl.Expression
Headers hcl.Expression
Body hcl.Expression
}
SQLCatch defines response mapping when a database query raises a specific error code.
type SQLStep ¶
type SQLStep struct {
ConnectionKey string
Query string
Args hcl.Expression
Catches []SQLCatch
}
SQLStep defines a parameterized database query with constraint catch blocks.
type Server ¶
type Server struct {
Host string
Port int
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
MaxBodySize int64
}
Server defines transport-level listener and socket settings.
type StarlarkStep ¶
type StarlarkStep struct {
Source string
}
StarlarkStep defines source code for an embedded Starlark transformation.
type Step ¶
type Step struct {
Type StepType
Name string
Go *GoStep
Starlark *StarlarkStep
SQL *SQLStep
Respond *RespondStep
}
Step represents a configured step ready for execution within a pipeline.