Skip to content

CharLemAznable/violet

Repository files navigation

violet

Build GitHub release (latest by date)

MIT Licence GitHub code size

Quality Gate Status

Reliability Rating Bugs

Security Rating Vulnerabilities

Maintainability Rating Technical Debt Code Smells

Lines of Code Coverage Duplicated Lines (%)

HTTP容错代理服务.

使用 resilience4go 包装代理请求.

支持:

  • 舱壁隔离
  • 限时
  • 限速
  • 熔断
  • 重试
  • 缓存
  • 故障恢复

配置样例

请参考: config_help.toml

数据平面

violet.NewDataPlane(*violet.Config)

  • 实现http.Handler接口, 按配置代理http请求
  • 支持配置热更新
  • 支持Prometheus监控指标收集

控制平面

violet.NewCtrlPlane(violet.DataPlane)

  • 实现http.Handler接口
    • /config: 响应返回当前配置
    • /metrics: 响应返回Prometheus指标数据
    • /circuitbreaker/disable: 停用指定Endpoint的熔断器, 使用url-query或post-form参数endpoint=xxx指定Endpoint
    • /circuitbreaker/force-open: 强制开启指定Endpoint的熔断器, 使用url-query或post-form参数endpoint=xxx指定Endpoint
    • /circuitbreaker/close: 关闭指定Endpoint的熔断器, 使用url-query或post-form参数endpoint=xxx指定Endpoint
    • /circuitbreaker/state: 查询指定Endpoint的熔断器的当前状态, 使用url-query或post-form参数endpoint=xxx指定Endpoint