balancer

package
v0.0.0-...-ab065fd Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundInstance = errors.New("not found instance")
	ErrEmptyInstance    = errors.New("empty instance")
)
View Source
var (
	DefaultOptions = Options{
		Index: 0,
		Key:   "dead",
	}
)

Functions

This section is empty.

Types

type IBalancer

type IBalancer interface {
	Init(...Option)
	Options() Options
	DoBalance([]*Instance, ...Option) (*Instance, error)
	String() string
}

type Instance

type Instance struct {
	Ip   string
	Port int
}

type Option

type Option func(o *Options)

func WithIndex

func WithIndex(index uint32) Option

func WithKey

func WithKey(key string) Option

type Options

type Options struct {
	Index uint32
	Key   string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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