API Reference
This reference is auto-generated from the godoc comments in the fountain and ftkit source trees via npm run gen:api. The pages below are not hand-edited — to change their content, edit the godoc comments in the source and regenerate. See Regenerating below.
Framework
Core framework packages: the application entry point, lifecycle primitives, controller registration, and global constants.
- fountain — framework entry point and lifecycle (
New(),Serving()) - runnable —
AppInstance,Invoker,JobInstancelifecycle interfaces - core —
CoreController, registration, and the cross-controller observer pattern - constants — global
K-prefixed constants
Clients
Protocol client packages.
- fhttp_client — HTTP client
- fgrpc_client — gRPC client
- fgrpc_client/interceptor — gRPC client interceptors
- fgrpc_client/resolver — gRPC name resolver
- ftcp_client — TCP client
- fudp_client — UDP client
- fquic_client — QUIC client
Servers
Multi-protocol server implementations under libs/fnet.
- fnet/fhttp — HTTP (Fiber)
- fnet/fgrpc — gRPC
- fnet/ftcp — TCP
- fnet/fudp — UDP
- fnet/fquic — QUIC
- fnet/codec — message codec utilities
- fnet/endpoint — endpoint abstraction
Storage
Storage backends under libs/stored. New code should prefer fedis (see the storage migration note on the Contributing page).
- stored/fedis — Redis (current)
- stored/fongo — MongoDB
- stored/fcql — Cassandra / CQL
- stored/felastic — Elasticsearch
- stored/fbolt — BoltDB
- stored/badger — BadgerDB
- stored/s3_client — AWS S3
- stored/esdb — EventStoreDB
- stored/fgraph — Graph database
- stored/fql — SQL abstraction
Caches
In-memory and distributed cache implementations under libs/cache.
- cache — cache abstraction and unified API
- cache/redis_cache — Redis-backed cache
- cache/memcache — Memcached
- cache/memory_cache — in-process memory cache
- cache/lru_cache — LRU eviction cache
- cache/lfu_cache — LFU eviction cache
- cache/arc_cache — ARC eviction cache
- cache/slru_cache — Segmented LRU cache
- cache/buntdb — BuntDB in-memory store
- cache/file_cache — file-based cache
Brokers
Message broker integrations under libs/brokers.
- brokers — broker abstraction and message types
- brokers/fmqtt — MQTT
- brokers/pipeline/middleware — pipeline middleware (retry, throttle, circuit breaker…)
- brokers/pipeline/plugin — pipeline plugin signals
- brokers/pubsub/gochannel — in-process Go channel pub/sub
- brokers/pubsub/sync — synchronous pub/sub helper
- brokers/subscriber — subscriber helpers
Broker providers
- brokers/providers/fnat — NATS
- brokers/providers/fka — Apache Kafka
- brokers/providers/fmqp — RabbitMQ (AMQP)
- brokers/providers/fedis — Redis Streams / Pub-Sub
- brokers/providers/sse — Server-Sent Events
- brokers/providers/sns — AWS SNS
- brokers/providers/sqs — AWS SQS
Auth
Authentication packages.
- auth_token — JWT / token management
- social_auth — OAuth2 social login
- firebase_auth — Firebase Authentication
Service discovery
Service discovery backends under libs/sd.
- sd/fconsul — Consul
- sd/fetcd — etcd
- sd/fregistry — registry abstraction
- sd/k8s — Kubernetes
Observability
Logging, tracing, and metrics.
- flog — structured logging (zerolog-based)
- flog/grpc_log — gRPC log adapter
- ftracer — distributed tracing (OpenTelemetry)
- metrics — metrics abstraction
- metrics/prometheus — Prometheus exporter
- metrics/cloudwatch — AWS CloudWatch
- metrics/cloudwatch2 — AWS CloudWatch v2
- metrics/influx — InfluxDB
- metrics/influx_stats_d — InfluxDB StatsD
- metrics/dog_stats_d — DogStatsD (Datadog)
- metrics/stats_d — StatsD
- metrics/graphite — Graphite
- metrics/multi — fan-out to multiple sinks
- metrics/expvar — Go expvar
- metrics/generic — generic in-process metrics
- metrics/discard — no-op / discard
Resilience
- fsentinel — Alibaba Sentinel flow control
- resilient/backoff — retry with backoff
- resilient/circuit_breaker — circuit breaker
- resilient/locker — distributed lock
- resilient/ratelimit — rate limiting
- resilient/recaptcha — reCAPTCHA verification
Workers & tasks
Background workers, jobs, and scheduling.
- fsync — concurrency primitives (worker pool root)
- fsync/fgo — goroutine pool
- fsync/fatomic — atomic helpers
- ftasker/fjob — one-shot jobs
- ftasker/fcron — cron scheduling
- ftasker/fcroner — cron daemon
Notifications
- noti/firebase_message — Firebase Cloud Messaging (FCM)
- noti/fmail — email notifications
Crypto
- crypto — cryptography helpers (hashing, encryption, signing)
System utilities
- fcpu — CPU affinity and core utilities
- fcycle — application lifecycle hooks
- ip2geo — IP-to-geography lookup
- k8f — Kubernetes helpers
- buff — byte buffer pool
Utilities
General-purpose utilities.
- env — environment configuration helpers
- fcontext — context helpers
- ferr — error wrapping and handling
- fflag — feature flags
- validator — input validation
Base utilities
Low-level utility packages under libs/base.
- base/arr_util — slice/array utilities
- base/bool_util — boolean helpers
- base/byte_util — byte slice helpers
- base/dump — debug dumping
- base/fgo — lightweight goroutine helpers
- base/fn — functional programming helpers
- base/fson — JSON helpers
- base/goinfo — Go runtime info
- base/map_util — map utilities
- base/net_util — network utilities
- base/num_util — numeric utilities
- base/rand_util — random generation
- base/reflect_util — reflection helpers
- base/string_util — string utilities
- base/structs — struct helpers
- base/syncs — synchronization primitives
- base/sys_util — OS/system utilities
- base/time_util — time utilities
ftkit
Reference for the ftkit toolkit packages.
- ffs — filesystem helpers
- progress_bar — progress bar
Regenerating
These pages are produced by npm run gen:api. Regeneration requires the sibling fountain and ftkit repositories checked out alongside fountain-docs (their locations can be overridden with the FOUNTAIN_SRC and FTKIT_SRC environment variables), plus gomarkdoc installed:
go install github.com/princjef/gomarkdoc/cmd/gomarkdoc@latest
npm run gen:api