manifest

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPipelineHalted = errors.New("pipeline execution halted")

ErrPipelineHalted signals that a terminal step or error catch completed the response.

Functions

func BuiltinTypeFunctions added in v0.2.1

func BuiltinTypeFunctions() map[string]function.Function

BuiltinTypeFunctions returns constructors exposed during manifest evaluation.

func BuiltinTypeVariables added in v0.2.1

func BuiltinTypeVariables(schemas ...string) map[string]cty.Value

BuiltinTypeVariables returns identifiers allowing unquoted syntax like type = string or type = User.

func DiscoverFiles added in v0.2.0

func DiscoverFiles(patterns ...string) ([]string, error)

DiscoverFiles resolves globs, traverses directories, filters out hidden files and ignored paths, and returns a deduplicated, sorted list of .hcl file paths.

func FormatByteSize added in v0.2.1

func FormatByteSize(bytes int64) string

FormatByteSize formats a byte count into a compact human-readable representation. Unaligned values within a magnitude tier fall back to exact byte counts.

func ValidateFormat added in v0.2.1

func ValidateFormat(format string) error

ValidateFormat reports whether format is an allowed OpenAPI semantic constraint. An empty or whitespace-only string is considered valid (no constraint).

Types

type Args added in v0.2.1

type Args map[string]any

Args represents evaluated key-value arguments supplied to a native Go step handler.

func (Args) Bind added in v0.2.1

func (a Args) Bind(dst any) error

Bind serializes arguments to JSON and deserializes them into the destination struct pointer.

func (Args) Get added in v0.2.1

func (a Args) Get[T any](key string) (T, bool)

Get retrieves the argument associated with key and coerces it to type T. It returns (zero, false) if the key is missing, nil, or cannot be coerced to T.

func (Args) GetOr added in v0.2.1

func (a Args) GetOr[T any](key string, fallback T) T

GetOr retrieves the argument at key coerced to type T, returning fallback if absent or incompatible.

func (Args) Has added in v0.2.1

func (a Args) Has(key string) bool

Has reports whether key exists in the arguments map and is not nil.

func (Args) Slice added in v0.2.1

func (a Args) Slice[T any](key string) []T

Slice retrieves an array at key and coerces its elements to type T. If the value is not a slice or array, it returns nil.

type ByteSize added in v0.2.1

type ByteSize int64

ByteSize represents a quantity of bytes.

func ParseByteSize added in v0.2.1

func ParseByteSize(raw string) (ByteSize, error)

ParseByteSize converts a size string (e.g. "10MB", "1.5GiB", "1048576") into ByteSize.

func (ByteSize) Bytes added in v0.2.1

func (b ByteSize) Bytes() int64

Bytes returns the size in raw bytes as an int64.

func (ByteSize) String added in v0.2.1

func (b ByteSize) String() string

String returns a human-readable representation using FormatByteSize.

type Connection

type Connection struct {
	Type    string
	Name    string
	Engine  string
	Source  string
	URL     string
	MaxOpen int
	MaxIdle int
}

Connection defines external database connection pools and cache instances.

type Contact added in v0.2.1

type Contact struct {
	Name  string `hcl:"name,optional"`
	Email string `hcl:"email,optional"`
	URL   string `hcl:"url,optional"`
}

Contact contains API maintainer details exported in the specification info block.

type DataType added in v0.2.1

type DataType string

DataType represents an OpenAPI 3.1 primitive or collection type.

const (
	TypeString  DataType = "string"
	TypeInteger DataType = "integer"
	TypeNumber  DataType = "number"
	TypeBoolean DataType = "boolean"
	TypeObject  DataType = "object"
	TypeArray   DataType = "array"
)

Supported OpenAPI data types.

func (DataType) IsValid added in v0.2.1

func (dt DataType) IsValid() bool

IsValid reports whether dt matches a supported OpenAPI data type.

type Duration added in v0.2.1

type Duration time.Duration

Duration wraps time.Duration to represent human-configured intervals.

func ParseDuration added in v0.2.1

func ParseDuration(raw string) (Duration, error)

ParseDuration parses a human-readable duration string into a Duration. An empty string, whitespace-only string, or "0" yields a zero duration.

