Documentation
¶
Overview ¶
Package cloud provides shared configuration for the Engram Cloud subsystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseURLFromEnv ¶
func DatabaseURLFromEnv() string
DatabaseURLFromEnv returns the configured Postgres DSN using the canonical env name first, then the legacy alias.
func JWTSecretFromEnv ¶
func JWTSecretFromEnv() string
JWTSecretFromEnv returns the configured JWT secret using the canonical env name first, then the legacy alias.
Types ¶
type Config ¶
type Config struct {
DSN string // Postgres connection string
JWTSecret string // Secret for HMAC-SHA256 JWT signing (>= 32 bytes)
CORSOrigins []string // Allowed CORS origins
MaxPool int // Maximum database connection pool size
Port int // HTTP port for cloud server mode
AdminEmail string // Email of the admin user (enables Admin tab in dashboard)
}
Config holds configuration for the Engram Cloud server and its subsystems.
func ConfigFromEnv ¶
func ConfigFromEnv() Config
ConfigFromEnv reads cloud configuration from environment variables, falling back to DefaultConfig values when a variable is not set.
Environment variables:
- ENGRAM_DATABASE_URL: Postgres connection string (preferred)
- ENGRAM_JWT_SECRET: JWT signing secret (preferred, required in production)
- ENGRAM_CLOUD_DSN: Postgres connection string (legacy alias)
- ENGRAM_CLOUD_JWT_SECRET: JWT signing secret (legacy alias)
- ENGRAM_CLOUD_CORS_ORIGINS: Comma-separated list of allowed origins
- ENGRAM_CLOUD_MAX_POOL: Maximum DB connection pool size
- ENGRAM_PORT: HTTP port for cloud server mode
- ENGRAM_CLOUD_ADMIN: Admin user email (enables Admin tab in dashboard)
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults for local development.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package auth implements JWT authentication and API key management for Engram Cloud.
|
Package auth implements JWT authentication and API key management for Engram Cloud. |
|
Package autosync implements a lease-guarded background sync manager for Engram's local-first cloud replication.
|
Package autosync implements a lease-guarded background sync manager for Engram's local-first cloud replication. |
|
Package cloudserver implements the HTTP server for Engram Cloud.
|
Package cloudserver implements the HTTP server for Engram Cloud. |
|
Package cloudstore implements the Postgres-backed storage layer for Engram Cloud.
|
Package cloudstore implements the Postgres-backed storage layer for Engram Cloud. |
|
templ: version: v0.3.1001
|
templ: version: v0.3.1001 |
|
Package remote implements the cloud-backed sync transport for Engram.
|
Package remote implements the cloud-backed sync transport for Engram. |
Click to show internal directories.
Click to hide internal directories.