Documentation ¶
Overview ¶
Package quota manages run and tryjobs quotas per user
Index ¶
- type Manager
- func (qm *Manager) CreditRunQuota(ctx context.Context, r *run.Run) (*quotapb.OpResult, *cfgpb.UserLimit, error)
- func (qm *Manager) CreditTryjobQuota(ctx context.Context) (*quotapb.OpResult, error)
- func (qm *Manager) DebitRunQuota(ctx context.Context, r *run.Run) (*quotapb.OpResult, *cfgpb.UserLimit, error)
- func (qm *Manager) DebitTryjobQuota(ctx context.Context) (*quotapb.OpResult, error)
- func (qm *Manager) RunQuotaAccountID(r *run.Run) *quotapb.AccountID
- func (qm *Manager) WritePolicy(ctx context.Context, project string) (*quotapb.PolicyConfigID, error)
- type SrvQuota
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the quota accounts for CV users.
func NewManager ¶
NewManager creates a new quota manager.
func (*Manager) CreditRunQuota ¶
func (qm *Manager) CreditRunQuota(ctx context.Context, r *run.Run) (*quotapb.OpResult, *cfgpb.UserLimit, error)
CreditRunQuota credits the run quota into a given user's account.
func (*Manager) CreditTryjobQuota ¶
CreditTryjobQuota credits the tryjob quota into a given user's account.
func (*Manager) DebitRunQuota ¶
func (qm *Manager) DebitRunQuota(ctx context.Context, r *run.Run) (*quotapb.OpResult, *cfgpb.UserLimit, error)
DebitRunQuota debits the run quota from a given user's account.
func (*Manager) DebitTryjobQuota ¶
DebitTryjobQuota debits the tryjob quota from a given user's account.
func (*Manager) RunQuotaAccountID ¶
RunQuotaAccountID returns the account id of the run quota for the given run.
func (*Manager) WritePolicy ¶
func (qm *Manager) WritePolicy(ctx context.Context, project string) (*quotapb.PolicyConfigID, error)
WritePolicy writes lucicfg updates to the srvquota policies.
Click to show internal directories.
Click to hide internal directories.