func (Duration) Duration added in v0.2.1

func (d Duration) Duration() time.Duration

Duration returns the underlying time.Duration.

func (Duration) String added in v0.2.1

func (d Duration) String() string

String returns the formatted duration string.

type Expr added in v0.2.1

type Expr interface {
	Eval(scope Scope) (any, error)
	EvalBool(scope Scope) (bool, error)
	EvalMap(scope Scope) (map[string]any, error)
	String() string
	Raw() hcl.Expression
}

Expr represents a compiled HCL expression ready for evaluation against a Scope.

func NewExpr added in v0.2.1

func NewExpr(raw hcl.Expression, funcs map[string]function.Function) Expr

NewExpr compiles an HCL expression and optional function registry into an Expr.

type Field

type Field struct {
	Name        string
	Type        TypeSpec
	Required    bool
	Format      Format
	Default     any
	Description string
	Min         *float64
	Max         *float64
	MinLength   *int
	MaxLength   *int
	Enum        []string
}

Field specifies validation constraints and documentation metadata for a model attribute.

type Format added in v0.2.1

type Format string

Format defines semantic string constraints specified by OpenAPI.

const (
	FormatEmail    Format = "email"
	FormatUUID     Format = "uuid"
	FormatURI      Format = "uri"
	FormatDateTime Format = "date-time"
	FormatDate     Format = "date"
	FormatIPv4     Format = "ipv4"
	FormatIPv6     Format = "ipv6"
	FormatHostname Format = "hostname"
)

Supported OpenAPI semantic formats.

type GoHandler added in v0.2.1

type GoHandler func(ctx context.Context, req *GoRequest) (any, error)

GoHandler defines the function signature for custom Go step callbacks registered on the runtime.

type GoRequest added in v0.2.1

type GoRequest struct {
	Name    string
	Args    Args
	Request *http.Request
}

GoRequest encapsulates the input arguments and active HTTP request passed to a GoHandler.

type IgnoreRules added in v0.2.0

type IgnoreRules struct {
	// contains filtered or unexported fields
}

IgnoreRules holds compiled ignore patterns loaded from a .hclapiignore file.

func LoadIgnoreRules added in v0.2.0

func LoadIgnoreRules(rootDir string) (*IgnoreRules, error)

LoadIgnoreRules reads an optional .hclapiignore file from rootDir. If the file does not exist, an empty ruleset is returned without error.

func (*IgnoreRules) Matches added in v0.2.0

func (ir *IgnoreRules) Matches(relPath string, isDir bool) bool

Matches reports whether relPath is excluded by the active ruleset. Evaluation honors pattern order, directory-only suffixes, and negation.

type License added in v0.2.1

type License struct {
	Name string `hcl:"name"`
	URL  string `hcl:"url,optional"`
}

License describes legal licensing terms for the exposed API contract.

type Manifest added in v0.1.3

type Manifest struct {
	Server      Server
	OpenAPI     OpenAPI
	Telemetry   Telemetry
	Connections map[string]Connection
	Schemas     map[string]Schema
	Routes      []Route
}

Manifest represents the compiled, validated AST for an entire API service.

func Load added in v0.1.3

func Load(patterns ...string) (*Manifest, error)

Load discovers, reads, merges, and compiles HCL files into a validated Manifest using default steps.

func Parse added in v0.2.0

func Parse(source string) (*Manifest, error)

Parse compiles an in-memory HCL manifest string into a validated Manifest using default steps.

func (*Manifest) Validate added in v0.2.1

func (m *Manifest) Validate() error

Validate checks the structural integrity, types, and referential validity of the manifest.

type OpenAPI added in v0.2.1

type OpenAPI struct {
	Title       string          `hcl:"title,optional"`
	Version     string          `hcl:"version,optional"`
	Description string          `hcl:"description,optional"`
	Servers     []OpenAPIServer `hcl:"servers,optional"`
	Tags        []OpenAPITag    `hcl:"tags,optional"`
	Contact     *Contact        `hcl:"contact,block"`
	License     *License        `hcl:"license,block"`
}

OpenAPI holds document metadata exported into OpenAPI 3.1 specifications.

