Quota.pb.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: Quota.proto
  3. package pb
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. // Reference imports to suppress errors if they are not otherwise used.
  8. var _ = proto.Marshal
  9. var _ = fmt.Errorf
  10. var _ = math.Inf
  11. type QuotaScope int32
  12. const (
  13. QuotaScope_CLUSTER QuotaScope = 1
  14. QuotaScope_MACHINE QuotaScope = 2
  15. )
  16. var QuotaScope_name = map[int32]string{
  17. 1: "CLUSTER",
  18. 2: "MACHINE",
  19. }
  20. var QuotaScope_value = map[string]int32{
  21. "CLUSTER": 1,
  22. "MACHINE": 2,
  23. }
  24. func (x QuotaScope) Enum() *QuotaScope {
  25. p := new(QuotaScope)
  26. *p = x
  27. return p
  28. }
  29. func (x QuotaScope) String() string {
  30. return proto.EnumName(QuotaScope_name, int32(x))
  31. }
  32. func (x *QuotaScope) UnmarshalJSON(data []byte) error {
  33. value, err := proto.UnmarshalJSONEnum(QuotaScope_value, data, "QuotaScope")
  34. if err != nil {
  35. return err
  36. }
  37. *x = QuotaScope(value)
  38. return nil
  39. }
  40. func (QuotaScope) EnumDescriptor() ([]byte, []int) { return fileDescriptor14, []int{0} }
  41. type ThrottleType int32
  42. const (
  43. ThrottleType_REQUEST_NUMBER ThrottleType = 1
  44. ThrottleType_REQUEST_SIZE ThrottleType = 2
  45. ThrottleType_WRITE_NUMBER ThrottleType = 3
  46. ThrottleType_WRITE_SIZE ThrottleType = 4
  47. ThrottleType_READ_NUMBER ThrottleType = 5
  48. ThrottleType_READ_SIZE ThrottleType = 6
  49. )
  50. var ThrottleType_name = map[int32]string{
  51. 1: "REQUEST_NUMBER",
  52. 2: "REQUEST_SIZE",
  53. 3: "WRITE_NUMBER",
  54. 4: "WRITE_SIZE",
  55. 5: "READ_NUMBER",
  56. 6: "READ_SIZE",
  57. }
  58. var ThrottleType_value = map[string]int32{
  59. "REQUEST_NUMBER": 1,
  60. "REQUEST_SIZE": 2,
  61. "WRITE_NUMBER": 3,
  62. "WRITE_SIZE": 4,
  63. "READ_NUMBER": 5,
  64. "READ_SIZE": 6,
  65. }
  66. func (x ThrottleType) Enum() *ThrottleType {
  67. p := new(ThrottleType)
  68. *p = x
  69. return p
  70. }
  71. func (x ThrottleType) String() string {
  72. return proto.EnumName(ThrottleType_name, int32(x))
  73. }
  74. func (x *ThrottleType) UnmarshalJSON(data []byte) error {
  75. value, err := proto.UnmarshalJSONEnum(ThrottleType_value, data, "ThrottleType")
  76. if err != nil {
  77. return err
  78. }
  79. *x = ThrottleType(value)
  80. return nil
  81. }
  82. func (ThrottleType) EnumDescriptor() ([]byte, []int) { return fileDescriptor14, []int{1} }
  83. type QuotaType int32
  84. const (
  85. QuotaType_THROTTLE QuotaType = 1
  86. )
  87. var QuotaType_name = map[int32]string{
  88. 1: "THROTTLE",
  89. }
  90. var QuotaType_value = map[string]int32{
  91. "THROTTLE": 1,
  92. }
  93. func (x QuotaType) Enum() *QuotaType {
  94. p := new(QuotaType)
  95. *p = x
  96. return p
  97. }
  98. func (x QuotaType) String() string {
  99. return proto.EnumName(QuotaType_name, int32(x))
  100. }
  101. func (x *QuotaType) UnmarshalJSON(data []byte) error {
  102. value, err := proto.UnmarshalJSONEnum(QuotaType_value, data, "QuotaType")
  103. if err != nil {
  104. return err
  105. }
  106. *x = QuotaType(value)
  107. return nil
  108. }
  109. func (QuotaType) EnumDescriptor() ([]byte, []int) { return fileDescriptor14, []int{2} }
  110. type TimedQuota struct {
  111. TimeUnit *TimeUnit `protobuf:"varint,1,req,name=time_unit,json=timeUnit,enum=pb.TimeUnit" json:"time_unit,omitempty"`
  112. SoftLimit *uint64 `protobuf:"varint,2,opt,name=soft_limit,json=softLimit" json:"soft_limit,omitempty"`
  113. Share *float32 `protobuf:"fixed32,3,opt,name=share" json:"share,omitempty"`
  114. Scope *QuotaScope `protobuf:"varint,4,opt,name=scope,enum=pb.QuotaScope,def=2" json:"scope,omitempty"`
  115. XXX_unrecognized []byte `json:"-"`
  116. }
  117. func (m *TimedQuota) Reset() { *m = TimedQuota{} }
  118. func (m *TimedQuota) String() string { return proto.CompactTextString(m) }
  119. func (*TimedQuota) ProtoMessage() {}
  120. func (*TimedQuota) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{0} }
  121. const Default_TimedQuota_Scope QuotaScope = QuotaScope_MACHINE
  122. func (m *TimedQuota) GetTimeUnit() TimeUnit {
  123. if m != nil && m.TimeUnit != nil {
  124. return *m.TimeUnit
  125. }
  126. return TimeUnit_NANOSECONDS
  127. }
  128. func (m *TimedQuota) GetSoftLimit() uint64 {
  129. if m != nil && m.SoftLimit != nil {
  130. return *m.SoftLimit
  131. }
  132. return 0
  133. }
  134. func (m *TimedQuota) GetShare() float32 {
  135. if m != nil && m.Share != nil {
  136. return *m.Share
  137. }
  138. return 0
  139. }
  140. func (m *TimedQuota) GetScope() QuotaScope {
  141. if m != nil && m.Scope != nil {
  142. return *m.Scope
  143. }
  144. return Default_TimedQuota_Scope
  145. }
  146. type Throttle struct {
  147. ReqNum *TimedQuota `protobuf:"bytes,1,opt,name=req_num,json=reqNum" json:"req_num,omitempty"`
  148. ReqSize *TimedQuota `protobuf:"bytes,2,opt,name=req_size,json=reqSize" json:"req_size,omitempty"`
  149. WriteNum *TimedQuota `protobuf:"bytes,3,opt,name=write_num,json=writeNum" json:"write_num,omitempty"`
  150. WriteSize *TimedQuota `protobuf:"bytes,4,opt,name=write_size,json=writeSize" json:"write_size,omitempty"`
  151. ReadNum *TimedQuota `protobuf:"bytes,5,opt,name=read_num,json=readNum" json:"read_num,omitempty"`
  152. ReadSize *TimedQuota `protobuf:"bytes,6,opt,name=read_size,json=readSize" json:"read_size,omitempty"`
  153. XXX_unrecognized []byte `json:"-"`
  154. }
  155. func (m *Throttle) Reset() { *m = Throttle{} }
  156. func (m *Throttle) String() string { return proto.CompactTextString(m) }
  157. func (*Throttle) ProtoMessage() {}
  158. func (*Throttle) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{1} }
  159. func (m *Throttle) GetReqNum() *TimedQuota {
  160. if m != nil {
  161. return m.ReqNum
  162. }
  163. return nil
  164. }
  165. func (m *Throttle) GetReqSize() *TimedQuota {
  166. if m != nil {
  167. return m.ReqSize
  168. }
  169. return nil
  170. }
  171. func (m *Throttle) GetWriteNum() *TimedQuota {
  172. if m != nil {
  173. return m.WriteNum
  174. }
  175. return nil
  176. }
  177. func (m *Throttle) GetWriteSize() *TimedQuota {
  178. if m != nil {
  179. return m.WriteSize
  180. }
  181. return nil
  182. }
  183. func (m *Throttle) GetReadNum() *TimedQuota {
  184. if m != nil {
  185. return m.ReadNum
  186. }
  187. return nil
  188. }
  189. func (m *Throttle) GetReadSize() *TimedQuota {
  190. if m != nil {
  191. return m.ReadSize
  192. }
  193. return nil
  194. }
  195. type ThrottleRequest struct {
  196. Type *ThrottleType `protobuf:"varint,1,opt,name=type,enum=pb.ThrottleType" json:"type,omitempty"`
  197. TimedQuota *TimedQuota `protobuf:"bytes,2,opt,name=timed_quota,json=timedQuota" json:"timed_quota,omitempty"`
  198. XXX_unrecognized []byte `json:"-"`
  199. }
  200. func (m *ThrottleRequest) Reset() { *m = ThrottleRequest{} }
  201. func (m *ThrottleRequest) String() string { return proto.CompactTextString(m) }
  202. func (*ThrottleRequest) ProtoMessage() {}
  203. func (*ThrottleRequest) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{2} }
  204. func (m *ThrottleRequest) GetType() ThrottleType {
  205. if m != nil && m.Type != nil {
  206. return *m.Type
  207. }
  208. return ThrottleType_REQUEST_NUMBER
  209. }
  210. func (m *ThrottleRequest) GetTimedQuota() *TimedQuota {
  211. if m != nil {
  212. return m.TimedQuota
  213. }
  214. return nil
  215. }
  216. type Quotas struct {
  217. BypassGlobals *bool `protobuf:"varint,1,opt,name=bypass_globals,json=bypassGlobals,def=0" json:"bypass_globals,omitempty"`
  218. Throttle *Throttle `protobuf:"bytes,2,opt,name=throttle" json:"throttle,omitempty"`
  219. XXX_unrecognized []byte `json:"-"`
  220. }
  221. func (m *Quotas) Reset() { *m = Quotas{} }
  222. func (m *Quotas) String() string { return proto.CompactTextString(m) }
  223. func (*Quotas) ProtoMessage() {}
  224. func (*Quotas) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{3} }
  225. const Default_Quotas_BypassGlobals bool = false
  226. func (m *Quotas) GetBypassGlobals() bool {
  227. if m != nil && m.BypassGlobals != nil {
  228. return *m.BypassGlobals
  229. }
  230. return Default_Quotas_BypassGlobals
  231. }
  232. func (m *Quotas) GetThrottle() *Throttle {
  233. if m != nil {
  234. return m.Throttle
  235. }
  236. return nil
  237. }
  238. type QuotaUsage struct {
  239. XXX_unrecognized []byte `json:"-"`
  240. }
  241. func (m *QuotaUsage) Reset() { *m = QuotaUsage{} }
  242. func (m *QuotaUsage) String() string { return proto.CompactTextString(m) }
  243. func (*QuotaUsage) ProtoMessage() {}
  244. func (*QuotaUsage) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{4} }
  245. func init() {
  246. proto.RegisterType((*TimedQuota)(nil), "pb.TimedQuota")
  247. proto.RegisterType((*Throttle)(nil), "pb.Throttle")
  248. proto.RegisterType((*ThrottleRequest)(nil), "pb.ThrottleRequest")
  249. proto.RegisterType((*Quotas)(nil), "pb.Quotas")
  250. proto.RegisterType((*QuotaUsage)(nil), "pb.QuotaUsage")
  251. proto.RegisterEnum("pb.QuotaScope", QuotaScope_name, QuotaScope_value)
  252. proto.RegisterEnum("pb.ThrottleType", ThrottleType_name, ThrottleType_value)
  253. proto.RegisterEnum("pb.QuotaType", QuotaType_name, QuotaType_value)
  254. }
  255. func init() { proto.RegisterFile("Quota.proto", fileDescriptor14) }
  256. var fileDescriptor14 = []byte{
  257. // 546 bytes of a gzipped FileDescriptorProto
  258. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xc1, 0x6f, 0x9b, 0x3e,
  259. 0x14, 0xc7, 0x65, 0x9a, 0xa4, 0xf0, 0xa0, 0x14, 0x59, 0xbf, 0x43, 0x7e, 0x93, 0x26, 0x45, 0xd1,
  260. 0xb4, 0xd1, 0x74, 0x65, 0x52, 0x8f, 0xbd, 0x35, 0x1d, 0x5a, 0x2a, 0xb5, 0xdd, 0xea, 0x10, 0x4d,
  261. 0xda, 0x85, 0x99, 0xe2, 0x06, 0xa4, 0x24, 0x10, 0x6c, 0x36, 0xb5, 0x7f, 0xc1, 0xce, 0xbb, 0xee,
  262. 0xb2, 0x3f, 0x75, 0xf2, 0x83, 0x64, 0x95, 0x96, 0xde, 0xec, 0xef, 0xfb, 0xf8, 0xfb, 0xbe, 0x3c,
  263. 0x6c, 0xb0, 0x6f, 0xeb, 0x42, 0xf1, 0xa0, 0xac, 0x0a, 0x55, 0x50, 0xa3, 0x4c, 0x5e, 0xd8, 0x93,
  264. 0x31, 0x97, 0xa2, 0x11, 0x86, 0xbf, 0x08, 0x40, 0x94, 0x2f, 0x45, 0x8a, 0x14, 0x3d, 0x02, 0x4b,
  265. 0xe5, 0x4b, 0x11, 0xd7, 0xab, 0x5c, 0xf5, 0xc9, 0xc0, 0xf0, 0xdd, 0x53, 0x27, 0x28, 0x93, 0x40,
  266. 0x23, 0xb3, 0x55, 0xae, 0x98, 0xa9, 0xda, 0x15, 0x7d, 0x09, 0x20, 0x8b, 0x7b, 0x15, 0x2f, 0xf2,
  267. 0x65, 0xae, 0xfa, 0xc6, 0x80, 0xf8, 0x1d, 0x66, 0x69, 0xe5, 0x4a, 0x0b, 0xf4, 0x3f, 0xe8, 0xca,
  268. 0x8c, 0x57, 0xa2, 0xbf, 0x37, 0x20, 0xbe, 0xc1, 0x9a, 0x0d, 0x3d, 0x81, 0xae, 0xbc, 0x2b, 0x4a,
  269. 0xd1, 0xef, 0x0c, 0x88, 0xef, 0x9e, 0xba, 0xda, 0x1b, 0x3b, 0x4f, 0xb5, 0x7a, 0xb6, 0x7f, 0x7d,
  270. 0x7e, 0x31, 0xb9, 0xbc, 0x09, 0x59, 0x43, 0x0d, 0x7f, 0x1a, 0x60, 0x46, 0x59, 0x55, 0x28, 0xb5,
  271. 0x10, 0xf4, 0x0d, 0xec, 0x57, 0x62, 0x1d, 0xaf, 0xea, 0x65, 0x9f, 0x0c, 0x88, 0x6f, 0x37, 0xa7,
  272. 0xff, 0x86, 0x67, 0xbd, 0x4a, 0xac, 0x6f, 0xea, 0x25, 0x3d, 0x02, 0x53, 0x83, 0x32, 0x7f, 0x14,
  273. 0x98, 0xeb, 0x5f, 0x52, 0x1b, 0x4d, 0xf3, 0x47, 0x41, 0x8f, 0xc1, 0xfa, 0x5e, 0xe5, 0x4a, 0xa0,
  274. 0xeb, 0xde, 0x4e, 0xd6, 0x44, 0x40, 0xfb, 0x9e, 0x00, 0x34, 0x30, 0x3a, 0x77, 0x76, 0xd2, 0x8d,
  275. 0x1d, 0x7a, 0x63, 0x0c, 0x9e, 0xa2, 0x75, 0xf7, 0xb9, 0x18, 0x3c, 0xd5, 0xce, 0xc7, 0x60, 0x21,
  276. 0x8a, 0xc6, 0xbd, 0xdd, 0x31, 0x34, 0xa0, 0x7d, 0x87, 0x19, 0x1c, 0x6e, 0x66, 0xc2, 0xc4, 0xba,
  277. 0x16, 0x52, 0xd1, 0x57, 0xd0, 0x51, 0x0f, 0xa5, 0xc0, 0xb9, 0xb8, 0xa7, 0x1e, 0x1e, 0x6d, 0x91,
  278. 0xe8, 0xa1, 0x14, 0x0c, 0xab, 0xf4, 0x1d, 0xd8, 0xfa, 0xef, 0xa5, 0xf1, 0x5a, 0x3b, 0x3e, 0x33,
  279. 0x1a, 0x50, 0xdb, 0xf5, 0xf0, 0x2b, 0xf4, 0x70, 0x21, 0xe9, 0x5b, 0x70, 0x93, 0x87, 0x92, 0x4b,
  280. 0x19, 0xcf, 0x17, 0x45, 0xc2, 0x17, 0x12, 0x5b, 0x99, 0x67, 0xdd, 0x7b, 0xbe, 0x90, 0x82, 0x1d,
  281. 0x34, 0xc5, 0x0f, 0x4d, 0x8d, 0xfa, 0x60, 0xaa, 0xb6, 0x7d, 0xdb, 0xc5, 0x79, 0x1a, 0x89, 0x6d,
  282. 0xab, 0x43, 0x07, 0x00, 0x3b, 0xcc, 0x24, 0x9f, 0x8b, 0xd1, 0xeb, 0x76, 0x87, 0x97, 0x81, 0xda,
  283. 0xb0, 0x7f, 0x71, 0x35, 0x9b, 0x46, 0x21, 0xf3, 0x88, 0xde, 0xb4, 0x77, 0xc3, 0x33, 0x46, 0xdf,
  284. 0xc0, 0x79, 0xfa, 0x79, 0x94, 0x82, 0xcb, 0xc2, 0xdb, 0x59, 0x38, 0x8d, 0xe2, 0x9b, 0xd9, 0xf5,
  285. 0x18, 0x0f, 0x78, 0xe0, 0x6c, 0xb4, 0xe9, 0xe5, 0x97, 0xd0, 0x33, 0xb4, 0xf2, 0x99, 0x5d, 0x46,
  286. 0xe1, 0x86, 0xd9, 0xa3, 0x2e, 0x40, 0xa3, 0x20, 0xd1, 0xa1, 0x87, 0x60, 0xb3, 0xf0, 0xfc, 0xfd,
  287. 0x06, 0xe8, 0xd2, 0x03, 0xb0, 0x50, 0xc0, 0x7a, 0x6f, 0xf4, 0x3f, 0x58, 0x98, 0x0f, 0x9b, 0x3a,
  288. 0x60, 0x46, 0x13, 0xf6, 0x31, 0x8a, 0xae, 0x42, 0x8f, 0x8c, 0xcf, 0x61, 0x54, 0x54, 0xf3, 0x80,
  289. 0x97, 0xfc, 0x2e, 0x13, 0x41, 0xc6, 0xd3, 0xa2, 0x28, 0x83, 0x2c, 0xd9, 0x3e, 0xb4, 0xa4, 0xbe,
  290. 0x0f, 0xe6, 0x62, 0x25, 0x2a, 0xae, 0x44, 0x3a, 0x6e, 0xde, 0xe4, 0x27, 0x5d, 0x90, 0x13, 0xf2,
  291. 0x83, 0x90, 0xdf, 0x84, 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0x31, 0x6b, 0x5c, 0x31, 0xa9, 0x03,
  292. 0x00, 0x00,
  293. }