balancer

package
v0.37.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 4 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 {
	Volumes *orderedmap.OrderedMap[int64, VolumeInfo]
}

Simple balancing to retrieve the next volume and its server's public URL, checking for free space

func New

func New() *Balancer

func (*Balancer) Next

func (b *Balancer) Next(minSpace int64) (*Volume, error)

Gets the next volume that has enough space to store the file

func (*Balancer) Track added in v0.12.0

func (b *Balancer) Track(pubURL string, volumes []*proto.VolumesAcknowledgeRequest_Volume) error

Tracks the given volumes in the balancer, sorting them by id

func (*Balancer) Untrack added in v0.12.0

func (b *Balancer) Untrack(pubURL string, volumes []*proto.VolumesAcknowledgeRequest_Volume)

Removes the given volumes from the balancer

type Volume

type Volume struct {
	Id int64
	VolumeInfo
}

type VolumeInfo added in v0.22.0

type VolumeInfo struct {
	PublicUrl string
	FreeSpace int64
}

Jump to

Keyboard shortcuts

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