type OpenAPIServer

type OpenAPIServer struct {
	URL         string `hcl:"url"                  cty:"url"`
	Description string `hcl:"description,optional" cty:"description"`
}

OpenAPIServer defines a deployment origin in the generated specification.

type OpenAPITag

type OpenAPITag struct {
	Name        string `hcl:"name"                 cty:"name"`
	Description string `hcl:"description,optional" cty:"description"`
}

OpenAPITag groups operations inside interactive documentation portals.

type Parser added in v0.2.1

type Parser struct {
	// contains filtered or unexported fields
}

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. If registry is nil, DefaultStepRegistry is used.

func (*Parser) Load added in v0.2.1

func (p *Parser) Load(patterns ...string) (*Manifest, error)

Load discovers and compiles files matching the supplied patterns.

func (*Parser) Parse added in v0.2.1

func (p *Parser) Parse(source string) (*Manifest, error)

Parse compiles an in-memory HCL manifest string.

type RecordSeq added in v0.2.1

type RecordSeq iter.Seq2[any, error]

RecordSeq defines the standard Go iterator yielding record items and potential errors.

type Request added in v0.2.1

type Request struct {
	Path    map[string]Field
	Query   map[string]Field
	Headers map[string]Field
	Body    map[string]Field
	BodyRef string
}

Request defines validation constraints across incoming HTTP request coordinates.

func (*Request) HasRules added in v0.2.1

func (r *Request) HasRules() bool

HasRules reports whether any ingress constraints are declared.

type Route added in v0.2.1

type Route struct {
	Method  string
	Path    string
	Summary string
	Tag     string
	Hidden  bool
	Request *Request
	Steps   []Step
}

Route binds an HTTP method and URL pattern to an ordered pipeline of steps.

func (Route) HasTerminalStep added in v0.2.1

func (r Route) HasTerminalStep() bool

HasTerminalStep reports whether the route contains at least one response-producing step.

func (Route) Pattern added in v0.2.1

func (r Route) Pattern() string

Pattern returns the canonical route key formatted as "METHOD /path".

type SQLCatch added in v0.2.1

type SQLCatch struct {
	Code       string
	Constraint string
	Match      string
	Status     int
	Body       Expr
}

SQLCatch specifies interception criteria for database driver errors.

type Schema

type Schema struct {
	Name        string
	Description string
	Fields      map[string]Field
}

Schema represents a reusable domain model for payload validation and egress filtering.

type Scope added in v0.2.1

type Scope struct {
	Request map[string]any
	Steps   map[string]any
	Headers map[string]string
	Now     time.Time
}

Scope encapsulates the runtime execution state supplied to an Expr during evaluation.

type Server

type Server struct {
	Host         string
	Port         int
	ReadTimeout  Duration
	WriteTimeout Duration
	MaxBodySize  ByteSize
}

Server defines listener addresses, transport limits, and network timeouts.

type Step added in v0.2.1

type Step interface {
	StepName() string
	StepWhen() Expr
	IsTerminal() bool
}

Step defines the minimal AST node contract for a route task.

type StepDecoder added in v0.2.1

type StepDecoder func(name string, body hcl.Body, evalCtx *hcl.EvalContext, funcs map[string]function.Function) (Step, error)

StepDecoder decodes an HCL block into a concrete Step implementation.

type StepDocs added in v0.2.1

type StepDocs struct {
	Renderer string
	SpecURL  string
	Title    string
	Template string
	When     Expr
}

StepDocs renders and streams an interactive API documentation portal.

It delegates template execution to docs.Render using precompiled, embedded HTML viewer templates (Scalar, Swagger UI, Redoc, or Stoplight Elements), or an optional user-defined template file on disk.

Upon execution, it sets the Content-Type header to "text/html; charset=utf-8", flushes the compiled HTML bytes, and halts pipeline progression by returning ErrPipelineHalted.

func (*StepDocs) ExecuteStep added in v0.2.1

func (d *StepDocs) ExecuteStep(ctx context.Context, ec StepExecutionContext) (any, error)

ExecuteStep implements StepExecutor. It compiles the viewer template and streams the resulting HTML page to the response writer.

