glber

command module
v0.0.0-...-3be6b84 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 5 Imported by: 0

README

glber GoDoc Go Report Card

glber is a simple lightweight load balancer written in golang.

Requirement

Go (>= 1.9)

Installation

go get github.com/hlts2/glber

Example

Config file

Config file config.yml describes configuration of load balancer. The following is a setting example.

host: 0.0.0.0
port: 80
balancing: round-robin
tls:
  enabled: true
  cert_key: ./cert.key
  key_key: ./key.key
servers:
  - scheme: http
    host: 192.168.33.11
    port: 1111
  - scheme: http
    host: 192.168.33.11
    port: 2222
  - scheme: http
    host: 192.168.33.11

Balancing Algorithm

There are three possible algorithms for balancing

Please write algorithm name in balancing field of config.yml file

balancing: round-robin # or ip-hash or least-connections
Basic Example
$ glber serve -s config.yml

CLI Usage

$ glber --help
NAME:
   glber - Load Balancer

USAGE:
   glber [global options] command [command options] [arguments...]

VERSION:
   v1.0.0

COMMANDS:
     serve    serve load balancer
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version
Serve command
$ glber serve --help
NAME:
   glber serve - serve load balancer

USAGE:
   glber serve [command options] [arguments...]

OPTIONS:
   --set value, -s value  set the configuration file (default: "config.yml")

TODO

  • Helth check of service

Author

hlts2

LICENSE

glber released under MIT license, refer LICENSE file.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
slb

Jump to

Keyboard shortcuts

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