439 lines
14 KiB
Go
439 lines
14 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: google/spanner/v1/keys.proto
|
|
|
|
/*
|
|
Package spanner is a generated protocol buffer package.
|
|
|
|
It is generated from these files:
|
|
google/spanner/v1/keys.proto
|
|
google/spanner/v1/mutation.proto
|
|
google/spanner/v1/query_plan.proto
|
|
google/spanner/v1/result_set.proto
|
|
google/spanner/v1/spanner.proto
|
|
google/spanner/v1/transaction.proto
|
|
google/spanner/v1/type.proto
|
|
|
|
It has these top-level messages:
|
|
KeyRange
|
|
KeySet
|
|
Mutation
|
|
PlanNode
|
|
QueryPlan
|
|
ResultSet
|
|
PartialResultSet
|
|
ResultSetMetadata
|
|
ResultSetStats
|
|
CreateSessionRequest
|
|
Session
|
|
GetSessionRequest
|
|
DeleteSessionRequest
|
|
ExecuteSqlRequest
|
|
ReadRequest
|
|
BeginTransactionRequest
|
|
CommitRequest
|
|
CommitResponse
|
|
RollbackRequest
|
|
TransactionOptions
|
|
Transaction
|
|
TransactionSelector
|
|
Type
|
|
StructType
|
|
*/
|
|
package spanner
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
import _ "google.golang.org/genproto/googleapis/api/annotations"
|
|
import google_protobuf1 "github.com/golang/protobuf/ptypes/struct"
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
// KeyRange represents a range of rows in a table or index.
|
|
//
|
|
// A range has a start key and an end key. These keys can be open or
|
|
// closed, indicating if the range includes rows with that key.
|
|
//
|
|
// Keys are represented by lists, where the ith value in the list
|
|
// corresponds to the ith component of the table or index primary key.
|
|
// Individual values are encoded as described [here][google.spanner.v1.TypeCode].
|
|
//
|
|
// For example, consider the following table definition:
|
|
//
|
|
// CREATE TABLE UserEvents (
|
|
// UserName STRING(MAX),
|
|
// EventDate STRING(10)
|
|
// ) PRIMARY KEY(UserName, EventDate);
|
|
//
|
|
// The following keys name rows in this table:
|
|
//
|
|
// ["Bob", "2014-09-23"]
|
|
// ["Alfred", "2015-06-12"]
|
|
//
|
|
// Since the `UserEvents` table's `PRIMARY KEY` clause names two
|
|
// columns, each `UserEvents` key has two elements; the first is the
|
|
// `UserName`, and the second is the `EventDate`.
|
|
//
|
|
// Key ranges with multiple components are interpreted
|
|
// lexicographically by component using the table or index key's declared
|
|
// sort order. For example, the following range returns all events for
|
|
// user `"Bob"` that occurred in the year 2015:
|
|
//
|
|
// "start_closed": ["Bob", "2015-01-01"]
|
|
// "end_closed": ["Bob", "2015-12-31"]
|
|
//
|
|
// Start and end keys can omit trailing key components. This affects the
|
|
// inclusion and exclusion of rows that exactly match the provided key
|
|
// components: if the key is closed, then rows that exactly match the
|
|
// provided components are included; if the key is open, then rows
|
|
// that exactly match are not included.
|
|
//
|
|
// For example, the following range includes all events for `"Bob"` that
|
|
// occurred during and after the year 2000:
|
|
//
|
|
// "start_closed": ["Bob", "2000-01-01"]
|
|
// "end_closed": ["Bob"]
|
|
//
|
|
// The next example retrieves all events for `"Bob"`:
|
|
//
|
|
// "start_closed": ["Bob"]
|
|
// "end_closed": ["Bob"]
|
|
//
|
|
// To retrieve events before the year 2000:
|
|
//
|
|
// "start_closed": ["Bob"]
|
|
// "end_open": ["Bob", "2000-01-01"]
|
|
//
|
|
// The following range includes all rows in the table:
|
|
//
|
|
// "start_closed": []
|
|
// "end_closed": []
|
|
//
|
|
// This range returns all users whose `UserName` begins with any
|
|
// character from A to C:
|
|
//
|
|
// "start_closed": ["A"]
|
|
// "end_open": ["D"]
|
|
//
|
|
// This range returns all users whose `UserName` begins with B:
|
|
//
|
|
// "start_closed": ["B"]
|
|
// "end_open": ["C"]
|
|
//
|
|
// Key ranges honor column sort order. For example, suppose a table is
|
|
// defined as follows:
|
|
//
|
|
// CREATE TABLE DescendingSortedTable {
|
|
// Key INT64,
|
|
// ...
|
|
// ) PRIMARY KEY(Key DESC);
|
|
//
|
|
// The following range retrieves all rows with key values between 1
|
|
// and 100 inclusive:
|
|
//
|
|
// "start_closed": ["100"]
|
|
// "end_closed": ["1"]
|
|
//
|
|
// Note that 100 is passed as the start, and 1 is passed as the end,
|
|
// because `Key` is a descending column in the schema.
|
|
type KeyRange struct {
|
|
// The start key must be provided. It can be either closed or open.
|
|
//
|
|
// Types that are valid to be assigned to StartKeyType:
|
|
// *KeyRange_StartClosed
|
|
// *KeyRange_StartOpen
|
|
StartKeyType isKeyRange_StartKeyType `protobuf_oneof:"start_key_type"`
|
|
// The end key must be provided. It can be either closed or open.
|
|
//
|
|
// Types that are valid to be assigned to EndKeyType:
|
|
// *KeyRange_EndClosed
|
|
// *KeyRange_EndOpen
|
|
EndKeyType isKeyRange_EndKeyType `protobuf_oneof:"end_key_type"`
|
|
}
|
|
|
|
func (m *KeyRange) Reset() { *m = KeyRange{} }
|
|
func (m *KeyRange) String() string { return proto.CompactTextString(m) }
|
|
func (*KeyRange) ProtoMessage() {}
|
|
func (*KeyRange) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
type isKeyRange_StartKeyType interface {
|
|
isKeyRange_StartKeyType()
|
|
}
|
|
type isKeyRange_EndKeyType interface {
|
|
isKeyRange_EndKeyType()
|
|
}
|
|
|
|
type KeyRange_StartClosed struct {
|
|
StartClosed *google_protobuf1.ListValue `protobuf:"bytes,1,opt,name=start_closed,json=startClosed,oneof"`
|
|
}
|
|
type KeyRange_StartOpen struct {
|
|
StartOpen *google_protobuf1.ListValue `protobuf:"bytes,2,opt,name=start_open,json=startOpen,oneof"`
|
|
}
|
|
type KeyRange_EndClosed struct {
|
|
EndClosed *google_protobuf1.ListValue `protobuf:"bytes,3,opt,name=end_closed,json=endClosed,oneof"`
|
|
}
|
|
type KeyRange_EndOpen struct {
|
|
EndOpen *google_protobuf1.ListValue `protobuf:"bytes,4,opt,name=end_open,json=endOpen,oneof"`
|
|
}
|
|
|
|
func (*KeyRange_StartClosed) isKeyRange_StartKeyType() {}
|
|
func (*KeyRange_StartOpen) isKeyRange_StartKeyType() {}
|
|
func (*KeyRange_EndClosed) isKeyRange_EndKeyType() {}
|
|
func (*KeyRange_EndOpen) isKeyRange_EndKeyType() {}
|
|
|
|
func (m *KeyRange) GetStartKeyType() isKeyRange_StartKeyType {
|
|
if m != nil {
|
|
return m.StartKeyType
|
|
}
|
|
return nil
|
|
}
|
|
func (m *KeyRange) GetEndKeyType() isKeyRange_EndKeyType {
|
|
if m != nil {
|
|
return m.EndKeyType
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *KeyRange) GetStartClosed() *google_protobuf1.ListValue {
|
|
if x, ok := m.GetStartKeyType().(*KeyRange_StartClosed); ok {
|
|
return x.StartClosed
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *KeyRange) GetStartOpen() *google_protobuf1.ListValue {
|
|
if x, ok := m.GetStartKeyType().(*KeyRange_StartOpen); ok {
|
|
return x.StartOpen
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *KeyRange) GetEndClosed() *google_protobuf1.ListValue {
|
|
if x, ok := m.GetEndKeyType().(*KeyRange_EndClosed); ok {
|
|
return x.EndClosed
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *KeyRange) GetEndOpen() *google_protobuf1.ListValue {
|
|
if x, ok := m.GetEndKeyType().(*KeyRange_EndOpen); ok {
|
|
return x.EndOpen
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofFuncs is for the internal use of the proto package.
|
|
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{}) {
|
|
return _KeyRange_OneofMarshaler, _KeyRange_OneofUnmarshaler, _KeyRange_OneofSizer, []interface{}{
|
|
(*KeyRange_StartClosed)(nil),
|
|
(*KeyRange_StartOpen)(nil),
|
|
(*KeyRange_EndClosed)(nil),
|
|
(*KeyRange_EndOpen)(nil),
|
|
}
|
|
}
|
|
|
|
func _KeyRange_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
|
|
m := msg.(*KeyRange)
|
|
// start_key_type
|
|
switch x := m.StartKeyType.(type) {
|
|
case *KeyRange_StartClosed:
|
|
b.EncodeVarint(1<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.StartClosed); err != nil {
|
|
return err
|
|
}
|
|
case *KeyRange_StartOpen:
|
|
b.EncodeVarint(2<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.StartOpen); err != nil {
|
|
return err
|
|
}
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("KeyRange.StartKeyType has unexpected type %T", x)
|
|
}
|
|
// end_key_type
|
|
switch x := m.EndKeyType.(type) {
|
|
case *KeyRange_EndClosed:
|
|
b.EncodeVarint(3<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.EndClosed); err != nil {
|
|
return err
|
|
}
|
|
case *KeyRange_EndOpen:
|
|
b.EncodeVarint(4<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.EndOpen); err != nil {
|
|
return err
|
|
}
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("KeyRange.EndKeyType has unexpected type %T", x)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _KeyRange_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
|
|
m := msg.(*KeyRange)
|
|
switch tag {
|
|
case 1: // start_key_type.start_closed
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(google_protobuf1.ListValue)
|
|
err := b.DecodeMessage(msg)
|
|
m.StartKeyType = &KeyRange_StartClosed{msg}
|
|
return true, err
|
|
case 2: // start_key_type.start_open
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(google_protobuf1.ListValue)
|
|
err := b.DecodeMessage(msg)
|
|
m.StartKeyType = &KeyRange_StartOpen{msg}
|
|
return true, err
|
|
case 3: // end_key_type.end_closed
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(google_protobuf1.ListValue)
|
|
err := b.DecodeMessage(msg)
|
|
m.EndKeyType = &KeyRange_EndClosed{msg}
|
|
return true, err
|
|
case 4: // end_key_type.end_open
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(google_protobuf1.ListValue)
|
|
err := b.DecodeMessage(msg)
|
|
m.EndKeyType = &KeyRange_EndOpen{msg}
|
|
return true, err
|
|
default:
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
func _KeyRange_OneofSizer(msg proto.Message) (n int) {
|
|
m := msg.(*KeyRange)
|
|
// start_key_type
|
|
switch x := m.StartKeyType.(type) {
|
|
case *KeyRange_StartClosed:
|
|
s := proto.Size(x.StartClosed)
|
|
n += proto.SizeVarint(1<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *KeyRange_StartOpen:
|
|
s := proto.Size(x.StartOpen)
|
|
n += proto.SizeVarint(2<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
// end_key_type
|
|
switch x := m.EndKeyType.(type) {
|
|
case *KeyRange_EndClosed:
|
|
s := proto.Size(x.EndClosed)
|
|
n += proto.SizeVarint(3<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *KeyRange_EndOpen:
|
|
s := proto.Size(x.EndOpen)
|
|
n += proto.SizeVarint(4<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
return n
|
|
}
|
|
|
|
// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All
|
|
// the keys are expected to be in the same table or index. The keys need
|
|
// not be sorted in any particular way.
|
|
//
|
|
// If the same key is specified multiple times in the set (for example
|
|
// if two ranges, two keys, or a key and a range overlap), Cloud Spanner
|
|
// behaves as if the key were only specified once.
|
|
type KeySet struct {
|
|
// A list of specific keys. Entries in `keys` should have exactly as
|
|
// many elements as there are columns in the primary or index key
|
|
// with which this `KeySet` is used. Individual key values are
|
|
// encoded as described [here][google.spanner.v1.TypeCode].
|
|
Keys []*google_protobuf1.ListValue `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"`
|
|
// A list of key ranges. See [KeyRange][google.spanner.v1.KeyRange] for more information about
|
|
// key range specifications.
|
|
Ranges []*KeyRange `protobuf:"bytes,2,rep,name=ranges" json:"ranges,omitempty"`
|
|
// For convenience `all` can be set to `true` to indicate that this
|
|
// `KeySet` matches all keys in the table or index. Note that any keys
|
|
// specified in `keys` or `ranges` are only yielded once.
|
|
All bool `protobuf:"varint,3,opt,name=all" json:"all,omitempty"`
|
|
}
|
|
|
|
func (m *KeySet) Reset() { *m = KeySet{} }
|
|
func (m *KeySet) String() string { return proto.CompactTextString(m) }
|
|
func (*KeySet) ProtoMessage() {}
|
|
func (*KeySet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
|
|
|
func (m *KeySet) GetKeys() []*google_protobuf1.ListValue {
|
|
if m != nil {
|
|
return m.Keys
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *KeySet) GetRanges() []*KeyRange {
|
|
if m != nil {
|
|
return m.Ranges
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *KeySet) GetAll() bool {
|
|
if m != nil {
|
|
return m.All
|
|
}
|
|
return false
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*KeyRange)(nil), "google.spanner.v1.KeyRange")
|
|
proto.RegisterType((*KeySet)(nil), "google.spanner.v1.KeySet")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("google/spanner/v1/keys.proto", fileDescriptor0) }
|
|
|
|
var fileDescriptor0 = []byte{
|
|
// 356 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x6b, 0xf2, 0x30,
|
|
0x18, 0xc7, 0xdf, 0x56, 0xf1, 0xd5, 0x28, 0xe2, 0x5b, 0x78, 0x59, 0x71, 0x3b, 0x88, 0xa7, 0x9d,
|
|
0x52, 0x9c, 0x87, 0x0d, 0x3c, 0x0c, 0xea, 0x61, 0x03, 0x07, 0x93, 0x0a, 0x1e, 0x76, 0x91, 0x68,
|
|
0x9f, 0x85, 0x62, 0x96, 0x84, 0x26, 0x95, 0xf5, 0xb4, 0xaf, 0xb2, 0xf3, 0x3e, 0xe5, 0x48, 0x9a,
|
|
0x8e, 0x81, 0xb0, 0x79, 0x4b, 0xf8, 0x3f, 0xbf, 0xe7, 0x97, 0x3e, 0x4f, 0xd1, 0x05, 0x15, 0x82,
|
|
0x32, 0x88, 0x94, 0x24, 0x9c, 0x43, 0x1e, 0x1d, 0x26, 0xd1, 0x1e, 0x4a, 0x85, 0x65, 0x2e, 0xb4,
|
|
0x08, 0xfe, 0x55, 0x29, 0x76, 0x29, 0x3e, 0x4c, 0x86, 0x35, 0x40, 0x64, 0x16, 0x11, 0xce, 0x85,
|
|
0x26, 0x3a, 0x13, 0xdc, 0x01, 0x5f, 0xa9, 0xbd, 0x6d, 0x8b, 0xe7, 0x48, 0xe9, 0xbc, 0xd8, 0xe9,
|
|
0x2a, 0x1d, 0xbf, 0xfb, 0xa8, 0xbd, 0x80, 0x32, 0x21, 0x9c, 0x42, 0x70, 0x8b, 0x7a, 0x4a, 0x93,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