gokit

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 0 Imported by: 0

README

gokit

Композируемый Go service kit. Около тридцати независимо импортируемых пакетов, покрывающих то, что каждый HTTP API сервис делает руками: роутинг, ошибки, БД, аутентификация, исходящие HTTP, NATS-стриминг, observability, resilience, audit, schedulers, file uploads, webhook'и.

Каждый пакет можно использовать отдельно. Вместе они уводят вас от main.go к сервису production-shape — либо постепенно (fibermap сам по себе), либо одним вызовом через service.New.

Статус: v1.0.0 — stable. Semver-обещания (что считается breaking / MINOR / PATCH, политика по min Go version, coexistence с будущими major'ами) — в docs/versioning.md. Pre-v1 audit-close список — в docs/v1-readiness.md.

Что в коробке

Базовые блоки
Пакет Что делает
fibermap/ YAML-декларативный роутер для Fiber v2. Хендлеры и middleware по именам. Типизированный per-request контекст. OpenAPI генерация.
errs/ Типизированные доменные ошибки (Kind, Code, Details, Cause) с маппингом в HTTP. Только stdlib.
errs/errsval/ Конверсия validator.ValidationErrors*errs.Error{KindValidation}.
reqctx/ Request-ID propagation primitive.
База данных
Пакет Что делает
db/ pgx pool wrapper. Транзакции с savepoint'ами. Healthcheck. Маппинг ошибок в *errs.Error.
db/sqb/ Опциональная squirrel-обёртка, преднастроенная на $N placeholders.
db/migrate/ Zero-dependency migration runner на embed.FS.
db/lock/ pg_advisory_lock примитив для leader-election и mutual exclusion.
db/jobs/ Postgres-backed delayed job queue (gap между cron'ом и outbox'ом).
db/outbox/ Transactional outbox pattern (publish-side).
db/outbox/outboxnats/ Adapter — outbox.PublishFn → natsmap.
db/inbox/ Inbox table для effectively-once consumer'ов.
db/inbox/inboxnats/ Adapter — natsmap handler wrapper с дедупликацией.
Аутентификация
Пакет Что делает
auth/ JWT issue/verify (EdDSA/ES256), Argon2id hashing, refresh-token rotation, Fiber middleware.
auth/refreshpg/ Postgres-backed RefreshStore.
auth/refreshredis/ Redis-backed RefreshStore (Lua-atomic).
auth/apikeypg/ Postgres-backed API-key store.
auth/sessions/ Server-side cookie sessions с revocation.
auth/fibermount/ Bridge между auth и fibermap middleware factories.
Исходящий HTTP
Пакет Что делает
clients/httpc/ *http.Client с retry / per-attempt timeout / breaker / bulkhead / observability.
clients/apimap/ YAML-декларативные upstream API'и. Вызов по имени через Decode[T]/Exchange[Req,Resp].
NATS / JetStream
Пакет Что делает
clients/nats/ Типизированная обёртка над JetStream. Publisher[T] / Subscribe[T].
clients/natsmap/ Декларативные подписчики/публишеры через YAML.
clients/natsmap/natsgw/ HTTP-gateway для NATS publish (для сервисов в network zone без NATS reachability).
Redis-инфраструктура
Пакет Что делает
clients/redis/ *redis.Client bootstrap с initial-PING retry.
clients/cache/ Типизированный Redis read-through cache с positive/negative TTL.
clients/ratelimit/ Sliding-window rate limiter на Lua-скрипте.
Прочие clients
Пакет Что делает
clients/s3/ aws-sdk-go-v2/service/s3 wrapper. AWS / MinIO / R2 / Spaces / B2.
clients/email/ Pluggable transactional email (SMTP / SES / Postmark).
clients/webhooks/ Outbound + inbound webhook'и (Subscription/Delivery/Fanout/Worker, HMAC signing).
Resilience
Пакет Что делает
breaker/ 3-state circuit breaker (closed/open/half_open).
bulkhead/ Concurrency cap с bounded queue + опциональный adaptive controller (AIMD).
batch/ Batched-handler dispatcher для bulk sink-операций.
Криптография
Пакет Что делает
crypto/ AES-256-GCM at-rest sealing. MasterKey для single-key случая; Keychain (kid-routed) для rotation. Version-tagged blob format с cross-type isolation.
Идентификаторы
Пакет Что делает
ids/ Prefixed ULIDs (user_01H…). New/Parse/Format + validate:"id_prefix=prod_" struct tag. 16-byte raw — совместимо с pgx uuid column через kit's auto-codec.
Observability
Пакет Что делает
otelkit/ OpenTelemetry bootstrap (tracing + metrics + logs bridges).
sentrykit/ Sentry error-tracking + Fiber middleware + slog→breadcrumb bridge.
Scheduling
Пакет Что делает
cronmap/ Declarative cron scheduler с YAML + handler-by-name. Per-run timeout, singleton (pg-advisory-lock), Sentry crons slug — всё YAML-аттрибутами. См. также db/jobs/ (Postgres-backed delayed/one-shot queue).
Operations
Пакет Что делает
audit/ Append-only audit-log infrastructure (SOC2 / HIPAA / PCI-DSS). С v1.1.0: audit/auditfm/ — declarative per-handler decorator поверх fibermap.
runbook/ Runtime kill-switch для ops без redeploy.
fibermap/uploadguard/ File-upload validation middleware (pairs с clients/s3).
Bundle
Пакет Что делает
service/ service.New(ctx, cfg, opts...) всё-в-одном wiring. Auto-detect optionality + startup log + Status() introspection.

Decision guide — "мне нужно X"

Полная таблица «задача → пакет» — в docs/decision-guide.md. Самое частое:

Задача Бери
Описать routes снаружи кода fibermap + routes.yaml
Postgres pool + транзакции db
JWT-based authn auth + auth/refreshpg/refreshredis
HTTP-клиент с retry + observability clients/httpc
Описать upstream API'и в YAML clients/apimap
Publish событий в NATS JetStream clients/nats или clients/natsmap
Гарантированный publish после db.Commit db/outbox + db/outbox/outboxnats
Periodic cron jobs (declarative YAML) cronmap
Всё сразу одним вызовом service

Правила зависимостей

errs                                        → только stdlib
reqctx                                      → только stdlib
db, db/sqb, db/migrate, db/lock             → errs + pgx
db/jobs, db/outbox, db/inbox                → db + errs
db/outbox/outboxnats, db/inbox/inboxnats    → db/outbox|inbox + clients/natsmap
breaker, bulkhead, batch                    → stdlib + prometheus
cronmap                                     → errs + robfig/cron + yaml.v3 (+ db/lock optional for PGLocker, sentrykit optional)
clients/httpc                               → errs + prometheus + breaker + bulkhead
clients/apimap                              → errs + clients/httpc + breaker + bulkhead + yaml.v3
clients/nats                                → errs + nats.go + prometheus
clients/natsmap                             → errs + clients/nats + yaml.v3
clients/redis, clients/cache, clients/ratelimit → errs + go-redis
clients/s3                                  → errs + aws-sdk-go-v2
clients/email                               → errs + (provider-specific)
clients/webhooks                            → errs + db + clients/httpc
auth                                        → errs + crypto + jwt + fiber
auth/refreshpg, auth/apikeypg, auth/sessions → auth + db
auth/refreshredis                           → auth + go-redis
auth/fibermount                             → auth + fibermap
fibermap                                    → errs + fiber
fibermap/uploadguard                        → fibermap + clients/s3
otelkit, sentrykit, runbook                 → fibermap + provider SDK
audit                                       → errs + db (audit/auditpg)
service                                     → почти всё (это и есть all-in-one)

Корневой пакет gokit пустой — без экспортируемых символов. Импорт одного подпакета не тянет остальные (service — единственное исключение).

Установка

# Минимум для роутера:
go get github.com/theizzatbek/gokit/fibermap
go get github.com/theizzatbek/gokit/errs

# Всё-в-одном:
go get github.com/theizzatbek/gokit/service

# Опциональный CLI для linting'а routes.yaml + экспорта schema:
go install github.com/theizzatbek/gokit/cmd/fibermap@latest

# CLI для scaffold'а нового сервиса:
go install github.com/theizzatbek/gokit/cmd/kit@latest

Требуется Go 1.26+ и Fiber v2 (для fibermap/).

Quickstart — fibermap роутер

# routes.yaml
groups:
  - prefix: /v1
    routes:
      - method: GET
        path:   /ping
        handler: ping
        name:   ping.get
package main

import (
    "context"

    "github.com/gofiber/fiber/v2"
    "github.com/theizzatbek/gokit/fibermap"
)

type AppCtx struct{ /* per-request data */ }

func main() {
    eng := fibermap.New[AppCtx]()
    eng.SetContextBuilder(func(c *fiber.Ctx) (AppCtx, error) {
        return AppCtx{}, nil
    })
    fibermap.RegisterHandler(eng, "ping", func(c *fibermap.Context[AppCtx]) error {
        return c.SendString("pong")
    })
    if err := eng.LoadFile("routes.yaml"); err != nil {
        panic(err)
    }
    if err := eng.Run(context.Background(), fibermap.WithAddr(":3000")); err != nil {
        panic(err)
    }
}

Для реальных endpoint'ов используйте типизированные регистры — они парсят body/query/params, валидируют через eng.SetValidator, авто-attach'ат схему для OpenAPI и сводят boilerplate к одной строке req argument:

type CreateTaskReq struct {
    Title string `json:"title" validate:"required,min=1,max=200"`
}

fibermap.RegisterHandlerWithBody(eng, "tasks.create",
    func(c *fibermap.Context[AppCtx], req CreateTaskReq) error {
        // req уже распарсен и провалидирован.
        return c.Status(201).JSON(...)
    },
    fibermap.WithResponse(201, Task{}),
)

Sibling-хелперы — RegisterHandlerWith{Query,Params,Headers}. Комбинированные кейсы (body+param и т.д.) — RegisterHandlerWithInput. См. fibermap/README.md § «Типизированный body-bound хендлер» и «Комбинированные binder'ы».

Quickstart — service.New (полный bundle)

svc, err := service.New[AppCtx, MyClaims](ctx, cfg,
    service.WithRoutes(),
    service.WithOpenAPI(),
    service.WithSentry(dsn, service.SentryOptions{
        ErrorCaptureLevel: service.LevelPtr(slog.LevelError),
    }),
)
if err != nil { return err }
defer svc.Close()

svc.SetContextBuilder(...)
fibermap.RegisterHandler(svc.Engine, ...)
return svc.Run()

На старте печатает один структурированный service ready log с booleanами по каждому подсистеме (db=true, auth=true, redis=false, ...); intospection через svc.Status(). Подробности — service/README.md.

Поддержка редактора для YAML-конфигов

Все встроенные YAML'ы кита (routes.yaml, crons.yaml, clients.yaml, subscribers.yaml/publishers.yaml) имеют JSON Schema (draft-07), сгружённые в schemas/. Добавьте modeline в начало соответствующего файла:

# yaml-language-server: $schema=https://raw.githubusercontent.com/theizzatbek/gokit/main/schemas/routes.schema.json

VS Code (с redhat.vscode-yaml), GoLand и Vim с coc-yaml дают автодополнение, hover-документацию и inline-диагностику — опечатки в middleware: подсвечиваются до go test. Полный список схем + примеры — в schemas/README.md.

CLI

fibermap validate routes.yaml    # schema-lint; ненулевой exit при проблемах
fibermap dump-schema             # печатает встроенную JSON Schema

validate проверяет схему (обязательные поля, валидные HTTP методы, циклы в middleware_set, форма middleware). НЕ проверяет, что имена handler / middleware / factory зарегистрированы — ваш Go-бинарь это единственное место, где они живут. Для полной валидации вызовите Engine.Validate() в Go-тесте или boot-скрипте.

cmd/kit — отдельный generator/scaffold CLI (см. cmd/kit/README.md).

Примеры

Пример Что показывает
examples/urlshort/ Multi-binary microservice setup с outbox + apimap.
examples/resilience/ breaker + bulkhead через apimap YAML против flaky httptest сервера.
examples/inbox-outbox/ Effectively-once event flow с outboxnats + inboxnats (testcontainers postgres + nats).

Documentation

Overview

Package gokit is the umbrella for the Go service kit. Each subpackage is independently importable. Subpackages:

  • fibermap: YAML-declarative Fiber router
  • errs: typed domain errors + HTTP mapping
  • db: pgx pool + transactions + healthcheck
  • db/sqb: opt-in squirrel wrapper over db
  • auth: JWT + refresh + ready-to-mount middleware
  • clients/httpc: outbound *http.Client with retry/timeout
  • clients/apimap: declarative outbound HTTP via YAML
  • clients/nats: typed JetStream wrapper (package natsclient)

The root gokit package itself has no exported symbols. Importing one subpackage does not pull the others.

See README.md for the per-package overview and dependency rules.

Directories

Path Synopsis
Package audit is an append-only audit-log primitive.
Package audit is an append-only audit-log primitive.
auditadmin
Package auditadmin is a small browser UI for the audit log: search by actor / action / outcome / time-range, paginate, export the filtered set as JSON for compliance review.
Package auditadmin is a small browser UI for the audit log: search by actor / action / outcome / time-range, paginate, export the filtered set as JSON for compliance review.
auditfm
Package auditfm wires the audit package into fibermap handler registration: a single per-handler decorator emits the audit event AFTER the handler returns, derived from the spec (Action / Target / Subject / Metadata) the caller declared at registration time.
Package auditfm wires the audit package into fibermap handler registration: a single per-handler decorator emits the audit event AFTER the handler returns, derived from the spec (Action / Target / Subject / Metadata) the caller declared at registration time.
auditmw
Package auditmw is a Fiber middleware that auto-emits audit events from each inbound HTTP request.
Package auditmw is a Fiber middleware that auto-emits audit events from each inbound HTTP request.
auditpg
Package auditpg is the Postgres-backed audit.Store.
Package auditpg is the Postgres-backed audit.Store.
Package auth provides a complete authentication bundle for fibermap services: asymmetrically-signed JWT access tokens (EdDSA / ES256), opaque rotation-aware refresh tokens with reuse detection, argon2id password hashing, the IssueTokens / IssueLogin / IssueRefresh / Logout / RevokeRefresh / RevokeFamily / RevokeAllForSubject primitives, and Bearer/RequireScope/RequireRole middleware.
Package auth provides a complete authentication bundle for fibermap services: asymmetrically-signed JWT access tokens (EdDSA / ES256), opaque rotation-aware refresh tokens with reuse detection, argon2id password hashing, the IssueTokens / IssueLogin / IssueRefresh / Logout / RevokeRefresh / RevokeFamily / RevokeAllForSubject primitives, and Bearer/RequireScope/RequireRole middleware.
apikeypg
Package apikeypg implements auth.KeyStore on top of Postgres via the kit's db.Querier interface.
Package apikeypg implements auth.KeyStore on top of Postgres via the kit's db.Querier interface.
authtest
Package authtest exposes test-only helpers for the auth package that production code MUST NOT depend on.
Package authtest exposes test-only helpers for the auth package that production code MUST NOT depend on.
fibermount
Package fibermount wires auth.Auth[C]'s middleware factories into a *fibermap.Engine[T].
Package fibermount wires auth.Auth[C]'s middleware factories into a *fibermap.Engine[T].
internal/memstore
Package memstore is an in-process RefreshStore used by auth handler tests.
Package memstore is an in-process RefreshStore used by auth handler tests.
internal/principalkey
Package principalkey exposes the unexported Locals key that auth middleware (Bearer, API-key, session-bridge) uses to store the Principal on each request, and that auth/From / auth/MustFrom read it back from.
Package principalkey exposes the unexported Locals key that auth middleware (Bearer, API-key, session-bridge) uses to store the Principal on each request, and that auth/From / auth/MustFrom read it back from.
refreshpg
Package refreshpg implements auth.RefreshStore on top of Postgres via the kit's db.Querier interface.
Package refreshpg implements auth.RefreshStore on top of Postgres via the kit's db.Querier interface.
refreshredis
Package refreshredis implements auth.RefreshStore on top of Redis.
Package refreshredis implements auth.RefreshStore on top of Redis.
sessions
Package sessions adds server-side cookie sessions to the JWT-first auth package.
Package sessions adds server-side cookie sessions to the JWT-first auth package.
sessionsredis
Package sessionsredis implements auth/sessions.SessionStore on top of Redis.
Package sessionsredis implements auth/sessions.SessionStore on top of Redis.
Package batch is the kit's generic batched-handler dispatcher.
Package batch is the kit's generic batched-handler dispatcher.
Package breaker is the kit's generic three-state circuit breaker.
Package breaker is the kit's generic three-state circuit breaker.
Package bulkhead is the kit's generic concurrency-cap with bounded wait queue.
Package bulkhead is the kit's generic concurrency-cap with bounded wait queue.
clients
apimap
Package apimap is the kit's declarative outbound HTTP layer.
Package apimap is the kit's declarative outbound HTTP layer.
cache
Package cache is a typed Redis-backed read-through cache.
Package cache is a typed Redis-backed read-through cache.
email
Package email is a pluggable transactional-email kit.
Package email is a pluggable transactional-email kit.
httpc
Package httpc is the kit's outbound HTTP client builder.
Package httpc is the kit's outbound HTTP client builder.
nats
Package natsclient is the kit's NATS / JetStream wrapper.
Package natsclient is the kit's NATS / JetStream wrapper.
natsmap
Package natsmap is the declarative YAML layer for NATS subscribers and publishers, symmetric to clients/apimap.
Package natsmap is the declarative YAML layer for NATS subscribers and publishers, symmetric to clients/apimap.
natsmap/natsgw
Package natsgw is a generic HTTP→NATS gateway middleware.
Package natsgw is a generic HTTP→NATS gateway middleware.
ratelimit
Package ratelimit is a Redis-backed sliding-window rate limiter.
Package ratelimit is a Redis-backed sliding-window rate limiter.
redis
Package redisclient is the kit's thin wrapper around github.com/redis/go-redis/v9.
Package redisclient is the kit's thin wrapper around github.com/redis/go-redis/v9.
s3
Package s3client is the kit's thin AWS S3 wrapper.
Package s3client is the kit's thin AWS S3 wrapper.
webhooks
Package webhooks implements outbound + inbound HTTP webhook infrastructure for the kit: typed Subscription / Delivery rows persisted by an implementation of SubscriptionStore + DeliveryStore, a Fanout that turns one domain event into N per-target deliveries, a Worker that drains pending deliveries with per-target retry and dead-letter, an outbound Signer producing Stripe-style HMAC signatures, and a Verifier interface (with two ready-made implementations in clients/webhooks/verifiers) for inbound payloads.
Package webhooks implements outbound + inbound HTTP webhook infrastructure for the kit: typed Subscription / Delivery rows persisted by an implementation of SubscriptionStore + DeliveryStore, a Fanout that turns one domain event into N per-target deliveries, a Worker that drains pending deliveries with per-target retry and dead-letter, an outbound Signer producing Stripe-style HMAC signatures, and a Verifier interface (with two ready-made implementations in clients/webhooks/verifiers) for inbound payloads.
webhooks/verifiers
Package verifiers ships ready-made implementations of clients/webhooks.Verifier.
Package verifiers ships ready-made implementations of clients/webhooks.Verifier.
cmd
fibermap command
Command fibermap is a small CLI around the fibermap library.
Command fibermap is a small CLI around the fibermap library.
kit command
Command kit is the kit's operator CLI: migrations, auth key minting, outbox inspection.
Command kit is the kit's operator CLI: migrations, auth key minting, outbox inspection.
Package cronmap is the kit's declarative cron scheduler — symmetric to fibermap (HTTP routes), clients/apimap (outbound calls), and clients/natsmap (NATS pub/sub).
Package cronmap is the kit's declarative cron scheduler — symmetric to fibermap (HTTP routes), clients/apimap (outbound calls), and clients/natsmap (NATS pub/sub).
Package crypto is the kit's standard at-rest sealing primitive.
Package crypto is the kit's standard at-rest sealing primitive.
db
Package db is the kit's pgx-based connection layer.
Package db is the kit's pgx-based connection layer.
inbox
Package inbox is the consumer-side companion to db/outbox.
Package inbox is the consumer-side companion to db/outbox.
inbox/inboxnats
Package inboxnats wires db/inbox onto clients/natsmap handlers.
Package inboxnats wires db/inbox onto clients/natsmap handlers.
jobs
Package jobs is a Postgres-backed delayed-job queue.
Package jobs is a Postgres-backed delayed-job queue.
lock
Package lock is the kit's Postgres advisory-lock primitive.
Package lock is the kit's Postgres advisory-lock primitive.
migrate
Package migrate is the kit's zero-dependency Postgres migration runner.
Package migrate is the kit's zero-dependency Postgres migration runner.
outbox
Package outbox implements the transactional-outbox pattern over Postgres: events are written to an `outbox` table inside the same transaction as the business state, then a background Worker dispatches them to the real bus (NATS / Kafka / SQS) with at-least-once semantics.
Package outbox implements the transactional-outbox pattern over Postgres: events are written to an `outbox` table inside the same transaction as the business state, then a background Worker dispatches them to the real bus (NATS / Kafka / SQS) with at-least-once semantics.
outbox/outboxnats
Package outboxnats wires db/outbox onto clients/natsmap's natsmap.PublishRaw — turning the manual three-line closure
Package outboxnats wires db/outbox onto clients/natsmap's natsmap.PublishRaw — turning the manual three-line closure
sqb
Package sqb is an opt-in squirrel query-builder wrapper preconfigured for Postgres ($N placeholders).
Package sqb is an opt-in squirrel query-builder wrapper preconfigured for Postgres ($N placeholders).
testdb
Package testdb provides testing helpers that spin up Postgres containers via testcontainers-go and return ready-to-use *db.DB handles.
Package testdb provides testing helpers that spin up Postgres containers via testcontainers-go and return ready-to-use *db.DB handles.
Package errs defines typed domain errors for the fibermap kit.
Package errs defines typed domain errors for the fibermap kit.
errsval
Package errsval converts go-playground/validator errors into *errs.Error.
Package errsval converts go-playground/validator errors into *errs.Error.
examples
inbox-outbox command
Command inbox-outbox is a single-process demo of the kit's effectively-once event flow: producer commits a domain row + an outbox row inside one Tx; an outbox worker drains the table through natsmap to JetStream; a consumer wraps its handler with inboxnats so redelivery dedups against an inbox row committed atomically with the consumer's domain write.
Command inbox-outbox is a single-process demo of the kit's effectively-once event flow: producer commits a domain row + an outbox row inside one Tx; an outbox worker drains the table through natsmap to JetStream; a consumer wraps its handler with inboxnats so redelivery dedups against an inbox row committed atomically with the consumer's domain write.
resilience command
Command resilience is a single-process demo of the kit's three outbound-HTTP resilience features composed together: circuit breaker, concurrency bulkhead, and YAML-declarative apimap.
Command resilience is a single-process demo of the kit's three outbound-HTTP resilience features composed together: circuit breaker, concurrency bulkhead, and YAML-declarative apimap.
urlshort/shared/events
Package events is the SHARED event-payload contract between urlshort's three services (api / counter / enricher).
Package events is the SHARED event-payload contract between urlshort's three services (api / counter / enricher).
urlshort/shared/migrations
Package migrations exports the urlshort schema migrations as an fs.FS.
Package migrations exports the urlshort schema migrations as an fs.FS.
urlshort/urlshort-api command
Command urlshort-api is the HTTP frontend of the urlshort sample.
Command urlshort-api is the HTTP frontend of the urlshort sample.
urlshort/urlshort-api/internal/appctx
Package appctx defines the per-request AppCtx and a ContextBuilder that populates UserID from Bearer claims.
Package appctx defines the per-request AppCtx and a ContextBuilder that populates UserID from Bearer claims.
urlshort/urlshort-api/internal/config
Package config defines urlshort-api's environment configuration.
Package config defines urlshort-api's environment configuration.
urlshort/urlshort-api/internal/links
Package links holds the link domain — code generation, service, handlers.
Package links holds the link domain — code generation, service, handlers.
urlshort/urlshort-api/internal/publisher
Package publisher is api-side wiring for the LinkVisited HTTP publish.
Package publisher is api-side wiring for the LinkVisited HTTP publish.
urlshort/urlshort-api/internal/users
Package users owns the user account model — registration, password hashing, and the credentials verifier consumed by gokit/auth's LoginHandler.
Package users owns the user account model — registration, password hashing, and the credentials verifier consumed by gokit/auth's LoginHandler.
urlshort/urlshort-counter command
Command urlshort-counter is the batched visit-counter worker.
Command urlshort-counter is the batched visit-counter worker.
urlshort/urlshort-counter/internal/counter
Package counter is the batched NATS-subscriber side of urlshort.
Package counter is the batched NATS-subscriber side of urlshort.
urlshort/urlshort-enricher command
Command urlshort-enricher is the metadata-fetcher worker.
Command urlshort-enricher is the metadata-fetcher worker.
urlshort/urlshort-enricher/internal/enrich
Package enrich fetches title + description + image_url for a URL, using apimap for both the MicroLink lookup AND the open-client title fetch.
Package enrich fetches title + description + image_url for a URL, using apimap for both the MicroLink lookup AND the open-client title fetch.
urlshort/urlshort-enricher/internal/enricher
Package enricher is the NATS-subscriber side of urlshort's metadata fetching.
Package enricher is the NATS-subscriber side of urlshort's metadata fetching.
urlshort/urlshort-publisher command
Command urlshort-publisher is the HTTP→NATS gateway + outbox drainer of urlshort.
Command urlshort-publisher is the HTTP→NATS gateway + outbox drainer of urlshort.
Package fibermap loads YAML-described HTTP route trees and middleware chains into a Fiber router.
Package fibermap loads YAML-described HTTP route trees and middleware chains into a Fiber router.
bind
Package bind provides typed request parse + validation helpers for fibermap (or any Fiber) handlers.
Package bind provides typed request parse + validation helpers for fibermap (or any Fiber) handlers.
dev
Package dev wires the kit's dev-only DX tooling — HTML error pages with stack traces, route/config inspectors.
Package dev wires the kit's dev-only DX tooling — HTML error pages with stack traces, route/config inspectors.
factory
Package factory ships ready-made middleware factories and adapters for fibermap.Engine.
Package factory ships ready-made middleware factories and adapters for fibermap.Engine.
fibermaptest
Package fibermaptest provides assertion helpers for fibermap engines.
Package fibermaptest provides assertion helpers for fibermap engines.
openapi
Package openapi generates OpenAPI 3.0 specifications from a fibermap fibermap.Engine.
Package openapi generates OpenAPI 3.0 specifications from a fibermap fibermap.Engine.
sse
Package sse adds Server-Sent Events handlers to fibermap.
Package sse adds Server-Sent Events handlers to fibermap.
uploadguard
Package uploadguard is a Fiber middleware that validates an inbound multipart-form file field BEFORE the handler sees it.
Package uploadguard is a Fiber middleware that validates an inbound multipart-form file field BEFORE the handler sees it.
webhookguard
Package webhookguard ships a fiber middleware that verifies the signature of an inbound webhook payload against a clients/webhooks.Verifier.
Package webhookguard ships a fiber middleware that verifies the signature of an inbound webhook payload against a clients/webhooks.Verifier.
ws
Package ws adds WebSocket handlers to fibermap on top of github.com/gofiber/websocket/v2.
Package ws adds WebSocket handlers to fibermap on top of github.com/gofiber/websocket/v2.
wsnats
Package wsnats bridges browser WebSocket clients to NATS pub/sub.
Package wsnats bridges browser WebSocket clients to NATS pub/sub.
Package ids is the kit's standard prefixed-ULID utility.
Package ids is the kit's standard prefixed-ULID utility.
Package otelkit is the kit's thin OpenTelemetry tracing bootstrap.
Package otelkit is the kit's thin OpenTelemetry tracing bootstrap.
Package reqctx carries the per-request identifier (X-Request-ID) through context.Context for cross-package propagation.
Package reqctx carries the per-request identifier (X-Request-ID) through context.Context for cross-package propagation.
Package runbook is a runtime kill-switch primitive.
Package runbook is a runtime kill-switch primitive.
Package schemas bundles the JSON Schema (draft-07) documents for every kit YAML config.
Package schemas bundles the JSON Schema (draft-07) documents for every kit YAML config.
Package sentrykit is the kit's Sentry error-tracking bootstrap.
Package sentrykit is the kit's Sentry error-tracking bootstrap.
Package service bundles every gokit subpackage into a single runtime.
Package service bundles every gokit subpackage into a single runtime.

Jump to

Keyboard shortcuts

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