All Projects → 4paradigm → Cfg Center

4paradigm / Cfg Center

Licence: apache-2.0
高性能配置读取服务器,为Yaml配置文件提供JSON RESTful读取接口

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Cfg Center

Bricks
A standard library for microservices.
Stars: ✭ 142 (+264.1%)
Mutual labels:  restful-api, json
Airframe
Essential Building Blocks for Scala
Stars: ✭ 442 (+1033.33%)
Mutual labels:  config, json
Verify Json
verify-json
Stars: ✭ 208 (+433.33%)
Mutual labels:  restful-api, json
Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (+25.64%)
Mutual labels:  restful-api, json
Dasel
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Stars: ✭ 759 (+1846.15%)
Mutual labels:  config, json
Jokeapi
A REST API that serves uniformly and well formatted jokes in JSON, XML, YAML or plain text format that also offers a great variety of filtering methods
Stars: ✭ 71 (+82.05%)
Mutual labels:  restful-api, json
Quicklib
Quick development library (AutoMapper, LinQ, IOC Dependency Injection, MemoryCache, Scheduled tasks, Config, Serializers, etc) with crossplatform support for Delphi/Firemonkey (Windows,Linux,OSX/IOS/Android) and freepascal (Windows/Linux).
Stars: ✭ 274 (+602.56%)
Mutual labels:  config, json
Config
🛠 A configuration library for Go that parses environment variables, JSON files, and reloads automatically on SIGHUP
Stars: ✭ 203 (+420.51%)
Mutual labels:  config, json
Conf
Simple config handling for your app or module
Stars: ✭ 707 (+1712.82%)
Mutual labels:  config, json
Jsonnet
Jsonnet - The data templating language
Stars: ✭ 5,257 (+13379.49%)
Mutual labels:  config, json
Vscode Data Preview
Data Preview 🈸 extension for importing 📤 viewing 🔎 slicing 🔪 dicing 🎲 charting 📊 & exporting 📥 large JSON array/config, YAML, Apache Arrow, Avro, Parquet & Excel data files
Stars: ✭ 245 (+528.21%)
Mutual labels:  config, json
Html Pdf Service
LGPL V3. Java Spring Boot microservice with RESTful webconsole and service endpoints that convert HTML to PDF, optionally styling with CSS and templating with JSON using Flying Saucer, PDF Box and Jackson libraries. Available on Docker Hub.
Stars: ✭ 12 (-69.23%)
Mutual labels:  restful-api, json
Konf
A type-safe cascading configuration library for Kotlin/Java/Android, supporting most configuration formats
Stars: ✭ 225 (+476.92%)
Mutual labels:  config, json
Swurg
Parse OpenAPI documents into Burp Suite for automating OpenAPI-based APIs security assessments (approved by PortSwigger for inclusion in their official BApp Store).
Stars: ✭ 94 (+141.03%)
Mutual labels:  restful-api, json
Config
📝 Go config manage(load,get,set). support JSON, YAML, TOML, INI, HCL, ENV and Flags. Multi file load, data override merge, parse ENV var. Go应用配置加载管理,支持多种格式,多文件加载,远程文件加载,支持数据合并,解析环境变量名
Stars: ✭ 225 (+476.92%)
Mutual labels:  config, json
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (+548.72%)
Mutual labels:  restful-api, json
Goconfig
goconfig uses a struct as input and populates the fields of this struct with parameters from command line, environment variables and configuration file.
Stars: ✭ 146 (+274.36%)
Mutual labels:  config, json
Simple Settings
A simple way to manage your project settings.
Stars: ✭ 165 (+323.08%)
Mutual labels:  config, json
Featureflags
🚩 Allows developers to configure feature flags, run multiple A/B tests or phase feature roll out using a JSON configuration file.
Stars: ✭ 506 (+1197.44%)
Mutual labels:  config, json
Config Rs
⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
Stars: ✭ 915 (+2246.15%)
Mutual labels:  config, json

配置管理

目标

配置管理中心的目标是将我式的所有运维、业务相关的配置集中在一处进行管理。 这样做的好处主要有以下几点:

  1. 集中配置,减少重复、冲突配置。
  2. 简化多个环境,多套部署的配置管理。

原理

cfg-center类似于etcd、zookeeper之类的配置管理中心服务,主要区别如下:

  1. 采用直白的yaml配置文件作为配置存储,方便现场部署时进行修改和debug。
  2. 代码量少,超轻量级设计。
  3. inotify关注配置修改,保证高性能。
  4. RESTful请求接口,JSON响应格式,直白易操作。
  5. 不依赖任何非必须系统库。

部署

部署目录结构如下:

├── bin                     # 主程序和运维脚本
│   ├── cfg-center
│   ├── restart.sh
│   ├── start.sh
│   └── stop.sh
├── conf_data               # cfg-center的配置数据
│   ├── ...(参见下面)
│   └── ...
└── log                     # 日志目录
    └── cfg-center.log

其中conf_data目录作为配置文件的唯一存储区域,目录结构如下

└── conf_data               # cfg-center的配置数据目录
    ├── aws.yaml            # 配置文件,Amazon环境                       
    ├── azure.yaml          # 配置文件,Azure环境            
    ├── test1.yaml          # 配置文件,test1环境     
    └── bank.yaml           # 配置文件,XX银行环境       

上述目录将会保存在git中,在开发&测试时直接用命令行工具、浏览器、Java/Python SDK请求即可。

yaml配置如下,后面有示例

模块1:
    配置key: 配置value
    配置key: 配置value
    配置key: 配置value
模块2:
    配置key: 配置value
    配置key: 配置value

配置格式管理规范

cfg-center启动后会采用conf_data目录的配置数据,使用默认端口:2120

假设conf_data/bank.yaml的内容如下:

dummyWorkder:
    slotStatement: select * from A

task-manager:
    serverPort: 9876
    dbURL: "jdbc:mariadb://localhost:3306/TM"
    dbUser: root

我们想要获取bank环境的task-managerdbURL配置, 那么请求 http://cfg-center:port/conf/bank/task-manager/dbURL 将会得到HTTP响应:

"jdbc:mariadb://localhost:3306/TM"

请求http://cfg-center:port/conf/bank/task-manager 将会得到HTTP响应:

{
    acquireIncrement: 1,
    dbPassword: "1qaz",
    dbURL: "jdbc:mariadb://localhost:3306/TM",
    dbUser: "root",
    maxPoolSize: 10,
    minPoolSize: 2,
    serverPort: 9876
}

所以获取配置就是要访问如下URL: http://cfg-center:port/conf/{环境}/{模块}/{yaml中的key}

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].