storj/satellite/console/projectusagelimits.go
Michał Niewrzał 3f0babffe8 satellite/{console,satellitedb}: add project segment limit to user
All limits we have for projects have also parent limits stored
with user data. New created project is first taking limits from
owner (user) limits.
This change is extending users table with project_segment_limit
column and adds functionality to get and set value for this
column.

Change-Id: Iff5e36c62b517652390b649fc05992475916ecff
2021-12-16 08:46:01 +00:00

24 lines
776 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package console
import "storj.io/common/memory"
// ProjectUsageLimits holds project usage limits and current usage.
type ProjectUsageLimits struct {
StorageLimit int64 `json:"storageLimit"`
BandwidthLimit int64 `json:"bandwidthLimit"`
StorageUsed int64 `json:"storageUsed"`
BandwidthUsed int64 `json:"bandwidthUsed"`
ObjectCount int64 `json:"objectCount"`
SegmentCount int64 `json:"segmentCount"`
}
// UserProjectLimits holds a users storage, bandwidth, and segment limits for new projects.
type UserProjectLimits struct {
BandwidthLimit memory.Size `json:"bandwidthLimit"`
StorageLimit memory.Size `json:"storageUsed"`
SegmentLimit int64 `json:"segmentLimit"`
}