Documentation
¶
Index ¶
- Variables
- type Quota
- func (*Quota) Descriptor() ([]byte, []int)deprecated
- func (x *Quota) GetCarrierId() string
- func (x *Quota) GetCarrierType() string
- func (x *Quota) GetKind() string
- func (x *Quota) GetLimit() int64
- func (x *Quota) GetSourceScope() Quota_Scope
- func (x *Quota) GetSourceScopeId() string
- func (x *Quota) GetUsed() int64
- func (*Quota) ProtoMessage()
- func (x *Quota) ProtoReflect() protoreflect.Message
- func (x *Quota) Reset()
- func (x *Quota) String() string
- type Quota_Scope
- func (Quota_Scope) Descriptor() protoreflect.EnumDescriptor
- func (x Quota_Scope) Enum() *Quota_Scope
- func (Quota_Scope) EnumDescriptor() ([]byte, []int)deprecated
- func (x Quota_Scope) Number() protoreflect.EnumNumber
- func (x Quota_Scope) String() string
- func (Quota_Scope) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( Quota_Scope_name = map[int32]string{ 0: "SCOPE_UNSPECIFIED", 1: "DEFAULT", 2: "ACCOUNT", 3: "PROJECT", } Quota_Scope_value = map[string]int32{ "SCOPE_UNSPECIFIED": 0, "DEFAULT": 1, "ACCOUNT": 2, "PROJECT": 3, } )
Enum value maps for Quota_Scope.
var File_kacho_cloud_quota_v1_quota_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Quota ¶
type Quota struct {
// The kind this row governs — a dotted `domain.resource` token from the
// platform's closed catalogue (`vpc.network`, `vpc.subnet`, …). The same token
// the administrator states a `Limit` on, so the two are joinable without a
// translation table.
Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
// The effective ceiling: how many of this kind the carrier may hold. Zero is a
// legal, meaningful value — "none of this kind may be created" — and is NOT to
// be read as "unset".
Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
// How many are held right now. Counted by the owner in the very statement that
// inserts or deletes the row, so it cannot drift from the rows it counts.
Used int64 `protobuf:"varint,3,opt,name=used,proto3" json:"used,omitempty"`
// Scope the winning value was stated at — PROJECT beats ACCOUNT beats DEFAULT.
//
// Without it "you are at 16 of 16" does not tell the tenant whether the number
// is their own override, their account's, or the platform's, and therefore does
// not tell them who can change it.
SourceScope Quota_Scope `` /* 133-byte string literal not displayed */
// Id of the object the winning scope names: an account id for ACCOUNT, a
// project id for PROJECT. Empty when the winner is DEFAULT, and empty ONLY
// then — the pairing mirrors `iam.v1.Limit`, where a DB CHECK enforces it.
SourceScopeId string `protobuf:"bytes,5,opt,name=source_scope_id,json=sourceScopeId,proto3" json:"source_scope_id,omitempty"`
// What the count is kept against. Today `project` for every kind of every
// domain; a kind whose ceiling belongs to a PARENT resource rather than to the
// project (children of one object) carries that parent's type here.
//
// Stated rather than assumed, because "quota is per project" is true of the
// present catalogue and not of the mechanism: reading it off the request would
// make the response describe the question instead of the resource.
CarrierType string `protobuf:"bytes,6,opt,name=carrier_type,json=carrierType,proto3" json:"carrier_type,omitempty"`
// Id of the carrier — the project id when `carrier_type` is `project`.
CarrierId string `protobuf:"bytes,7,opt,name=carrier_id,json=carrierId,proto3" json:"carrier_id,omitempty"`
// contains filtered or unexported fields
}
Quota — one ceiling as the tenant sees it: the limit, what is already spent against it, and WHERE the limit came from.
WHY THIS MESSAGE IS SHARED AND THE SERVICE IS NOT. The value lives in iam and the counting lives with the owner of the resource type (`iam.v1.Limit`). A single summary endpoint at iam would need `iam -> owner` calls to learn what is spent, and iam is a leaf domain every service already calls — that edge would close a cycle. So each owner answers about ITS OWN kinds, from its own database, and the SHAPE of the answer is stated once, here, so eight domains cannot drift into eight dialects of the same three numbers.
WHY `Scope` IS STATED HERE AND NOT IMPORTED. A tenant who hits a ceiling needs to know whose ceiling it is before they know who can raise it. The access service is being carved out into a product of its own, so borrowing the arm from ITS contract would mean the platform no longer builds without it — and that its contract could not be removed while this import lives. The arms are therefore stated here, with the same names and the same numbers they have always had on the wire: the tenant sees no change, and neither does JSON, which encodes an enum by its NAME.
The drift a shared enumeration was meant to prevent is prevented differently now, and by construction rather than by hope: whoever states a value is a SOURCE for this field, and a source that gains an arm this enumeration does not have cannot map it — the translation is total by type, and a new arm shows up as a compile error at the one place the mapping lives, not as a silently widened answer.
READ-ONLY BY CONSTRUCTION. This message never appears in a request body. The tenant reads; only the cloud administrator changes a value, through `iam.v1.InternalLimitService` on the internal listener. The split is a permission boundary, not a convenience: a tenant able to raise their own ceiling has no ceiling.
func (*Quota) Descriptor
deprecated
func (*Quota) GetCarrierId ¶
func (*Quota) GetCarrierType ¶
func (*Quota) GetSourceScope ¶
func (x *Quota) GetSourceScope() Quota_Scope
func (*Quota) GetSourceScopeId ¶
func (*Quota) ProtoMessage ¶
func (*Quota) ProtoMessage()
func (*Quota) ProtoReflect ¶
func (x *Quota) ProtoReflect() protoreflect.Message
type Quota_Scope ¶
type Quota_Scope int32
Scope — where the winning value was stated, ordered by specificity: PROJECT beats ACCOUNT beats DEFAULT.
Names and numbers are the ones this field has carried since it was introduced, and they are not free to change: JSON encodes an enum by its NAME and the wire by its NUMBER, so a rename or a renumber is a breaking change for every tenant already reading the field.
`SCOPE_UNSPECIFIED` is not a fourth place a value may be stated at — it is what an unreadable stored row maps to. Mapping such a row to `DEFAULT` instead would assert "the platform stated this", which is a claim about who can raise the ceiling, made on a row nobody managed to read.
const ( Quota_SCOPE_UNSPECIFIED Quota_Scope = 0 // Platform-wide fallback. Exactly one value per kind. Quota_DEFAULT Quota_Scope = 1 // Stated for one account; applies to every project of that account unless // the project states its own. Quota_ACCOUNT Quota_Scope = 2 // Stated for one project. The most specific arm. Quota_PROJECT Quota_Scope = 3 )
func (Quota_Scope) Descriptor ¶
func (Quota_Scope) Descriptor() protoreflect.EnumDescriptor
func (Quota_Scope) Enum ¶
func (x Quota_Scope) Enum() *Quota_Scope
func (Quota_Scope) EnumDescriptor
deprecated
func (Quota_Scope) EnumDescriptor() ([]byte, []int)
Deprecated: Use Quota_Scope.Descriptor instead.
func (Quota_Scope) Number ¶
func (x Quota_Scope) Number() protoreflect.EnumNumber
func (Quota_Scope) String ¶
func (x Quota_Scope) String() string
func (Quota_Scope) Type ¶
func (Quota_Scope) Type() protoreflect.EnumType