Directories
ΒΆ
| Path | Synopsis |
|---|---|
|
adapters
|
|
|
chi
Package chi adapts api/rest route handles to github.com/go-chi/chi/v5 routers.
|
Package chi adapts api/rest route handles to github.com/go-chi/chi/v5 routers. |
|
mcpgo
Package mcpgo adapts api/mcp handles to github.com/mark3labs/mcp-go servers.
|
Package mcpgo adapts api/mcp handles to github.com/mark3labs/mcp-go servers. |
|
mqtt
Package mqtt adapts api/events channel handles to [Paho MQTT] callbacks.
|
Package mqtt adapts api/events channel handles to [Paho MQTT] callbacks. |
|
nethttp
Package nethttp adapts api/rest route handles to net/http handlers.
|
Package nethttp adapts api/rest route handles to net/http handlers. |
|
templ
Package templ provides a format.Format factory that renders a github.com/a-h/templ component as a text/html response.
|
Package templ provides a format.Format factory that renders a github.com/a-h/templ component as a text/html response. |
|
api
|
|
|
events
Package events provides a transport-agnostic event channel builder for go-codex.
|
Package events provides a transport-agnostic event channel builder for go-codex. |
|
internal
Package internal provides shared helpers used by api/rest and api/events.
|
Package internal provides shared helpers used by api/rest and api/events. |
|
mcp
Package mcp provides a transport-agnostic MCP server builder for go-codex.
|
Package mcp provides a transport-agnostic MCP server builder for go-codex. |
|
rest
Package rest provides a transport-agnostic REST API builder for go-codex.
|
Package rest provides a transport-agnostic REST API builder for go-codex. |
|
Package codex is the public API for go-codex: a self-documenting codec library for Go.
|
Package codex is the public API for go-codex: a self-documenting codec library for Go. |
|
examples
|
|
|
adapters-chi
command
Package adapters-chi demonstrates the three-layer codec pipeline pattern using the chi router.
|
Package adapters-chi demonstrates the three-layer codec pipeline pattern using the chi router. |
|
adapters-chi-security
command
Package adapters-chi-security demonstrates authentication and authorization for REST APIs built with go-codex and the chi router adapter.
|
Package adapters-chi-security demonstrates authentication and authorization for REST APIs built with go-codex and the chi router adapter. |
|
adapters-mcp
command
Package main demonstrates the go-codex MCP server adapter.
|
Package main demonstrates the go-codex MCP server adapter. |
|
adapters-mqtt
command
Package adapters-mqtt demonstrates the three-layer codec pipeline pattern for event-driven / MQTT applications.
|
Package adapters-mqtt demonstrates the three-layer codec pipeline pattern for event-driven / MQTT applications. |
|
adapters-mqtt-contract
command
Package adapters-mqtt-contract demonstrates the "codec-as-contract" pattern for MQTT event-driven services.
|
Package adapters-mqtt-contract demonstrates the "codec-as-contract" pattern for MQTT event-driven services. |
|
adapters-mqtt-contract/contract
Package contract is the shared API contract between producer and consumer services.
|
Package contract is the shared API contract between producer and consumer services. |
|
adapters-mqtt-security
command
Package adapters-mqtt-security demonstrates SecurityFunc-based authentication for MQTT subscribe channels built with go-codex.
|
Package adapters-mqtt-security demonstrates SecurityFunc-based authentication for MQTT subscribe channels built with go-codex. |
|
adapters-nethttp
command
Package adapters-nethttp demonstrates the three-layer codec pipeline pattern where every boundary β HTTP request, database, HTTP response β is modelled as a codec contract.
|
Package adapters-nethttp demonstrates the three-layer codec pipeline pattern where every boundary β HTTP request, database, HTTP response β is modelled as a codec contract. |
|
adapters-nethttp-client
command
Package adapters-nethttp-client demonstrates the HTTP client-side adapter.
|
Package adapters-nethttp-client demonstrates the HTTP client-side adapter. |
|
adapters-nethttp-client/contract
Package contract defines the shared HTTP API contract for the adapters-nethttp-client example.
|
Package contract defines the shared HTTP API contract for the adapters-nethttp-client example. |
|
adapters-nethttp-security
command
Package adapters-nethttp-security demonstrates authentication and authorization for REST APIs built with go-codex and the net/http adapter.
|
Package adapters-nethttp-security demonstrates authentication and authorization for REST APIs built with go-codex and the net/http adapter. |
|
adapters-sse
command
Package adapters-sse demonstrates Server-Sent Events (SSE) using the go-codex adapters/nethttp and adapters/chi adapters.
|
Package adapters-sse demonstrates Server-Sent Events (SSE) using the go-codex adapters/nethttp and adapters/chi adapters. |
|
adapters-streaming-sse-templ
command
Package main demonstrates two templ + go-codex patterns on a single server:
|
Package main demonstrates two templ + go-codex patterns on a single server: |
|
adapters-templ
command
Package main demonstrates how go-codex fits into a templ-based rendering pipeline using the adapters/templ format plug-in.
|
Package main demonstrates how go-codex fits into a templ-based rendering pipeline using the adapters/templ format plug-in. |
|
api-events
command
Package api-events demonstrates the api/events builder: define channels with codec-backed payload types, get typed Decode/Encode helpers, and generate a full AsyncAPI 3.0 spec β all without importing any messaging library.
|
Package api-events demonstrates the api/events builder: define channels with codec-backed payload types, get typed Decode/Encode helpers, and generate a full AsyncAPI 3.0 spec β all without importing any messaging library. |
|
api-rest
command
Package api-rest demonstrates the api/rest builder: define routes with codec-backed types, get typed Decode/Encode helpers, and generate a full OpenAPI 3.1 spec β all without importing net/http or any HTTP framework.
|
Package api-rest demonstrates the api/rest builder: define routes with codec-backed types, get typed Decode/Encode helpers, and generate a full OpenAPI 3.1 spec β all without importing net/http or any HTTP framework. |
|
cli-config
command
Package main demonstrates using go-codex for CLI tool configuration: loading a TOML config file and overlaying environment variable overrides.
|
Package main demonstrates using go-codex for CLI tool configuration: loading a TOML config file and overlaying environment variable overrides. |
|
codec-mapping
command
Package main demonstrates three patterns for reusing and transforming codecs without repeating constraint definitions.
|
Package main demonstrates three patterns for reusing and transforming codecs without repeating constraint definitions. |
|
construction
command
|
|
|
decode-errors
command
Package decode-errors demonstrates multi-field validation errors in go-codex.
|
Package decode-errors demonstrates multi-field validation errors in go-codex. |
|
env-config
command
Package main demonstrates format.FromEnv: loading application configuration exclusively from environment variables using the codec as the single source of truth for field names, types, validations, and documentation.
|
Package main demonstrates format.FromEnv: loading application configuration exclusively from environment variables using the codec as the single source of truth for field names, types, validations, and documentation. |
|
error-types
command
Package error-types demonstrates every structured error type in go-codex.
|
Package error-types demonstrates every structured error type in go-codex. |
|
event-driven
command
Package event-driven demonstrates generating a full AsyncAPI 3.0 document from channel descriptors and Codec-derived schemas using the render/asyncapi/v3 package.
|
Package event-driven demonstrates generating a full AsyncAPI 3.0 document from channel descriptors and Codec-derived schemas using the render/asyncapi/v3 package. |
|
forge-collection
command
Package forge-collection demonstrates forge collection operations applied to a batch of MQTT-style sensor temperature readings.
|
Package forge-collection demonstrates forge collection operations applied to a batch of MQTT-style sensor temperature readings. |
|
forge-oee
command
Package main demonstrates the forge package for signed, governed KPI computation.
|
Package main demonstrates the forge package for signed, governed KPI computation. |
|
formats
command
Package formats demonstrates the builtin format constraints in validate/, as well as WithExample, WithDeprecated, and the Duration codec.
|
Package formats demonstrates the builtin format constraints in validate/, as well as WithExample, WithDeprecated, and the Duration codec. |
|
gob-contract
command
Package gob-contract demonstrates the "Go library as contract" pattern.
|
Package gob-contract demonstrates the "Go library as contract" pattern. |
|
gob-contract/contract
Package contract is the shared API contract between producer and consumer services.
|
Package contract is the shared API contract between producer and consumer services. |
|
html-sanitize
command
Package main demonstrates where go-codex shines in a comment moderation use case: a single codec definition simultaneously escapes HTML, enforces length limits, and documents the schema β all derived from one value.
|
Package main demonstrates where go-codex shines in a comment moderation use case: a single codec definition simultaneously escapes HTML, enforces length limits, and documents the schema β all derived from one value. |
|
multiformat
command
|
|
|
oee-chain
command
Package oee-chain demonstrates the three-layer go-codex architecture end-to-end:
|
Package oee-chain demonstrates the three-layer go-codex architecture end-to-end: |
|
openapi
command
Package openapi demonstrates generating an OpenAPI components/schemas section from Codec definitions using the render/openapi package.
|
Package openapi demonstrates generating an OpenAPI components/schemas section from Codec definitions using the render/openapi package. |
|
order
command
|
|
|
png-upload
command
Package png-upload demonstrates how to define REST routes for PNG binary transfer using go-codex:
|
Package png-upload demonstrates how to define REST routes for PNG binary transfer using go-codex: |
|
rest-api
command
Package rest-api demonstrates generating a full OpenAPI 3.1 document from route descriptors and Codec-derived schemas using the render/openapi package.
|
Package rest-api demonstrates generating a full OpenAPI 3.1 document from route descriptors and Codec-derived schemas using the render/openapi package. |
|
shape
command
|
|
|
stats-observer
command
Package stats-observer demonstrates how to use stats.ValidationObserver and stats.ReportErrors with codecs directly β without any HTTP or MQTT adapter.
|
Package stats-observer demonstrates how to use stats.ValidationObserver and stats.ReportErrors with codecs directly β without any HTTP or MQTT adapter. |
|
validate
command
Package main shows how to use Codec.Validate and Format.Validate for explicit bidirectional validation.
|
Package main shows how to use Codec.Validate and Format.Validate for explicit bidirectional validation. |
|
Package forge provides governed, self-documenting KPI computation functions.
|
Package forge provides governed, self-documenting KPI computation functions. |
|
Package format bridges Codec[T] to concrete serialization formats (JSON, YAML, TOML, Gob).
|
Package format bridges Codec[T] to concrete serialization formats (JSON, YAML, TOML, Gob). |
|
render
|
|
|
asyncapi/v2
Package v2 renders schema.Schema values as an AsyncAPI 2.6 document.
|
Package v2 renders schema.Schema values as an AsyncAPI 2.6 document. |
|
asyncapi/v3
Package v3 renders schema.Schema values and route.SecurityScheme definitions as an AsyncAPI 3.0 document.
|
Package v3 renders schema.Schema values and route.SecurityScheme definitions as an AsyncAPI 3.0 document. |
|
internal/schemarender
Package schemarender converts schema.Schema values to [map[string]any] objects suitable for marshalling into OpenAPI or AsyncAPI documents.
|
Package schemarender converts schema.Schema values to [map[string]any] objects suitable for marshalling into OpenAPI or AsyncAPI documents. |
|
jsonschema
Package jsonschema renders schema.Schema values to plain JSON Schema compatible json.RawMessage.
|
Package jsonschema renders schema.Schema values to plain JSON Schema compatible json.RawMessage. |
|
openapi
Package openapi renders schema.Schema values as OpenAPI 3.x schema objects.
|
Package openapi renders schema.Schema values as OpenAPI 3.x schema objects. |
|
pipeline
Package pipeline renders a forge.PipelineSpec as a YAML document.
|
Package pipeline renders a forge.PipelineSpec as a YAML document. |
|
Package route describes HTTP operations for use with API spec renderers.
|
Package route describes HTTP operations for use with API spec renderers. |
|
Package schema defines the pure data model for describing value shapes.
|
Package schema defines the pure data model for describing value shapes. |
|
Package stats defines the Observer interface for codec and adapter lifecycle events.
|
Package stats defines the Observer interface for codec and adapter lifecycle events. |
|
Package validate provides reusable codex.Constraint values for common validation rules.
|
Package validate provides reusable codex.Constraint values for common validation rules. |
Click to show internal directories.
Click to hide internal directories.