chassis

package module
v10.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 6 Imported by: 1

README

chassis-go

A composable Go service toolkit for building production-grade microservices. Toolkit, not framework — chassis never owns main(), never hides wiring behind magic, and every package is independently importable.

go get github.com/ai8future/chassis-go/v10

Current version: 10.0.1 · Go: 1.25.5+ · License: MIT


Why chassis-go?

Every Go microservice needs the same foundational concerns: env-based config, structured logging, graceful shutdown, health checks, HTTP middleware, gRPC interceptors, resilient HTTP clients, observability, feature flags, and request guards. Without a shared toolkit, teams re-implement these inconsistently across services.

chassis-go provides one cohesive, OTel-native solution where you wire together only what you need.


Packages

Tier 1: Foundation
Package Import Purpose
chassis github.com/ai8future/chassis-go/v10 Version gate (RequireMajor(10)) and deterministic port assignment (Port(name, offset) via djb2)
config .../v10/config Generic env-to-struct config loader via struct tags. Panics on missing required vars
logz .../v10/logz Structured JSON logging wrapping log/slog with automatic OTel trace_id/span_id injection
lifecycle .../v10/lifecycle Signal-aware graceful shutdown orchestration via errgroup
registry .../v10/registry File-based service registration at /tmp/chassis/. Status reporting, port declarations, custom commands, heartbeat
testkit .../v10/testkit Test helpers: NewLogger (writes to t.Log), SetEnv (with cleanup), GetFreePort
Tier 2: Transports and Clients
Package Import Purpose
httpkit .../v10/httpkit HTTP middleware: RequestID, Logging, Recovery, Tracing. JSON error responses
grpckit .../v10/grpckit gRPC interceptors: Logging, Recovery, Metrics, Tracing. Health service registration
health .../v10/health Parallel health check aggregation with HTTP handler and gRPC adapter
call .../v10/call Resilient outbound HTTP client: retry with exponential backoff, circuit breaker, OTel spans
Tier 3: Cross-Cutting
Package Import Purpose
guard .../v10/guard HTTP guards: rate limiter (LRU), CORS, IP filter, security headers, body limits, timeouts
flagz .../v10/flagz Feature flags with percentage rollouts (FNV-1a), pluggable sources, OTel span events
metrics .../v10/metrics OTel-native metrics recorder with cardinality protection (max 1000 label combos)
otel .../v10/otel OpenTelemetry bootstrap: OTLP gRPC traces + metrics, configurable samplers
errors .../v10/errors Unified error type with dual HTTP/gRPC codes and RFC 9457 Problem Details
secval .../v10/secval JSON security validation: blocks prototype pollution keys (__proto__, constructor, prototype) and deep nesting
work .../v10/work Structured concurrency: Map, All, Race, Stream — all OTel-traced
Tier 4: Utilities
Package Import Purpose
cache .../v10/cache Generic LRU+TTL in-memory cache with Prune()
seal .../v10/seal AES-256-GCM encrypt/decrypt, HMAC-SHA256 sign/verify, temporary tokens
tick .../v10/tick Periodic task components for lifecycle.Run (Every with Immediate/OnError options)
webhook .../v10/webhook HMAC-signed webhook send with retry, delivery tracking, VerifyPayload
deploy .../v10/deploy Convention-based deploy directory discovery, environment detection, endpoints, dependencies, health
Tier 4: Integrations
Package Import Purpose
kafkakit .../v10/kafkakit Publish/subscribe to Redpanda event bus with Avro envelopes, tenant filtering, DLQ. Depends on schemakit. Uses github.com/twmb/franz-go
schemakit .../v10/schemakit Avro schema validation, registration, serialization. Confluent Schema Registry client
tracekit .../v10/tracekit Distributed trace ID propagation (tr_ + 12 hex). HTTP middleware. Wraps OTel when available
heartbeatkit .../v10/heartbeatkit Auto liveness heartbeats every 30s. Depends on kafkakit. Auto-activates with kafkakit
announcekit .../v10/announcekit Service/job lifecycle events. Depends on kafkakit. Auto-activates with kafkakit
registrykit .../v10/registrykit HTTP client to registry_svc for entity resolution. Depends on call
graphkit .../v10/graphkit HTTP client to graphiti_svc for knowledge graph access. Depends on call
lakekit .../v10/lakekit HTTP client to lake_svc for data lake access. Depends on call

