Documentation ¶
Index ¶
- Constants
- func AddQuotaHandler(manager *SQuotaManager, prefix string, app *appsrv.Application)
- type IQuota
- type IQuotaStore
- type SDBQuotaStore
- type SMemoryQuotaStore
- type SQuotaManager
- func (manager *SQuotaManager) CancelPendingUsage(ctx context.Context, userCred mcclient.TokenCredential, projectId string, ...) error
- func (manager *SQuotaManager) CheckQuota(ctx context.Context, userCred mcclient.TokenCredential, projectId string, ...) (IQuota, error)
- func (manager *SQuotaManager) CheckSetPendingQuota(ctx context.Context, userCred mcclient.TokenCredential, projectId string, ...) error
- func (manager *SQuotaManager) GetPendingUsage(ctx context.Context, projectId string, quota IQuota) error
- func (manager *SQuotaManager) GetQuota(ctx context.Context, projectId string, quota IQuota) error
- func (manager *SQuotaManager) Keyword() string
- func (manager *SQuotaManager) SetQuota(ctx context.Context, userCred mcclient.TokenCredential, projectId string, ...) error
Constants ¶
View Source
const (
METADATA_KEY = "quota"
)
Variables ¶
This section is empty.
Functions ¶
func AddQuotaHandler ¶
func AddQuotaHandler(manager *SQuotaManager, prefix string, app *appsrv.Application)
Types ¶
type IQuotaStore ¶
type SDBQuotaStore ¶
type SDBQuotaStore struct { }
func NewDBQuotaStore ¶
func NewDBQuotaStore() *SDBQuotaStore
func (*SDBQuotaStore) SetQuota ¶
func (store *SDBQuotaStore) SetQuota(ctx context.Context, userCred mcclient.TokenCredential, tenantId string, quota IQuota) error
type SMemoryQuotaStore ¶
type SMemoryQuotaStore struct {
// contains filtered or unexported fields
}
func NewMemoryQuotaStore ¶
func NewMemoryQuotaStore() *SMemoryQuotaStore
func (*SMemoryQuotaStore) SetQuota ¶
func (self *SMemoryQuotaStore) SetQuota(ctx context.Context, userCred mcclient.TokenCredential, tenantId string, quota IQuota) error
type SQuotaManager ¶
type SQuotaManager struct {
// contains filtered or unexported fields
}
func NewQuotaManager ¶
func NewQuotaManager(keyword string, quotaData interface{}, persist IQuotaStore, pending IQuotaStore) *SQuotaManager
func (*SQuotaManager) CancelPendingUsage ¶
func (manager *SQuotaManager) CancelPendingUsage(ctx context.Context, userCred mcclient.TokenCredential, projectId string, localUsage IQuota, cancelUsage IQuota) error
func (*SQuotaManager) CheckQuota ¶
func (manager *SQuotaManager) CheckQuota(ctx context.Context, userCred mcclient.TokenCredential, projectId string, request IQuota) (IQuota, error)
func (*SQuotaManager) CheckSetPendingQuota ¶
func (manager *SQuotaManager) CheckSetPendingQuota(ctx context.Context, userCred mcclient.TokenCredential, projectId string, quota IQuota) error
func (*SQuotaManager) GetPendingUsage ¶
func (*SQuotaManager) Keyword ¶
func (manager *SQuotaManager) Keyword() string
func (*SQuotaManager) SetQuota ¶
func (manager *SQuotaManager) SetQuota(ctx context.Context, userCred mcclient.TokenCredential, projectId string, quota IQuota) error
Click to show internal directories.
Click to hide internal directories.