gateway-nginx/src
Type Aliases
FieldRef
FieldRef = object
Defined in: packages/gateway-nginx/src/types.ts:5
Properties
path
path: string
Defined in: packages/gateway-nginx/src/types.ts:6
source
source:Defined in: packages/gateway-nginx/src/types.ts:7"body"|"headers"|"status"
GeneratorInput
GeneratorInput = object
Defined in: packages/gateway-nginx/src/types.ts:21
Properties
extraDirectives?
Defined in: packages/gateway-nginx/src/types.ts:27optionalextraDirectives:string[]
routes
routes: RouteConfig[]
Defined in: packages/gateway-nginx/src/types.ts:22
sidecarURL
sidecarURL: string
Defined in: packages/gateway-nginx/src/types.ts:23
sitePrefix?
Defined in: packages/gateway-nginx/src/types.ts:26optionalsitePrefix:string
specRoot?
Defined in: packages/gateway-nginx/src/types.ts:25optionalspecRoot:string
upstreamURL
upstreamURL: string
Defined in: packages/gateway-nginx/src/types.ts:24
GeneratorOutput
GeneratorOutput = object
Defined in: packages/gateway-nginx/src/types.ts:30
Properties
locationsConf
locationsConf: string
Defined in: packages/gateway-nginx/src/types.ts:31
luaFiles
luaFiles:Defined in: packages/gateway-nginx/src/types.ts:32Map<string,string>
warnings
warnings: string[]
Defined in: packages/gateway-nginx/src/types.ts:33
PricingMode
PricingMode =Defined in: packages/gateway-nginx/src/types.ts:10"two-phase"|"one-phase"
RouteConfig
RouteConfig = object
Defined in: packages/gateway-nginx/src/types.ts:12
Properties
captureFields
captureFields: FieldRef[]
Defined in: packages/gateway-nginx/src/types.ts:18
method
method: string
Defined in: packages/gateway-nginx/src/types.ts:14
path
path: string
Defined in: packages/gateway-nginx/src/types.ts:13
pricingMode
pricingMode: PricingMode
Defined in: packages/gateway-nginx/src/types.ts:17
pricingRules
pricingRules:Defined in: packages/gateway-nginx/src/types.ts:15Record<string,string>
transportType
transportType: TransportType
Defined in: packages/gateway-nginx/src/types.ts:16
TransportType
TransportType =Defined in: packages/middleware-openapi/dist/src/types.d.ts:21"json"|"sse"|"websocket"
Functions
analyzeRule()
analyzeRule(Defined in: packages/gateway-nginx/src/analyzer.ts:193rule):AnalysisResult
Parameters
rule
AnalyzedRule
Returns
AnalysisResult
convertPath()
convertPath(Defined in: packages/gateway-nginx/src/path.ts:108path):LocationDirective
Parameters
path
string
Returns
LocationDirective
detectOverlaps()
detectOverlaps(Defined in: packages/gateway-nginx/src/path.ts:119paths):string[]
Parameters
paths
string[]
Returns
string[]
extractGatewaySpec()
extractGatewaySpec(Defined in: packages/gateway-nginx/src/parser.ts:72 Convert an already-dereferenced OpenAPI document into an nginx-ready route set. Runs the same validation as loadGatewaySpec.doc):ParsedSpec
Parameters
doc
Record<string, unknown>
Returns
ParsedSpec
generateConfig()
generateConfig(Defined in: packages/gateway-nginx/src/index.ts:24 Generate nginx location blocks and a bundled Lua module for a set of parsed routes. Produces:input):GeneratorOutput
-
locationsConf— the location block text. The operator includes this inside their ownserver { }block viainclude locations.conf;. -
luaFiles— standalone Lua modules that the generated config willrequire()at runtime. The operator places these in theirlua_package_path. Currently produces a singlefaremeter.luabundle. -
warnings— non-fatal concerns detected at generation time.
Parameters
input
GeneratorInput
Returns
GeneratorOutput
generateLuaFiles()
generateLuaFiles():Defined in: packages/gateway-nginx/src/lua/index.ts:21Map<string,string>
Returns
Map<string, string>
generateNginxConf()
generateNginxConf(Defined in: packages/gateway-nginx/src/nginx/index.ts:18opts):NginxGeneratorResult
Parameters
opts
NginxGeneratorOpts
Returns
NginxGeneratorResult
loadGatewaySpec()
loadGatewaySpec(Defined in: packages/gateway-nginx/src/parser.ts:63 Load and parse an OpenAPI spec file into an nginx-ready route set.filePath):Promise<ParsedSpec>
Parameters
filePath
string
Returns
Promise<ParsedSpec>