Tier isolation: If you only use Tier 1 packages, only golang.org/x/sync is pulled in — no gRPC, no OTel SDK.


Quick Start

package main

import (
    "context"
    "fmt"
    "net"
    "net/http"
    "time"

    chassis "github.com/ai8future/chassis-go/v10"
    "github.com/ai8future/chassis-go/v10/config"
    "github.com/ai8future/chassis-go/v10/guard"
    "github.com/ai8future/chassis-go/v10/health"
    "github.com/ai8future/chassis-go/v10/httpkit"
    "github.com/ai8future/chassis-go/v10/lifecycle"
    "github.com/ai8future/chassis-go/v10/logz"
)

type AppConfig struct {
    Port     int    `env:"PORT" default:"8080"`
    LogLevel string `env:"LOG_LEVEL" default:"info"`
}

func main() {
    // Version gate — must be first
    chassis.RequireMajor(10)

    cfg := config.MustLoad[AppConfig]()
    logger := logz.New(cfg.LogLevel)
    logger.Info("starting service", "version", chassis.Version)

    // Routes
    mux := http.NewServeMux()
    mux.HandleFunc("GET /hello", func(w http.ResponseWriter, r *http.Request) {
        fmt.Fprintln(w, "hello world")
    })
    mux.Handle("GET /health", health.Handler(map[string]health.Check{
        "self": func(_ context.Context) error { return nil },
    }))

    // Middleware stack
    handler := httpkit.Recovery(logger)(
        httpkit.Tracing()(
            httpkit.RequestID(
                guard.Timeout(10*time.Second)(
                    httpkit.Logging(logger)(mux),
                ),
            ),
        ),
    )

    // Run with graceful shutdown
    lifecycle.Run(context.Background(),
        func(ctx context.Context) error {
            addr := fmt.Sprintf(":%d", cfg.Port)
            srv := &http.Server{Addr: addr, Handler: handler}
            ln, _ := net.Listen("tcp", addr)
            logger.Info("listening", "addr", ln.Addr().String())

            errCh := make(chan error, 1)
            go func() { errCh <- srv.Serve(ln) }()
            select {
            case <-ctx.Done():
                return srv.Shutdown(context.Background())
            case err := <-errCh:
                return err
            }
        },
    )
}

Package Details

config — Environment-Based Configuration

Load environment variables into typed structs using struct tags. Fail-fast: missing required config panics at startup.

type AppConfig struct {
    Port        int           `env:"PORT" default:"8080"`
    DatabaseURL string        `env:"DATABASE_URL"`                // required (default)
    Debug       bool          `env:"DEBUG" required:"false"`      // optional
    Timeout     time.Duration `env:"TIMEOUT" default:"30s"`
    AllowedIPs  []string      `env:"ALLOWED_IPS" default:"127.0.0.1"`
}

cfg := config.MustLoad[AppConfig]()

Supported types: string, int, int64, float64, bool, time.Duration, []string (comma-separated)

logz — Structured JSON Logging

Wraps log/slog with automatic OpenTelemetry trace correlation. When OTel is active, every log line includes trace_id and span_id at the top level of JSON output — even inside slog.Group scopes.

logger := logz.New("info")  // "debug", "info", "warn", "error"
logger.Info("request handled", "status", 200, "duration_ms", 42)

Output:

{"time":"...","level":"INFO","msg":"request handled","trace_id":"abc123","span_id":"def456","status":200,"duration_ms":42}
lifecycle — Graceful Shutdown

Signal-aware orchestrator using errgroup. Catches SIGTERM/SIGINT, cancels the shared context, and waits for all components to drain. Automatically initializes the registry on startup — every service is registered at /tmp/chassis/ with heartbeat and command polling.

lifecycle.Run(ctx,
    httpServerComponent,
    grpcServerComponent,
    workerComponent,
)

Each component receives a context that cancels on signal or when any peer returns an error.

