go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/server/quotabeta/proto/config.proto (about) 1 // Copyright 2022 The LUCI Authors. All rights reserved. 2 // Use of this source code is governed under the Apache License, Version 2.0 3 // that can be found in the LICENSE file. 4 5 syntax = "proto3"; 6 7 option go_package = "go.chromium.org/luci/server/quotabeta/proto"; 8 9 package proto; 10 11 // A Policy represents an abstract quota policy. 12 // 13 // Policies should be defined in ways that are relevant to each service. For 14 // example, a policy may represent "builds for builder B", in which case 15 // resources may be interpreted as "number of builds", or a policy may represent 16 // "storage in database D", in which case resources may be interpreted as 17 // "stored bytes". 18 message Policy { 19 // A globally unique name. 20 // 21 // Must start with a letter. Allowed characters (no spaces): A-Z a-z 0-9 - _ / 22 // The substring "${user}" can be used in this name to define identical 23 // per-user policies. Must not exceed 64 characters. 24 string name = 1; 25 26 // The amount of resources available. Must not be negative. 27 int64 resources = 2; 28 29 // The amount of resources to replenish every second. Must not be negative. 30 int64 replenishment = 3; 31 } 32 33 // A Config encapsulates a set of quota policies. 34 message Config { 35 repeated Policy policy = 1; 36 }