Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit

Permalink
feat(docs): JSON schemas (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarampampam authored May 14, 2021
1 parent 2200977 commit 78d0f7c
Show file tree
Hide file tree
Showing 5 changed files with 936 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{yml, yaml, sh, conf}]
[*.{yml, yaml, json, sh, conf}]
indent_size = 2

[{Makefile, go.mod, *.go}]
Expand Down
278 changes: 278 additions & 0 deletions schemas/config/1.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Version 1.0 is deprecated. Please, upgrade RR up to version 2",
"type": "object",
"properties": {
"env": {
"type": "object",
"properties": {
"key": {
"type": "string"
}
}
},
"rpc": {
"type": "object",
"properties": {
"enable": {
"type": "boolean"
},
"listen": {
"type": "string"
}
}
},
"metrics": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"collect": {
"type": "object",
"patternProperties": {
"[a-zA-Z0-9-_]": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"help": {
"type": "string"
},
"labels": {
"type": "array",
"items": {}
},
"buckets": {
"type": "array",
"items": {}
}
}
}
}
}
}
},
"http": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"ssl": {
"type": "object",
"properties": {
"port": {
"type": "integer"
},
"redirect": {
"type": "boolean"
},
"cert": {
"type": "string"
},
"key": {
"type": "string"
},
"rootCa": {
"type": "string"
}
}
},
"fcgi": {
"type": "object",
"properties": {
"address": {
"type": "string"
}
}
},
"http2": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"h2c": {
"type": "boolean"
},
"maxConcurrentStreams": {
"type": "integer"
}
}
},
"maxRequestSize": {
"type": "integer"
},
"uploads": {
"type": "object",
"properties": {
"forbid": {
"type": "array",
"items": {}
}
}
},
"trustedSubnets": {
"type": "array",
"items": {}
},
"workers": {
"type": "object",
"properties": {
"command": {
"type": "string"
},
"relay": {
"type": "string"
},
"user": {
"type": "string"
},
"pool": {
"type": "object",
"properties": {
"numWorkers": {
"type": "integer"
},
"maxJobs": {
"type": "integer"
},
"allocateTimeout": {
"type": "integer"
},
"destroyTimeout": {
"type": "integer"
}
}
}
}
}
}
},
"headers": {
"type": "object",
"properties": {
"cors": {
"type": "object",
"properties": {
"allowedOrigin": {
"type": "string"
},
"allowedHeaders": {
"type": "string"
},
"allowedMethods": {
"type": "string"
},
"allowCredentials": {
"type": "boolean"
},
"exposedHeaders": {
"type": "string"
},
"maxAge": {
"type": "integer"
}
}
},
"request": {
"type": "object",
"patternProperties": {
"[a-zA-Z0-9-_]": {
"type": "string"
}
}
},
"response": {
"type": "object",
"patternProperties": {
"[a-zA-Z0-9-_]": {
"type": "string"
}
}
}
}
},
"limit": {
"type": "object",
"properties": {
"interval": {
"type": "integer"
},
"services": {
"type": "object",
"properties": {
"http": {
"type": "object",
"properties": {
"maxMemory": {
"type": "integer"
},
"TTL": {
"type": "integer"
},
"idleTTL": {
"type": "integer"
},
"execTTL": {
"type": "integer"
}
}
}
}
}
}
},
"static": {
"type": "object",
"properties": {
"dir": {
"type": "string"
},
"forbid": {
"type": "array",
"items": {}
}
}
},
"health": {
"type": "object",
"properties": {
"address": {
"type": "string"
}
}
},
"reload": {
"type": "object",
"properties": {
"interval": {
"type": "string"
},
"patterns": {
"type": "array",
"items": {}
},
"services": {
"type": "object",
"properties": {
"http": {
"type": "object",
"properties": {
"dirs": {
"type": "array",
"items": {}
},
"recursive": {
"type": "boolean"
}
}
}
}
}
}
}
}
}
Loading

0 comments on commit 78d0f7c

Please sign in to comment.