How devravik/go-license-api works
Go License API is a self-hosted, multi-tenant licensing service. In the main online workflow, a client submits a license validation request; routing and middleware protect it, a bounded worker pool runs validation, and the service checks cached license and tenant data before returning a result. The control plane manages tenants, licenses, plans, and products, with database updates and cache consistency. Documented capabilities also include activation and usage, offline signed licenses, audit logging, webhooks, key rotation, and rate limiting. Some links reflect README-described behavior because the corresponding implementation excerpts were not available.
Main entry points: router.go Route Setup · license/handler.go License Handler · admin/handler.go Admin Handler · validation_service.go License Validation
Components 19
HTTP API
- Route Setup
internal/http/router.go - License Handler
internal/http/license/handler.go - Activation Handler
internal/http/handlers/activation_handler.go - Admin Handler
internal/http/admin/handler.go - Request Guards
internal/http/middleware
Validation Runtime
- License Validation
internal/app/validation_service.go - Activation Service
internal/app/activation_service.go - Worker Pool
internal/worker/pool.go - Validation Worker
internal/worker/worker.go - Offline Licenses
internal/http/handlers/signed_license_handler.go
Control Plane
- Admin Services
internal/app/admin_service.go - Tenant API
internal/http/tenant/handler.go
Infrastructure
- PostgreSQL
internal/infrastructure/db/postgres.go - License Cache
internal/infrastructure/cache/license_store.go - Redis L2 Cache
internal/infrastructure/cache/l2_redis.go - Audit Pipeline
internal/infrastructure/audit/worker.go - Webhook Delivery
internal/webhook/dispatcher.go - License Signing
internal/security/signer.go
Other components
- License Client
Connections 19
- License Client → Route Setup: sends request
- Route Setup → Request Guards: applies guards
internal/http/router.go - Route Setup → License Handler: routes validation
internal/http/router.go - License Handler → Worker Pool: submits validation
- Worker Pool → Validation Worker: dispatches jobs
internal/worker/worker.go - Validation Worker → License Validation: executes validation
internal/worker/worker.go - License Validation → License Cache: checks cache
- License Cache → Redis L2 Cache: checks L2
- License Handler → Activation Handler: serves activation routes
- Activation Handler → Activation Service: handles activation
internal/http/handlers/activation_handler.go - Route Setup → Admin Handler: routes admin requests
internal/http/router.go - Admin Handler → Admin Services: invokes management
internal/http/admin/handler.go - Route Setup → Tenant API: routes tenant requests
internal/http/router.go - Admin Services → PostgreSQL: persists changes
- Admin Services → License Cache: updates cache
internal/app/admin_service.go - License Validation → Audit Pipeline: records events
- Admin Handler → Webhook Delivery: registers callbacks
- License Client → Offline Licenses: verifies offline
- Offline Licenses → License Signing: verifies signature