queryhttp

package
v0.0.0-...-de77d72 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package queryhttp serves a store's exposed named queries, those annotated -- expose: http, to Lambda function URLs, API Gateway HTTP and REST APIs, and direct invoke (ADR 0018). docs/spec/http.md is the wire format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Region string // the function's, which every response names
	Prefix string // the deployment's prefix, as in [catalog.Naming]
	Log    *slog.Logger
}

Config is what a Handler needs besides the store and the catalog.

type Handler

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

Handler serves the exposed named queries to every front door and to direct invoke. It is safe for concurrent use.

func New

func New(b store.Backend, cat *engine.Catalog, c Config) (*Handler, error)

New returns the handler of cat's exposed queries, which reads them from b.

func (*Handler) Invoke

func (h *Handler) Invoke(ctx context.Context, payload []byte) ([]byte, error)

Invoke implements aws-lambda-go's Handler, so the handler owns the response bytes. A request it can't serve is a response with an error status; only an event of no door it knows is an error, which fails the invocation.

Jump to

Keyboard shortcuts

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