cheryl

command module
v0.0.0-...-be629c2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 4 Imported by: 0

README

License

介绍

Cheryl 是由 Golang 编写的一款分布式微服务网关

下载

go get github.com/qiancijun/cheryl

快速开始

配置文件

name: node1
schema: http
port: 80
http_port: 9119
ssl_certificate:
ssl_certificate_key:
tcp_health_check: true
log_level: error
router_type: default
read_header_timeout: 10
read_timeout: 10
idle_timeout: 10
raft:
  data_dir: ./data
  tcp_address: 127.0.0.1:7000
  leader: true
  leader_address: 127.0.0.1:9119
  snapshot_interval: 20
  snapshot_threshold: 1
  log_level: info
  heartbeat_timeout: 10
  election_timeout: 10
location:                         # route matching for reverse proxy
  - pattern: /api
    proxy_pass:                   # URL of the reverse proxy
    - "http://localhost:8080"
    - "http://localhost:8081"
    # - "http://my-server.com"
    balance_mode: round-robin     # load balancing algorithm

Demo

package main

import (
	"github.com/qiancijun/cheryl/config"
	"github.com/qiancijun/cheryl/cheryl"
)

func main() {
	conf, err := config.ReadConfig("./config.yaml")
	if err != nil {
		panic(err)
	}
	cheryl.Start(conf)
}

启动成功后,访问9119端口查看WebUI页面

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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