Documentation ¶
Overview ¶
Package storagepb is a generated protocol buffer package.
Package storagepb contains definitions for quota storage protos, which are recorded in etcd.
It is generated from these files:
storagepb.proto
It has these top-level messages:
Bucket Configs Config SequencingBasedStrategy TimeBasedStrategy
Index ¶
- Variables
- type Bucket
- type Config
- func (*Config) Descriptor() ([]byte, []int)
- func (m *Config) GetMaxTokens() int64
- func (m *Config) GetName() string
- func (m *Config) GetReplenishmentStrategy() isConfig_ReplenishmentStrategy
- func (m *Config) GetSequencingBased() *SequencingBasedStrategy
- func (m *Config) GetState() Config_State
- func (m *Config) GetTimeBased() *TimeBasedStrategy
- func (*Config) ProtoMessage()
- func (m *Config) Reset()
- func (m *Config) String() string
- func (*Config) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type Config_SequencingBased
- type Config_State
- type Config_TimeBased
- type Configs
- type SequencingBasedStrategy
- type TimeBasedStrategy
Constants ¶
This section is empty.
Variables ¶
View Source
var Config_State_name = map[int32]string{
0: "UNKNOWN_CONFIG_STATE",
1: "ENABLED",
2: "DISABLED",
}
View Source
var Config_State_value = map[string]int32{
"UNKNOWN_CONFIG_STATE": 0,
"ENABLED": 1,
"DISABLED": 2,
}
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct { // Number of tokens left in the bucket. Tokens int64 `protobuf:"varint,1,opt,name=tokens" json:"tokens,omitempty"` // Timestamp of the last time the bucket got replenished. LastReplenishMillisSinceEpoch int64 `` /* 148-byte string literal not displayed */ }
Data contained in a quota bucket. Stored at each each quota's zero bucket. For example, quotas/global/read/0 or quotas/trees/$id/read/0.
func (*Bucket) Descriptor ¶
func (*Bucket) GetLastReplenishMillisSinceEpoch ¶
func (*Bucket) ProtoMessage ¶
func (*Bucket) ProtoMessage()
type Config ¶
type Config struct { // Name of the config, eg, “quotas/trees/1234/read/config”. Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // State of the config. State Config_State `protobuf:"varint,2,opt,name=state,enum=storagepb.Config_State" json:"state,omitempty"` // Max number of tokens available for the config. MaxTokens int64 `protobuf:"varint,3,opt,name=max_tokens,json=maxTokens" json:"max_tokens,omitempty"` // Replenishment strategy used by the config. // // Types that are valid to be assigned to ReplenishmentStrategy: // *Config_SequencingBased // *Config_TimeBased ReplenishmentStrategy isConfig_ReplenishmentStrategy `protobuf_oneof:"replenishment_strategy"` }
Configuration of a quota.
func (*Config) Descriptor ¶
func (*Config) GetMaxTokens ¶
func (*Config) GetReplenishmentStrategy ¶
func (m *Config) GetReplenishmentStrategy() isConfig_ReplenishmentStrategy
func (*Config) GetSequencingBased ¶
func (m *Config) GetSequencingBased() *SequencingBasedStrategy
func (*Config) GetState ¶
func (m *Config) GetState() Config_State
func (*Config) GetTimeBased ¶
func (m *Config) GetTimeBased() *TimeBasedStrategy
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
type Config_SequencingBased ¶
type Config_SequencingBased struct {
SequencingBased *SequencingBasedStrategy `protobuf:"bytes,4,opt,name=sequencing_based,json=sequencingBased,oneof"`
}
type Config_State ¶
type Config_State int32
Possible states of a quota configuration.
const ( // Unknown quota state. Invalid. Config_UNKNOWN_CONFIG_STATE Config_State = 0 // Quota is enabled. Config_ENABLED Config_State = 1 // Quota is disabled (considered infinite). Config_DISABLED Config_State = 2 )
func (Config_State) EnumDescriptor ¶
func (Config_State) EnumDescriptor() ([]byte, []int)
func (Config_State) String ¶
func (x Config_State) String() string
type Config_TimeBased ¶
type Config_TimeBased struct {
TimeBased *TimeBasedStrategy `protobuf:"bytes,5,opt,name=time_based,json=timeBased,oneof"`
}
type Configs ¶
type Configs struct { // Known quota configurations. Configs []*Config `protobuf:"bytes,1,rep,name=configs" json:"configs,omitempty"` }
Configuration for all quotas. Stored at quotas/configs.
func (*Configs) Descriptor ¶
func (*Configs) GetConfigs ¶
func (*Configs) ProtoMessage ¶
func (*Configs) ProtoMessage()
type SequencingBasedStrategy ¶
type SequencingBasedStrategy struct { }
Sequencing-based replenishment strategy settings.
func (*SequencingBasedStrategy) Descriptor ¶
func (*SequencingBasedStrategy) Descriptor() ([]byte, []int)
func (*SequencingBasedStrategy) ProtoMessage ¶
func (*SequencingBasedStrategy) ProtoMessage()
func (*SequencingBasedStrategy) Reset ¶
func (m *SequencingBasedStrategy) Reset()
func (*SequencingBasedStrategy) String ¶
func (m *SequencingBasedStrategy) String() string
type TimeBasedStrategy ¶
type TimeBasedStrategy struct { // Number of tokens to replenish at every replenish_interval_seconds. TokensToReplenish int64 `protobuf:"varint,1,opt,name=tokens_to_replenish,json=tokensToReplenish" json:"tokens_to_replenish,omitempty"` // Interval at which tokens_to_replenish get replenished. ReplenishIntervalSeconds int64 `` /* 129-byte string literal not displayed */ }
Time-based replenishment strategy settings.
func (*TimeBasedStrategy) Descriptor ¶
func (*TimeBasedStrategy) Descriptor() ([]byte, []int)
func (*TimeBasedStrategy) GetReplenishIntervalSeconds ¶
func (m *TimeBasedStrategy) GetReplenishIntervalSeconds() int64
func (*TimeBasedStrategy) GetTokensToReplenish ¶
func (m *TimeBasedStrategy) GetTokensToReplenish() int64
func (*TimeBasedStrategy) ProtoMessage ¶
func (*TimeBasedStrategy) ProtoMessage()
func (*TimeBasedStrategy) Reset ¶
func (m *TimeBasedStrategy) Reset()
func (*TimeBasedStrategy) String ¶
func (m *TimeBasedStrategy) String() string
Click to show internal directories.
Click to hide internal directories.