You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

455 lines
15 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/spanner/v1/keys.proto
  3. package spanner // import "google.golang.org/genproto/googleapis/spanner/v1"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import _struct "github.com/golang/protobuf/ptypes/struct"
  8. import _ "google.golang.org/genproto/googleapis/api/annotations"
  9. // Reference imports to suppress errors if they are not otherwise used.
  10. var _ = proto.Marshal
  11. var _ = fmt.Errorf
  12. var _ = math.Inf
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the proto package it is being compiled against.
  15. // A compilation error at this line likely means your copy of the
  16. // proto package needs to be updated.
  17. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  18. // KeyRange represents a range of rows in a table or index.
  19. //
  20. // A range has a start key and an end key. These keys can be open or
  21. // closed, indicating if the range includes rows with that key.
  22. //
  23. // Keys are represented by lists, where the ith value in the list
  24. // corresponds to the ith component of the table or index primary key.
  25. // Individual values are encoded as described
  26. // [here][google.spanner.v1.TypeCode].
  27. //
  28. // For example, consider the following table definition:
  29. //
  30. // CREATE TABLE UserEvents (
  31. // UserName STRING(MAX),
  32. // EventDate STRING(10)
  33. // ) PRIMARY KEY(UserName, EventDate);
  34. //
  35. // The following keys name rows in this table:
  36. //
  37. // ["Bob", "2014-09-23"]
  38. // ["Alfred", "2015-06-12"]
  39. //
  40. // Since the `UserEvents` table's `PRIMARY KEY` clause names two
  41. // columns, each `UserEvents` key has two elements; the first is the
  42. // `UserName`, and the second is the `EventDate`.
  43. //
  44. // Key ranges with multiple components are interpreted
  45. // lexicographically by component using the table or index key's declared
  46. // sort order. For example, the following range returns all events for
  47. // user `"Bob"` that occurred in the year 2015:
  48. //
  49. // "start_closed": ["Bob", "2015-01-01"]
  50. // "end_closed": ["Bob", "2015-12-31"]
  51. //
  52. // Start and end keys can omit trailing key components. This affects the
  53. // inclusion and exclusion of rows that exactly match the provided key
  54. // components: if the key is closed, then rows that exactly match the
  55. // provided components are included; if the key is open, then rows
  56. // that exactly match are not included.
  57. //
  58. // For example, the following range includes all events for `"Bob"` that
  59. // occurred during and after the year 2000:
  60. //
  61. // "start_closed": ["Bob", "2000-01-01"]
  62. // "end_closed": ["Bob"]
  63. //
  64. // The next example retrieves all events for `"Bob"`:
  65. //
  66. // "start_closed": ["Bob"]
  67. // "end_closed": ["Bob"]
  68. //
  69. // To retrieve events before the year 2000:
  70. //
  71. // "start_closed": ["Bob"]
  72. // "end_open": ["Bob", "2000-01-01"]
  73. //
  74. // The following range includes all rows in the table:
  75. //
  76. // "start_closed": []
  77. // "end_closed": []
  78. //
  79. // This range returns all users whose `UserName` begins with any
  80. // character from A to C:
  81. //
  82. // "start_closed": ["A"]
  83. // "end_open": ["D"]
  84. //
  85. // This range returns all users whose `UserName` begins with B:
  86. //
  87. // "start_closed": ["B"]
  88. // "end_open": ["C"]
  89. //
  90. // Key ranges honor column sort order. For example, suppose a table is
  91. // defined as follows:
  92. //
  93. // CREATE TABLE DescendingSortedTable {
  94. // Key INT64,
  95. // ...
  96. // ) PRIMARY KEY(Key DESC);
  97. //
  98. // The following range retrieves all rows with key values between 1
  99. // and 100 inclusive:
  100. //
  101. // "start_closed": ["100"]
  102. // "end_closed": ["1"]
  103. //
  104. // Note that 100 is passed as the start, and 1 is passed as the end,
  105. // because `Key` is a descending column in the schema.
  106. type KeyRange struct {
  107. // The start key must be provided. It can be either closed or open.
  108. //
  109. // Types that are valid to be assigned to StartKeyType:
  110. // *KeyRange_StartClosed
  111. // *KeyRange_StartOpen
  112. StartKeyType isKeyRange_StartKeyType `protobuf_oneof:"start_key_type"`
  113. // The end key must be provided. It can be either closed or open.
  114. //
  115. // Types that are valid to be assigned to EndKeyType:
  116. // *KeyRange_EndClosed
  117. // *KeyRange_EndOpen
  118. EndKeyType isKeyRange_EndKeyType `protobuf_oneof:"end_key_type"`
  119. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  120. XXX_unrecognized []byte `json:"-"`
  121. XXX_sizecache int32 `json:"-"`
  122. }
  123. func (m *KeyRange) Reset() { *m = KeyRange{} }
  124. func (m *KeyRange) String() string { return proto.CompactTextString(m) }
  125. func (*KeyRange) ProtoMessage() {}
  126. func (*KeyRange) Descriptor() ([]byte, []int) {
  127. return fileDescriptor_keys_54e97a5c3f94e641, []int{0}
  128. }
  129. func (m *KeyRange) XXX_Unmarshal(b []byte) error {
  130. return xxx_messageInfo_KeyRange.Unmarshal(m, b)
  131. }
  132. func (m *KeyRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  133. return xxx_messageInfo_KeyRange.Marshal(b, m, deterministic)
  134. }
  135. func (dst *KeyRange) XXX_Merge(src proto.Message) {
  136. xxx_messageInfo_KeyRange.Merge(dst, src)
  137. }
  138. func (m *KeyRange) XXX_Size() int {
  139. return xxx_messageInfo_KeyRange.Size(m)
  140. }
  141. func (m *KeyRange) XXX_DiscardUnknown() {
  142. xxx_messageInfo_KeyRange.DiscardUnknown(m)
  143. }
  144. var xxx_messageInfo_KeyRange proto.InternalMessageInfo
  145. type isKeyRange_StartKeyType interface {
  146. isKeyRange_StartKeyType()
  147. }
  148. type KeyRange_StartClosed struct {
  149. StartClosed *_struct.ListValue `protobuf:"bytes,1,opt,name=start_closed,json=startClosed,proto3,oneof"`
  150. }
  151. type KeyRange_StartOpen struct {
  152. StartOpen *_struct.ListValue `protobuf:"bytes,2,opt,name=start_open,json=startOpen,proto3,oneof"`
  153. }
  154. func (*KeyRange_StartClosed) isKeyRange_StartKeyType() {}
  155. func (*KeyRange_StartOpen) isKeyRange_StartKeyType() {}
  156. func (m *KeyRange) GetStartKeyType() isKeyRange_StartKeyType {
  157. if m != nil {
  158. return m.StartKeyType
  159. }
  160. return nil
  161. }
  162. func (m *KeyRange) GetStartClosed() *_struct.ListValue {
  163. if x, ok := m.GetStartKeyType().(*KeyRange_StartClosed); ok {
  164. return x.StartClosed
  165. }
  166. return nil
  167. }
  168. func (m *KeyRange) GetStartOpen() *_struct.ListValue {
  169. if x, ok := m.GetStartKeyType().(*KeyRange_StartOpen); ok {
  170. return x.StartOpen
  171. }
  172. return nil
  173. }
  174. type isKeyRange_EndKeyType interface {
  175. isKeyRange_EndKeyType()
  176. }
  177. type KeyRange_EndClosed struct {
  178. EndClosed *_struct.ListValue `protobuf:"bytes,3,opt,name=end_closed,json=endClosed,proto3,oneof"`
  179. }
  180. type KeyRange_EndOpen struct {
  181. EndOpen *_struct.ListValue `protobuf:"bytes,4,opt,name=end_open,json=endOpen,proto3,oneof"`
  182. }
  183. func (*KeyRange_EndClosed) isKeyRange_EndKeyType() {}
  184. func (*KeyRange_EndOpen) isKeyRange_EndKeyType() {}
  185. func (m *KeyRange) GetEndKeyType() isKeyRange_EndKeyType {
  186. if m != nil {
  187. return m.EndKeyType
  188. }
  189. return nil
  190. }
  191. func (m *KeyRange) GetEndClosed() *_struct.ListValue {
  192. if x, ok := m.GetEndKeyType().(*KeyRange_EndClosed); ok {
  193. return x.EndClosed
  194. }
  195. return nil
  196. }
  197. func (m *KeyRange) GetEndOpen() *_struct.ListValue {
  198. if x, ok := m.GetEndKeyType().(*KeyRange_EndOpen); ok {
  199. return x.EndOpen
  200. }
  201. return nil
  202. }
  203. // XXX_OneofFuncs is for the internal use of the proto package.
  204. func (*KeyRange) 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{}) {
  205. return _KeyRange_OneofMarshaler, _KeyRange_OneofUnmarshaler, _KeyRange_OneofSizer, []interface{}{
  206. (*KeyRange_StartClosed)(nil),
  207. (*KeyRange_StartOpen)(nil),
  208. (*KeyRange_EndClosed)(nil),
  209. (*KeyRange_EndOpen)(nil),
  210. }
  211. }
  212. func _KeyRange_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  213. m := msg.(*KeyRange)
  214. // start_key_type
  215. switch x := m.StartKeyType.(type) {
  216. case *KeyRange_StartClosed:
  217. b.EncodeVarint(1<<3 | proto.WireBytes)
  218. if err := b.EncodeMessage(x.StartClosed); err != nil {
  219. return err
  220. }
  221. case *KeyRange_StartOpen:
  222. b.EncodeVarint(2<<3 | proto.WireBytes)
  223. if err := b.EncodeMessage(x.StartOpen); err != nil {
  224. return err
  225. }
  226. case nil:
  227. default:
  228. return fmt.Errorf("KeyRange.StartKeyType has unexpected type %T", x)
  229. }
  230. // end_key_type
  231. switch x := m.EndKeyType.(type) {
  232. case *KeyRange_EndClosed:
  233. b.EncodeVarint(3<<3 | proto.WireBytes)
  234. if err := b.EncodeMessage(x.EndClosed); err != nil {
  235. return err
  236. }
  237. case *KeyRange_EndOpen:
  238. b.EncodeVarint(4<<3 | proto.WireBytes)
  239. if err := b.EncodeMessage(x.EndOpen); err != nil {
  240. return err
  241. }
  242. case nil:
  243. default:
  244. return fmt.Errorf("KeyRange.EndKeyType has unexpected type %T", x)
  245. }
  246. return nil
  247. }
  248. func _KeyRange_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  249. m := msg.(*KeyRange)
  250. switch tag {
  251. case 1: // start_key_type.start_closed
  252. if wire != proto.WireBytes {
  253. return true, proto.ErrInternalBadWireType
  254. }
  255. msg := new(_struct.ListValue)
  256. err := b.DecodeMessage(msg)
  257. m.StartKeyType = &KeyRange_StartClosed{msg}
  258. return true, err
  259. case 2: // start_key_type.start_open
  260. if wire != proto.WireBytes {
  261. return true, proto.ErrInternalBadWireType
  262. }
  263. msg := new(_struct.ListValue)
  264. err := b.DecodeMessage(msg)
  265. m.StartKeyType = &KeyRange_StartOpen{msg}
  266. return true, err
  267. case 3: // end_key_type.end_closed
  268. if wire != proto.WireBytes {
  269. return true, proto.ErrInternalBadWireType
  270. }
  271. msg := new(_struct.ListValue)
  272. err := b.DecodeMessage(msg)
  273. m.EndKeyType = &KeyRange_EndClosed{msg}
  274. return true, err
  275. case 4: // end_key_type.end_open
  276. if wire != proto.WireBytes {
  277. return true, proto.ErrInternalBadWireType
  278. }
  279. msg := new(_struct.ListValue)
  280. err := b.DecodeMessage(msg)
  281. m.EndKeyType = &KeyRange_EndOpen{msg}
  282. return true, err
  283. default:
  284. return false, nil
  285. }
  286. }
  287. func _KeyRange_OneofSizer(msg proto.Message) (n int) {
  288. m := msg.(*KeyRange)
  289. // start_key_type
  290. switch x := m.StartKeyType.(type) {
  291. case *KeyRange_StartClosed:
  292. s := proto.Size(x.StartClosed)
  293. n += 1 // tag and wire
  294. n += proto.SizeVarint(uint64(s))
  295. n += s
  296. case *KeyRange_StartOpen:
  297. s := proto.Size(x.StartOpen)
  298. n += 1 // tag and wire
  299. n += proto.SizeVarint(uint64(s))
  300. n += s
  301. case nil:
  302. default:
  303. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  304. }
  305. // end_key_type
  306. switch x := m.EndKeyType.(type) {
  307. case *KeyRange_EndClosed:
  308. s := proto.Size(x.EndClosed)
  309. n += 1 // tag and wire
  310. n += proto.SizeVarint(uint64(s))
  311. n += s
  312. case *KeyRange_EndOpen:
  313. s := proto.Size(x.EndOpen)
  314. n += 1 // tag and wire
  315. n += proto.SizeVarint(uint64(s))
  316. n += s
  317. case nil:
  318. default:
  319. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  320. }
  321. return n
  322. }
  323. // `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All
  324. // the keys are expected to be in the same table or index. The keys need
  325. // not be sorted in any particular way.
  326. //
  327. // If the same key is specified multiple times in the set (for example
  328. // if two ranges, two keys, or a key and a range overlap), Cloud Spanner
  329. // behaves as if the key were only specified once.
  330. type KeySet struct {
  331. // A list of specific keys. Entries in `keys` should have exactly as
  332. // many elements as there are columns in the primary or index key
  333. // with which this `KeySet` is used. Individual key values are
  334. // encoded as described [here][google.spanner.v1.TypeCode].
  335. Keys []*_struct.ListValue `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
  336. // A list of key ranges. See [KeyRange][google.spanner.v1.KeyRange] for more
  337. // information about key range specifications.
  338. Ranges []*KeyRange `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges,omitempty"`
  339. // For convenience `all` can be set to `true` to indicate that this
  340. // `KeySet` matches all keys in the table or index. Note that any keys
  341. // specified in `keys` or `ranges` are only yielded once.
  342. All bool `protobuf:"varint,3,opt,name=all,proto3" json:"all,omitempty"`
  343. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  344. XXX_unrecognized []byte `json:"-"`
  345. XXX_sizecache int32 `json:"-"`
  346. }
  347. func (m *KeySet) Reset() { *m = KeySet{} }
  348. func (m *KeySet) String() string { return proto.CompactTextString(m) }
  349. func (*KeySet) ProtoMessage() {}
  350. func (*KeySet) Descriptor() ([]byte, []int) {
  351. return fileDescriptor_keys_54e97a5c3f94e641, []int{1}
  352. }
  353. func (m *KeySet) XXX_Unmarshal(b []byte) error {
  354. return xxx_messageInfo_KeySet.Unmarshal(m, b)
  355. }
  356. func (m *KeySet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  357. return xxx_messageInfo_KeySet.Marshal(b, m, deterministic)
  358. }
  359. func (dst *KeySet) XXX_Merge(src proto.Message) {
  360. xxx_messageInfo_KeySet.Merge(dst, src)
  361. }
  362. func (m *KeySet) XXX_Size() int {
  363. return xxx_messageInfo_KeySet.Size(m)
  364. }
  365. func (m *KeySet) XXX_DiscardUnknown() {
  366. xxx_messageInfo_KeySet.DiscardUnknown(m)
  367. }
  368. var xxx_messageInfo_KeySet proto.InternalMessageInfo
  369. func (m *KeySet) GetKeys() []*_struct.ListValue {
  370. if m != nil {
  371. return m.Keys
  372. }
  373. return nil
  374. }
  375. func (m *KeySet) GetRanges() []*KeyRange {
  376. if m != nil {
  377. return m.Ranges
  378. }
  379. return nil
  380. }
  381. func (m *KeySet) GetAll() bool {
  382. if m != nil {
  383. return m.All
  384. }
  385. return false
  386. }
  387. func init() {
  388. proto.RegisterType((*KeyRange)(nil), "google.spanner.v1.KeyRange")
  389. proto.RegisterType((*KeySet)(nil), "google.spanner.v1.KeySet")
  390. }
  391. func init() { proto.RegisterFile("google/spanner/v1/keys.proto", fileDescriptor_keys_54e97a5c3f94e641) }
  392. var fileDescriptor_keys_54e97a5c3f94e641 = []byte{
  393. // 371 bytes of a gzipped FileDescriptorProto
  394. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6b, 0xea, 0x30,
  395. 0x1c, 0xc7, 0x5f, 0xab, 0xf8, 0x34, 0x8a, 0xf8, 0x0a, 0x8f, 0x57, 0x7c, 0x3b, 0x88, 0xa7, 0x9d,
  396. 0x52, 0x3a, 0x0f, 0x1b, 0x78, 0x18, 0xd4, 0xc3, 0x06, 0x0e, 0x26, 0x15, 0x3c, 0x0c, 0x41, 0xa2,
  397. 0xfd, 0xad, 0x14, 0xb3, 0x24, 0x34, 0xa9, 0xd0, 0xd3, 0xfe, 0x87, 0xfd, 0x05, 0x3b, 0xef, 0x4f,
  398. 0xd9, 0x5f, 0x35, 0x92, 0xa6, 0x63, 0x20, 0x6c, 0xde, 0x12, 0x3e, 0xbf, 0xcf, 0xf7, 0x9b, 0x26,
  399. 0x45, 0x67, 0x29, 0xe7, 0x29, 0x85, 0x40, 0x0a, 0xc2, 0x18, 0xe4, 0xc1, 0x21, 0x0c, 0xf6, 0x50,
  400. 0x4a, 0x2c, 0x72, 0xae, 0xb8, 0xf7, 0xa7, 0xa2, 0xd8, 0x52, 0x7c, 0x08, 0x87, 0xb5, 0x40, 0x44,
  401. 0x16, 0x10, 0xc6, 0xb8, 0x22, 0x2a, 0xe3, 0xcc, 0x0a, 0x9f, 0xd4, 0xec, 0xb6, 0xc5, 0x63, 0x20,
  402. 0x55, 0x5e, 0xec, 0x54, 0x45, 0xc7, 0xaf, 0x2e, 0x6a, 0xcf, 0xa1, 0x8c, 0x09, 0x4b, 0xc1, 0xbb,
  403. 0x46, 0x3d, 0xa9, 0x48, 0xae, 0x36, 0x3b, 0xca, 0x25, 0x24, 0xbe, 0x33, 0x72, 0xce, 0xbb, 0x17,
  404. 0x43, 0x6c, 0x2b, 0xeb, 0x04, 0x7c, 0x97, 0x49, 0xb5, 0x22, 0xb4, 0x80, 0xdb, 0x5f, 0x71, 0xd7,
  405. 0x18, 0x33, 0x23, 0x78, 0x53, 0x84, 0xaa, 0x00, 0x2e, 0x80, 0xf9, 0xee, 0x09, 0x7a, 0xc7, 0xcc,
  406. 0xdf, 0x0b, 0x60, 0x5a, 0x06, 0x96, 0xd4, 0xdd, 0x8d, 0x1f, 0x65, 0x27, 0xee, 0x00, 0x4b, 0x6c,
  407. 0xf3, 0x25, 0x6a, 0x6b, 0xd9, 0xf4, 0x36, 0x4f, 0x50, 0x7f, 0x03, 0x4b, 0x74, 0x6b, 0x34, 0x40,
  408. 0xfd, 0xea, 0xc8, 0x7b, 0x28, 0x37, 0xaa, 0x14, 0x10, 0xf5, 0x51, 0x4f, 0x47, 0xd5, 0xfb, 0xf1,
  409. 0x33, 0x6a, 0xcd, 0xa1, 0x5c, 0x82, 0xf2, 0x30, 0x6a, 0xea, 0x97, 0xf0, 0x9d, 0x51, 0xe3, 0xfb,
  410. 0x82, 0xd8, 0xcc, 0x79, 0x13, 0xd4, 0xca, 0xf5, 0xc5, 0x4a, 0xdf, 0x35, 0xc6, 0x7f, 0x7c, 0xf4,
  411. 0x78, 0xb8, 0xbe, 0xfc, 0xd8, 0x8e, 0x7a, 0x03, 0xd4, 0x20, 0x94, 0x9a, 0xef, 0x6f, 0xc7, 0x7a,
  412. 0x19, 0xbd, 0x38, 0xe8, 0xef, 0x8e, 0x3f, 0x1d, 0xcb, 0x51, 0x67, 0x0e, 0xa5, 0x5c, 0xe8, 0xfa,
  413. 0x85, 0xf3, 0x70, 0x65, 0x79, 0xca, 0x29, 0x61, 0x29, 0xe6, 0x79, 0x1a, 0xa4, 0xc0, 0xcc, 0xe1,
  414. 0x82, 0x0a, 0x11, 0x91, 0xc9, 0x2f, 0xbf, 0xd5, 0xd4, 0x2e, 0xdf, 0xdc, 0x7f, 0x37, 0x95, 0x3a,
  415. 0xa3, 0xbc, 0x48, 0xf0, 0xd2, 0x16, 0xac, 0xc2, 0xf7, 0x9a, 0xac, 0x0d, 0x59, 0x5b, 0xb2, 0x5e,
  416. 0x85, 0xdb, 0x96, 0x09, 0x9e, 0x7c, 0x04, 0x00, 0x00, 0xff, 0xff, 0x27, 0x88, 0xea, 0x11, 0xae,
  417. 0x02, 0x00, 0x00,
  418. }