quota

package
v1.4.17 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package quota provides functions to fetch and check quotas for various cloud environments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constraint

type Constraint struct {
	Name string
	// This should be global or specific region.
	Region string
	// Count is the number of the resource that is required
	// to be free for use.
	Count int64
}

Constraint defines a check against availablity for a resource quota.

type ConstraintReport

type ConstraintReport struct {
	For     *Constraint
	Result  ConstraintReportResult
	Message string
}

ConstraintReport provides result for a given constraint.

func Check

func Check(quotas []Quota, checks []Constraint) ([]ConstraintReport, error)

Check returns whether the checks constraints are possible gives the quotas. It returns an erros when any one of the constraint's result was `NotAvailable` or `Unknown`

type ConstraintReportResult

type ConstraintReportResult string

ConstraintReportResult provide one word result for the constraint

const (
	// Available corresponds to a constraint that is available.
	Available ConstraintReportResult = "Available"
	// AvailableButLow corresponds to a constraint that is available but there is very low overhead after satisfying the constraint.
	AvailableButLow ConstraintReportResult = "AvailableButLow"
	// NotAvailable corresponds to a constraint that is not available.
	NotAvailable ConstraintReportResult = "NotAvailable"
	// Unknown corresponds to a constraint that could not be calculated.
	Unknown ConstraintReportResult = "Unknown"
)

type Quota

type Quota struct {
	Service string
	Name    string
	Region  string

	InUse int64
	Limit int64

	Unlimited bool
}

Quota stores the used and limit for a resouce's quota.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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