package storagepb
import "github.com/google/trillian/quota/etcd/storagepb"
Package storagepb contains the protobuf definitions for using etcd as a Trillian quota backend.
Index ¶
- Variables
- type Bucket
- func (*Bucket) Descriptor() ([]byte, []int)
- func (x *Bucket) GetLastReplenishMillisSinceEpoch() int64
- func (x *Bucket) GetTokens() int64
- func (*Bucket) ProtoMessage()
- func (x *Bucket) ProtoReflect() protoreflect.Message
- func (x *Bucket) Reset()
- func (x *Bucket) String() string
- type Config
- func (*Config) Descriptor() ([]byte, []int)
- func (x *Config) GetMaxTokens() int64
- func (x *Config) GetName() string
- func (x *Config) GetReplenishmentStrategy() isConfig_ReplenishmentStrategy
- func (x *Config) GetSequencingBased() *SequencingBasedStrategy
- func (x *Config) GetState() Config_State
- func (x *Config) GetTimeBased() *TimeBasedStrategy
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- type Config_SequencingBased
- type Config_State
- func (Config_State) Descriptor() protoreflect.EnumDescriptor
- func (x Config_State) Enum() *Config_State
- func (Config_State) EnumDescriptor() ([]byte, []int)
- func (x Config_State) Number() protoreflect.EnumNumber
- func (x Config_State) String() string
- func (Config_State) Type() protoreflect.EnumType
- type Config_TimeBased
- type Configs
- func (*Configs) Descriptor() ([]byte, []int)
- func (x *Configs) GetConfigs() []*Config
- func (*Configs) ProtoMessage()
- func (x *Configs) ProtoReflect() protoreflect.Message
- func (x *Configs) Reset()
- func (x *Configs) String() string
- type SequencingBasedStrategy
- func (*SequencingBasedStrategy) Descriptor() ([]byte, []int)
- func (*SequencingBasedStrategy) ProtoMessage()
- func (x *SequencingBasedStrategy) ProtoReflect() protoreflect.Message
- func (x *SequencingBasedStrategy) Reset()
- func (x *SequencingBasedStrategy) String() string
- type TimeBasedStrategy
- func (*TimeBasedStrategy) Descriptor() ([]byte, []int)
- func (x *TimeBasedStrategy) GetReplenishIntervalSeconds() int64
- func (x *TimeBasedStrategy) GetTokensToReplenish() int64
- func (*TimeBasedStrategy) ProtoMessage()
- func (x *TimeBasedStrategy) ProtoReflect() protoreflect.Message
- func (x *TimeBasedStrategy) Reset()
- func (x *TimeBasedStrategy) String() string
Variables ¶
var ( Config_State_name = map[int32]string{ 0: "UNKNOWN_CONFIG_STATE", 1: "ENABLED", 2: "DISABLED", } Config_State_value = map[string]int32{ "UNKNOWN_CONFIG_STATE": 0, "ENABLED": 1, "DISABLED": 2, } )
Enum value maps for Config_State.
var File_storagepb_proto protoreflect.FileDescriptor
Types ¶
type Bucket ¶
type Bucket struct { // Number of tokens left in the bucket. Tokens int64 `protobuf:"varint,1,opt,name=tokens,proto3" json:"tokens,omitempty"` // Timestamp of the last time the bucket got replenished. LastReplenishMillisSinceEpoch int64 `protobuf:"varint,2,opt,name=last_replenish_millis_since_epoch,json=lastReplenishMillisSinceEpoch,proto3" json:"last_replenish_millis_since_epoch,omitempty"` // contains filtered or unexported fields }
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 ¶
Deprecated: Use Bucket.ProtoReflect.Descriptor instead.
func (*Bucket) GetLastReplenishMillisSinceEpoch ¶
func (*Bucket) GetTokens ¶
func (*Bucket) ProtoMessage ¶
func (*Bucket) ProtoMessage()
func (*Bucket) ProtoReflect ¶
func (x *Bucket) ProtoReflect() protoreflect.Message
func (*Bucket) Reset ¶
func (x *Bucket) Reset()
func (*Bucket) String ¶
type Config ¶
type Config struct { // Name of the config, eg, “quotas/trees/1234/read/config”. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // State of the config. State Config_State `protobuf:"varint,2,opt,name=state,proto3,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,proto3" 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"` // contains filtered or unexported fields }
Configuration of a quota.
func (*Config) Descriptor ¶
Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (*Config) GetMaxTokens ¶
func (*Config) GetName ¶
func (*Config) GetReplenishmentStrategy ¶
func (x *Config) GetReplenishmentStrategy() isConfig_ReplenishmentStrategy
func (*Config) GetSequencingBased ¶
func (x *Config) GetSequencingBased() *SequencingBasedStrategy
func (*Config) GetState ¶
func (x *Config) GetState() Config_State
func (*Config) GetTimeBased ¶
func (x *Config) GetTimeBased() *TimeBasedStrategy
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) Reset ¶
func (x *Config) Reset()
func (*Config) String ¶
type Config_SequencingBased ¶
type Config_SequencingBased struct { // Sequencing-based replenishment settings. SequencingBased *SequencingBasedStrategy `protobuf:"bytes,4,opt,name=sequencing_based,json=sequencingBased,proto3,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) Descriptor ¶
func (Config_State) Descriptor() protoreflect.EnumDescriptor
func (Config_State) Enum ¶
func (x Config_State) Enum() *Config_State
func (Config_State) EnumDescriptor ¶
func (Config_State) EnumDescriptor() ([]byte, []int)
Deprecated: Use Config_State.Descriptor instead.
func (Config_State) Number ¶
func (x Config_State) Number() protoreflect.EnumNumber
func (Config_State) String ¶
func (x Config_State) String() string
func (Config_State) Type ¶
func (Config_State) Type() protoreflect.EnumType
type Config_TimeBased ¶
type Config_TimeBased struct { // Time-based replenishment settings. TimeBased *TimeBasedStrategy `protobuf:"bytes,5,opt,name=time_based,json=timeBased,proto3,oneof"` }
type Configs ¶
type Configs struct { // Known quota configurations. Configs []*Config `protobuf:"bytes,1,rep,name=configs,proto3" json:"configs,omitempty"` // contains filtered or unexported fields }
Configuration for all quotas. Stored at quotas/configs.
func (*Configs) Descriptor ¶
Deprecated: Use Configs.ProtoReflect.Descriptor instead.
func (*Configs) GetConfigs ¶
func (*Configs) ProtoMessage ¶
func (*Configs) ProtoMessage()
func (*Configs) ProtoReflect ¶
func (x *Configs) ProtoReflect() protoreflect.Message
func (*Configs) Reset ¶
func (x *Configs) Reset()
func (*Configs) String ¶
type SequencingBasedStrategy ¶
type SequencingBasedStrategy struct {
// contains filtered or unexported fields
}
Sequencing-based replenishment strategy settings.
func (*SequencingBasedStrategy) Descriptor ¶
func (*SequencingBasedStrategy) Descriptor() ([]byte, []int)
Deprecated: Use SequencingBasedStrategy.ProtoReflect.Descriptor instead.
func (*SequencingBasedStrategy) ProtoMessage ¶
func (*SequencingBasedStrategy) ProtoMessage()
func (*SequencingBasedStrategy) ProtoReflect ¶
func (x *SequencingBasedStrategy) ProtoReflect() protoreflect.Message
func (*SequencingBasedStrategy) Reset ¶
func (x *SequencingBasedStrategy) Reset()
func (*SequencingBasedStrategy) String ¶
func (x *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,proto3" json:"tokens_to_replenish,omitempty"` // Interval at which tokens_to_replenish get replenished. ReplenishIntervalSeconds int64 `protobuf:"varint,2,opt,name=replenish_interval_seconds,json=replenishIntervalSeconds,proto3" json:"replenish_interval_seconds,omitempty"` // contains filtered or unexported fields }
Time-based replenishment strategy settings.
func (*TimeBasedStrategy) Descriptor ¶
func (*TimeBasedStrategy) Descriptor() ([]byte, []int)
Deprecated: Use TimeBasedStrategy.ProtoReflect.Descriptor instead.
func (*TimeBasedStrategy) GetReplenishIntervalSeconds ¶
func (x *TimeBasedStrategy) GetReplenishIntervalSeconds() int64
func (*TimeBasedStrategy) GetTokensToReplenish ¶
func (x *TimeBasedStrategy) GetTokensToReplenish() int64
func (*TimeBasedStrategy) ProtoMessage ¶
func (*TimeBasedStrategy) ProtoMessage()
func (*TimeBasedStrategy) ProtoReflect ¶
func (x *TimeBasedStrategy) ProtoReflect() protoreflect.Message
func (*TimeBasedStrategy) Reset ¶
func (x *TimeBasedStrategy) Reset()
func (*TimeBasedStrategy) String ¶
func (x *TimeBasedStrategy) String() string
Source Files ¶
- Version
- v1.7.1 (latest)
- Published
- Jan 9, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 5 days ago –
Tools for package owners.