func (*StepDocs) IsTerminal added in v0.2.1

func (d *StepDocs) IsTerminal() bool

IsTerminal implements Step and returns true.

func (*StepDocs) StepName added in v0.2.1

func (d *StepDocs) StepName() string

StepName implements Step and returns the step identifier.

func (*StepDocs) StepWhen added in v0.2.1

func (d *StepDocs) StepWhen() Expr

StepWhen implements Step and returns the conditional execution guard.

func (*StepDocs) ValidateStep added in v0.2.1

func (d *StepDocs) ValidateStep(m *Manifest) error

ValidateStep implements StepValidator. It verifies that the renderer is one of the supported portal technologies and that any custom template file exists on disk.

type StepExecutionContext added in v0.2.1

type StepExecutionContext interface {
	SQL(name string) (*sql.DB, error)
	Valkey(name string) (valkey.Client, error)
	GoHandler(name string) (GoHandler, error)
	HTTPClient() *http.Client
	ResponseWriter() http.ResponseWriter
	ResponseController() *http.ResponseController
	OpenAPISpec(format string) ([]byte, string, error)
	Scope() Scope
	Schemas() map[string]Schema
}

StepExecutionContext supplies runtime dependencies and request state to steps during execution.

type StepExecutor added in v0.2.1

type StepExecutor interface {
	ExecuteStep(ctx context.Context, ec StepExecutionContext) (any, error)
}

StepExecutor is implemented by steps that execute runtime request logic.

type StepGo added in v0.2.1

type StepGo struct {
	Name string
	Use  string
	Args Expr
	When Expr
}

StepGo invokes a custom Go callback function registered on the runtime engine.

func (*StepGo) ExecuteStep added in v0.2.1

func (g *StepGo) ExecuteStep(ctx context.Context, ec StepExecutionContext) (res any, err error)

ExecuteStep implements StepExecutor. It resolves the registered handler, evaluates arguments, executes the callback behind a panic boundary, and captures returned data or error problems.

func (*StepGo) IsTerminal added in v0.2.1

func (g *StepGo) IsTerminal() bool

IsTerminal implements Step and returns false.

func (*StepGo) StepName added in v0.2.1

func (g *StepGo) StepName() string

StepName implements Step.

func (*StepGo) StepWhen added in v0.2.1

func (g *StepGo) StepWhen() Expr

StepWhen implements Step.

func (*StepGo) ValidateStep added in v0.2.1

func (g *StepGo) ValidateStep(m *Manifest) error

ValidateStep implements StepValidator. It verifies that the callback identifier is non-empty.

type StepHTTP added in v0.2.1

type StepHTTP struct {
	Name    string
	Method  string
	URL     Expr
	Body    Expr
	When    Expr
	Timeout Duration
	Headers map[string]string
	Stream  bool
}

StepHTTP makes outbound HTTP calls to external APIs.

In standard execution, response bodies up to 10MB are buffered, automatically parsed as JSON if applicable, and published to context as steps.<name>.status and steps.<name>.body. When Stream is true, buffering is skipped and the live socket is exported as an io.ReadCloser under steps.<name>.stream.

func (*StepHTTP) ExecuteStep added in v0.2.1

func (h *StepHTTP) ExecuteStep(ctx context.Context, ec StepExecutionContext) (any, error)

ExecuteStep implements StepExecutor. It resolves dynamic URLs and request bodies, injects headers, enforces request deadlines, and executes the call via the engine client.

func (*StepHTTP) IsTerminal added in v0.2.1

func (h *StepHTTP) IsTerminal() bool

IsTerminal implements Step and returns false.

func (*StepHTTP) StepName added in v0.2.1

func (h *StepHTTP) StepName() string

StepName implements Step.

func (*StepHTTP) StepWhen added in v0.2.1

func (h *StepHTTP) StepWhen() Expr

StepWhen implements Step.

func (*StepHTTP) ValidateStep added in v0.2.1

func (h *StepHTTP) ValidateStep(m *Manifest) error

ValidateStep implements StepValidator. It verifies that the URL expression is declared and that the configured HTTP verb matches a standard HTTP method.

