go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/server/quotabeta/proto/config.pb.go (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 // Code generated by protoc-gen-go. DO NOT EDIT. 6 // versions: 7 // protoc-gen-go v1.31.0 8 // protoc v3.21.7 9 // source: go.chromium.org/luci/server/quotabeta/proto/config.proto 10 11 package proto 12 13 import ( 14 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 15 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 16 reflect "reflect" 17 sync "sync" 18 ) 19 20 const ( 21 // Verify that this generated code is sufficiently up-to-date. 22 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 23 // Verify that runtime/protoimpl is sufficiently up-to-date. 24 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 25 ) 26 27 // A Policy represents an abstract quota policy. 28 // 29 // Policies should be defined in ways that are relevant to each service. For 30 // example, a policy may represent "builds for builder B", in which case 31 // resources may be interpreted as "number of builds", or a policy may represent 32 // "storage in database D", in which case resources may be interpreted as 33 // "stored bytes". 34 type Policy struct { 35 state protoimpl.MessageState 36 sizeCache protoimpl.SizeCache 37 unknownFields protoimpl.UnknownFields 38 39 // A globally unique name. 40 // 41 // Must start with a letter. Allowed characters (no spaces): A-Z a-z 0-9 - _ / 42 // The substring "${user}" can be used in this name to define identical 43 // per-user policies. Must not exceed 64 characters. 44 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 45 // The amount of resources available. Must not be negative. 46 Resources int64 `protobuf:"varint,2,opt,name=resources,proto3" json:"resources,omitempty"` 47 // The amount of resources to replenish every second. Must not be negative. 48 Replenishment int64 `protobuf:"varint,3,opt,name=replenishment,proto3" json:"replenishment,omitempty"` 49 } 50 51 func (x *Policy) Reset() { 52 *x = Policy{} 53 if protoimpl.UnsafeEnabled { 54 mi := &file_go_chromium_org_luci_server_quotabeta_proto_config_proto_msgTypes[0] 55 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 56 ms.StoreMessageInfo(mi) 57 } 58 } 59 60 func (x *Policy) String() string { 61 return protoimpl.X.MessageStringOf(x) 62 } 63 64 func (*Policy) ProtoMessage() {} 65 66 func (x *Policy) ProtoReflect() protoreflect.Message { 67 mi := &file_go_chromium_org_luci_server_quotabeta_proto_config_proto_msgTypes[0] 68 if protoimpl.UnsafeEnabled && x != nil { 69 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 70 if ms.LoadMessageInfo() == nil { 71 ms.StoreMessageInfo(mi) 72 } 73 return ms 74 } 75 return mi.MessageOf(x) 76 } 77 78 // Deprecated: Use Policy.ProtoReflect.Descriptor instead. 79 func (*Policy) Descriptor() ([]byte, []int) { 80 return file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDescGZIP(), []int{0} 81 } 82 83 func (x *Policy) GetName() string { 84 if x != nil { 85 return x.Name 86 } 87 return "" 88 } 89 90 func (x *Policy) GetResources() int64 { 91 if x != nil { 92 return x.Resources 93 } 94 return 0 95 } 96 97 func (x *Policy) GetReplenishment() int64 { 98 if x != nil { 99 return x.Replenishment 100 } 101 return 0 102 } 103 104 // A Config encapsulates a set of quota policies. 105 type Config struct { 106 state protoimpl.MessageState 107 sizeCache protoimpl.SizeCache 108 unknownFields protoimpl.UnknownFields 109 110 Policy []*Policy `protobuf:"bytes,1,rep,name=policy,proto3" json:"policy,omitempty"` 111 } 112 113 func (x *Config) Reset() { 114 *x = Config{} 115 if protoimpl.UnsafeEnabled { 116 mi := &file_go_chromium_org_luci_server_quotabeta_proto_config_proto_msgTypes[1] 117 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 118 ms.StoreMessageInfo(mi) 119 } 120 } 121 122 func (x *Config) String() string { 123 return protoimpl.X.MessageStringOf(x) 124 } 125 126 func (*Config) ProtoMessage() {} 127 128 func (x *Config) ProtoReflect() protoreflect.Message { 129 mi := &file_go_chromium_org_luci_server_quotabeta_proto_config_proto_msgTypes[1] 130 if protoimpl.UnsafeEnabled && x != nil { 131 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 132 if ms.LoadMessageInfo() == nil { 133 ms.StoreMessageInfo(mi) 134 } 135 return ms 136 } 137 return mi.MessageOf(x) 138 } 139 140 // Deprecated: Use Config.ProtoReflect.Descriptor instead. 141 func (*Config) Descriptor() ([]byte, []int) { 142 return file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDescGZIP(), []int{1} 143 } 144 145 func (x *Config) GetPolicy() []*Policy { 146 if x != nil { 147 return x.Policy 148 } 149 return nil 150 } 151 152 var File_go_chromium_org_luci_server_quotabeta_proto_config_proto protoreflect.FileDescriptor 153 154 var file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDesc = []byte{ 155 0x0a, 0x38, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 156 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x71, 0x75, 157 0x6f, 0x74, 0x61, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 158 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 159 0x6f, 0x22, 0x60, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 160 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 161 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 162 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x24, 0x0a, 163 0x0d, 0x72, 0x65, 0x70, 0x6c, 0x65, 0x6e, 0x69, 0x73, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 164 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6c, 0x65, 0x6e, 0x69, 0x73, 0x68, 0x6d, 165 0x65, 0x6e, 0x74, 0x22, 0x2f, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x25, 0x0a, 166 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 167 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 168 0x6c, 0x69, 0x63, 0x79, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 169 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x73, 0x65, 0x72, 170 0x76, 0x65, 0x72, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x70, 0x72, 171 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 172 } 173 174 var ( 175 file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDescOnce sync.Once 176 file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDescData = file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDesc 177 ) 178 179 func file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDescGZIP() []byte { 180 file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDescOnce.Do(func() { 181 file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDescData) 182 }) 183 return file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDescData 184 } 185 186 var file_go_chromium_org_luci_server_quotabeta_proto_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) 187 var file_go_chromium_org_luci_server_quotabeta_proto_config_proto_goTypes = []interface{}{ 188 (*Policy)(nil), // 0: proto.Policy 189 (*Config)(nil), // 1: proto.Config 190 } 191 var file_go_chromium_org_luci_server_quotabeta_proto_config_proto_depIdxs = []int32{ 192 0, // 0: proto.Config.policy:type_name -> proto.Policy 193 1, // [1:1] is the sub-list for method output_type 194 1, // [1:1] is the sub-list for method input_type 195 1, // [1:1] is the sub-list for extension type_name 196 1, // [1:1] is the sub-list for extension extendee 197 0, // [0:1] is the sub-list for field type_name 198 } 199 200 func init() { file_go_chromium_org_luci_server_quotabeta_proto_config_proto_init() } 201 func file_go_chromium_org_luci_server_quotabeta_proto_config_proto_init() { 202 if File_go_chromium_org_luci_server_quotabeta_proto_config_proto != nil { 203 return 204 } 205 if !protoimpl.UnsafeEnabled { 206 file_go_chromium_org_luci_server_quotabeta_proto_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 207 switch v := v.(*Policy); i { 208 case 0: 209 return &v.state 210 case 1: 211 return &v.sizeCache 212 case 2: 213 return &v.unknownFields 214 default: 215 return nil 216 } 217 } 218 file_go_chromium_org_luci_server_quotabeta_proto_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 219 switch v := v.(*Config); i { 220 case 0: 221 return &v.state 222 case 1: 223 return &v.sizeCache 224 case 2: 225 return &v.unknownFields 226 default: 227 return nil 228 } 229 } 230 } 231 type x struct{} 232 out := protoimpl.TypeBuilder{ 233 File: protoimpl.DescBuilder{ 234 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 235 RawDescriptor: file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDesc, 236 NumEnums: 0, 237 NumMessages: 2, 238 NumExtensions: 0, 239 NumServices: 0, 240 }, 241 GoTypes: file_go_chromium_org_luci_server_quotabeta_proto_config_proto_goTypes, 242 DependencyIndexes: file_go_chromium_org_luci_server_quotabeta_proto_config_proto_depIdxs, 243 MessageInfos: file_go_chromium_org_luci_server_quotabeta_proto_config_proto_msgTypes, 244 }.Build() 245 File_go_chromium_org_luci_server_quotabeta_proto_config_proto = out.File 246 file_go_chromium_org_luci_server_quotabeta_proto_config_proto_rawDesc = nil 247 file_go_chromium_org_luci_server_quotabeta_proto_config_proto_goTypes = nil 248 file_go_chromium_org_luci_server_quotabeta_proto_config_proto_depIdxs = nil 249 }