registry — File-Based Service Registration

Every service automatically registers itself at /tmp/chassis/<service-name>/ when lifecycle.Run() is called. The registry writes a JSON PID file, maintains a structured log, and provides a command interface for external tooling.

What gets created:

/tmp/chassis/<service-name>/
  <pid>.json        # Registration: name, PID, hostname, version, available commands
  <pid>.log.jsonl   # Structured event log: startup, heartbeat, status, errors, shutdown
  <pid>.cmd.json    # Command file (written by external tools, consumed by the service)

Automatic behavior (managed by lifecycle.Run()):

  • Heartbeat event logged every 30 seconds
  • Command file polled every 3 seconds
  • Built-in stop command triggers graceful shutdown
  • Built-in restart command sets the restart flag and triggers shutdown
  • Stale PID files from dead processes are cleaned up on startup

Module-level API — no object to pass around:

import "github.com/ai8future/chassis-go/v10/registry"

// Report status (written to the service log)
registry.Status("processing batch 42")

// Report errors
registry.Errorf("failed to connect to %s: %v", host, err)

// Register custom commands (must be called before lifecycle.Run)
registry.Handle("flush-cache", "Clear all cached data", func() error {
    cache.Flush()
    return nil
})

The service name is resolved from CHASSIS_SERVICE_NAME env var, falling back to the working directory name. The service version is read from a VERSION file in the working directory.

call — Resilient HTTP Client

Outbound HTTP with retry (exponential backoff + jitter), circuit breaker (Closed/Open/HalfOpen states), and OTel client spans.

client := call.New(
    call.WithTimeout(5*time.Second),
    call.WithRetry(3, 500*time.Millisecond),
    call.WithCircuitBreaker("payments-api", 5, 30*time.Second),
)

resp, err := client.Do(req)

Batch concurrent requests with client.Batch(ctx, requests) — powered by work.Map under the hood.

errors — Unified Error Type

Dual HTTP + gRPC error codes with RFC 9457 Problem Details. Fluent API for decorating errors.

err := errors.NotFoundError("user not found").
    WithDetail("user_id", "abc123").
    WithType("https://api.example.com/errors/user-not-found").
    WithCause(dbErr)

// Factory constructors:
errors.ValidationError(msg)    // 400 / INVALID_ARGUMENT
errors.UnauthorizedError(msg)  // 401 / UNAUTHENTICATED
errors.ForbiddenError(msg)     // 403 / PERMISSION_DENIED
errors.NotFoundError(msg)      // 404 / NOT_FOUND
errors.PayloadTooLargeError(msg) // 413 / INVALID_ARGUMENT
errors.RateLimitError(msg)     // 429 / RESOURCE_EXHAUSTED
errors.TimeoutError(msg)       // 504 / DEADLINE_EXCEEDED
errors.DependencyError(msg)    // 503 / UNAVAILABLE
errors.InternalError(msg)      // 500 / INTERNAL

Write RFC 9457 responses directly:

errors.WriteProblem(w, r, err, requestID)
httpkit — HTTP Middleware

Standard func(http.Handler) http.Handler middleware — compatible with any router.

// Recommended stack order (outermost first):
handler := httpkit.Recovery(logger)(        // catch panics → 500
    httpkit.Tracing()(                      // OTel server spans + duration metric
        httpkit.RequestID(                  // UUID v4 request ID
            httpkit.Logging(logger)(mux),   // structured request logging
        ),
    ),
)

// Access request ID from context
id := httpkit.RequestIDFrom(r.Context())

Response helpers:

httpkit.JSONError(w, r, http.StatusBadRequest, "invalid input")
httpkit.JSONProblem(w, r, serviceErr)
grpckit — gRPC Interceptors

Unary and stream interceptors for logging, panic recovery, metrics, and tracing. Wire them with grpc.ChainUnaryInterceptor.

srv := grpc.NewServer(
    grpc.ChainUnaryInterceptor(
        grpckit.UnaryRecovery(logger),
        grpckit.UnaryTracing(),
        grpckit.UnaryLogging(logger),
        grpckit.UnaryMetrics(),
    ),
    grpc.ChainStreamInterceptor(
        grpckit.StreamRecovery(logger),
        grpckit.StreamTracing(),
        grpckit.StreamLogging(logger),
        grpckit.StreamMetrics(),
    ),
)

// Register gRPC health service
grpckit.RegisterHealth(srv, health.CheckFunc(checks))
health — Health Checks

Composable health checks that run in parallel. Supports both HTTP and gRPC transports.

checks := map[string]health.Check{
    "database": func(ctx context.Context) error { return db.PingContext(ctx) },
    "cache":    func(ctx context.Context) error { return redis.Ping(ctx).Err() },
}

// HTTP handler: 200 {"status":"healthy",...} or 503 {"status":"unhealthy",...}
mux.Handle("GET /health", health.Handler(checks))

// gRPC adapter
grpckit.RegisterHealth(srv, health.CheckFunc(checks))
guard — Request Guards

HTTP middleware for rate limiting, CORS, IP filtering, security headers, body limits, and timeouts.

// Rate limiter with LRU eviction (O(1))
guard.RateLimit(guard.RateLimitConfig{
    Rate:    100,
    Window:  time.Minute,
    MaxKeys: 10000,
    KeyFunc: guard.XForwardedFor("10.0.0.0/8"),  // spoof-resistant
})

// CORS
guard.CORS(guard.CORSConfig{
    AllowOrigins: []string{"https://app.example.com"},
    AllowMethods: []string{"GET", "POST"},
    MaxAge:       time.Hour,
})

// Security headers (CSP, HSTS 2yr, X-Frame-Options: DENY, etc.)
guard.SecurityHeaders(guard.DefaultSecurityHeaders)

// IP allow/deny by CIDR (deny takes precedence)
guard.IPFilter(guard.IPFilterConfig{
    Allow: []string{"10.0.0.0/8"},
    Deny:  []string{"10.0.0.1/32"},
})

// Body size limit
guard.MaxBody(2 * 1024 * 1024)  // 2 MB

// Request timeout with buffered response writer
guard.Timeout(10 * time.Second)

Key functions for rate limiter identification:

guard.RemoteAddr()                          // r.RemoteAddr
guard.XForwardedFor("10.0.0.0/8")          // rightmost untrusted IP
guard.HeaderKey("X-API-Key")               // arbitrary header
flagz — Feature Flags

Feature flags with boolean checks, percentage rollouts, and multi-source configuration.

// Sources: env, map, JSON file, or composite
flags := flagz.New(flagz.Multi(
    flagz.FromEnv("FLAG"),       // FLAG_NEW_CHECKOUT=true
    flagz.FromJSON("flags.json"),
))

// Boolean check
if flags.Enabled("new-checkout") { ... }

// Percentage rollout (consistent per user via FNV-1a hash)
if flags.EnabledFor(ctx, "new-checkout", flagz.Context{
    UserID:  user.ID,
    Percent: 25,  // 25% of users
}) { ... }

// String variant
theme := flags.Variant("theme", "light")
metrics — OTel Metrics with Cardinality Protection

Pre-configured metrics recorder with automatic cardinality limits. Drops new label combinations after 1000 per metric to prevent backend explosions.

rec := metrics.New("ordersvc", logger)

// Pre-built request metrics
rec.RecordRequest(ctx, method, status, durationMs, contentLength)

// Custom domain counters and histograms
orders := rec.Counter("orders_placed")
orders.Add(ctx, 1, "region", "us-east", "tier", "premium")

latency := rec.Histogram("payment_duration_seconds", metrics.DurationBuckets)
latency.Observe(ctx, 0.042, "provider", "stripe")
otel — OpenTelemetry Bootstrap

One-call OTel SDK initialization: OTLP gRPC exporters for traces and metrics, W3C propagation, configurable samplers.

shutdown := otel.Init(otel.Config{
    ServiceName:    "ordersvc",
    ServiceVersion: chassis.Version,
    Endpoint:       "otel-collector:4317",   // default: localhost:4317
    Sampler:        otel.RatioSample(0.1),   // 10% sampling; default: AlwaysSample
    Insecure:       true,                    // plaintext for dev; default: TLS
})
defer shutdown(context.Background())
secval — JSON Security Validation

