Documentation
¶
Overview ¶
Package gocell provides the top-level entry point for the GoCell framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAssembly ¶
func NewAssembly(id string) *assembly.CoreAssembly
NewAssembly creates a new CoreAssembly with the given identifier.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
adapters
|
|
|
circuitbreaker
Package circuitbreaker provides a sony/gobreaker adapter that implements the runtime/http/middleware.Allower interface.
|
Package circuitbreaker provides a sony/gobreaker adapter that implements the runtime/http/middleware.Allower interface. |
|
oidc
Package oidc provides a thin adapter over coreos/go-oidc v3 and golang.org/x/oauth2 for OpenID Connect authentication.
|
Package oidc provides a thin adapter over coreos/go-oidc v3 and golang.org/x/oauth2 for OpenID Connect authentication. |
|
otel
Package otel provides an OpenTelemetry adapter that implements the runtime/observability/tracing.Tracer interface using the OTel SDK.
|
Package otel provides an OpenTelemetry adapter that implements the runtime/observability/tracing.Tracer interface using the OTel SDK. |
|
postgres
Package postgres provides a PostgreSQL adapter for the GoCell framework.
|
Package postgres provides a PostgreSQL adapter for the GoCell framework. |
|
prometheus
Package prometheus provides a Prometheus backend for the provider-neutral metrics abstraction defined in kernel/observability/metrics, plus a direct cell.LifecycleHookObserver implementation for assembly hook metrics.
|
Package prometheus provides a Prometheus backend for the provider-neutral metrics abstraction defined in kernel/observability/metrics, plus a direct cell.LifecycleHookObserver implementation for assembly hook metrics. |
|
rabbitmq
Package rabbitmq provides a RabbitMQ adapter for the GoCell event bus.
|
Package rabbitmq provides a RabbitMQ adapter for the GoCell event bus. |
|
ratelimit
Package ratelimit provides a token-bucket rate limiter adapter that implements the runtime/http/middleware.RateLimiter and WindowedRateLimiter interfaces using golang.org/x/time/rate.
|
Package ratelimit provides a token-bucket rate limiter adapter that implements the runtime/http/middleware.RateLimiter and WindowedRateLimiter interfaces using golang.org/x/time/rate. |
|
redis
Package redis provides a Redis adapter for the GoCell framework.
|
Package redis provides a Redis adapter for the GoCell framework. |
|
s3
Package s3 provides a thin adapter over aws-sdk-go-v2 for S3-compatible object storage.
|
Package s3 provides a thin adapter over aws-sdk-go-v2 for S3-compatible object storage. |
|
vault
Package vault provides a HashiCorp Vault Transit adapter that implements the kernel/crypto.KeyProvider interface.
|
Package vault provides a HashiCorp Vault Transit adapter that implements the kernel/crypto.KeyProvider interface. |
|
websocket
Package websocket provides an nhooyr.io/websocket binding for the runtime/websocket.Conn interface.
|
Package websocket provides an nhooyr.io/websocket binding for the runtime/websocket.Conn interface. |
|
cells
|
|
|
access-core
Package accesscore implements the access-core Cell: identity management, session lifecycle (login/refresh/logout/validate), RBAC authorization, and role queries.
|
Package accesscore implements the access-core Cell: identity management, session lifecycle (login/refresh/logout/validate), RBAC authorization, and role queries. |
|
access-core/internal/domain
Package domain contains the access-core Cell domain models.
|
Package domain contains the access-core Cell domain models. |
|
access-core/internal/dto
Package dto provides handler-level response types for access-core, shared across slices that return the same entity shape.
|
Package dto provides handler-level response types for access-core, shared across slices that return the same entity shape. |
|
access-core/internal/mem
Package mem provides in-memory repository implementations for access-core.
|
Package mem provides in-memory repository implementations for access-core. |
|
access-core/internal/ports
Package ports defines the driven-side interfaces for access-core.
|
Package ports defines the driven-side interfaces for access-core. |
|
access-core/slices/authorizationdecide
Package authorizationdecide implements the authorization-decide slice: RBAC-based authorization decisions.
|
Package authorizationdecide implements the authorization-decide slice: RBAC-based authorization decisions. |
|
access-core/slices/configreceive
Package configreceive implements the config-receive slice: consumes config change events from config-core.
|
Package configreceive implements the config-receive slice: consumes config change events from config-core. |
|
access-core/slices/identitymanage
Package identitymanage implements the identity-manage slice: CRUD + Lock/Unlock user accounts.
|
Package identitymanage implements the identity-manage slice: CRUD + Lock/Unlock user accounts. |
|
access-core/slices/rbaccheck
Package rbaccheck implements the rbac-check slice: HasRole / ListRoles queries for a given user.
|
Package rbaccheck implements the rbac-check slice: HasRole / ListRoles queries for a given user. |
|
access-core/slices/sessionlogin
Package sessionlogin implements the session-login slice: password-based login with JWT issuance.
|
Package sessionlogin implements the session-login slice: password-based login with JWT issuance. |
|
access-core/slices/sessionlogout
Package sessionlogout implements the session-logout slice: revokes sessions and publishes revocation events.
|
Package sessionlogout implements the session-logout slice: revokes sessions and publishes revocation events. |
|
access-core/slices/sessionrefresh
Package sessionrefresh implements the session-refresh slice: validates a refresh token and issues a new JWT token pair.
|
Package sessionrefresh implements the session-refresh slice: validates a refresh token and issues a new JWT token pair. |
|
access-core/slices/sessionvalidate
Package sessionvalidate implements the session-validate slice: verifies access tokens and returns Claims.
|
Package sessionvalidate implements the session-validate slice: verifies access tokens and returns Claims. |
|
audit-core
Package auditcore implements the audit-core Cell: tamper-evident audit log with hash chain, event consumption, integrity verification, and query.
|
Package auditcore implements the audit-core Cell: tamper-evident audit log with hash chain, event consumption, integrity verification, and query. |
|
audit-core/internal/adapters/postgres
Package postgres provides a PostgreSQL implementation of audit-core ports.
|
Package postgres provides a PostgreSQL implementation of audit-core ports. |
|
audit-core/internal/adapters/s3archive
Package s3archive provides an S3-backed implementation of the audit-core ArchiveStore port.
|
Package s3archive provides an S3-backed implementation of the audit-core ArchiveStore port. |
|
audit-core/internal/domain
Package domain contains the audit-core Cell domain models.
|
Package domain contains the audit-core Cell domain models. |
|
audit-core/internal/mem
Package mem provides in-memory repository implementations for audit-core.
|
Package mem provides in-memory repository implementations for audit-core. |
|
audit-core/internal/ports
Package ports defines the driven-side interfaces for audit-core.
|
Package ports defines the driven-side interfaces for audit-core. |
|
audit-core/slices/auditappend
Package auditappend implements the audit-append slice: consumes events from 6 topics and appends them to the hash chain.
|
Package auditappend implements the audit-append slice: consumes events from 6 topics and appends them to the hash chain. |
|
audit-core/slices/auditarchive
Package auditarchive implements the audit-archive slice: stub implementation for Phase 2.
|
Package auditarchive implements the audit-archive slice: stub implementation for Phase 2. |
|
audit-core/slices/auditquery
Package auditquery implements the audit-query slice: query audit entries via HTTP.
|
Package auditquery implements the audit-query slice: query audit entries via HTTP. |
|
audit-core/slices/auditverify
Package auditverify implements the audit-verify slice: verifies hash chain integrity and publishes verification results.
|
Package auditverify implements the audit-verify slice: verifies hash chain integrity and publishes verification results. |
|
config-core
Package configcore implements the config-core Cell: configuration management with versioning, publishing, rollback, and feature flag evaluation.
|
Package configcore implements the config-core Cell: configuration management with versioning, publishing, rollback, and feature flag evaluation. |
|
config-core/internal/adapters/postgres
Package postgres provides a PostgreSQL implementation of config-core ports.
|
Package postgres provides a PostgreSQL implementation of config-core ports. |
|
config-core/internal/crypto
Package crypto provides config-core-specific crypto helpers.
|
Package crypto provides config-core-specific crypto helpers. |
|
config-core/internal/domain
Package domain contains the config-core Cell domain models.
|
Package domain contains the config-core Cell domain models. |
|
config-core/internal/dto
Package dto provides shared handler-level data transfer objects for config-core.
|
Package dto provides shared handler-level data transfer objects for config-core. |
|
config-core/internal/mem
Package mem provides in-memory repository implementations for config-core.
|
Package mem provides in-memory repository implementations for config-core. |
|
config-core/internal/ports
Package ports defines the driven-side interfaces for config-core.
|
Package ports defines the driven-side interfaces for config-core. |
|
config-core/slices/configpublish
Package configpublish implements the config-publish slice: Publish/Rollback versioned config snapshots.
|
Package configpublish implements the config-publish slice: Publish/Rollback versioned config snapshots. |
|
config-core/slices/configread
Package configread implements the config-read slice: Get/List config entries.
|
Package configread implements the config-read slice: Get/List config entries. |
|
config-core/slices/configsubscribe
Package configsubscribe implements the config-subscribe slice: consumes config change events to update a local cache.
|
Package configsubscribe implements the config-subscribe slice: consumes config change events to update a local cache. |
|
config-core/slices/configwrite
Package configwrite implements the config-write slice: Create/Update/Delete config entries with event publishing.
|
Package configwrite implements the config-write slice: Create/Update/Delete config entries with event publishing. |
|
config-core/slices/featureflag
Package featureflag implements the feature-flag slice: Get/Evaluate feature flags.
|
Package featureflag implements the feature-flag slice: Get/Evaluate feature flags. |
|
config-core/slices/flagwrite
Package flagwrite implements the flag-write slice: Create/Update/Delete/Toggle feature flags with transactional outbox event publishing (L2 consistency).
|
Package flagwrite implements the flag-write slice: Create/Update/Delete/Toggle feature flags with transactional outbox event publishing (L2 consistency). |
|
device-cell
Package devicecell implements the device-cell Cell for the iot-device example.
|
Package devicecell implements the device-cell Cell for the iot-device example. |
|
device-cell/internal/domain
Package domain defines the core domain model for the device-cell example.
|
Package domain defines the core domain model for the device-cell example. |
|
device-cell/internal/mem
Package mem provides in-memory implementations of the device domain repositories.
|
Package mem provides in-memory implementations of the device domain repositories. |
|
device-cell/slices/devicecommand
Package devicecommand implements the device-command slice: enqueuing commands for devices, polling pending commands, and acknowledging execution.
|
Package devicecommand implements the device-command slice: enqueuing commands for devices, polling pending commands, and acknowledging execution. |
|
device-cell/slices/deviceregister
Package deviceregister implements the device-register slice: registering devices and publishing device.registered events.
|
Package deviceregister implements the device-register slice: registering devices and publishing device.registered events. |
|
device-cell/slices/devicestatus
Package devicestatus implements the device-status slice: querying device status.
|
Package devicestatus implements the device-status slice: querying device status. |
|
order-cell
Package ordercell implements the order-cell Cell for the todo-order example.
|
Package ordercell implements the order-cell Cell for the todo-order example. |
|
order-cell/internal/domain
Package domain defines the core domain model for the order-cell example.
|
Package domain defines the core domain model for the order-cell example. |
|
order-cell/internal/mem
Package mem provides an in-memory implementation of the order domain repository.
|
Package mem provides an in-memory implementation of the order domain repository. |
|
order-cell/slices/ordercreate
Package ordercreate implements the order-create slice: creating orders and publishing order.created events via the transactional outbox pattern.
|
Package ordercreate implements the order-create slice: creating orders and publishing order.created events via the transactional outbox pattern. |
|
order-cell/slices/orderquery
Package orderquery implements the order-query slice: reading orders.
|
Package orderquery implements the order-query slice: reading orders. |
|
cmd
|
|
|
core-bundle
command
Package main is the entry point for the core-bundle assembly.
|
Package main is the entry point for the core-bundle assembly. |
|
gocell
command
Command gocell is the GoCell metadata / scaffolding CLI entry point.
|
Command gocell is the GoCell metadata / scaffolding CLI entry point. |
|
gocell/app
Package app implements the gocell CLI command dispatch.
|
Package app implements the gocell CLI command dispatch. |
|
examples
|
|
|
iot-device
command
Package main is the entry point for the iot-device example application.
|
Package main is the entry point for the iot-device example application. |
|
sso-bff
command
Package main is the entry point for the sso-bff example application.
|
Package main is the entry point for the sso-bff example application. |
|
todo-order
command
Package main is the entry point for the todo-order example application.
|
Package main is the entry point for the todo-order example application. |
|
kernel
|
|
|
assembly
Package assembly provides the CoreAssembly that orchestrates Cell lifecycle (register, start, stop, health).
|
Package assembly provides the CoreAssembly that orchestrates Cell lifecycle (register, start, stop, health). |
|
cell
Package cell defines the core Cell and Slice abstractions for the GoCell framework: interfaces, base implementations, metadata types, consistency levels, and the Cell registrar.
|
Package cell defines the core Cell and Slice abstractions for the GoCell framework: interfaces, base implementations, metadata types, consistency levels, and the Cell registrar. |
|
cell/celltest
Package celltest provides test utilities for kernel/cell types.
|
Package celltest provides test utilities for kernel/cell types. |
|
crypto
Package crypto defines the kernel-level cryptographic interfaces: KeyProvider, KeyHandle, ValueTransformer, and CurrentKeyIDProvider.
|
Package crypto defines the kernel-level cryptographic interfaces: KeyProvider, KeyHandle, ValueTransformer, and CurrentKeyIDProvider. |
|
governance
Package governance implements validation rules for GoCell metadata.
|
Package governance implements validation rules for GoCell metadata. |
|
idempotency
Package idempotency defines the consumer-side idempotency interface.
|
Package idempotency defines the consumer-side idempotency interface. |
|
journey
Package journey provides query access to Journey metadata and status.
|
Package journey provides query access to Journey metadata and status. |
|
lifecycle
Package lifecycle provides the ContextCloser interface and adapters for managing resource teardown with context-aware shutdown budgets.
|
Package lifecycle provides the ContextCloser interface and adapters for managing resource teardown with context-aware shutdown budgets. |
|
metadata
Package metadata provides a parser that loads all GoCell YAML descriptors (cell.yaml, slice.yaml, contract.yaml, assembly.yaml, journey.yaml) from a project root and produces a validated ProjectMeta model.
|
Package metadata provides a parser that loads all GoCell YAML descriptors (cell.yaml, slice.yaml, contract.yaml, assembly.yaml, journey.yaml) from a project root and produces a validated ProjectMeta model. |
|
observability/metrics
Package metrics defines a provider-neutral metrics abstraction used by kernel modules that emit counters and histograms without importing any specific backend (Prometheus, OTel, …).
|
Package metrics defines a provider-neutral metrics abstraction used by kernel modules that emit counters and histograms without importing any specific backend (Prometheus, OTel, …). |
|
outbox
Package outbox defines interfaces for the transactional outbox pattern: Writer (insert within a transaction), Relay (poll-and-publish), Publisher (fire-and-forget), and Subscriber (consume).
|
Package outbox defines interfaces for the transactional outbox pattern: Writer (insert within a transaction), Relay (poll-and-publish), Publisher (fire-and-forget), and Subscriber (consume). |
|
outbox/outboxtest
Package outboxtest provides a reusable conformance test suite for outbox.Publisher and outbox.Subscriber implementations.
|
Package outboxtest provides a reusable conformance test suite for outbox.Publisher and outbox.Subscriber implementations. |
|
persistence
Package persistence defines shared persistence abstractions for the GoCell framework.
|
Package persistence defines shared persistence abstractions for the GoCell framework. |
|
registry
Package registry provides indexed, read-only access to parsed GoCell project metadata (cells, slices, contracts).
|
Package registry provides indexed, read-only access to parsed GoCell project metadata (cells, slices, contracts). |
|
scaffold
Package scaffold generates boilerplate files (cell.yaml, slice.yaml, Go source stubs) for new Cells and Slices using embedded templates.
|
Package scaffold generates boilerplate files (cell.yaml, slice.yaml, Go source stubs) for new Cells and Slices using embedded templates. |
|
verify
Package verify provides metadata-driven verification runners for cells, slices, and journeys.
|
Package verify provides metadata-driven verification runners for cells, slices, and journeys. |
|
worker
Package worker defines the Worker domain contract.
|
Package worker defines the Worker domain contract. |
|
pkg
|
|
|
aeadutil
Package aeadutil provides pure AES-GCM helpers shared across runtime/crypto and adapters/vault.
|
Package aeadutil provides pure AES-GCM helpers shared across runtime/crypto and adapters/vault. |
|
contracts
Package contracts defines shared schema and transport types used by both kernel/metadata (the YAML metadata model) and pkg/contracttest (the test validation helpers).
|
Package contracts defines shared schema and transport types used by both kernel/metadata (the YAML metadata model) and pkg/contracttest (the test validation helpers). |
|
contracttest
Package contracttest provides schema-driven contract validation helpers for use in contract_test.go files across GoCell cells.
|
Package contracttest provides schema-driven contract validation helpers for use in contract_test.go files across GoCell cells. |
|
ctxkeys
Package ctxkeys provides typed context keys and helper functions for propagating GoCell identifiers (cell, slice, correlation, journey, trace, span, request, ip) through context.Context.
|
Package ctxkeys provides typed context keys and helper functions for propagating GoCell identifiers (cell, slice, correlation, journey, trace, span, request, ip) through context.Context. |
|
errcode
Package errcode provides structured error codes for the GoCell framework.
|
Package errcode provides structured error codes for the GoCell framework. |
|
httputil
Package httputil provides shared HTTP response helpers for GoCell handlers, including JSON success/error writers and the standard response envelope.
|
Package httputil provides shared HTTP response helpers for GoCell handlers, including JSON success/error writers and the standard response envelope. |
|
idutil
Package idutil provides shared ID validation and generation for observability-safe identifiers across kernel/ and runtime/ layers.
|
Package idutil provides shared ID validation and generation for observability-safe identifiers across kernel/ and runtime/ layers. |
|
query
Package query provides utilities for constructing parameterized SQL queries.
|
Package query provides utilities for constructing parameterized SQL queries. |
|
securecookie
Package securecookie encodes and decodes cookie values with HMAC-SHA256 signing and optional AES-GCM encryption using Go standard library crypto only.
|
Package securecookie encodes and decodes cookie values with HMAC-SHA256 signing and optional AES-GCM encryption using Go standard library crypto only. |
|
testutil/sloghelper
Package sloghelper provides test helpers for asserting slog JSON output.
|
Package sloghelper provides test helpers for asserting slog JSON output. |
|
runtime
|
|
|
auth
ref: go-kratos/kratos middleware/auth/auth.go — auth middleware pattern Adopted: middleware wrapping pattern, Claims extraction from context.
|
ref: go-kratos/kratos middleware/auth/auth.go — auth middleware pattern Adopted: middleware wrapping pattern, Claims extraction from context. |
|
auth/config
Package config is the production wiring entrypoint for runtime/auth components.
|
Package config is the production wiring entrypoint for runtime/auth components. |
|
auth/refresh
Package refresh provides the server-side opaque refresh token store interface and in-memory implementation used by the access-core session slices.
|
Package refresh provides the server-side opaque refresh token store interface and in-memory implementation used by the access-core session slices. |
|
auth/refresh/memstore
Package memstore provides an in-memory implementation of refresh.Store.
|
Package memstore provides an in-memory implementation of refresh.Store. |
|
auth/refresh/storetest
Package storetest provides a reusable contract test suite for refresh.Store implementations.
|
Package storetest provides a reusable contract test suite for refresh.Store implementations. |
|
bootstrap
Package bootstrap orchestrates the full GoCell application lifecycle: config loading, assembly init/start, HTTP serving, event subscriptions, background workers, and graceful shutdown.
|
Package bootstrap orchestrates the full GoCell application lifecycle: config loading, assembly init/start, HTTP serving, event subscriptions, background workers, and graceful shutdown. |
|
config
Package config provides a Config interface with YAML + environment variable loading.
|
Package config provides a Config interface with YAML + environment variable loading. |
|
crypto
Package crypto provides the KeyProvider abstraction and implementations for encrypting sensitive values at the repository boundary.
|
Package crypto provides the KeyProvider abstraction and implementations for encrypting sensitive values at the repository boundary. |
|
distlock
Package distlock defines the provider-neutral distributed-lock contract for the GoCell runtime layer.
|
Package distlock defines the provider-neutral distributed-lock contract for the GoCell runtime layer. |
|
eventbus
Package eventbus provides an in-memory implementation of kernel/outbox Publisher and Subscriber for development and testing.
|
Package eventbus provides an in-memory implementation of kernel/outbox Publisher and Subscriber for development and testing. |
|
eventrouter
Package eventrouter provides a Router that separates event subscription declaration from execution.
|
Package eventrouter provides a Router that separates event subscription declaration from execution. |
|
http/health
Package health provides /healthz (liveness) and /readyz (readiness) HTTP endpoints.
|
Package health provides /healthz (liveness) and /readyz (readiness) HTTP endpoints. |
|
http/middleware
Package middleware provides chi-compatible HTTP middleware for GoCell applications.
|
Package middleware provides chi-compatible HTTP middleware for GoCell applications. |
|
http/router
Package router provides a chi-based HTTP router that implements kernel/cell.RouteMux with default middleware and automatic health/metrics endpoint registration.
|
Package router provides a chi-based HTTP router that implements kernel/cell.RouteMux with default middleware and automatic health/metrics endpoint registration. |
|
observability/logging
Package logging provides a slog.Handler that enriches log records with trace_id, span_id, request_id, correlation_id, and cell_id from the request context.
|
Package logging provides a slog.Handler that enriches log records with trace_id, span_id, request_id, correlation_id, and cell_id from the request context. |
|
observability/metrics
Package metrics provides HTTP request instrumentation interfaces and an in-memory implementation.
|
Package metrics provides HTTP request instrumentation interfaces and an in-memory implementation. |
|
observability/poolstats
Package poolstats defines a provider-neutral connection-pool snapshot interface.
|
Package poolstats defines a provider-neutral connection-pool snapshot interface. |
|
observability/tracing
Package tracing provides a Tracer interface and HTTP middleware for distributed tracing.
|
Package tracing provides a Tracer interface and HTTP middleware for distributed tracing. |
|
outbox
Package outbox provides the runtime-layer Store interface and relay worker for transactional outbox delivery.
|
Package outbox provides the runtime-layer Store interface and relay worker for transactional outbox delivery. |
|
outbox/outboxtest
Package outboxtest provides a public in-memory Store implementation and a Store conformance test suite for use in unit tests.
|
Package outboxtest provides a public in-memory Store implementation and a Store conformance test suite for use in unit tests. |
|
shutdown
Package shutdown provides graceful shutdown support by listening for SIGINT/SIGTERM signals with a configurable timeout and ordered teardown.
|
Package shutdown provides graceful shutdown support by listening for SIGINT/SIGTERM signals with a configurable timeout and ordered teardown. |
|
websocket
Package websocket provides a Hub-based WebSocket connection manager with signal-first broadcasting, ping/pong health checks, and graceful shutdown.
|
Package websocket provides a Hub-based WebSocket connection manager with signal-first broadcasting, ping/pong health checks, and graceful shutdown. |
|
worker
Package worker provides a Worker interface and WorkerGroup for managing concurrent background workers with graceful lifecycle control.
|
Package worker provides a Worker interface and WorkerGroup for managing concurrent background workers with graceful lifecycle control. |
|
tests
|
|
|
testutil
Package testutil provides shared test utilities for integration tests.
|
Package testutil provides shared test utilities for integration tests. |
|
tools
|
|
|
archtest
Package archtest enforces Go source-level import layering rules for the GoCell architecture.
|
Package archtest enforces Go source-level import layering rules for the GoCell architecture. |
Click to show internal directories.
Click to hide internal directories.