quota

package
v0.90.17 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

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