storagepb

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2018 License: Apache-2.0 Imports: 3 Imported by: 10

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

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) Descriptor() ([]byte, []int)

func (*Bucket) GetLastReplenishMillisSinceEpoch

func (m *Bucket) GetLastReplenishMillisSinceEpoch() int64

func (*Bucket) GetTokens

func (m *Bucket) GetTokens() int64

func (*Bucket) ProtoMessage

func (*Bucket) ProtoMessage()

func (*Bucket) Reset

func (m *Bucket) Reset()

func (*Bucket) String

func (m *Bucket) String() string

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) Descriptor() ([]byte, []int)

func (*Config) GetMaxTokens

func (m *Config) GetMaxTokens() int64

func (*Config) GetName

func (m *Config) GetName() string

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()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) String

func (m *Config) String() string

func (*Config) XXX_OneofFuncs

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{})

XXX_OneofFuncs is for the internal use of the proto package.

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) Descriptor() ([]byte, []int)

func (*Configs) GetConfigs

func (m *Configs) GetConfigs() []*Config

func (*Configs) ProtoMessage

func (*Configs) ProtoMessage()

func (*Configs) Reset

func (m *Configs) Reset()

func (*Configs) String

func (m *Configs) String() string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL