github.com/letsencrypt/trillian@v1.1.2-0.20180615153820-ae375a99d36a/quota/etcd/storagepb/storagepb.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // source: storagepb.proto
     3  
     4  /*
     5  Package storagepb is a generated protocol buffer package.
     6  
     7  Package storagepb contains definitions for quota storage protos, which are recorded in etcd.
     8  
     9  It is generated from these files:
    10  	storagepb.proto
    11  
    12  It has these top-level messages:
    13  	Bucket
    14  	Configs
    15  	Config
    16  	SequencingBasedStrategy
    17  	TimeBasedStrategy
    18  */
    19  package storagepb
    20  
    21  import proto "github.com/golang/protobuf/proto"
    22  import fmt "fmt"
    23  import math "math"
    24  
    25  // Reference imports to suppress errors if they are not otherwise used.
    26  var _ = proto.Marshal
    27  var _ = fmt.Errorf
    28  var _ = math.Inf
    29  
    30  // This is a compile-time assertion to ensure that this generated file
    31  // is compatible with the proto package it is being compiled against.
    32  // A compilation error at this line likely means your copy of the
    33  // proto package needs to be updated.
    34  const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
    35  
    36  // Possible states of a quota configuration.
    37  type Config_State int32
    38  
    39  const (
    40  	// Unknown quota state. Invalid.
    41  	Config_UNKNOWN_CONFIG_STATE Config_State = 0
    42  	// Quota is enabled.
    43  	Config_ENABLED Config_State = 1
    44  	// Quota is disabled (considered infinite).
    45  	Config_DISABLED Config_State = 2
    46  )
    47  
    48  var Config_State_name = map[int32]string{
    49  	0: "UNKNOWN_CONFIG_STATE",
    50  	1: "ENABLED",
    51  	2: "DISABLED",
    52  }
    53  var Config_State_value = map[string]int32{
    54  	"UNKNOWN_CONFIG_STATE": 0,
    55  	"ENABLED":              1,
    56  	"DISABLED":             2,
    57  }
    58  
    59  func (x Config_State) String() string {
    60  	return proto.EnumName(Config_State_name, int32(x))
    61  }
    62  func (Config_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} }
    63  
    64  // Data contained in a quota bucket.
    65  // Stored at each each quota's zero bucket. For example,
    66  // quotas/global/read/0 or quotas/trees/$id/read/0.
    67  type Bucket struct {
    68  	// Number of tokens left in the bucket.
    69  	Tokens int64 `protobuf:"varint,1,opt,name=tokens" json:"tokens,omitempty"`
    70  	// Timestamp of the last time the bucket got replenished.
    71  	LastReplenishMillisSinceEpoch int64 `protobuf:"varint,2,opt,name=last_replenish_millis_since_epoch,json=lastReplenishMillisSinceEpoch" json:"last_replenish_millis_since_epoch,omitempty"`
    72  }
    73  
    74  func (m *Bucket) Reset()                    { *m = Bucket{} }
    75  func (m *Bucket) String() string            { return proto.CompactTextString(m) }
    76  func (*Bucket) ProtoMessage()               {}
    77  func (*Bucket) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
    78  
    79  func (m *Bucket) GetTokens() int64 {
    80  	if m != nil {
    81  		return m.Tokens
    82  	}
    83  	return 0
    84  }
    85  
    86  func (m *Bucket) GetLastReplenishMillisSinceEpoch() int64 {
    87  	if m != nil {
    88  		return m.LastReplenishMillisSinceEpoch
    89  	}
    90  	return 0
    91  }
    92  
    93  // Configuration for all quotas.
    94  // Stored at quotas/configs.
    95  type Configs struct {
    96  	// Known quota configurations.
    97  	Configs []*Config `protobuf:"bytes,1,rep,name=configs" json:"configs,omitempty"`
    98  }
    99  
   100  func (m *Configs) Reset()                    { *m = Configs{} }
   101  func (m *Configs) String() string            { return proto.CompactTextString(m) }
   102  func (*Configs) ProtoMessage()               {}
   103  func (*Configs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
   104  
   105  func (m *Configs) GetConfigs() []*Config {
   106  	if m != nil {
   107  		return m.Configs
   108  	}
   109  	return nil
   110  }
   111  
   112  // Configuration of a quota.
   113  type Config struct {
   114  	// Name of the config, eg, "quotas/trees/1234/read/config".
   115  	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
   116  	// State of the config.
   117  	State Config_State `protobuf:"varint,2,opt,name=state,enum=storagepb.Config_State" json:"state,omitempty"`
   118  	// Max number of tokens available for the config.
   119  	MaxTokens int64 `protobuf:"varint,3,opt,name=max_tokens,json=maxTokens" json:"max_tokens,omitempty"`
   120  	// Replenishment strategy used by the config.
   121  	//
   122  	// Types that are valid to be assigned to ReplenishmentStrategy:
   123  	//	*Config_SequencingBased
   124  	//	*Config_TimeBased
   125  	ReplenishmentStrategy isConfig_ReplenishmentStrategy `protobuf_oneof:"replenishment_strategy"`
   126  }
   127  
   128  func (m *Config) Reset()                    { *m = Config{} }
   129  func (m *Config) String() string            { return proto.CompactTextString(m) }
   130  func (*Config) ProtoMessage()               {}
   131  func (*Config) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
   132  
   133  type isConfig_ReplenishmentStrategy interface {
   134  	isConfig_ReplenishmentStrategy()
   135  }
   136  
   137  type Config_SequencingBased struct {
   138  	SequencingBased *SequencingBasedStrategy `protobuf:"bytes,4,opt,name=sequencing_based,json=sequencingBased,oneof"`
   139  }
   140  type Config_TimeBased struct {
   141  	TimeBased *TimeBasedStrategy `protobuf:"bytes,5,opt,name=time_based,json=timeBased,oneof"`
   142  }
   143  
   144  func (*Config_SequencingBased) isConfig_ReplenishmentStrategy() {}
   145  func (*Config_TimeBased) isConfig_ReplenishmentStrategy()       {}
   146  
   147  func (m *Config) GetReplenishmentStrategy() isConfig_ReplenishmentStrategy {
   148  	if m != nil {
   149  		return m.ReplenishmentStrategy
   150  	}
   151  	return nil
   152  }
   153  
   154  func (m *Config) GetName() string {
   155  	if m != nil {
   156  		return m.Name
   157  	}
   158  	return ""
   159  }
   160  
   161  func (m *Config) GetState() Config_State {
   162  	if m != nil {
   163  		return m.State
   164  	}
   165  	return Config_UNKNOWN_CONFIG_STATE
   166  }
   167  
   168  func (m *Config) GetMaxTokens() int64 {
   169  	if m != nil {
   170  		return m.MaxTokens
   171  	}
   172  	return 0
   173  }
   174  
   175  func (m *Config) GetSequencingBased() *SequencingBasedStrategy {
   176  	if x, ok := m.GetReplenishmentStrategy().(*Config_SequencingBased); ok {
   177  		return x.SequencingBased
   178  	}
   179  	return nil
   180  }
   181  
   182  func (m *Config) GetTimeBased() *TimeBasedStrategy {
   183  	if x, ok := m.GetReplenishmentStrategy().(*Config_TimeBased); ok {
   184  		return x.TimeBased
   185  	}
   186  	return nil
   187  }
   188  
   189  // XXX_OneofFuncs is for the internal use of the proto package.
   190  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{}) {
   191  	return _Config_OneofMarshaler, _Config_OneofUnmarshaler, _Config_OneofSizer, []interface{}{
   192  		(*Config_SequencingBased)(nil),
   193  		(*Config_TimeBased)(nil),
   194  	}
   195  }
   196  
   197  func _Config_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
   198  	m := msg.(*Config)
   199  	// replenishment_strategy
   200  	switch x := m.ReplenishmentStrategy.(type) {
   201  	case *Config_SequencingBased:
   202  		b.EncodeVarint(4<<3 | proto.WireBytes)
   203  		if err := b.EncodeMessage(x.SequencingBased); err != nil {
   204  			return err
   205  		}
   206  	case *Config_TimeBased:
   207  		b.EncodeVarint(5<<3 | proto.WireBytes)
   208  		if err := b.EncodeMessage(x.TimeBased); err != nil {
   209  			return err
   210  		}
   211  	case nil:
   212  	default:
   213  		return fmt.Errorf("Config.ReplenishmentStrategy has unexpected type %T", x)
   214  	}
   215  	return nil
   216  }
   217  
   218  func _Config_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
   219  	m := msg.(*Config)
   220  	switch tag {
   221  	case 4: // replenishment_strategy.sequencing_based
   222  		if wire != proto.WireBytes {
   223  			return true, proto.ErrInternalBadWireType
   224  		}
   225  		msg := new(SequencingBasedStrategy)
   226  		err := b.DecodeMessage(msg)
   227  		m.ReplenishmentStrategy = &Config_SequencingBased{msg}
   228  		return true, err
   229  	case 5: // replenishment_strategy.time_based
   230  		if wire != proto.WireBytes {
   231  			return true, proto.ErrInternalBadWireType
   232  		}
   233  		msg := new(TimeBasedStrategy)
   234  		err := b.DecodeMessage(msg)
   235  		m.ReplenishmentStrategy = &Config_TimeBased{msg}
   236  		return true, err
   237  	default:
   238  		return false, nil
   239  	}
   240  }
   241  
   242  func _Config_OneofSizer(msg proto.Message) (n int) {
   243  	m := msg.(*Config)
   244  	// replenishment_strategy
   245  	switch x := m.ReplenishmentStrategy.(type) {
   246  	case *Config_SequencingBased:
   247  		s := proto.Size(x.SequencingBased)
   248  		n += proto.SizeVarint(4<<3 | proto.WireBytes)
   249  		n += proto.SizeVarint(uint64(s))
   250  		n += s
   251  	case *Config_TimeBased:
   252  		s := proto.Size(x.TimeBased)
   253  		n += proto.SizeVarint(5<<3 | proto.WireBytes)
   254  		n += proto.SizeVarint(uint64(s))
   255  		n += s
   256  	case nil:
   257  	default:
   258  		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
   259  	}
   260  	return n
   261  }
   262  
   263  // Sequencing-based replenishment strategy settings.
   264  type SequencingBasedStrategy struct {
   265  }
   266  
   267  func (m *SequencingBasedStrategy) Reset()                    { *m = SequencingBasedStrategy{} }
   268  func (m *SequencingBasedStrategy) String() string            { return proto.CompactTextString(m) }
   269  func (*SequencingBasedStrategy) ProtoMessage()               {}
   270  func (*SequencingBasedStrategy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
   271  
   272  // Time-based replenishment strategy settings.
   273  type TimeBasedStrategy struct {
   274  	// Number of tokens to replenish at every replenish_interval_seconds.
   275  	TokensToReplenish int64 `protobuf:"varint,1,opt,name=tokens_to_replenish,json=tokensToReplenish" json:"tokens_to_replenish,omitempty"`
   276  	// Interval at which tokens_to_replenish get replenished.
   277  	ReplenishIntervalSeconds int64 `protobuf:"varint,2,opt,name=replenish_interval_seconds,json=replenishIntervalSeconds" json:"replenish_interval_seconds,omitempty"`
   278  }
   279  
   280  func (m *TimeBasedStrategy) Reset()                    { *m = TimeBasedStrategy{} }
   281  func (m *TimeBasedStrategy) String() string            { return proto.CompactTextString(m) }
   282  func (*TimeBasedStrategy) ProtoMessage()               {}
   283  func (*TimeBasedStrategy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
   284  
   285  func (m *TimeBasedStrategy) GetTokensToReplenish() int64 {
   286  	if m != nil {
   287  		return m.TokensToReplenish
   288  	}
   289  	return 0
   290  }
   291  
   292  func (m *TimeBasedStrategy) GetReplenishIntervalSeconds() int64 {
   293  	if m != nil {
   294  		return m.ReplenishIntervalSeconds
   295  	}
   296  	return 0
   297  }
   298  
   299  func init() {
   300  	proto.RegisterType((*Bucket)(nil), "storagepb.Bucket")
   301  	proto.RegisterType((*Configs)(nil), "storagepb.Configs")
   302  	proto.RegisterType((*Config)(nil), "storagepb.Config")
   303  	proto.RegisterType((*SequencingBasedStrategy)(nil), "storagepb.SequencingBasedStrategy")
   304  	proto.RegisterType((*TimeBasedStrategy)(nil), "storagepb.TimeBasedStrategy")
   305  	proto.RegisterEnum("storagepb.Config_State", Config_State_name, Config_State_value)
   306  }
   307  
   308  func init() { proto.RegisterFile("storagepb.proto", fileDescriptor0) }
   309  
   310  var fileDescriptor0 = []byte{
   311  	// 422 bytes of a gzipped FileDescriptorProto
   312  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6f, 0xd3, 0x30,
   313  	0x14, 0xc6, 0x97, 0x76, 0x6d, 0xe9, 0x2b, 0x62, 0xad, 0x41, 0x5b, 0x40, 0x4c, 0x2a, 0x39, 0x55,
   314  	0x42, 0xe4, 0x50, 0x24, 0x4e, 0xe3, 0xb0, 0x6c, 0x81, 0x55, 0x40, 0x2a, 0x25, 0x41, 0x1c, 0x2d,
   315  	0x37, 0x7b, 0x64, 0x66, 0x89, 0x1d, 0x62, 0x0f, 0x8d, 0x23, 0xff, 0x22, 0x7f, 0x11, 0x8a, 0x9d,
   316  	0xa6, 0x83, 0x89, 0x9b, 0xfd, 0xde, 0x2f, 0x5f, 0xbe, 0xe7, 0xf7, 0xc1, 0x81, 0xd2, 0xb2, 0x66,
   317  	0x39, 0x56, 0x1b, 0xbf, 0xaa, 0xa5, 0x96, 0x64, 0xdc, 0x15, 0xbc, 0x6f, 0x30, 0x0c, 0x6e, 0xb2,
   318  	0x6b, 0xd4, 0xe4, 0x10, 0x86, 0x5a, 0x5e, 0xa3, 0x50, 0xae, 0x33, 0x77, 0x16, 0xfd, 0xb8, 0xbd,
   319  	0x91, 0x0b, 0x78, 0x51, 0x30, 0xa5, 0x69, 0x8d, 0x55, 0x81, 0x82, 0xab, 0x2b, 0x5a, 0xf2, 0xa2,
   320  	0xe0, 0x8a, 0x2a, 0x2e, 0x32, 0xa4, 0x58, 0xc9, 0xec, 0xca, 0xed, 0x99, 0x4f, 0x8e, 0x1b, 0x30,
   321  	0xde, 0x72, 0x9f, 0x0c, 0x96, 0x34, 0x54, 0xd8, 0x40, 0xde, 0x1b, 0x18, 0x9d, 0x49, 0xf1, 0x95,
   322  	0xe7, 0x8a, 0xbc, 0x84, 0x51, 0x66, 0x8f, 0xae, 0x33, 0xef, 0x2f, 0x26, 0xcb, 0x99, 0xbf, 0x33,
   323  	0x69, 0xa1, 0x78, 0x4b, 0x78, 0xbf, 0x7b, 0x30, 0xb4, 0x35, 0x42, 0x60, 0x5f, 0xb0, 0x12, 0x8d,
   324  	0xc5, 0x71, 0x6c, 0xce, 0xe4, 0x15, 0x0c, 0x94, 0x66, 0x1a, 0x8d, 0x89, 0x47, 0xcb, 0xa3, 0x7b,
   325  	0x4a, 0x7e, 0xd2, 0xb4, 0x63, 0x4b, 0x91, 0x63, 0x80, 0x92, 0xdd, 0xd2, 0x76, 0xd6, 0xbe, 0x31,
   326  	0x3e, 0x2e, 0xd9, 0x6d, 0x6a, 0xc7, 0x5d, 0xc3, 0x54, 0xe1, 0xf7, 0x1b, 0x14, 0x19, 0x17, 0x39,
   327  	0xdd, 0x30, 0x85, 0x97, 0xee, 0xfe, 0xdc, 0x59, 0x4c, 0x96, 0xde, 0x1d, 0xe1, 0xa4, 0x43, 0x82,
   328  	0x86, 0x48, 0x74, 0xcd, 0x34, 0xe6, 0x3f, 0x2f, 0xf6, 0xe2, 0x03, 0xf5, 0x77, 0x8b, 0xbc, 0x05,
   329  	0xd0, 0xbc, 0xc4, 0x56, 0x6a, 0x60, 0xa4, 0x9e, 0xdf, 0x91, 0x4a, 0x79, 0x89, 0xff, 0x8a, 0x8c,
   330  	0xf5, 0xb6, 0xe8, 0x9d, 0xc0, 0xc0, 0xd8, 0x27, 0x2e, 0x3c, 0xf9, 0x1c, 0x7d, 0x88, 0xd6, 0x5f,
   331  	0x22, 0x7a, 0xb6, 0x8e, 0xde, 0xad, 0xde, 0xd3, 0x24, 0x3d, 0x4d, 0xc3, 0xe9, 0x1e, 0x99, 0xc0,
   332  	0x28, 0x8c, 0x4e, 0x83, 0x8f, 0xe1, 0xf9, 0xd4, 0x21, 0x0f, 0xe1, 0xc1, 0xf9, 0x2a, 0xb1, 0xb7,
   333  	0x5e, 0xe0, 0xc2, 0x61, 0xb7, 0xb7, 0x12, 0x85, 0xa6, 0xaa, 0xfd, 0x89, 0xf7, 0x14, 0x8e, 0xfe,
   334  	0x33, 0x84, 0xf7, 0xcb, 0x81, 0xd9, 0x3d, 0x57, 0xc4, 0x87, 0xc7, 0xf6, 0xcd, 0xa8, 0x96, 0xbb,
   335  	0x30, 0xb4, 0x61, 0x99, 0xd9, 0x56, 0x2a, 0xbb, 0xed, 0x93, 0x13, 0x78, 0xb6, 0x8b, 0x0c, 0x17,
   336  	0x1a, 0xeb, 0x1f, 0xac, 0xa0, 0x0a, 0x33, 0x29, 0x2e, 0x55, 0x1b, 0x18, 0xb7, 0x23, 0x56, 0x2d,
   337  	0x90, 0xd8, 0xfe, 0x66, 0x68, 0x92, 0xfa, 0xfa, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x4a,
   338  	0xd5, 0x29, 0xbc, 0x02, 0x00, 0x00,
   339  }