glber

command module
v0.0.0-...-9c2d3da Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址