How amosehiguese/tyk works
Project type and purpose
• This is Tyk API Gateway—a high-performance, open-source API Gateway written in Go.
• It supports REST, GraphQL, gRPC and TCP protocols, and is extensible via middleware and plugins.
• It can run as a standalone Go service (main.go), in Docker/Kubernetes, and integrates with Redis, Consul, Vault, tracing backends, etc.
File structure
• Top-level “main.go” kicks off the Gateway process.
• “gateway/” package contains core HTTP/gRPC/TCP server, request routing, middleware chain, store adapters and analytics.
• “apidef/” package implements the API-definition adapters for OpenAPI, GraphQL, asyncAPI, etc.
• “config/” loads runtime configuration (config file, env vars, tracing, external services).
• “storage/”, “rpc/”, “dnscache/”, “redis/” etc. implement pluggable backends for rate-limit, sessions, discovery.
• “ee/” holds enterprise-only middleware (streams, OAuth, upstream auth, etc.).
• “cli/” provides command-line utilities (linter, importer, bundler).
• “coprocess/” provides the plugin engine via gRPC/protobuf for Go/Python/Java/Lua plugins.
• “trace/” integrates with Jaeger and Zipkin.
README for additional insights
• Tyk Gateway is “batteries-included” and provides features like rate limiting, quotas, transformations, analytics, service discovery, hitless reloads, and plug-in architecture.