Validates JSON payloads against dangerous keys and excessive nesting. Zero cross-module dependencies.

if err := secval.ValidateJSON(body); err != nil {
    // errors.Is(err, secval.ErrDangerousKey)
    // errors.Is(err, secval.ErrNestingDepth)
    // errors.Is(err, secval.ErrInvalidJSON)
}

Blocks prototype pollution keys: __proto__, constructor, prototype. Common business-domain words are intentionally excluded to avoid false positives. Max nesting depth: 20.

work — Structured Concurrency

Parallel execution primitives with bounded worker pools and automatic OTel tracing.

// Map: transform items concurrently (preserves order)
results, err := work.Map(ctx, items, processItem, work.Workers(8))

// All: run tasks concurrently, fail on first error
err := work.All(ctx, []func(context.Context) error{task1, task2, task3})

// Race: first success wins, cancels the rest
result, err := work.Race(ctx, fetchFromPrimary, fetchFromReplica)

// Stream: process channel items concurrently
out := work.Stream(ctx, inChan, transform, work.Workers(4))
for r := range out {
    fmt.Println(r.Value, r.Err)
}
testkit — Test Utilities
func TestMyHandler(t *testing.T) {
    logger := testkit.NewLogger(t)        // writes to t.Log, hidden on pass
    testkit.SetEnv(t, map[string]string{  // auto-cleanup via t.Cleanup
        "PORT": "0",
        "DATABASE_URL": "postgres://...",
    })
    port, _ := testkit.GetFreePort()      // OS-assigned free TCP port
}

Version Gate

chassis-go enforces a mandatory version compatibility contract. Every service must declare which major version it expects:

func main() {
    chassis.RequireMajor(10)  // must be the first chassis call
    // ...
}

If the installed library's major version doesn't match, the process exits immediately with a clear migration message. Every chassis module calls AssertVersionChecked() at its entry points — importing a chassis module without calling RequireMajor first causes an immediate crash.


Examples

The examples/ directory contains runnable services demonstrating progressive complexity:

Example What It Demonstrates
examples/01-cli Minimal CLI: config + logz
examples/02-service gRPC service: config + grpckit + health + lifecycle
examples/03-client Resilient HTTP client: call with retry + circuit breaker
examples/04-full-service Full wiring: all packages combined (HTTP + admin server)
cmd/demo-shutdown Graceful shutdown demonstration with two worker goroutines

Run any example:

go run ./examples/04-full-service

Test it:

curl http://localhost:9090/health
curl -X POST http://localhost:8080/v1/demo -d '{"input":"hello"}'
curl -X POST http://localhost:8080/v1/demo -d '{"__proto__":"evil"}'  # → 400

Design Principles

  1. Toolkit, not framework — Chassis never owns main(). You call it, not the other way around.
  2. Tier isolation — Importing config doesn't pull in gRPC or OTel SDK. Dependencies scale with what you use.
  3. Visible wiring — No magic startup, no global init. All assembly happens in your code.
  4. Fail fast — Missing config, invalid guard parameters, or wrong major version crash immediately at startup with clear messages.
  5. OTel native — Tracing, metrics, and log correlation are built in from the ground up, not bolted on.
  6. Standard interfaces — HTTP middleware uses func(http.Handler) http.Handler. gRPC uses standard interceptors. No custom types to learn.

Auto-Instrumented Observability

When OTel is initialized, the following telemetry is collected automatically:

Traces:

  • httpkit.Tracing() — HTTP server spans with W3C context propagation
  • grpckit.UnaryTracing() / StreamTracing() — gRPC server spans from metadata
  • call.Client.Do() — HTTP client spans with header injection
  • work.Map/All/Race/Stream — parent + per-item child spans

Metrics:

  • http.server.request.duration — HTTP server latency histogram
  • http.client.request.duration — HTTP client latency histogram
  • rpc.server.duration — gRPC server latency histogram

Log correlation:

  • Every logz log line includes trace_id and span_id from the active span context

Dependencies