type StepRegistry added in v0.2.1

type StepRegistry struct {
	// contains filtered or unexported fields
}

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.

func NewStepRegistry added in v0.2.1

func NewStepRegistry() *StepRegistry

NewStepRegistry returns an empty, isolated step registry.

func (*StepRegistry) BlockHeaderSchemas added in v0.2.1

func (r *StepRegistry) BlockHeaderSchemas() []hcl.BlockHeaderSchema

BlockHeaderSchemas exports the block schemas for all registered step keywords, allowing the route parser to dynamically accept direct keywords.

func (*StepRegistry) Decode added in v0.2.1

func (r *StepRegistry) Decode(block *hcl.Block, evalCtx *hcl.EvalContext, funcs map[string]function.Function) (Step, error)

Decode resolves the matching decoder for block.Type and compiles the block into a Step.

func (*StepRegistry) Register added in v0.2.1

func (r *StepRegistry) Register(keyword string, labelNames []string, decoder StepDecoder)

Register adds a step decoder for a specific HCL block keyword and its expected labels.

type StepRespond added in v0.2.1

type StepRespond struct {
	Status       int
	Headers      map[string]string
	When         Expr
	Body         Expr
	Schema       *TypeSpec
	InlineFields map[string]Field
}

StepRespond terminates pipeline execution, serializes the response payload, applies schema-based egress field masking, and streams the HTTP response to the client.

A respond step may declare a contract using an explicit named TypeSpec reference via Schema, an explicit inline schema block via InlineFields, or omit both to allow the compiler to statically infer the response shape directly from the Body expression.

func (*StepRespond) ExecuteStep added in v0.2.1

func (r *StepRespond) ExecuteStep(ctx context.Context, ec StepExecutionContext) (any, error)

ExecuteStep implements StepExecutor. It serializes the body, applies named or inline schema masking, sets headers, and streams the wire response.

func (*StepRespond) IsTerminal added in v0.2.1

func (r *StepRespond) IsTerminal() bool

IsTerminal implements Step and returns true.

func (*StepRespond) StepName added in v0.2.1

func (r *StepRespond) StepName() string

StepName implements Step and returns the step identifier.

func (*StepRespond) StepWhen added in v0.2.1

func (r *StepRespond) StepWhen() Expr

StepWhen implements Step and returns the conditional execution guard.

func (*StepRespond) ValidateStep added in v0.2.1

func (r *StepRespond) ValidateStep(m *Manifest) error

ValidateStep implements StepValidator. It verifies that the HTTP status code is valid, ensures that Schema and InlineFields are mutually exclusive, and checks that all referenced models exist.

type StepSQL added in v0.2.1

type StepSQL struct {
	Name       string
	Connection string
	Query      string
	Args       Expr
	When       Expr
	Stream     bool
	Catches    []SQLCatch
	// contains filtered or unexported fields
}

StepSQL executes parameterized relational database queries against configured pools.

func (*StepSQL) ExecuteStep added in v0.2.1

func (s *StepSQL) ExecuteStep(ctx context.Context, ec StepExecutionContext) (any, error)

ExecuteStep implements StepExecutor.

func (*StepSQL) IsTerminal added in v0.2.1

func (s *StepSQL) IsTerminal() bool

IsTerminal implements Step and returns false.

func (*StepSQL) StepName added in v0.2.1

func (s *StepSQL) StepName() string

StepName implements Step.

func (*StepSQL) StepWhen added in v0.2.1

func (s *StepSQL) StepWhen() Expr

StepWhen implements Step.

func (*StepSQL) ValidateStep added in v0.2.1

func (s *StepSQL) ValidateStep(m *Manifest) error

ValidateStep implements StepValidator.

type StepSpec added in v0.2.1

type StepSpec struct {
	Format string
	When   Expr
}

StepSpec serves the compiled OpenAPI specification in JSON or YAML format with ETag caching.

When incoming requests include a matching If-None-Match header, StepSpec returns HTTP 304 Not Modified without re-transmitting the document payload.

func (*StepSpec) ExecuteStep added in v0.2.1

func (s *StepSpec) ExecuteStep(ctx context.Context, ec StepExecutionContext) (any, error)

