quota

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultServiceQuota  = util.GetEnvInt("QUOTA_SERVICE", defaultServiceLimit)
	DefaultInstanceQuota = util.GetEnvInt("QUOTA_INSTANCE", defaultInstanceLimit)
	DefaultSchemaQuota   = util.GetEnvInt("QUOTA_SCHEMA", defaultSchemaLimit)
	DefaultTagQuota      = util.GetEnvInt("QUOTA_TAG", defaultTagLimit)
	DefaultRuleQuota     = util.GetEnvInt("QUOTA_RULE", defaultRuleLimit)
)

Functions

This section is empty.

Types

type ApplyQuotaResource

type ApplyQuotaResource struct {
	QuotaType     ResourceType
	DomainProject string
	ServiceID     string
	QuotaSize     int64
}

func NewApplyQuotaResource

func NewApplyQuotaResource(quotaType ResourceType, domainProject, serviceID string, quotaSize int64) *ApplyQuotaResource

type ApplyQuotaResult

type ApplyQuotaResult struct {
	Err *scerr.Error
	// contains filtered or unexported fields
}

func NewApplyQuotaResult

func NewApplyQuotaResult(reporter Reporter, err *scerr.Error) *ApplyQuotaResult

func (*ApplyQuotaResult) Close

func (r *ApplyQuotaResult) Close(ctx context.Context)

func (*ApplyQuotaResult) ReportUsedQuota

func (r *ApplyQuotaResult) ReportUsedQuota(ctx context.Context) error

type Manager

type Manager interface {
	Apply4Quotas(ctx context.Context, res *ApplyQuotaResource) *ApplyQuotaResult
	RemandQuotas(ctx context.Context, quotaType ResourceType)
}

type Reporter

type Reporter interface {
	ReportUsedQuota(ctx context.Context) error
	Close(ctx context.Context)
}

type ResourceType

type ResourceType int
const (
	RuleQuotaType ResourceType = iota
	SchemaQuotaType
	TagQuotaType
	MicroServiceQuotaType
	MicroServiceInstanceQuotaType
)

func (ResourceType) String

func (r ResourceType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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