fastest

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

type Balancer struct {
	Filter   loadbalance.Filter
	LastSync time.Time
	Endpoint string
	// contains filtered or unexported fields
}

Balancer is a custom load balancer that selects connections based on their response time.

func (*Balancer) Pick

Pick selects the connection with the least response time.

type Builder

type Builder struct {
	Filter   loadbalance.Filter
	Endpoint string
	Query    string
	Interval time.Duration
}

func (*Builder) Build

func (b *Builder) Build(info base.PickerBuildInfo) balancer.Picker

Build creates a new Balancer and starts a background goroutine to update connections' response times.

type Conn added in v0.0.3

type Conn struct {
	SubConn  balancer.SubConn
	Address  resolver.Address
	Response time.Duration // Response time of the connection.
}

Conn represents a connection with its address and response time.

Jump to

Keyboard shortcuts

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