ExecuteStep implements StepExecutor. It retrieves pre-cached specification bytes and ETag headers, verifies conditional cache headers, and streams the document to the client.

func (*StepSpec) IsTerminal added in v0.2.1

func (s *StepSpec) IsTerminal() bool

IsTerminal implements Step and returns true.

func (*StepSpec) StepName added in v0.2.1

func (s *StepSpec) StepName() string

StepName implements Step.

func (*StepSpec) StepWhen added in v0.2.1

func (s *StepSpec) StepWhen() Expr

StepWhen implements Step.

func (*StepSpec) ValidateStep added in v0.2.1

func (s *StepSpec) ValidateStep(m *Manifest) error

ValidateStep implements StepValidator. It verifies that the format is either "json" or "yaml".

type StepStarlark added in v0.2.1

type StepStarlark struct {
	Name   string
	Source string
	When   Expr
	// contains filtered or unexported fields
}

StepStarlark executes a sandboxed, deterministic Starlark (Python dialect) script for in-memory payload transformation, field enrichment, and filtering.

Scripts run in a hermetic runtime without access to the host filesystem, network, or environment variables. Execution is bounded by an instruction budget of 100,000 steps to guarantee termination and prevent runaway loops or unbounded recursion.

The script must declare an entrypoint function with the signature:

def execute(ctx):
    ...
    return result

The return value is unmarshaled into native Go types and published to the request scope as steps.<name>.result.

func (*StepStarlark) ExecuteStep added in v0.2.1

func (s *StepStarlark) ExecuteStep(ctx context.Context, ec StepExecutionContext) (any, error)

ExecuteStep implements StepExecutor. It populates the execution context dictionary, bounds execution with a 100,000 instruction limit, and returns the unpacked result.

func (*StepStarlark) IsTerminal added in v0.2.1

func (s *StepStarlark) IsTerminal() bool

IsTerminal implements Step and returns false.

func (*StepStarlark) StepName added in v0.2.1

func (s *StepStarlark) StepName() string

StepName implements Step.

func (*StepStarlark) StepWhen added in v0.2.1

func (s *StepStarlark) StepWhen() Expr

StepWhen implements Step.

func (*StepStarlark) ValidateStep added in v0.2.1

func (s *StepStarlark) ValidateStep(m *Manifest) error

ValidateStep implements StepValidator. It compiles the script at boot time, verifies syntax validity, and ensures that an 'execute(ctx)' callable entrypoint is exported.

type StepStream added in v0.2.1

type StepStream struct {
	Format      string
	Source      Expr
	Event       string
	Heartbeat   Duration
	Retry       Duration
	FlushEvery  int
	Headers     map[string]string
	ContentType string
	Schema      *TypeSpec
	When        Expr
}

StepStream consumes a data stream and flushes items according to the declared protocol.

func (*StepStream) ExecuteStep added in v0.2.1

func (s *StepStream) ExecuteStep(ctx context.Context, ec StepExecutionContext) (any, error)

ExecuteStep implements StepExecutor.

func (*StepStream) IsTerminal added in v0.2.1

func (s *StepStream) IsTerminal() bool

IsTerminal implements Step.

func (*StepStream) StepName added in v0.2.1

func (s *StepStream) StepName() string

StepName implements Step.

func (*StepStream) StepWhen added in v0.2.1

func (s *StepStream) StepWhen() Expr

StepWhen implements Step.

func (*StepStream) ValidateStep added in v0.2.1

func (s *StepStream) ValidateStep(m *Manifest) error

ValidateStep implements StepValidator.

type StepValidator added in v0.2.1

type StepValidator interface {
	ValidateStep(m *Manifest) error
}

StepValidator is an optional interface implemented by AST step definitions that require semantic verification against the compiled manifest topology.

type StepValkey added in v0.2.1

type StepValkey struct {
	Name       string
	Connection string
	Op         string
	Key        Expr
	Value      Expr
	Channel    Expr
	TTL        Duration
	When       Expr
}

StepValkey executes caching commands or Pub/Sub subscriptions against Valkey or Redis.

