package
0.0.0-20250307173044-634e8ce82c05
Repository: https://github.com/sapcc/go-bits.git
Documentation: pkg.go.dev
# Functions
AtLeastZero safely converts int values (which often appear in Gophercloud types) to uint64 by clamping negative values to 0.
DistributeDemandFairly is used to distribute cluster capacity or cluster-wide usage between different resources.
DistributeFairly takes a number of resource requests, as well as a total available capacity, and tries to fulfil all requests as fairly as possible.
NewClient creates a Client for interacting with a liquid.
RestrictToKnownAZs takes a mapping of objects sorted by AZ, and moves all objects in unknown AZs into the pseudo-AZ "unknown".
Run spawns an HTTP server that serves the LIQUID API, using the provided Logic to answer requests.
SaturatingSub is like `lhs - rhs`, but never underflows below 0.
# Structs
Client provides structured access to a LIQUID API.
ClientOpts contains additional options for NewClient().
RunOpts provides configuration to func Run().
State contains data that is guarded by an RWMutex, such that the data cannot be accessed without using the mutex.
# Interfaces
Logic is the interface for types that implement the core logic of a liquid.