Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAO ¶
type DAO interface { // Count returns the total count of quotas according to the query. Count(ctx context.Context, query *q.Query) (int64, error) // Create create quota for reference object Create(ctx context.Context, reference, referenceID string, hardLimits, used types.ResourceList) (int64, error) // Delete delete quota by id Delete(ctx context.Context, id int64) error // Get returns quota by id Get(ctx context.Context, id int64) (*models.Quota, error) // GetByRef returns quota by reference object GetByRef(ctx context.Context, reference, referenceID string) (*models.Quota, error) // Update update quota Update(ctx context.Context, quota *models.Quota) error // List list quotas List(ctx context.Context, query *q.Query) ([]*models.Quota, error) }
DAO the dao for Quota and QuotaUsage
type Quota ¶
type Quota struct { ID int64 `orm:"pk;auto;column(id)" json:"id"` Reference string `orm:"column(reference)" json:"reference"` // The reference type for quota, eg: project, user ReferenceID string `orm:"column(reference_id)" json:"reference_id"` Hard string `orm:"column(hard);type(jsonb)" json:"-"` CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"` UpdateTime time.Time `orm:"column(update_time);auto_now" json:"update_time"` Version int64 `orm:"column(version)" json:"-"` }
Quota model for quota
type QuotaUsage ¶
type QuotaUsage struct { ID int64 `orm:"pk;auto;column(id)" json:"id"` Reference string `orm:"column(reference)" json:"reference"` // The reference type for quota usage, eg: project, user ReferenceID string `orm:"column(reference_id)" json:"reference_id"` Used string `orm:"column(used);type(jsonb)" json:"-"` CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"` UpdateTime time.Time `orm:"column(update_time);auto_now" json:"update_time"` Version int64 `orm:"column(version)" json:"-"` }
QuotaUsage model for quota usage
func (*QuotaUsage) TableName ¶
func (qu *QuotaUsage) TableName() string
TableName returns table name for orm
Click to show internal directories.
Click to hide internal directories.