Only the OTel API, golang.org/x/sync, and google.golang.org/grpc are direct dependencies:

go.opentelemetry.io/otel          v1.40.0
go.opentelemetry.io/otel/sdk      v1.40.0
golang.org/x/sync                 v0.19.0
google.golang.org/grpc            v1.78.0
github.com/twmb/franz-go          (kafkakit)
github.com/hamba/avro/v2           (schemakit)

License

MIT — see LICENSE.

Documentation

Overview

Package chassis provides the chassis-go toolkit version and version compatibility check.

Index

Constants

View Source
const (
	PortHTTP    = 0 // Primary HTTP/REST API
	PortGRPC    = 1 // gRPC transport
	PortMetrics = 2 // Admin, Prometheus metrics, health
)

Standard port role offsets for chassis transport roles.

Variables

View Source
var Version = strings.TrimSpace(rawVersion)

Version returns the current release of chassis-go, read from the VERSION file. This is the single source of truth for the version number.

Functions

func AssertVersionChecked

func AssertVersionChecked()

AssertVersionChecked crashes if RequireMajor has not been called yet. Other chassis modules call this at their entry points.

func Port

func Port(name string, offset ...int) int

Port returns a deterministic port number derived from a service name using the djb2 hash algorithm. The result is in the range 5000–48000, well below the OS ephemeral port range (49152+).

The optional offset parameter (default 0) allows multiple ports per service:

chassis.Port("my_svc")                    // base port (HTTP)
chassis.Port("my_svc", chassis.PortGRPC)  // base + 1 (gRPC)
chassis.Port("my_svc", chassis.PortMetrics) // base + 2 (metrics)

func RequireMajor

func RequireMajor(required int)

RequireMajor crashes the process if the chassis major version does not match the required version. Services must call this at the top of main() before using any other chassis module.

func ResetVersionCheck

func ResetVersionCheck()

ResetVersionCheck is for testing only — resets the version assertion state.

Types

This section is empty.

Directories

