godon

package module
v0.0.0-...-e548f88 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 9 Imported by: 0

README

godon

Godon is a simple load balancer built with golang.

Features

  • Load Balancing Algorithm
    • RoundRobin
  • HealthCheck
    • Active and passive check

Get started

See examples.

Appendix

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve()

Serve serves a loadbalancer.

Types

type Backend

type Backend struct {
	URL    string `json:"url"`
	IsDead bool
	// contains filtered or unexported fields
}

Backend is servers which load balancer is transferred.

func (*Backend) GetIsDead

func (backend *Backend) GetIsDead() bool

GetIsDead returns the value of IsDead in Backend.

func (*Backend) SetDead

func (backend *Backend) SetDead(b bool)

SetDead updates the value of IsDead in Backend.

type Config

type Config struct {
	Proxy    Proxy     `json:"proxy"`
	Backends []Backend `json:"backends"`
}

Config is a configuration.

type Proxy

type Proxy struct {
	Port string `json:"port"`
}

Proxy is a reverse proxy, and means load balancer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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