Key-value commands ("get", "set", "del") publish execution metadata to context:

  • "get": sets steps.<name>.found (bool) and steps.<name>.value (unmarshaled JSON or string). A cache miss doesn't return an error; it sets found = false and value = nil.
  • "set": serializes the payload, sets expiration if configured, and sets steps.<name>.success = true.
  • "del": removes the key and sets steps.<name>.success = true.

The "subscribe" operation produces a continuous RecordSeq iterator under steps.<name>.stream, allowing live messages to be piped directly into a terminal StepStream (e.g. SSE).

func (*StepValkey) ExecuteStep added in v0.2.1

func (v *StepValkey) ExecuteStep(ctx context.Context, ec StepExecutionContext) (any, error)

ExecuteStep implements StepExecutor. It performs caching operations or builds a live subscription iterator based on the declared operation.

func (*StepValkey) IsTerminal added in v0.2.1

func (v *StepValkey) IsTerminal() bool

IsTerminal implements Step and returns false.

func (*StepValkey) StepName added in v0.2.1

func (v *StepValkey) StepName() string

StepName implements Step.

func (*StepValkey) StepWhen added in v0.2.1

func (v *StepValkey) StepWhen() Expr

StepWhen implements Step.

func (*StepValkey) ValidateStep added in v0.2.1

func (v *StepValkey) ValidateStep(m *Manifest) error

ValidateStep implements StepValidator. It verifies connection presence and type, operation keywords, and required parameter expressions for each operation mode.

type Telemetry added in v0.2.1

type Telemetry struct {
	ServiceName string   `hcl:"service_name,optional"`
	LogLevel    string   `hcl:"log_level,optional"`
	LogFormat   string   `hcl:"log_format,optional"`
	Redact      []string `hcl:"redact,optional"`
}

Telemetry configures structured logging output, log level thresholds, and key redaction.

type TypeSpec added in v0.2.1

type TypeSpec struct {
	Type      DataType
	SchemaRef string
	ElemType  *TypeSpec
}

TypeSpec encapsulates a scalar primitive, custom schema reference, or nested list.

Because TypeSpec contains a pointer field (ElemType), instances must never be compared using Go == or != operators. Use TypeSpec.Equal instead.

func ListType added in v0.2.1

func ListType(elem TypeSpec) TypeSpec

ListType constructs a TypeSpec representing an array of the specified element type.

func ObjectType added in v0.2.1

func ObjectType(schemaRef string) TypeSpec

ObjectType constructs a TypeSpec referencing a declared schema model.

func ParseTypeSpec added in v0.2.1

func ParseTypeSpec(raw string) (TypeSpec, error)

ParseTypeSpec parses a type string, accepting primitives, schema identifiers, and collection wrappers using list(T).

func ScalarType added in v0.2.1

func ScalarType(dt DataType) (TypeSpec, error)

ScalarType constructs a TypeSpec for primitive scalar types.

func TypeSpecFromCty added in v0.2.1

func TypeSpecFromCty(val cty.Value) (TypeSpec, error)

TypeSpecFromCty converts an evaluated cty.Value into a verified TypeSpec.

func (TypeSpec) ElementSchemaRef added in v0.2.1

func (t TypeSpec) ElementSchemaRef() string

ElementSchemaRef recursively traverses nested lists to locate the underlying schema identifier, returning an empty string if the element is a scalar primitive.

func (TypeSpec) Equal added in v0.2.1

func (t TypeSpec) Equal(other TypeSpec) bool

Equal performs a deep equality comparison against another TypeSpec.

func (TypeSpec) IsArray added in v0.2.1

func (t TypeSpec) IsArray() bool

IsArray reports whether the specification represents a list or array.

func (TypeSpec) IsObject added in v0.2.1

func (t TypeSpec) IsObject() bool

IsObject reports whether the specification represents a single object or schema reference.

func (TypeSpec) IsScalar added in v0.2.1

func (t TypeSpec) IsScalar() bool

IsScalar reports whether the specification represents a primitive scalar value.

func (TypeSpec) String added in v0.2.1

func (t TypeSpec) String() string

String returns the canonical HCL representation of the type specification.

Jump to

Keyboard shortcuts

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