driver

package
v0.0.0-...-e4b6a09 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, driver Driver)

Register register quota driver

Types

type Driver

type Driver interface {
	// Enabled returns true when quota enabled for the ref object
	Enabled(ctx context.Context, key string) (bool, error)
	// HardLimits returns default resource list
	HardLimits(ctx context.Context) types.ResourceList
	// Load returns quota ref object by key
	Load(ctx context.Context, key string) (RefObject, error)
	// Validate validate the hard limits
	Validate(hardLimits types.ResourceList) error
	// CalculateUsage calculate quota usage by reference id
	CalculateUsage(ctx context.Context, key string) (types.ResourceList, error)
}

Driver the driver for quota

func Get

func Get(name string) (Driver, bool)

Get returns quota driver by name

type RefObject

type RefObject map[string]interface{}

RefObject type for quota ref object

Jump to

Keyboard shortcuts

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