github.com/zorawar87/trillian@v1.2.1/quota/etcd/storagepb/storagepb.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: storagepb.proto 3 4 package storagepb 5 6 /* 7 Package storagepb contains definitions for quota storage protos, which are recorded in etcd. 8 */ 9 10 import proto "github.com/golang/protobuf/proto" 11 import fmt "fmt" 12 import math "math" 13 14 // Reference imports to suppress errors if they are not otherwise used. 15 var _ = proto.Marshal 16 var _ = fmt.Errorf 17 var _ = math.Inf 18 19 // This is a compile-time assertion to ensure that this generated file 20 // is compatible with the proto package it is being compiled against. 21 // A compilation error at this line likely means your copy of the 22 // proto package needs to be updated. 23 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 24 25 // Possible states of a quota configuration. 26 type Config_State int32 27 28 const ( 29 // Unknown quota state. Invalid. 30 Config_UNKNOWN_CONFIG_STATE Config_State = 0 31 // Quota is enabled. 32 Config_ENABLED Config_State = 1 33 // Quota is disabled (considered infinite). 34 Config_DISABLED Config_State = 2 35 ) 36 37 var Config_State_name = map[int32]string{ 38 0: "UNKNOWN_CONFIG_STATE", 39 1: "ENABLED", 40 2: "DISABLED", 41 } 42 var Config_State_value = map[string]int32{ 43 "UNKNOWN_CONFIG_STATE": 0, 44 "ENABLED": 1, 45 "DISABLED": 2, 46 } 47 48 func (x Config_State) String() string { 49 return proto.EnumName(Config_State_name, int32(x)) 50 } 51 func (Config_State) EnumDescriptor() ([]byte, []int) { 52 return fileDescriptor_storagepb_7b621c1201af4753, []int{2, 0} 53 } 54 55 // Data contained in a quota bucket. 56 // Stored at each each quota's zero bucket. For example, 57 // quotas/global/read/0 or quotas/trees/$id/read/0. 58 type Bucket struct { 59 // Number of tokens left in the bucket. 60 Tokens int64 `protobuf:"varint,1,opt,name=tokens" json:"tokens,omitempty"` 61 // Timestamp of the last time the bucket got replenished. 62 LastReplenishMillisSinceEpoch int64 `protobuf:"varint,2,opt,name=last_replenish_millis_since_epoch,json=lastReplenishMillisSinceEpoch" json:"last_replenish_millis_since_epoch,omitempty"` 63 XXX_NoUnkeyedLiteral struct{} `json:"-"` 64 XXX_unrecognized []byte `json:"-"` 65 XXX_sizecache int32 `json:"-"` 66 } 67 68 func (m *Bucket) Reset() { *m = Bucket{} } 69 func (m *Bucket) String() string { return proto.CompactTextString(m) } 70 func (*Bucket) ProtoMessage() {} 71 func (*Bucket) Descriptor() ([]byte, []int) { 72 return fileDescriptor_storagepb_7b621c1201af4753, []int{0} 73 } 74 func (m *Bucket) XXX_Unmarshal(b []byte) error { 75 return xxx_messageInfo_Bucket.Unmarshal(m, b) 76 } 77 func (m *Bucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 78 return xxx_messageInfo_Bucket.Marshal(b, m, deterministic) 79 } 80 func (dst *Bucket) XXX_Merge(src proto.Message) { 81 xxx_messageInfo_Bucket.Merge(dst, src) 82 } 83 func (m *Bucket) XXX_Size() int { 84 return xxx_messageInfo_Bucket.Size(m) 85 } 86 func (m *Bucket) XXX_DiscardUnknown() { 87 xxx_messageInfo_Bucket.DiscardUnknown(m) 88 } 89 90 var xxx_messageInfo_Bucket proto.InternalMessageInfo 91 92 func (m *Bucket) GetTokens() int64 { 93 if m != nil { 94 return m.Tokens 95 } 96 return 0 97 } 98 99 func (m *Bucket) GetLastReplenishMillisSinceEpoch() int64 { 100 if m != nil { 101 return m.LastReplenishMillisSinceEpoch 102 } 103 return 0 104 } 105 106 // Configuration for all quotas. 107 // Stored at quotas/configs. 108 type Configs struct { 109 // Known quota configurations. 110 Configs []*Config `protobuf:"bytes,1,rep,name=configs" json:"configs,omitempty"` 111 XXX_NoUnkeyedLiteral struct{} `json:"-"` 112 XXX_unrecognized []byte `json:"-"` 113 XXX_sizecache int32 `json:"-"` 114 } 115 116 func (m *Configs) Reset() { *m = Configs{} } 117 func (m *Configs) String() string { return proto.CompactTextString(m) } 118 func (*Configs) ProtoMessage() {} 119 func (*Configs) Descriptor() ([]byte, []int) { 120 return fileDescriptor_storagepb_7b621c1201af4753, []int{1} 121 } 122 func (m *Configs) XXX_Unmarshal(b []byte) error { 123 return xxx_messageInfo_Configs.Unmarshal(m, b) 124 } 125 func (m *Configs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 126 return xxx_messageInfo_Configs.Marshal(b, m, deterministic) 127 } 128 func (dst *Configs) XXX_Merge(src proto.Message) { 129 xxx_messageInfo_Configs.Merge(dst, src) 130 } 131 func (m *Configs) XXX_Size() int { 132 return xxx_messageInfo_Configs.Size(m) 133 } 134 func (m *Configs) XXX_DiscardUnknown() { 135 xxx_messageInfo_Configs.DiscardUnknown(m) 136 } 137 138 var xxx_messageInfo_Configs proto.InternalMessageInfo 139 140 func (m *Configs) GetConfigs() []*Config { 141 if m != nil { 142 return m.Configs 143 } 144 return nil 145 } 146 147 // Configuration of a quota. 148 type Config struct { 149 // Name of the config, eg, “quotas/trees/1234/read/config”. 150 Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 151 // State of the config. 152 State Config_State `protobuf:"varint,2,opt,name=state,enum=storagepb.Config_State" json:"state,omitempty"` 153 // Max number of tokens available for the config. 154 MaxTokens int64 `protobuf:"varint,3,opt,name=max_tokens,json=maxTokens" json:"max_tokens,omitempty"` 155 // Replenishment strategy used by the config. 156 // 157 // Types that are valid to be assigned to ReplenishmentStrategy: 158 // *Config_SequencingBased 159 // *Config_TimeBased 160 ReplenishmentStrategy isConfig_ReplenishmentStrategy `protobuf_oneof:"replenishment_strategy"` 161 XXX_NoUnkeyedLiteral struct{} `json:"-"` 162 XXX_unrecognized []byte `json:"-"` 163 XXX_sizecache int32 `json:"-"` 164 } 165 166 func (m *Config) Reset() { *m = Config{} } 167 func (m *Config) String() string { return proto.CompactTextString(m) } 168 func (*Config) ProtoMessage() {} 169 func (*Config) Descriptor() ([]byte, []int) { 170 return fileDescriptor_storagepb_7b621c1201af4753, []int{2} 171 } 172 func (m *Config) XXX_Unmarshal(b []byte) error { 173 return xxx_messageInfo_Config.Unmarshal(m, b) 174 } 175 func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 176 return xxx_messageInfo_Config.Marshal(b, m, deterministic) 177 } 178 func (dst *Config) XXX_Merge(src proto.Message) { 179 xxx_messageInfo_Config.Merge(dst, src) 180 } 181 func (m *Config) XXX_Size() int { 182 return xxx_messageInfo_Config.Size(m) 183 } 184 func (m *Config) XXX_DiscardUnknown() { 185 xxx_messageInfo_Config.DiscardUnknown(m) 186 } 187 188 var xxx_messageInfo_Config proto.InternalMessageInfo 189 190 type isConfig_ReplenishmentStrategy interface { 191 isConfig_ReplenishmentStrategy() 192 } 193 194 type Config_SequencingBased struct { 195 SequencingBased *SequencingBasedStrategy `protobuf:"bytes,4,opt,name=sequencing_based,json=sequencingBased,oneof"` 196 } 197 type Config_TimeBased struct { 198 TimeBased *TimeBasedStrategy `protobuf:"bytes,5,opt,name=time_based,json=timeBased,oneof"` 199 } 200 201 func (*Config_SequencingBased) isConfig_ReplenishmentStrategy() {} 202 func (*Config_TimeBased) isConfig_ReplenishmentStrategy() {} 203 204 func (m *Config) GetReplenishmentStrategy() isConfig_ReplenishmentStrategy { 205 if m != nil { 206 return m.ReplenishmentStrategy 207 } 208 return nil 209 } 210 211 func (m *Config) GetName() string { 212 if m != nil { 213 return m.Name 214 } 215 return "" 216 } 217 218 func (m *Config) GetState() Config_State { 219 if m != nil { 220 return m.State 221 } 222 return Config_UNKNOWN_CONFIG_STATE 223 } 224 225 func (m *Config) GetMaxTokens() int64 { 226 if m != nil { 227 return m.MaxTokens 228 } 229 return 0 230 } 231 232 func (m *Config) GetSequencingBased() *SequencingBasedStrategy { 233 if x, ok := m.GetReplenishmentStrategy().(*Config_SequencingBased); ok { 234 return x.SequencingBased 235 } 236 return nil 237 } 238 239 func (m *Config) GetTimeBased() *TimeBasedStrategy { 240 if x, ok := m.GetReplenishmentStrategy().(*Config_TimeBased); ok { 241 return x.TimeBased 242 } 243 return nil 244 } 245 246 // XXX_OneofFuncs is for the internal use of the proto package. 247 func (*Config) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 248 return _Config_OneofMarshaler, _Config_OneofUnmarshaler, _Config_OneofSizer, []interface{}{ 249 (*Config_SequencingBased)(nil), 250 (*Config_TimeBased)(nil), 251 } 252 } 253 254 func _Config_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 255 m := msg.(*Config) 256 // replenishment_strategy 257 switch x := m.ReplenishmentStrategy.(type) { 258 case *Config_SequencingBased: 259 b.EncodeVarint(4<<3 | proto.WireBytes) 260 if err := b.EncodeMessage(x.SequencingBased); err != nil { 261 return err 262 } 263 case *Config_TimeBased: 264 b.EncodeVarint(5<<3 | proto.WireBytes) 265 if err := b.EncodeMessage(x.TimeBased); err != nil { 266 return err 267 } 268 case nil: 269 default: 270 return fmt.Errorf("Config.ReplenishmentStrategy has unexpected type %T", x) 271 } 272 return nil 273 } 274 275 func _Config_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 276 m := msg.(*Config) 277 switch tag { 278 case 4: // replenishment_strategy.sequencing_based 279 if wire != proto.WireBytes { 280 return true, proto.ErrInternalBadWireType 281 } 282 msg := new(SequencingBasedStrategy) 283 err := b.DecodeMessage(msg) 284 m.ReplenishmentStrategy = &Config_SequencingBased{msg} 285 return true, err 286 case 5: // replenishment_strategy.time_based 287 if wire != proto.WireBytes { 288 return true, proto.ErrInternalBadWireType 289 } 290 msg := new(TimeBasedStrategy) 291 err := b.DecodeMessage(msg) 292 m.ReplenishmentStrategy = &Config_TimeBased{msg} 293 return true, err 294 default: 295 return false, nil 296 } 297 } 298 299 func _Config_OneofSizer(msg proto.Message) (n int) { 300 m := msg.(*Config) 301 // replenishment_strategy 302 switch x := m.ReplenishmentStrategy.(type) { 303 case *Config_SequencingBased: 304 s := proto.Size(x.SequencingBased) 305 n += 1 // tag and wire 306 n += proto.SizeVarint(uint64(s)) 307 n += s 308 case *Config_TimeBased: 309 s := proto.Size(x.TimeBased) 310 n += 1 // tag and wire 311 n += proto.SizeVarint(uint64(s)) 312 n += s 313 case nil: 314 default: 315 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 316 } 317 return n 318 } 319 320 // Sequencing-based replenishment strategy settings. 321 type SequencingBasedStrategy struct { 322 XXX_NoUnkeyedLiteral struct{} `json:"-"` 323 XXX_unrecognized []byte `json:"-"` 324 XXX_sizecache int32 `json:"-"` 325 } 326 327 func (m *SequencingBasedStrategy) Reset() { *m = SequencingBasedStrategy{} } 328 func (m *SequencingBasedStrategy) String() string { return proto.CompactTextString(m) } 329 func (*SequencingBasedStrategy) ProtoMessage() {} 330 func (*SequencingBasedStrategy) Descriptor() ([]byte, []int) { 331 return fileDescriptor_storagepb_7b621c1201af4753, []int{3} 332 } 333 func (m *SequencingBasedStrategy) XXX_Unmarshal(b []byte) error { 334 return xxx_messageInfo_SequencingBasedStrategy.Unmarshal(m, b) 335 } 336 func (m *SequencingBasedStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 337 return xxx_messageInfo_SequencingBasedStrategy.Marshal(b, m, deterministic) 338 } 339 func (dst *SequencingBasedStrategy) XXX_Merge(src proto.Message) { 340 xxx_messageInfo_SequencingBasedStrategy.Merge(dst, src) 341 } 342 func (m *SequencingBasedStrategy) XXX_Size() int { 343 return xxx_messageInfo_SequencingBasedStrategy.Size(m) 344 } 345 func (m *SequencingBasedStrategy) XXX_DiscardUnknown() { 346 xxx_messageInfo_SequencingBasedStrategy.DiscardUnknown(m) 347 } 348 349 var xxx_messageInfo_SequencingBasedStrategy proto.InternalMessageInfo 350 351 // Time-based replenishment strategy settings. 352 type TimeBasedStrategy struct { 353 // Number of tokens to replenish at every replenish_interval_seconds. 354 TokensToReplenish int64 `protobuf:"varint,1,opt,name=tokens_to_replenish,json=tokensToReplenish" json:"tokens_to_replenish,omitempty"` 355 // Interval at which tokens_to_replenish get replenished. 356 ReplenishIntervalSeconds int64 `protobuf:"varint,2,opt,name=replenish_interval_seconds,json=replenishIntervalSeconds" json:"replenish_interval_seconds,omitempty"` 357 XXX_NoUnkeyedLiteral struct{} `json:"-"` 358 XXX_unrecognized []byte `json:"-"` 359 XXX_sizecache int32 `json:"-"` 360 } 361 362 func (m *TimeBasedStrategy) Reset() { *m = TimeBasedStrategy{} } 363 func (m *TimeBasedStrategy) String() string { return proto.CompactTextString(m) } 364 func (*TimeBasedStrategy) ProtoMessage() {} 365 func (*TimeBasedStrategy) Descriptor() ([]byte, []int) { 366 return fileDescriptor_storagepb_7b621c1201af4753, []int{4} 367 } 368 func (m *TimeBasedStrategy) XXX_Unmarshal(b []byte) error { 369 return xxx_messageInfo_TimeBasedStrategy.Unmarshal(m, b) 370 } 371 func (m *TimeBasedStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 372 return xxx_messageInfo_TimeBasedStrategy.Marshal(b, m, deterministic) 373 } 374 func (dst *TimeBasedStrategy) XXX_Merge(src proto.Message) { 375 xxx_messageInfo_TimeBasedStrategy.Merge(dst, src) 376 } 377 func (m *TimeBasedStrategy) XXX_Size() int { 378 return xxx_messageInfo_TimeBasedStrategy.Size(m) 379 } 380 func (m *TimeBasedStrategy) XXX_DiscardUnknown() { 381 xxx_messageInfo_TimeBasedStrategy.DiscardUnknown(m) 382 } 383 384 var xxx_messageInfo_TimeBasedStrategy proto.InternalMessageInfo 385 386 func (m *TimeBasedStrategy) GetTokensToReplenish() int64 { 387 if m != nil { 388 return m.TokensToReplenish 389 } 390 return 0 391 } 392 393 func (m *TimeBasedStrategy) GetReplenishIntervalSeconds() int64 { 394 if m != nil { 395 return m.ReplenishIntervalSeconds 396 } 397 return 0 398 } 399 400 func init() { 401 proto.RegisterType((*Bucket)(nil), "storagepb.Bucket") 402 proto.RegisterType((*Configs)(nil), "storagepb.Configs") 403 proto.RegisterType((*Config)(nil), "storagepb.Config") 404 proto.RegisterType((*SequencingBasedStrategy)(nil), "storagepb.SequencingBasedStrategy") 405 proto.RegisterType((*TimeBasedStrategy)(nil), "storagepb.TimeBasedStrategy") 406 proto.RegisterEnum("storagepb.Config_State", Config_State_name, Config_State_value) 407 } 408 409 func init() { proto.RegisterFile("storagepb.proto", fileDescriptor_storagepb_7b621c1201af4753) } 410 411 var fileDescriptor_storagepb_7b621c1201af4753 = []byte{ 412 // 422 bytes of a gzipped FileDescriptorProto 413 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6f, 0xd3, 0x30, 414 0x14, 0xc6, 0x97, 0x76, 0x6d, 0xe9, 0x2b, 0x62, 0xad, 0x41, 0x5b, 0x40, 0x4c, 0x2a, 0x39, 0x55, 415 0x42, 0xe4, 0x50, 0x24, 0x4e, 0xe3, 0xb0, 0x6c, 0x81, 0x55, 0x40, 0x2a, 0x25, 0x41, 0x1c, 0x2d, 416 0x37, 0x7b, 0x64, 0x66, 0x89, 0x1d, 0x62, 0x0f, 0x8d, 0x23, 0xff, 0x22, 0x7f, 0x11, 0x8a, 0x9d, 417 0xa6, 0x83, 0x89, 0x9b, 0xfd, 0xde, 0x2f, 0x5f, 0xbe, 0xe7, 0xf7, 0xc1, 0x81, 0xd2, 0xb2, 0x66, 418 0x39, 0x56, 0x1b, 0xbf, 0xaa, 0xa5, 0x96, 0x64, 0xdc, 0x15, 0xbc, 0x6f, 0x30, 0x0c, 0x6e, 0xb2, 419 0x6b, 0xd4, 0xe4, 0x10, 0x86, 0x5a, 0x5e, 0xa3, 0x50, 0xae, 0x33, 0x77, 0x16, 0xfd, 0xb8, 0xbd, 420 0x91, 0x0b, 0x78, 0x51, 0x30, 0xa5, 0x69, 0x8d, 0x55, 0x81, 0x82, 0xab, 0x2b, 0x5a, 0xf2, 0xa2, 421 0xe0, 0x8a, 0x2a, 0x2e, 0x32, 0xa4, 0x58, 0xc9, 0xec, 0xca, 0xed, 0x99, 0x4f, 0x8e, 0x1b, 0x30, 422 0xde, 0x72, 0x9f,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