ratel

package module
v2.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

README

Ratel

Go Go Report Card goproxy codecov Release

Ratel 介绍

Ratel 一套微服务治理框架,集成了各种工程实践的 web 和 rpc 框架。

优点:

  • 轻松获得支撑千万日活服务的稳定性
  • 内建级联超时控制、限流、自适应熔断、自适应降载等微服务治理能力,无需配置和额外代码
  • 微服务治理中间件可无缝集成到其它现有框架使用
  • 大量微服务治理和并发工具包

Ratel 目的

  • 高效的性能
  • 简洁的语法
  • 广泛验证的工程效率
  • 极致的部署体验
  • 极低的服务端资源成本

Ratel 思考

  • 保持简单,第一原则
  • 弹性设计,面向故障编程
  • 工具大于约定和文档
  • 高可用
  • 高并发
  • 易扩展
  • 对业务开发友好,封装复杂度
  • 约束做一件事只有一种方式

Ratel 特性

  • 统一的指标采集
  • 链路追踪
  • 日志埋点
  • 统一错误处理
  • 动态配置
  • 安全策略
  • Debug 模式 等,可以极大的提高应用开发效率
  • 强大的工具支持,尽可能少的代码编写
  • 极简的接口
  • 完全兼容 net/http
  • 支持中间件,方便扩展
  • 高性能
  • 面向故障编程,弹性设计
  • 内建服务发现、负载均衡
  • 内建限流、熔断、降载,且自动触发,自动恢复
  • API 参数自动校验
  • 超时级联控制
  • 自动缓存控制
  • 链路跟踪、统计报警等
  • 高并发支撑,稳定保障了疫情期间每天的流量洪峰

Documentation

Index

Constants

View Source
const (
	//StageAfterStop after app stop
	StageAfterStop uint32 = iota + 1
	//StageBeforeStop before app stop
	StageBeforeStop
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Ratel

type Ratel struct {
	// contains filtered or unexported fields
}

Ratel Create an instance of Application, by using &Ratel{}

var App *Ratel

func New

func New(fns ...func() error) (*Ratel, error)

New new a Application

func (*Ratel) GracefulStop

func (app *Ratel) GracefulStop(ctx context.Context) (err error)

GracefulStop application after necessary cleanup

func (*Ratel) RegisterHooks

func (app *Ratel) RegisterHooks(k uint32, fns ...func() error) error

RegisterHooks register a stage Hook

func (*Ratel) Registry

func (app *Ratel) Registry(reg registry.Registry) *Ratel

Registry set customize registry

func (*Ratel) Run

func (app *Ratel) Run(servers ...server.Server) error

Run run application

func (*Ratel) Serve

func (app *Ratel) Serve(s ...server.Server) error

Serve start server

func (*Ratel) Startup

func (app *Ratel) Startup(fns ...func() error) error

Startup ..

func (*Ratel) Stop

func (app *Ratel) Stop() (err error)

Stop application immediately after necessary cleanup

func (*Ratel) Tracer

func (app *Ratel) Tracer(name, host string) *Ratel

Tracer ...

func (*Ratel) Worker

func (app *Ratel) Worker(w worker.Worker) *Ratel

Worker ..

Directories

Path Synopsis
client
ftp
Package config is a go config management implement.
Package config is a go config management implement.
dotnev
Package dotnev provide load .env data to os ENV Deprecated: please use github.com/gookit/ini/v2/dotenv
Package dotnev provide load .env data to os ENV Deprecated: please use github.com/gookit/ini/v2/dotenv
hcl
Package hcl is driver use HCL format content as config source about HCL, please see https://github.com/hashicorp/hcl
Package hcl is driver use HCL format content as config source about HCL, please see https://github.com/hashicorp/hcl
hclv2
Package hclv2 is driver use HCL format content as config source about HCL, please see https://github.com/hashicorp/hcl docs for HCL v2 https://pkg.go.dev/github.com/hashicorp/hcl/v2
Package hclv2 is driver use HCL format content as config source about HCL, please see https://github.com/hashicorp/hcl docs for HCL v2 https://pkg.go.dev/github.com/hashicorp/hcl/v2
ini
Package ini is driver use INI format content as config source about ini parse, please see https://github.com/gookit/ini/parser
Package ini is driver use INI format content as config source about ini parse, please see https://github.com/gookit/ini/parser
json
Package json use the https://github.com/json-iterator/go for parse json
Package json use the https://github.com/json-iterator/go for parse json
json5
Package json5 use the https://github.com/yosuke-furukawa/json5 for parse json5
Package json5 use the https://github.com/yosuke-furukawa/json5 for parse json5
other
Package other is an example of a custom driver
Package other is an example of a custom driver
toml
Package toml is driver use TOML format content as config source Usage please see example:
Package toml is driver use TOML format content as config source Usage please see example:
yaml
Package yaml is a driver use YAML format content as config source Usage please see example:
Package yaml is a driver use YAML format content as config source Usage please see example:
yamlv3
Package yaml is a driver use YAML format content as config source Usage please see example:
Package yaml is a driver use YAML format content as config source Usage please see example:
gen
gin
img
es
rpc
store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL