scheduler

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPHashName = "iphash"
	RandomName = "random"
)

Variables

This section is empty.

Functions

func IP2Long

func IP2Long(ipstr string) uint32

IP2Long ip to int

func LocalIPAddrs

func LocalIPAddrs() []string

LocalIPAddrs get local public address

func Long2IP

func Long2IP(ipLong uint32) string

Long2IP int to ip

func Register

func Register(name string, handle Scheduler)

Registration scheduler

Types

type IPHash

type IPHash struct {
}

IPHash IP-based scheduler

func (*IPHash) Schedule

func (strategy *IPHash) Schedule(client string, servers []string) string

Schedule 调度

type Random

type Random struct {
}

Random Random scheduler

func (*Random) Schedule

func (strategy *Random) Schedule(client string, servers []string) string

Schedule Dispatch

type Scheduler

type Scheduler interface {
	Schedule(client string, servers []string) string
}

scheduler

func Get

func Get(name string) Scheduler

Get scheduler

Jump to

Keyboard shortcuts

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