Path Synopsis
Package announcekit provides standardized lifecycle events for services and jobs.
Package announcekit provides standardized lifecycle events for services and jobs.
Package cache provides an in-memory TTL/LRU cache with optional OTel metrics.
Package cache provides an in-memory TTL/LRU cache with optional OTel metrics.
Package call provides a resilient HTTP client with retry, circuit breaker, and timeout support using a composable builder pattern.
Package call provides a resilient HTTP client with retry, circuit breaker, and timeout support using a composable builder pattern.
cmd
demo-shutdown command
Command demo-shutdown verifies that lifecycle.Run handles SIGTERM correctly, cancels Contexts, and drains gracefully.
Command demo-shutdown verifies that lifecycle.Run handles SIGTERM correctly, cancels Contexts, and drains gracefully.
Package config provides a generic, reflection-based configuration loader that populates structs from environment variables using struct tags.
Package config provides a generic, reflection-based configuration loader that populates structs from environment variables using struct tags.
Package deploy provides convention-based deploy directory discovery.
Package deploy provides convention-based deploy directory discovery.
Package errors provides a unified error type with dual HTTP and gRPC status codes.
Package errors provides a unified error type with dual HTTP and gRPC status codes.
examples
01-cli command
Example 01-cli demonstrates a simple CLI tool using config + logz.
Example 01-cli demonstrates a simple CLI tool using config + logz.
02-service command
Example 02-service demonstrates a reference gRPC service using config + logz + lifecycle + grpckit + health.
Example 02-service demonstrates a reference gRPC service using config + logz + lifecycle + grpckit + health.
03-client command
Example 03-client demonstrates the call package with retries and circuit breaking.
Example 03-client demonstrates the call package with retries and circuit breaking.
04-full-service command
Example 04-full-service demonstrates all chassis 5.0 modules wired together: config, logz, lifecycle, errors, secval, metrics, health, httpkit, grpckit, otel.
Example 04-full-service demonstrates all chassis 5.0 modules wired together: config, logz, lifecycle, errors, secval, metrics, health, httpkit, grpckit, otel.
Package flagz provides feature flags with percentage rollouts and pluggable sources.
Package flagz provides feature flags with percentage rollouts and pluggable sources.
Package graphkit provides an HTTP client for graphiti_svc, the knowledge graph service.
Package graphkit provides an HTTP client for graphiti_svc, the knowledge graph service.
Package grpckit provides gRPC server utilities including standard interceptors for logging, panic recovery, and health-check registration.
Package grpckit provides gRPC server utilities including standard interceptors for logging, panic recovery, and health-check registration.
Package health provides composable health checks with parallel execution and a standard HTTP handler that returns structured JSON results.
Package health provides composable health checks with parallel execution and a standard HTTP handler that returns structured JSON results.
Package heartbeatkit provides zero-config automatic liveness events.
Package heartbeatkit provides zero-config automatic liveness events.
Package httpkit provides standard HTTP middleware and response utilities.
Package httpkit provides standard HTTP middleware and response utilities.
internal
otelutil
Package otelutil provides shared OTel API helpers for chassis-go packages.
Package otelutil provides shared OTel API helpers for chassis-go packages.
Package kafkakit provides publish/subscribe to Redpanda via the Kafka protocol, with envelope wrapping, tenant filtering, dead letter queue routing, and stats.
Package kafkakit provides publish/subscribe to Redpanda via the Kafka protocol, with envelope wrapping, tenant filtering, dead letter queue routing, and stats.
Package lakekit provides an HTTP client for lake_svc, the data lake query service.
Package lakekit provides an HTTP client for lake_svc, the data lake query service.
Package lifecycle provides a minimal orchestration primitive for running concurrent components that share a single context for cancellation and graceful shutdown via OS signals.
Package lifecycle provides a minimal orchestration primitive for running concurrent components that share a single context for cancellation and graceful shutdown via OS signals.
Package logz provides structured JSON logging with trace ID propagation.
Package logz provides structured JSON logging with trace ID propagation.
Package metrics provides OpenTelemetry metrics with cardinality protection.
Package metrics provides OpenTelemetry metrics with cardinality protection.
Package otel bootstraps OpenTelemetry trace and metric pipelines for chassis-go services.
Package otel bootstraps OpenTelemetry trace and metric pipelines for chassis-go services.
Package registry provides file-based service registration at /tmp/chassis/.
Package registry provides file-based service registration at /tmp/chassis/.
Package registrykit provides an HTTP client for registry_svc, the entity registry service.
Package registrykit provides an HTTP client for registry_svc, the entity registry service.
Package schemakit provides Avro schema loading, validation, serialization, deserialization, and registration with a Schema Registry (e.g.
Package schemakit provides Avro schema loading, validation, serialization, deserialization, and registration with a Schema Registry (e.g.
Package seal provides cryptographic primitives: AES-256-GCM encryption, HMAC-SHA256 signing, and temporary signed tokens.
Package seal provides cryptographic primitives: AES-256-GCM encryption, HMAC-SHA256 signing, and temporary signed tokens.
Package secval provides JSON security validation: dangerous key detection and nesting depth limits.
Package secval provides JSON security validation: dangerous key detection and nesting depth limits.
Package testkit provides lightweight test helpers for chassis-go services.
Package testkit provides lightweight test helpers for chassis-go services.
Package tick provides periodic task components for use with lifecycle.Run.
Package tick provides periodic task components for use with lifecycle.Run.
Package tracekit propagates trace IDs across events and HTTP calls using Go's context mechanism.
Package tracekit propagates trace IDs across events and HTTP calls using Go's context mechanism.
Package work provides structured concurrency primitives with bounded parallelism and OpenTelemetry tracing.
Package work provides structured concurrency primitives with bounded parallelism and OpenTelemetry tracing.
Package xyops provides a client for the xyops API with curated methods, optional monitoring bridge, and a raw escape hatch.
Package xyops provides a client for the xyops API with curated methods, optional monitoring bridge, and a raw escape hatch.
Package xyopsworker lets a chassis service receive and execute jobs dispatched by xyops, behaving as a satellite server.
Package xyopsworker lets a chassis service receive and execute jobs dispatched by xyops, behaving as a satellite server.

Jump to

Keyboard shortcuts

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