diff --git a/cluster/bootstrap.go b/cluster/bootstrap.go index f3500211..f47f8934 100644 --- a/cluster/bootstrap.go +++ b/cluster/bootstrap.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/random" ) diff --git a/cluster/client.go b/cluster/client.go index 04c2b621..d25dc66d 100644 --- a/cluster/client.go +++ b/cluster/client.go @@ -13,7 +13,7 @@ import ( "time" "github.com/rqlite/rqlite/v8/auth" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/rtls" "github.com/rqlite/rqlite/v8/tcp" "github.com/rqlite/rqlite/v8/tcp/pool" diff --git a/cluster/client_test.go b/cluster/client_test.go index bb36d43d..dbf9398f 100644 --- a/cluster/client_test.go +++ b/cluster/client_test.go @@ -9,7 +9,7 @@ import ( "time" "github.com/rqlite/rqlite/v8/cluster/servicetest" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" "google.golang.org/protobuf/proto" ) diff --git a/cluster/join.go b/cluster/join.go index 4477fd28..47cfc7ad 100644 --- a/cluster/join.go +++ b/cluster/join.go @@ -6,7 +6,7 @@ import ( "os" "time" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" ) var ( diff --git a/cluster/message.proto b/cluster/message.proto index f14b481e..0b35522d 100644 --- a/cluster/message.proto +++ b/cluster/message.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package cluster; -import "command/command.proto"; +import "command/proto/command.proto"; option go_package = "github.com/rqlite/rqlite/v8/cluster"; diff --git a/cluster/remove.go b/cluster/remove.go index 4a848042..5952107a 100644 --- a/cluster/remove.go +++ b/cluster/remove.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" ) const ( diff --git a/cluster/service.go b/cluster/service.go index 42defc21..c1556907 100644 --- a/cluster/service.go +++ b/cluster/service.go @@ -15,7 +15,7 @@ import ( "time" "github.com/rqlite/rqlite/v8/auth" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" "google.golang.org/protobuf/proto" ) diff --git a/cluster/service_db_clstr_test.go b/cluster/service_db_clstr_test.go index 1ea82734..8a064046 100644 --- a/cluster/service_db_clstr_test.go +++ b/cluster/service_db_clstr_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/rqlite/rqlite/v8/command" "github.com/rqlite/rqlite/v8/command/encoding" + command "github.com/rqlite/rqlite/v8/command/proto" ) const shortWait = 1 * time.Second diff --git a/cluster/service_test.go b/cluster/service_test.go index d5aa5067..2a628c4c 100644 --- a/cluster/service_test.go +++ b/cluster/service_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/testdata/x509" ) diff --git a/command/chunking/chunker.go b/command/chunking/chunker.go index 5e0691eb..7347a210 100644 --- a/command/chunking/chunker.go +++ b/command/chunking/chunker.go @@ -9,7 +9,7 @@ import ( "io" "sync" - "github.com/rqlite/rqlite/v8/command" + "github.com/rqlite/rqlite/v8/command/proto" ) const ( @@ -70,7 +70,7 @@ func generateStreamID() string { } // Next returns the next LoadChunkRequest, or io.EOF if finished. -func (c *Chunker) Next() (*command.LoadChunkRequest, error) { +func (c *Chunker) Next() (*proto.LoadChunkRequest, error) { c.statsMu.Lock() defer c.statsMu.Unlock() @@ -126,7 +126,7 @@ func (c *Chunker) Next() (*command.LoadChunkRequest, error) { return nil, io.EOF } // If previous chunks were sent, return a final empty chunk with IsLast = true - return &command.LoadChunkRequest{ + return &proto.LoadChunkRequest{ StreamId: c.streamID, SequenceNum: c.sequenceNum + 1, IsLast: true, @@ -135,7 +135,7 @@ func (c *Chunker) Next() (*command.LoadChunkRequest, error) { } c.sequenceNum++ - return &command.LoadChunkRequest{ + return &proto.LoadChunkRequest{ StreamId: c.streamID, SequenceNum: c.sequenceNum, IsLast: totalRead < c.chunkSize, @@ -145,8 +145,8 @@ func (c *Chunker) Next() (*command.LoadChunkRequest, error) { // Abort returns a LoadChunkRequest that signals the receiver to abort the // given stream. -func (c *Chunker) Abort() *command.LoadChunkRequest { - return &command.LoadChunkRequest{ +func (c *Chunker) Abort() *proto.LoadChunkRequest { + return &proto.LoadChunkRequest{ StreamId: c.streamID, Abort: true, } diff --git a/command/chunking/dechunker.go b/command/chunking/dechunker.go index 6f2ce7b6..d3a5f30d 100644 --- a/command/chunking/dechunker.go +++ b/command/chunking/dechunker.go @@ -8,7 +8,7 @@ import ( "os" "sync" - "github.com/rqlite/rqlite/v8/command" + "github.com/rqlite/rqlite/v8/command/proto" ) // Dechunker is a writer that writes chunks to a file and returns the file path when @@ -34,7 +34,7 @@ func NewDechunker(dir string) (*Dechunker, error) { // WriteChunk writes the chunk to the file. If the chunk is the last chunk, the // the bool return value is true. -func (d *Dechunker) WriteChunk(chunk *command.LoadChunkRequest) (bool, error) { +func (d *Dechunker) WriteChunk(chunk *proto.LoadChunkRequest) (bool, error) { if d.streamID == "" { d.streamID = chunk.StreamId } else if d.streamID != chunk.StreamId { diff --git a/command/chunking/dechunker_test.go b/command/chunking/dechunker_test.go index a9ff7bd0..aab9d9d3 100644 --- a/command/chunking/dechunker_test.go +++ b/command/chunking/dechunker_test.go @@ -10,12 +10,12 @@ import ( "strings" "testing" - "github.com/rqlite/rqlite/v8/command" + "github.com/rqlite/rqlite/v8/command/proto" ) func Test_SingleChunk(t *testing.T) { data := []byte("Hello, World!") - chunk := &command.LoadChunkRequest{ + chunk := &proto.LoadChunkRequest{ StreamId: "123", SequenceNum: 1, IsLast: true, @@ -58,14 +58,14 @@ func Test_SingleChunk(t *testing.T) { func Test_MultiChunk(t *testing.T) { data1 := []byte("Hello, World!") - chunk1 := &command.LoadChunkRequest{ + chunk1 := &proto.LoadChunkRequest{ StreamId: "123", SequenceNum: 1, IsLast: false, Data: mustCompressData(data1), } data2 := []byte("I'm OK") - chunk2 := &command.LoadChunkRequest{ + chunk2 := &proto.LoadChunkRequest{ StreamId: "123", SequenceNum: 2, IsLast: true, @@ -83,7 +83,7 @@ func Test_MultiChunk(t *testing.T) { t.Fatalf("failed to create Dechunker: %v", err) } - for _, chunk := range []*command.LoadChunkRequest{chunk1, chunk2} { + for _, chunk := range []*proto.LoadChunkRequest{chunk1, chunk2} { isLast, err := dechunker.WriteChunk(chunk) if err != nil { t.Fatalf("failed to write chunk: %v", err) @@ -110,20 +110,20 @@ func Test_MultiChunk(t *testing.T) { func Test_MultiChunkNilData(t *testing.T) { data1 := []byte("Hello, World!") - chunk1 := &command.LoadChunkRequest{ + chunk1 := &proto.LoadChunkRequest{ StreamId: "123", SequenceNum: 1, IsLast: false, Data: mustCompressData(data1), } data2 := []byte("I'm OK") - chunk2 := &command.LoadChunkRequest{ + chunk2 := &proto.LoadChunkRequest{ StreamId: "123", SequenceNum: 2, IsLast: false, Data: mustCompressData(data2), } - chunk3 := &command.LoadChunkRequest{ + chunk3 := &proto.LoadChunkRequest{ StreamId: "123", SequenceNum: 3, IsLast: true, @@ -141,7 +141,7 @@ func Test_MultiChunkNilData(t *testing.T) { t.Fatalf("failed to create Dechunker: %v", err) } - for _, chunk := range []*command.LoadChunkRequest{chunk1, chunk2, chunk3} { + for _, chunk := range []*proto.LoadChunkRequest{chunk1, chunk2, chunk3} { isLast, err := dechunker.WriteChunk(chunk) if err != nil { t.Fatalf("failed to write chunk: %v", err) @@ -170,14 +170,14 @@ func Test_UnexpectedStreamID(t *testing.T) { originalData := []byte("Hello, World!") compressedData := mustCompressData(originalData) - chunk1 := &command.LoadChunkRequest{ + chunk1 := &proto.LoadChunkRequest{ StreamId: "123", SequenceNum: 1, IsLast: false, Data: compressedData, } - chunk2 := &command.LoadChunkRequest{ + chunk2 := &proto.LoadChunkRequest{ StreamId: "456", SequenceNum: 2, IsLast: true, @@ -214,14 +214,14 @@ func Test_ChunksOutOfOrder(t *testing.T) { originalData := []byte("Hello, World!") compressedData := mustCompressData(originalData) - chunk1 := &command.LoadChunkRequest{ + chunk1 := &proto.LoadChunkRequest{ StreamId: "123", SequenceNum: 1, IsLast: false, Data: compressedData, } - chunk3 := &command.LoadChunkRequest{ + chunk3 := &proto.LoadChunkRequest{ StreamId: "123", SequenceNum: 3, IsLast: true, @@ -283,7 +283,7 @@ func Test_ReassemblyOfLargeData(t *testing.T) { end := start + chunkSize isLast := i == numChunks-1 - if _, err := d.WriteChunk(&command.LoadChunkRequest{ + if _, err := d.WriteChunk(&proto.LoadChunkRequest{ StreamId: "1", SequenceNum: int64(i + 1), IsLast: isLast, diff --git a/command/command.pb.go b/command/command.pb.go deleted file mode 100644 index 96eee5a1..00000000 --- a/command/command.pb.go +++ /dev/null @@ -1,1842 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.6.1 -// source: command/command.proto - -package command - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type QueryRequest_Level int32 - -const ( - QueryRequest_QUERY_REQUEST_LEVEL_NONE QueryRequest_Level = 0 - QueryRequest_QUERY_REQUEST_LEVEL_WEAK QueryRequest_Level = 1 - QueryRequest_QUERY_REQUEST_LEVEL_STRONG QueryRequest_Level = 2 -) - -// Enum value maps for QueryRequest_Level. -var ( - QueryRequest_Level_name = map[int32]string{ - 0: "QUERY_REQUEST_LEVEL_NONE", - 1: "QUERY_REQUEST_LEVEL_WEAK", - 2: "QUERY_REQUEST_LEVEL_STRONG", - } - QueryRequest_Level_value = map[string]int32{ - "QUERY_REQUEST_LEVEL_NONE": 0, - "QUERY_REQUEST_LEVEL_WEAK": 1, - "QUERY_REQUEST_LEVEL_STRONG": 2, - } -) - -func (x QueryRequest_Level) Enum() *QueryRequest_Level { - p := new(QueryRequest_Level) - *p = x - return p -} - -func (x QueryRequest_Level) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (QueryRequest_Level) Descriptor() protoreflect.EnumDescriptor { - return file_command_command_proto_enumTypes[0].Descriptor() -} - -func (QueryRequest_Level) Type() protoreflect.EnumType { - return &file_command_command_proto_enumTypes[0] -} - -func (x QueryRequest_Level) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use QueryRequest_Level.Descriptor instead. -func (QueryRequest_Level) EnumDescriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{3, 0} -} - -type BackupRequest_Format int32 - -const ( - BackupRequest_BACKUP_REQUEST_FORMAT_NONE BackupRequest_Format = 0 - BackupRequest_BACKUP_REQUEST_FORMAT_SQL BackupRequest_Format = 1 - BackupRequest_BACKUP_REQUEST_FORMAT_BINARY BackupRequest_Format = 2 -) - -// Enum value maps for BackupRequest_Format. -var ( - BackupRequest_Format_name = map[int32]string{ - 0: "BACKUP_REQUEST_FORMAT_NONE", - 1: "BACKUP_REQUEST_FORMAT_SQL", - 2: "BACKUP_REQUEST_FORMAT_BINARY", - } - BackupRequest_Format_value = map[string]int32{ - "BACKUP_REQUEST_FORMAT_NONE": 0, - "BACKUP_REQUEST_FORMAT_SQL": 1, - "BACKUP_REQUEST_FORMAT_BINARY": 2, - } -) - -func (x BackupRequest_Format) Enum() *BackupRequest_Format { - p := new(BackupRequest_Format) - *p = x - return p -} - -func (x BackupRequest_Format) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BackupRequest_Format) Descriptor() protoreflect.EnumDescriptor { - return file_command_command_proto_enumTypes[1].Descriptor() -} - -func (BackupRequest_Format) Type() protoreflect.EnumType { - return &file_command_command_proto_enumTypes[1] -} - -func (x BackupRequest_Format) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use BackupRequest_Format.Descriptor instead. -func (BackupRequest_Format) EnumDescriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{10, 0} -} - -type Command_Type int32 - -const ( - Command_COMMAND_TYPE_UNKNOWN Command_Type = 0 - Command_COMMAND_TYPE_QUERY Command_Type = 1 - Command_COMMAND_TYPE_EXECUTE Command_Type = 2 - Command_COMMAND_TYPE_NOOP Command_Type = 3 - Command_COMMAND_TYPE_LOAD Command_Type = 4 - Command_COMMAND_TYPE_JOIN Command_Type = 5 - Command_COMMAND_TYPE_EXECUTE_QUERY Command_Type = 6 - Command_COMMAND_TYPE_LOAD_CHUNK Command_Type = 7 -) - -// Enum value maps for Command_Type. -var ( - Command_Type_name = map[int32]string{ - 0: "COMMAND_TYPE_UNKNOWN", - 1: "COMMAND_TYPE_QUERY", - 2: "COMMAND_TYPE_EXECUTE", - 3: "COMMAND_TYPE_NOOP", - 4: "COMMAND_TYPE_LOAD", - 5: "COMMAND_TYPE_JOIN", - 6: "COMMAND_TYPE_EXECUTE_QUERY", - 7: "COMMAND_TYPE_LOAD_CHUNK", - } - Command_Type_value = map[string]int32{ - "COMMAND_TYPE_UNKNOWN": 0, - "COMMAND_TYPE_QUERY": 1, - "COMMAND_TYPE_EXECUTE": 2, - "COMMAND_TYPE_NOOP": 3, - "COMMAND_TYPE_LOAD": 4, - "COMMAND_TYPE_JOIN": 5, - "COMMAND_TYPE_EXECUTE_QUERY": 6, - "COMMAND_TYPE_LOAD_CHUNK": 7, - } -) - -func (x Command_Type) Enum() *Command_Type { - p := new(Command_Type) - *p = x - return p -} - -func (x Command_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Command_Type) Descriptor() protoreflect.EnumDescriptor { - return file_command_command_proto_enumTypes[2].Descriptor() -} - -func (Command_Type) Type() protoreflect.EnumType { - return &file_command_command_proto_enumTypes[2] -} - -func (x Command_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Command_Type.Descriptor instead. -func (Command_Type) EnumDescriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{17, 0} -} - -type Parameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Value: - // - // *Parameter_I - // *Parameter_D - // *Parameter_B - // *Parameter_Y - // *Parameter_S - Value isParameter_Value `protobuf_oneof:"value"` - Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *Parameter) Reset() { - *x = Parameter{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Parameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Parameter) ProtoMessage() {} - -func (x *Parameter) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Parameter.ProtoReflect.Descriptor instead. -func (*Parameter) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{0} -} - -func (m *Parameter) GetValue() isParameter_Value { - if m != nil { - return m.Value - } - return nil -} - -func (x *Parameter) GetI() int64 { - if x, ok := x.GetValue().(*Parameter_I); ok { - return x.I - } - return 0 -} - -func (x *Parameter) GetD() float64 { - if x, ok := x.GetValue().(*Parameter_D); ok { - return x.D - } - return 0 -} - -func (x *Parameter) GetB() bool { - if x, ok := x.GetValue().(*Parameter_B); ok { - return x.B - } - return false -} - -func (x *Parameter) GetY() []byte { - if x, ok := x.GetValue().(*Parameter_Y); ok { - return x.Y - } - return nil -} - -func (x *Parameter) GetS() string { - if x, ok := x.GetValue().(*Parameter_S); ok { - return x.S - } - return "" -} - -func (x *Parameter) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type isParameter_Value interface { - isParameter_Value() -} - -type Parameter_I struct { - I int64 `protobuf:"zigzag64,1,opt,name=i,proto3,oneof"` -} - -type Parameter_D struct { - D float64 `protobuf:"fixed64,2,opt,name=d,proto3,oneof"` -} - -type Parameter_B struct { - B bool `protobuf:"varint,3,opt,name=b,proto3,oneof"` -} - -type Parameter_Y struct { - Y []byte `protobuf:"bytes,4,opt,name=y,proto3,oneof"` -} - -type Parameter_S struct { - S string `protobuf:"bytes,5,opt,name=s,proto3,oneof"` -} - -func (*Parameter_I) isParameter_Value() {} - -func (*Parameter_D) isParameter_Value() {} - -func (*Parameter_B) isParameter_Value() {} - -func (*Parameter_Y) isParameter_Value() {} - -func (*Parameter_S) isParameter_Value() {} - -type Statement struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sql string `protobuf:"bytes,1,opt,name=sql,proto3" json:"sql,omitempty"` - Parameters []*Parameter `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty"` -} - -func (x *Statement) Reset() { - *x = Statement{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Statement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Statement) ProtoMessage() {} - -func (x *Statement) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Statement.ProtoReflect.Descriptor instead. -func (*Statement) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{1} -} - -func (x *Statement) GetSql() string { - if x != nil { - return x.Sql - } - return "" -} - -func (x *Statement) GetParameters() []*Parameter { - if x != nil { - return x.Parameters - } - return nil -} - -type Request struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Transaction bool `protobuf:"varint,1,opt,name=transaction,proto3" json:"transaction,omitempty"` - Statements []*Statement `protobuf:"bytes,2,rep,name=statements,proto3" json:"statements,omitempty"` -} - -func (x *Request) Reset() { - *x = Request{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Request) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Request) ProtoMessage() {} - -func (x *Request) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Request.ProtoReflect.Descriptor instead. -func (*Request) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{2} -} - -func (x *Request) GetTransaction() bool { - if x != nil { - return x.Transaction - } - return false -} - -func (x *Request) GetStatements() []*Statement { - if x != nil { - return x.Statements - } - return nil -} - -type QueryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - Timings bool `protobuf:"varint,2,opt,name=timings,proto3" json:"timings,omitempty"` - Level QueryRequest_Level `protobuf:"varint,3,opt,name=level,proto3,enum=command.QueryRequest_Level" json:"level,omitempty"` - Freshness int64 `protobuf:"varint,4,opt,name=freshness,proto3" json:"freshness,omitempty"` -} - -func (x *QueryRequest) Reset() { - *x = QueryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryRequest) ProtoMessage() {} - -func (x *QueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. -func (*QueryRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{3} -} - -func (x *QueryRequest) GetRequest() *Request { - if x != nil { - return x.Request - } - return nil -} - -func (x *QueryRequest) GetTimings() bool { - if x != nil { - return x.Timings - } - return false -} - -func (x *QueryRequest) GetLevel() QueryRequest_Level { - if x != nil { - return x.Level - } - return QueryRequest_QUERY_REQUEST_LEVEL_NONE -} - -func (x *QueryRequest) GetFreshness() int64 { - if x != nil { - return x.Freshness - } - return 0 -} - -type Values struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Parameters []*Parameter `protobuf:"bytes,1,rep,name=parameters,proto3" json:"parameters,omitempty"` -} - -func (x *Values) Reset() { - *x = Values{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Values) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Values) ProtoMessage() {} - -func (x *Values) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Values.ProtoReflect.Descriptor instead. -func (*Values) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{4} -} - -func (x *Values) GetParameters() []*Parameter { - if x != nil { - return x.Parameters - } - return nil -} - -type QueryRows struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Columns []string `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"` - Types []string `protobuf:"bytes,2,rep,name=types,proto3" json:"types,omitempty"` - Values []*Values `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` - Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` - Time float64 `protobuf:"fixed64,5,opt,name=time,proto3" json:"time,omitempty"` -} - -func (x *QueryRows) Reset() { - *x = QueryRows{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryRows) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryRows) ProtoMessage() {} - -func (x *QueryRows) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryRows.ProtoReflect.Descriptor instead. -func (*QueryRows) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{5} -} - -func (x *QueryRows) GetColumns() []string { - if x != nil { - return x.Columns - } - return nil -} - -func (x *QueryRows) GetTypes() []string { - if x != nil { - return x.Types - } - return nil -} - -func (x *QueryRows) GetValues() []*Values { - if x != nil { - return x.Values - } - return nil -} - -func (x *QueryRows) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *QueryRows) GetTime() float64 { - if x != nil { - return x.Time - } - return 0 -} - -type ExecuteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - Timings bool `protobuf:"varint,2,opt,name=timings,proto3" json:"timings,omitempty"` -} - -func (x *ExecuteRequest) Reset() { - *x = ExecuteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecuteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecuteRequest) ProtoMessage() {} - -func (x *ExecuteRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead. -func (*ExecuteRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{6} -} - -func (x *ExecuteRequest) GetRequest() *Request { - if x != nil { - return x.Request - } - return nil -} - -func (x *ExecuteRequest) GetTimings() bool { - if x != nil { - return x.Timings - } - return false -} - -type ExecuteResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LastInsertId int64 `protobuf:"varint,1,opt,name=last_insert_id,json=lastInsertId,proto3" json:"last_insert_id,omitempty"` - RowsAffected int64 `protobuf:"varint,2,opt,name=rows_affected,json=rowsAffected,proto3" json:"rows_affected,omitempty"` - Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` - Time float64 `protobuf:"fixed64,4,opt,name=time,proto3" json:"time,omitempty"` -} - -func (x *ExecuteResult) Reset() { - *x = ExecuteResult{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecuteResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecuteResult) ProtoMessage() {} - -func (x *ExecuteResult) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecuteResult.ProtoReflect.Descriptor instead. -func (*ExecuteResult) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{7} -} - -func (x *ExecuteResult) GetLastInsertId() int64 { - if x != nil { - return x.LastInsertId - } - return 0 -} - -func (x *ExecuteResult) GetRowsAffected() int64 { - if x != nil { - return x.RowsAffected - } - return 0 -} - -func (x *ExecuteResult) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *ExecuteResult) GetTime() float64 { - if x != nil { - return x.Time - } - return 0 -} - -type ExecuteQueryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - Timings bool `protobuf:"varint,2,opt,name=timings,proto3" json:"timings,omitempty"` - Level QueryRequest_Level `protobuf:"varint,3,opt,name=level,proto3,enum=command.QueryRequest_Level" json:"level,omitempty"` - Freshness int64 `protobuf:"varint,4,opt,name=freshness,proto3" json:"freshness,omitempty"` -} - -func (x *ExecuteQueryRequest) Reset() { - *x = ExecuteQueryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecuteQueryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecuteQueryRequest) ProtoMessage() {} - -func (x *ExecuteQueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecuteQueryRequest.ProtoReflect.Descriptor instead. -func (*ExecuteQueryRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{8} -} - -func (x *ExecuteQueryRequest) GetRequest() *Request { - if x != nil { - return x.Request - } - return nil -} - -func (x *ExecuteQueryRequest) GetTimings() bool { - if x != nil { - return x.Timings - } - return false -} - -func (x *ExecuteQueryRequest) GetLevel() QueryRequest_Level { - if x != nil { - return x.Level - } - return QueryRequest_QUERY_REQUEST_LEVEL_NONE -} - -func (x *ExecuteQueryRequest) GetFreshness() int64 { - if x != nil { - return x.Freshness - } - return 0 -} - -type ExecuteQueryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Result: - // - // *ExecuteQueryResponse_Q - // *ExecuteQueryResponse_E - // *ExecuteQueryResponse_Error - Result isExecuteQueryResponse_Result `protobuf_oneof:"result"` -} - -func (x *ExecuteQueryResponse) Reset() { - *x = ExecuteQueryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecuteQueryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecuteQueryResponse) ProtoMessage() {} - -func (x *ExecuteQueryResponse) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecuteQueryResponse.ProtoReflect.Descriptor instead. -func (*ExecuteQueryResponse) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{9} -} - -func (m *ExecuteQueryResponse) GetResult() isExecuteQueryResponse_Result { - if m != nil { - return m.Result - } - return nil -} - -func (x *ExecuteQueryResponse) GetQ() *QueryRows { - if x, ok := x.GetResult().(*ExecuteQueryResponse_Q); ok { - return x.Q - } - return nil -} - -func (x *ExecuteQueryResponse) GetE() *ExecuteResult { - if x, ok := x.GetResult().(*ExecuteQueryResponse_E); ok { - return x.E - } - return nil -} - -func (x *ExecuteQueryResponse) GetError() string { - if x, ok := x.GetResult().(*ExecuteQueryResponse_Error); ok { - return x.Error - } - return "" -} - -type isExecuteQueryResponse_Result interface { - isExecuteQueryResponse_Result() -} - -type ExecuteQueryResponse_Q struct { - Q *QueryRows `protobuf:"bytes,1,opt,name=q,proto3,oneof"` -} - -type ExecuteQueryResponse_E struct { - E *ExecuteResult `protobuf:"bytes,2,opt,name=e,proto3,oneof"` -} - -type ExecuteQueryResponse_Error struct { - Error string `protobuf:"bytes,3,opt,name=error,proto3,oneof"` -} - -func (*ExecuteQueryResponse_Q) isExecuteQueryResponse_Result() {} - -func (*ExecuteQueryResponse_E) isExecuteQueryResponse_Result() {} - -func (*ExecuteQueryResponse_Error) isExecuteQueryResponse_Result() {} - -type BackupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Format BackupRequest_Format `protobuf:"varint,1,opt,name=format,proto3,enum=command.BackupRequest_Format" json:"format,omitempty"` - Leader bool `protobuf:"varint,2,opt,name=Leader,proto3" json:"Leader,omitempty"` - Vacuum bool `protobuf:"varint,3,opt,name=Vacuum,proto3" json:"Vacuum,omitempty"` -} - -func (x *BackupRequest) Reset() { - *x = BackupRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BackupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupRequest) ProtoMessage() {} - -func (x *BackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BackupRequest.ProtoReflect.Descriptor instead. -func (*BackupRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{10} -} - -func (x *BackupRequest) GetFormat() BackupRequest_Format { - if x != nil { - return x.Format - } - return BackupRequest_BACKUP_REQUEST_FORMAT_NONE -} - -func (x *BackupRequest) GetLeader() bool { - if x != nil { - return x.Leader - } - return false -} - -func (x *BackupRequest) GetVacuum() bool { - if x != nil { - return x.Vacuum - } - return false -} - -type LoadRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *LoadRequest) Reset() { - *x = LoadRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadRequest) ProtoMessage() {} - -func (x *LoadRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoadRequest.ProtoReflect.Descriptor instead. -func (*LoadRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{11} -} - -func (x *LoadRequest) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type LoadChunkRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StreamId string `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` - SequenceNum int64 `protobuf:"varint,2,opt,name=sequence_num,json=sequenceNum,proto3" json:"sequence_num,omitempty"` - IsLast bool `protobuf:"varint,3,opt,name=is_last,json=isLast,proto3" json:"is_last,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` - Abort bool `protobuf:"varint,5,opt,name=abort,proto3" json:"abort,omitempty"` -} - -func (x *LoadChunkRequest) Reset() { - *x = LoadChunkRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadChunkRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadChunkRequest) ProtoMessage() {} - -func (x *LoadChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoadChunkRequest.ProtoReflect.Descriptor instead. -func (*LoadChunkRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{12} -} - -func (x *LoadChunkRequest) GetStreamId() string { - if x != nil { - return x.StreamId - } - return "" -} - -func (x *LoadChunkRequest) GetSequenceNum() int64 { - if x != nil { - return x.SequenceNum - } - return 0 -} - -func (x *LoadChunkRequest) GetIsLast() bool { - if x != nil { - return x.IsLast - } - return false -} - -func (x *LoadChunkRequest) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *LoadChunkRequest) GetAbort() bool { - if x != nil { - return x.Abort - } - return false -} - -type JoinRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Voter bool `protobuf:"varint,3,opt,name=voter,proto3" json:"voter,omitempty"` -} - -func (x *JoinRequest) Reset() { - *x = JoinRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JoinRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JoinRequest) ProtoMessage() {} - -func (x *JoinRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use JoinRequest.ProtoReflect.Descriptor instead. -func (*JoinRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{13} -} - -func (x *JoinRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *JoinRequest) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *JoinRequest) GetVoter() bool { - if x != nil { - return x.Voter - } - return false -} - -type NotifyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` -} - -func (x *NotifyRequest) Reset() { - *x = NotifyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NotifyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NotifyRequest) ProtoMessage() {} - -func (x *NotifyRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NotifyRequest.ProtoReflect.Descriptor instead. -func (*NotifyRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{14} -} - -func (x *NotifyRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *NotifyRequest) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -type RemoveNodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *RemoveNodeRequest) Reset() { - *x = RemoveNodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveNodeRequest) ProtoMessage() {} - -func (x *RemoveNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveNodeRequest.ProtoReflect.Descriptor instead. -func (*RemoveNodeRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{15} -} - -func (x *RemoveNodeRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type Noop struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *Noop) Reset() { - *x = Noop{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Noop) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Noop) ProtoMessage() {} - -func (x *Noop) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Noop.ProtoReflect.Descriptor instead. -func (*Noop) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{16} -} - -func (x *Noop) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type Command struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type Command_Type `protobuf:"varint,1,opt,name=type,proto3,enum=command.Command_Type" json:"type,omitempty"` - SubCommand []byte `protobuf:"bytes,2,opt,name=sub_command,json=subCommand,proto3" json:"sub_command,omitempty"` - Compressed bool `protobuf:"varint,3,opt,name=compressed,proto3" json:"compressed,omitempty"` -} - -func (x *Command) Reset() { - *x = Command{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Command) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Command) ProtoMessage() {} - -func (x *Command) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Command.ProtoReflect.Descriptor instead. -func (*Command) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{17} -} - -func (x *Command) GetType() Command_Type { - if x != nil { - return x.Type - } - return Command_COMMAND_TYPE_UNKNOWN -} - -func (x *Command) GetSubCommand() []byte { - if x != nil { - return x.SubCommand - } - return nil -} - -func (x *Command) GetCompressed() bool { - if x != nil { - return x.Compressed - } - return false -} - -var File_command_command_proto protoreflect.FileDescriptor - -var file_command_command_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x22, 0x78, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, - 0x01, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x48, 0x00, 0x52, 0x01, 0x69, 0x12, 0x0e, 0x0a, - 0x01, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x01, 0x64, 0x12, 0x0e, 0x0a, - 0x01, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x01, 0x62, 0x12, 0x0e, 0x0a, - 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x01, 0x79, 0x12, 0x0e, 0x0a, - 0x01, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x01, 0x73, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x51, 0x0a, 0x09, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x71, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x71, 0x6c, 0x12, 0x32, 0x0a, 0x0a, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x5f, 0x0a, - 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x0a, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x8a, - 0x02, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x2a, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, - 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x69, - 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x6e, 0x65, 0x73, 0x73, 0x22, 0x63, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, - 0x1c, 0x0a, 0x18, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, - 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1c, 0x0a, - 0x18, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x4c, - 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x45, 0x41, 0x4b, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x51, - 0x55, 0x45, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x4c, 0x45, 0x56, - 0x45, 0x4c, 0x5f, 0x53, 0x54, 0x52, 0x4f, 0x4e, 0x47, 0x10, 0x02, 0x22, 0x3c, 0x0a, 0x06, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x8e, 0x01, 0x0a, 0x09, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x56, 0x0a, 0x0e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x69, - 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x69, 0x6e, - 0x67, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x0d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x73, - 0x65, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, - 0x73, 0x74, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x6f, - 0x77, 0x73, 0x5f, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0c, 0x72, 0x6f, 0x77, 0x73, 0x41, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xac, 0x01, 0x0a, 0x13, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, - 0x07, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x65, - 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, - 0x65, 0x73, 0x68, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, - 0x72, 0x65, 0x73, 0x68, 0x6e, 0x65, 0x73, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x14, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x22, 0x0a, 0x01, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x6f, 0x77, 0x73, - 0x48, 0x00, 0x52, 0x01, 0x71, 0x12, 0x26, 0x0a, 0x01, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x01, 0x65, 0x12, 0x16, 0x0a, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, - 0xe1, 0x01, 0x0a, 0x0d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x35, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x16, 0x0a, 0x06, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x22, 0x69, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x12, 0x1e, 0x0a, 0x1a, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51, - 0x55, 0x45, 0x53, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, - 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51, - 0x55, 0x45, 0x53, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x53, 0x51, 0x4c, 0x10, - 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51, 0x55, - 0x45, 0x53, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x42, 0x49, 0x4e, 0x41, 0x52, - 0x59, 0x10, 0x02, 0x22, 0x21, 0x0a, 0x0b, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x95, 0x01, 0x0a, 0x10, 0x4c, 0x6f, 0x61, 0x64, 0x43, - 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x71, 0x75, - 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, - 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x69, - 0x73, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, - 0x4c, 0x61, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x62, 0x6f, 0x72, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x22, 0x4d, - 0x0a, 0x0b, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x22, 0x39, 0x0a, - 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x23, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x16, 0x0a, - 0x04, 0x4e, 0x6f, 0x6f, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xcc, 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x73, 0x75, 0x62, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1e, 0x0a, - 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0xd4, 0x01, - 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, - 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, - 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, - 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x4f, 0x50, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, - 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0x04, - 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x4a, 0x4f, 0x49, 0x4e, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x4d, 0x4d, 0x41, - 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x5f, - 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x06, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4d, 0x4d, 0x41, - 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x43, 0x48, 0x55, - 0x4e, 0x4b, 0x10, 0x07, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_command_command_proto_rawDescOnce sync.Once - file_command_command_proto_rawDescData = file_command_command_proto_rawDesc -) - -func file_command_command_proto_rawDescGZIP() []byte { - file_command_command_proto_rawDescOnce.Do(func() { - file_command_command_proto_rawDescData = protoimpl.X.CompressGZIP(file_command_command_proto_rawDescData) - }) - return file_command_command_proto_rawDescData -} - -var file_command_command_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 18) -var file_command_command_proto_goTypes = []interface{}{ - (QueryRequest_Level)(0), // 0: command.QueryRequest.Level - (BackupRequest_Format)(0), // 1: command.BackupRequest.Format - (Command_Type)(0), // 2: command.Command.Type - (*Parameter)(nil), // 3: command.Parameter - (*Statement)(nil), // 4: command.Statement - (*Request)(nil), // 5: command.Request - (*QueryRequest)(nil), // 6: command.QueryRequest - (*Values)(nil), // 7: command.Values - (*QueryRows)(nil), // 8: command.QueryRows - (*ExecuteRequest)(nil), // 9: command.ExecuteRequest - (*ExecuteResult)(nil), // 10: command.ExecuteResult - (*ExecuteQueryRequest)(nil), // 11: command.ExecuteQueryRequest - (*ExecuteQueryResponse)(nil), // 12: command.ExecuteQueryResponse - (*BackupRequest)(nil), // 13: command.BackupRequest - (*LoadRequest)(nil), // 14: command.LoadRequest - (*LoadChunkRequest)(nil), // 15: command.LoadChunkRequest - (*JoinRequest)(nil), // 16: command.JoinRequest - (*NotifyRequest)(nil), // 17: command.NotifyRequest - (*RemoveNodeRequest)(nil), // 18: command.RemoveNodeRequest - (*Noop)(nil), // 19: command.Noop - (*Command)(nil), // 20: command.Command -} -var file_command_command_proto_depIdxs = []int32{ - 3, // 0: command.Statement.parameters:type_name -> command.Parameter - 4, // 1: command.Request.statements:type_name -> command.Statement - 5, // 2: command.QueryRequest.request:type_name -> command.Request - 0, // 3: command.QueryRequest.level:type_name -> command.QueryRequest.Level - 3, // 4: command.Values.parameters:type_name -> command.Parameter - 7, // 5: command.QueryRows.values:type_name -> command.Values - 5, // 6: command.ExecuteRequest.request:type_name -> command.Request - 5, // 7: command.ExecuteQueryRequest.request:type_name -> command.Request - 0, // 8: command.ExecuteQueryRequest.level:type_name -> command.QueryRequest.Level - 8, // 9: command.ExecuteQueryResponse.q:type_name -> command.QueryRows - 10, // 10: command.ExecuteQueryResponse.e:type_name -> command.ExecuteResult - 1, // 11: command.BackupRequest.format:type_name -> command.BackupRequest.Format - 2, // 12: command.Command.type:type_name -> command.Command.Type - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_command_command_proto_init() } -func file_command_command_proto_init() { - if File_command_command_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Parameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Statement); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Values); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRows); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteQueryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteQueryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BackupRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadChunkRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JoinRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotifyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveNodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Noop); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Command); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_command_command_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Parameter_I)(nil), - (*Parameter_D)(nil), - (*Parameter_B)(nil), - (*Parameter_Y)(nil), - (*Parameter_S)(nil), - } - file_command_command_proto_msgTypes[9].OneofWrappers = []interface{}{ - (*ExecuteQueryResponse_Q)(nil), - (*ExecuteQueryResponse_E)(nil), - (*ExecuteQueryResponse_Error)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_command_command_proto_rawDesc, - NumEnums: 3, - NumMessages: 18, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_command_command_proto_goTypes, - DependencyIndexes: file_command_command_proto_depIdxs, - EnumInfos: file_command_command_proto_enumTypes, - MessageInfos: file_command_command_proto_msgTypes, - }.Build() - File_command_command_proto = out.File - file_command_command_proto_rawDesc = nil - file_command_command_proto_goTypes = nil - file_command_command_proto_depIdxs = nil -} diff --git a/command/encoding/json.go b/command/encoding/json.go index 586de9b9..4497525f 100644 --- a/command/encoding/json.go +++ b/command/encoding/json.go @@ -6,7 +6,7 @@ import ( "errors" "fmt" - "github.com/rqlite/rqlite/v8/command" + "github.com/rqlite/rqlite/v8/command/proto" ) var ( @@ -50,7 +50,7 @@ type ResultWithRows struct { // NewResultRowsFromExecuteQueryResponse returns an API object from an // ExecuteQueryResponse. -func NewResultRowsFromExecuteQueryResponse(e *command.ExecuteQueryResponse) (interface{}, error) { +func NewResultRowsFromExecuteQueryResponse(e *proto.ExecuteQueryResponse) (interface{}, error) { if er := e.GetE(); er != nil { return NewResultFromExecuteResult(er) } else if qr := e.GetQ(); qr != nil { @@ -63,7 +63,7 @@ func NewResultRowsFromExecuteQueryResponse(e *command.ExecuteQueryResponse) (int return nil, errors.New("no ExecuteResult, QueryRows, or Error") } -func NewAssociativeResultRowsFromExecuteQueryResponse(e *command.ExecuteQueryResponse) (interface{}, error) { +func NewAssociativeResultRowsFromExecuteQueryResponse(e *proto.ExecuteQueryResponse) (interface{}, error) { if er := e.GetE(); er != nil { r, err := NewResultFromExecuteResult(er) if err != nil { @@ -83,7 +83,7 @@ func NewAssociativeResultRowsFromExecuteQueryResponse(e *command.ExecuteQueryRes } // NewResultFromExecuteResult returns an API Result object from an ExecuteResult. -func NewResultFromExecuteResult(e *command.ExecuteResult) (*Result, error) { +func NewResultFromExecuteResult(e *proto.ExecuteResult) (*Result, error) { return &Result{ LastInsertID: e.LastInsertId, RowsAffected: e.RowsAffected, @@ -93,7 +93,7 @@ func NewResultFromExecuteResult(e *command.ExecuteResult) (*Result, error) { } // NewRowsFromQueryRows returns an API Rows object from a QueryRows -func NewRowsFromQueryRows(q *command.QueryRows) (*Rows, error) { +func NewRowsFromQueryRows(q *proto.QueryRows) (*Rows, error) { if len(q.Columns) != len(q.Types) { return nil, ErrTypesColumnsLengthViolation } @@ -112,7 +112,7 @@ func NewRowsFromQueryRows(q *command.QueryRows) (*Rows, error) { } // NewAssociativeRowsFromQueryRows returns an associative API object from a QueryRows -func NewAssociativeRowsFromQueryRows(q *command.QueryRows) (*AssociativeRows, error) { +func NewAssociativeRowsFromQueryRows(q *proto.QueryRows) (*AssociativeRows, error) { if len(q.Columns) != len(q.Types) { return nil, ErrTypesColumnsLengthViolation } @@ -145,7 +145,7 @@ func NewAssociativeRowsFromQueryRows(q *command.QueryRows) (*AssociativeRows, er } // NewValuesFromQueryValues sets Values from a QueryValue object. -func NewValuesFromQueryValues(dest [][]interface{}, v []*command.Values) error { +func NewValuesFromQueryValues(dest [][]interface{}, v []*proto.Values) error { for n := range v { vals := v[n] if vals == nil { @@ -162,15 +162,15 @@ func NewValuesFromQueryValues(dest [][]interface{}, v []*command.Values) error { rowValues := make([]interface{}, len(params)) for p := range params { switch w := params[p].GetValue().(type) { - case *command.Parameter_I: + case *proto.Parameter_I: rowValues[p] = w.I - case *command.Parameter_D: + case *proto.Parameter_D: rowValues[p] = w.D - case *command.Parameter_B: + case *proto.Parameter_B: rowValues[p] = w.B - case *command.Parameter_Y: + case *proto.Parameter_Y: rowValues[p] = w.Y - case *command.Parameter_S: + case *proto.Parameter_S: rowValues[p] = w.S case nil: rowValues[p] = nil @@ -223,13 +223,13 @@ type marshalFunc func(i interface{}) ([]byte, error) func jsonMarshal(i interface{}, f marshalFunc, assoc bool) ([]byte, error) { switch v := i.(type) { - case *command.ExecuteResult: + case *proto.ExecuteResult: r, err := NewResultFromExecuteResult(v) if err != nil { return nil, err } return f(r) - case []*command.ExecuteResult: + case []*proto.ExecuteResult: var err error results := make([]*Result, len(v)) for j := range v { @@ -239,7 +239,7 @@ func jsonMarshal(i interface{}, f marshalFunc, assoc bool) ([]byte, error) { } } return f(results) - case *command.QueryRows: + case *proto.QueryRows: if assoc { r, err := NewAssociativeRowsFromQueryRows(v) if err != nil { @@ -253,13 +253,13 @@ func jsonMarshal(i interface{}, f marshalFunc, assoc bool) ([]byte, error) { } return f(r) } - case *command.ExecuteQueryResponse: + case *proto.ExecuteQueryResponse: r, err := NewResultRowsFromExecuteQueryResponse(v) if err != nil { return nil, err } return f(r) - case []*command.QueryRows: + case []*proto.QueryRows: var err error if assoc { @@ -281,7 +281,7 @@ func jsonMarshal(i interface{}, f marshalFunc, assoc bool) ([]byte, error) { } return f(rows) } - case []*command.ExecuteQueryResponse: + case []*proto.ExecuteQueryResponse: if assoc { res := make([]interface{}, len(v)) for j := range v { @@ -303,7 +303,7 @@ func jsonMarshal(i interface{}, f marshalFunc, assoc bool) ([]byte, error) { } return f(res) } - case []*command.Values: + case []*proto.Values: values := make([][]interface{}, len(v)) if err := NewValuesFromQueryValues(values, v); err != nil { return nil, err diff --git a/command/encoding/json_test.go b/command/encoding/json_test.go index 2a33b4af..0ebe9de0 100644 --- a/command/encoding/json_test.go +++ b/command/encoding/json_test.go @@ -3,7 +3,7 @@ package encoding import ( "testing" - "github.com/rqlite/rqlite/v8/command" + "github.com/rqlite/rqlite/v8/command/proto" ) func Test_JSONNoEscaping(t *testing.T) { @@ -25,10 +25,10 @@ func Test_JSONNoEscaping(t *testing.T) { func Test_MarshalExecuteResult(t *testing.T) { var b []byte var err error - var r *command.ExecuteResult + var r *proto.ExecuteResult enc := Encoder{} - r = &command.ExecuteResult{ + r = &proto.ExecuteResult{ LastInsertId: 1, RowsAffected: 2, Time: 1234, @@ -41,7 +41,7 @@ func Test_MarshalExecuteResult(t *testing.T) { t.Fatalf("failed to marshal ExecuteResult: exp %s, got %s", exp, got) } - r = &command.ExecuteResult{ + r = &proto.ExecuteResult{ LastInsertId: 4, RowsAffected: 5, Error: "something went wrong", @@ -78,17 +78,17 @@ func Test_MarshalExecuteResults(t *testing.T) { var err error enc := Encoder{} - r1 := &command.ExecuteResult{ + r1 := &proto.ExecuteResult{ LastInsertId: 1, RowsAffected: 2, Time: 1234, } - r2 := &command.ExecuteResult{ + r2 := &proto.ExecuteResult{ LastInsertId: 3, RowsAffected: 4, Time: 5678, } - b, err = enc.JSONMarshal([]*command.ExecuteResult{r1, r2}) + b, err = enc.JSONMarshal([]*proto.ExecuteResult{r1, r2}) if err != nil { t.Fatalf("failed to marshal ExecuteResults: %s", err.Error()) } @@ -100,10 +100,10 @@ func Test_MarshalExecuteResults(t *testing.T) { // Test_MarshalQueryRowsError tests error cases func Test_MarshalQueryRowsError(t *testing.T) { var err error - var r *command.QueryRows + var r *proto.QueryRows enc := Encoder{} - r = &command.QueryRows{ + r = &proto.QueryRows{ Columns: []string{"c1", "c2"}, Types: []string{"int", "float", "string"}, Time: 6789, @@ -125,32 +125,32 @@ func Test_MarshalQueryRowsError(t *testing.T) { func Test_MarshalQueryRows(t *testing.T) { var b []byte var err error - var r *command.QueryRows + var r *proto.QueryRows enc := Encoder{} - r = &command.QueryRows{ + r = &proto.QueryRows{ Columns: []string{"c1", "c2", "c3"}, Types: []string{"int", "float", "string"}, Time: 6789, } - values := make([]*command.Parameter, len(r.Columns)) - values[0] = &command.Parameter{ - Value: &command.Parameter_I{ + values := make([]*proto.Parameter, len(r.Columns)) + values[0] = &proto.Parameter{ + Value: &proto.Parameter_I{ I: 123, }, } - values[1] = &command.Parameter{ - Value: &command.Parameter_D{ + values[1] = &proto.Parameter{ + Value: &proto.Parameter_D{ D: 678.0, }, } - values[2] = &command.Parameter{ - Value: &command.Parameter_S{ + values[2] = &proto.Parameter{ + Value: &proto.Parameter_S{ S: "fiona", }, } - r.Values = []*command.Values{ + r.Values = []*proto.Values{ {Parameters: values}, } @@ -196,34 +196,34 @@ func Test_MarshalQueryRows(t *testing.T) { func Test_MarshalQueryAssociativeRows(t *testing.T) { var b []byte var err error - var r *command.QueryRows + var r *proto.QueryRows enc := Encoder{ Associative: true, } - r = &command.QueryRows{ + r = &proto.QueryRows{ Columns: []string{"c1", "c2", "c3"}, Types: []string{"int", "float", "string"}, Time: 6789, } - values := make([]*command.Parameter, len(r.Columns)) - values[0] = &command.Parameter{ - Value: &command.Parameter_I{ + values := make([]*proto.Parameter, len(r.Columns)) + values[0] = &proto.Parameter{ + Value: &proto.Parameter_I{ I: 123, }, } - values[1] = &command.Parameter{ - Value: &command.Parameter_D{ + values[1] = &proto.Parameter{ + Value: &proto.Parameter_D{ D: 678.0, }, } - values[2] = &command.Parameter{ - Value: &command.Parameter_S{ + values[2] = &proto.Parameter{ + Value: &proto.Parameter_S{ S: "fiona", }, } - r.Values = []*command.Values{ + r.Values = []*proto.Values{ {Parameters: values}, } @@ -264,36 +264,36 @@ func Test_MarshalQueryAssociativeRows(t *testing.T) { func Test_MarshalQueryRowses(t *testing.T) { var b []byte var err error - var r *command.QueryRows + var r *proto.QueryRows enc := Encoder{} - r = &command.QueryRows{ + r = &proto.QueryRows{ Columns: []string{"c1", "c2", "c3"}, Types: []string{"int", "float", "string"}, Time: 6789, } - values := make([]*command.Parameter, len(r.Columns)) - values[0] = &command.Parameter{ - Value: &command.Parameter_I{ + values := make([]*proto.Parameter, len(r.Columns)) + values[0] = &proto.Parameter{ + Value: &proto.Parameter_I{ I: 123, }, } - values[1] = &command.Parameter{ - Value: &command.Parameter_D{ + values[1] = &proto.Parameter{ + Value: &proto.Parameter_D{ D: 678.0, }, } - values[2] = &command.Parameter{ - Value: &command.Parameter_S{ + values[2] = &proto.Parameter{ + Value: &proto.Parameter_S{ S: "fiona", }, } - r.Values = []*command.Values{ + r.Values = []*proto.Values{ {Parameters: values}, } - b, err = enc.JSONMarshal([]*command.QueryRows{r, r}) + b, err = enc.JSONMarshal([]*proto.QueryRows{r, r}) if err != nil { t.Fatalf("failed to marshal QueryRows: %s", err.Error()) } @@ -306,38 +306,38 @@ func Test_MarshalQueryRowses(t *testing.T) { func Test_MarshalQueryAssociativeRowses(t *testing.T) { var b []byte var err error - var r *command.QueryRows + var r *proto.QueryRows enc := Encoder{ Associative: true, } - r = &command.QueryRows{ + r = &proto.QueryRows{ Columns: []string{"c1", "c2", "c3"}, Types: []string{"int", "float", "string"}, Time: 6789, } - values := make([]*command.Parameter, len(r.Columns)) - values[0] = &command.Parameter{ - Value: &command.Parameter_I{ + values := make([]*proto.Parameter, len(r.Columns)) + values[0] = &proto.Parameter{ + Value: &proto.Parameter_I{ I: 123, }, } - values[1] = &command.Parameter{ - Value: &command.Parameter_D{ + values[1] = &proto.Parameter{ + Value: &proto.Parameter_D{ D: 678.0, }, } - values[2] = &command.Parameter{ - Value: &command.Parameter_S{ + values[2] = &proto.Parameter{ + Value: &proto.Parameter_S{ S: "fiona", }, } - r.Values = []*command.Values{ + r.Values = []*proto.Values{ {Parameters: values}, } - b, err = enc.JSONMarshal([]*command.QueryRows{r, r}) + b, err = enc.JSONMarshal([]*proto.QueryRows{r, r}) if err != nil { t.Fatalf("failed to marshal QueryRows: %s", err.Error()) } @@ -351,15 +351,15 @@ func Test_MarshalExecuteQueryResponse(t *testing.T) { tests := []struct { name string - responses []*command.ExecuteQueryResponse + responses []*proto.ExecuteQueryResponse expected string }{ { name: "Test with ExecuteResult", - responses: []*command.ExecuteQueryResponse{ + responses: []*proto.ExecuteQueryResponse{ { - Result: &command.ExecuteQueryResponse_E{ - E: &command.ExecuteResult{ + Result: &proto.ExecuteQueryResponse_E{ + E: &proto.ExecuteResult{ LastInsertId: 123, RowsAffected: 456, }, @@ -370,22 +370,22 @@ func Test_MarshalExecuteQueryResponse(t *testing.T) { }, { name: "Test with QueryRows", - responses: []*command.ExecuteQueryResponse{ + responses: []*proto.ExecuteQueryResponse{ { - Result: &command.ExecuteQueryResponse_Q{ - Q: &command.QueryRows{ + Result: &proto.ExecuteQueryResponse_Q{ + Q: &proto.QueryRows{ Columns: []string{"column1", "column2"}, Types: []string{"type1", "type2"}, - Values: []*command.Values{ + Values: []*proto.Values{ { - Parameters: []*command.Parameter{ + Parameters: []*proto.Parameter{ { - Value: &command.Parameter_I{ + Value: &proto.Parameter_I{ I: 123, }, }, { - Value: &command.Parameter_S{ + Value: &proto.Parameter_S{ S: "fiona", }, }, @@ -400,35 +400,35 @@ func Test_MarshalExecuteQueryResponse(t *testing.T) { }, { name: "Test with ExecuteResult and QueryRows", - responses: []*command.ExecuteQueryResponse{ + responses: []*proto.ExecuteQueryResponse{ { - Result: &command.ExecuteQueryResponse_E{ - E: &command.ExecuteResult{ + Result: &proto.ExecuteQueryResponse_E{ + E: &proto.ExecuteResult{ LastInsertId: 123, RowsAffected: 456, }, }, }, { - Result: &command.ExecuteQueryResponse_Error{ + Result: &proto.ExecuteQueryResponse_Error{ Error: "unique constraint failed", }, }, { - Result: &command.ExecuteQueryResponse_Q{ - Q: &command.QueryRows{ + Result: &proto.ExecuteQueryResponse_Q{ + Q: &proto.QueryRows{ Columns: []string{"column1", "column2"}, Types: []string{"int", "text"}, - Values: []*command.Values{ + Values: []*proto.Values{ { - Parameters: []*command.Parameter{ + Parameters: []*proto.Parameter{ { - Value: &command.Parameter_I{ + Value: &proto.Parameter_I{ I: 456, }, }, { - Value: &command.Parameter_S{ + Value: &proto.Parameter_S{ S: "declan", }, }, @@ -439,11 +439,11 @@ func Test_MarshalExecuteQueryResponse(t *testing.T) { }, }, { - Result: &command.ExecuteQueryResponse_Q{ - Q: &command.QueryRows{ + Result: &proto.ExecuteQueryResponse_Q{ + Q: &proto.QueryRows{ Columns: []string{"column1", "column2"}, Types: []string{"int", "text"}, - Values: []*command.Values{}, + Values: []*proto.Values{}, }, }, }, @@ -473,15 +473,15 @@ func Test_MarshalExecuteQueryAssociativeResponse(t *testing.T) { tests := []struct { name string - responses []*command.ExecuteQueryResponse + responses []*proto.ExecuteQueryResponse expected string }{ { name: "Test with ExecuteResult", - responses: []*command.ExecuteQueryResponse{ + responses: []*proto.ExecuteQueryResponse{ { - Result: &command.ExecuteQueryResponse_E{ - E: &command.ExecuteResult{ + Result: &proto.ExecuteQueryResponse_E{ + E: &proto.ExecuteResult{ LastInsertId: 123, RowsAffected: 456, }, @@ -492,22 +492,22 @@ func Test_MarshalExecuteQueryAssociativeResponse(t *testing.T) { }, { name: "Test with QueryRows", - responses: []*command.ExecuteQueryResponse{ + responses: []*proto.ExecuteQueryResponse{ { - Result: &command.ExecuteQueryResponse_Q{ - Q: &command.QueryRows{ + Result: &proto.ExecuteQueryResponse_Q{ + Q: &proto.QueryRows{ Columns: []string{"column1", "column2"}, Types: []string{"type1", "type2"}, - Values: []*command.Values{ + Values: []*proto.Values{ { - Parameters: []*command.Parameter{ + Parameters: []*proto.Parameter{ { - Value: &command.Parameter_I{ + Value: &proto.Parameter_I{ I: 123, }, }, { - Value: &command.Parameter_S{ + Value: &proto.Parameter_S{ S: "fiona", }, }, @@ -522,35 +522,35 @@ func Test_MarshalExecuteQueryAssociativeResponse(t *testing.T) { }, { name: "Test with ExecuteResult and QueryRows", - responses: []*command.ExecuteQueryResponse{ + responses: []*proto.ExecuteQueryResponse{ { - Result: &command.ExecuteQueryResponse_E{ - E: &command.ExecuteResult{ + Result: &proto.ExecuteQueryResponse_E{ + E: &proto.ExecuteResult{ LastInsertId: 123, RowsAffected: 456, }, }, }, { - Result: &command.ExecuteQueryResponse_Error{ + Result: &proto.ExecuteQueryResponse_Error{ Error: "unique constraint failed", }, }, { - Result: &command.ExecuteQueryResponse_Q{ - Q: &command.QueryRows{ + Result: &proto.ExecuteQueryResponse_Q{ + Q: &proto.QueryRows{ Columns: []string{"column1", "column2"}, Types: []string{"int", "text"}, - Values: []*command.Values{ + Values: []*proto.Values{ { - Parameters: []*command.Parameter{ + Parameters: []*proto.Parameter{ { - Value: &command.Parameter_I{ + Value: &proto.Parameter_I{ I: 456, }, }, { - Value: &command.Parameter_S{ + Value: &proto.Parameter_S{ S: "declan", }, }, @@ -561,17 +561,17 @@ func Test_MarshalExecuteQueryAssociativeResponse(t *testing.T) { }, }, { - Result: &command.ExecuteQueryResponse_Q{ - Q: &command.QueryRows{ + Result: &proto.ExecuteQueryResponse_Q{ + Q: &proto.QueryRows{ Columns: []string{"aaa", "bbb"}, Types: []string{"int", "text"}, - Values: []*command.Values{}, + Values: []*proto.Values{}, }, }, }, { - Result: &command.ExecuteQueryResponse_Q{ - Q: &command.QueryRows{ + Result: &proto.ExecuteQueryResponse_Q{ + Q: &proto.QueryRows{ Columns: []string{"ccc", "ddd"}, Types: []string{"int", "text"}, Values: nil, diff --git a/command/marshal.go b/command/marshal.go index d3c70aa4..1861a8a2 100644 --- a/command/marshal.go +++ b/command/marshal.go @@ -7,7 +7,8 @@ import ( "fmt" "io" - "google.golang.org/protobuf/proto" + "github.com/rqlite/rqlite/v8/command/proto" + pb "google.golang.org/protobuf/proto" ) const ( @@ -18,8 +19,8 @@ const ( // Requester is the interface objects must support to be marshaled // successfully. type Requester interface { - proto.Message - GetRequest() *Request + pb.Message + GetRequest() *proto.Request } // RequestMarshaler marshals Request objects, potentially performing @@ -80,7 +81,7 @@ func (m *RequestMarshaler) Marshal(r Requester) ([]byte, bool, error) { } } - b, err := proto.Marshal(r) + b, err := pb.Marshal(r) if err != nil { return nil, false, err } @@ -124,28 +125,28 @@ func (m *RequestMarshaler) Stats() map[string]interface{} { } // Marshal marshals a Command. -func Marshal(c *Command) ([]byte, error) { - return proto.Marshal(c) +func Marshal(c *proto.Command) ([]byte, error) { + return pb.Marshal(c) } // Unmarshal unmarshals a Command -func Unmarshal(b []byte, c *Command) error { - return proto.Unmarshal(b, c) +func Unmarshal(b []byte, c *proto.Command) error { + return pb.Unmarshal(b, c) } // MarshalNoop marshals a Noop command -func MarshalNoop(c *Noop) ([]byte, error) { - return proto.Marshal(c) +func MarshalNoop(c *proto.Noop) ([]byte, error) { + return pb.Marshal(c) } // UnmarshalNoop unmarshals a Noop command -func UnmarshalNoop(b []byte, c *Noop) error { - return proto.Unmarshal(b, c) +func UnmarshalNoop(b []byte, c *proto.Noop) error { + return pb.Unmarshal(b, c) } // MarshalLoadRequest marshals a LoadRequest command -func MarshalLoadRequest(lr *LoadRequest) ([]byte, error) { - b, err := proto.Marshal(lr) +func MarshalLoadRequest(lr *proto.LoadRequest) ([]byte, error) { + b, err := pb.Marshal(lr) if err != nil { return nil, err } @@ -153,27 +154,27 @@ func MarshalLoadRequest(lr *LoadRequest) ([]byte, error) { } // UnmarshalLoadRequest unmarshals a LoadRequest command -func UnmarshalLoadRequest(b []byte, lr *LoadRequest) error { +func UnmarshalLoadRequest(b []byte, lr *proto.LoadRequest) error { u, err := gzUncompress(b) if err != nil { return err } - return proto.Unmarshal(u, lr) + return pb.Unmarshal(u, lr) } // MarshalLoadChunkRequest marshals a LoadChunkRequest command -func MarshalLoadChunkRequest(lr *LoadChunkRequest) ([]byte, error) { - return proto.Marshal(lr) +func MarshalLoadChunkRequest(lr *proto.LoadChunkRequest) ([]byte, error) { + return pb.Marshal(lr) } // UnmarshalLoadChunkRequest unmarshals a LoadChunkRequest command -func UnmarshalLoadChunkRequest(b []byte, lr *LoadChunkRequest) error { - return proto.Unmarshal(b, lr) +func UnmarshalLoadChunkRequest(b []byte, lr *proto.LoadChunkRequest) error { + return pb.Unmarshal(b, lr) } // UnmarshalSubCommand unmarshalls a sub command m. It assumes that // m is the correct type. -func UnmarshalSubCommand(c *Command, m proto.Message) error { +func UnmarshalSubCommand(c *proto.Command, m pb.Message) error { b := c.SubCommand if c.Compressed { var err error @@ -183,7 +184,7 @@ func UnmarshalSubCommand(c *Command, m proto.Message) error { } } - if err := proto.Unmarshal(b, m); err != nil { + if err := pb.Unmarshal(b, m); err != nil { return fmt.Errorf("proto unmarshal: %s", err) } return nil diff --git a/command/marshal_test.go b/command/marshal_test.go index 12ea6096..ffbff100 100644 --- a/command/marshal_test.go +++ b/command/marshal_test.go @@ -4,7 +4,8 @@ import ( "sync" "testing" - "google.golang.org/protobuf/proto" + "github.com/rqlite/rqlite/v8/command/proto" + pb "google.golang.org/protobuf/proto" ) func Test_NewRequestMarshaler(t *testing.T) { @@ -16,9 +17,9 @@ func Test_NewRequestMarshaler(t *testing.T) { func Test_MarshalUncompressed(t *testing.T) { rm := NewRequestMarshaler() - r := &QueryRequest{ - Request: &Request{ - Statements: []*Statement{ + r := &proto.QueryRequest{ + Request: &proto.Request{ + Statements: []*proto.Statement{ { Sql: `INSERT INTO "names" VALUES(1,'bob','123-45-678')`, }, @@ -36,8 +37,8 @@ func Test_MarshalUncompressed(t *testing.T) { t.Fatal("Marshaled QueryRequest incorrectly compressed") } - c := &Command{ - Type: Command_COMMAND_TYPE_QUERY, + c := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_QUERY, SubCommand: b, Compressed: comp, } @@ -47,18 +48,18 @@ func Test_MarshalUncompressed(t *testing.T) { t.Fatalf("failed to marshal Command: %s", err) } - var nc Command + var nc proto.Command if err := Unmarshal(b, &nc); err != nil { t.Fatalf("failed to unmarshal Command: %s", err) } - if nc.Type != Command_COMMAND_TYPE_QUERY { + if nc.Type != proto.Command_COMMAND_TYPE_QUERY { t.Fatalf("unmarshaled command has wrong type: %s", nc.Type) } if nc.Compressed { t.Fatal("Unmarshaled QueryRequest incorrectly marked as compressed") } - var nr QueryRequest + var nr proto.QueryRequest if err := UnmarshalSubCommand(&nc, &nr); err != nil { t.Fatalf("failed to unmarshal sub command: %s", err) } @@ -81,9 +82,9 @@ func Test_MarshalCompressedBatch(t *testing.T) { rm.BatchThreshold = 1 rm.ForceCompression = true - r := &QueryRequest{ - Request: &Request{ - Statements: []*Statement{ + r := &proto.QueryRequest{ + Request: &proto.Request{ + Statements: []*proto.Statement{ { Sql: `INSERT INTO "names" VALUES(1,'bob','123-45-678')`, }, @@ -101,8 +102,8 @@ func Test_MarshalCompressedBatch(t *testing.T) { t.Fatal("Marshaled QueryRequest wasn't compressed") } - c := &Command{ - Type: Command_COMMAND_TYPE_QUERY, + c := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_QUERY, SubCommand: b, Compressed: comp, } @@ -112,22 +113,22 @@ func Test_MarshalCompressedBatch(t *testing.T) { t.Fatalf("failed to marshal Command: %s", err) } - var nc Command + var nc proto.Command if err := Unmarshal(b, &nc); err != nil { t.Fatalf("failed to unmarshal Command: %s", err) } - if nc.Type != Command_COMMAND_TYPE_QUERY { + if nc.Type != proto.Command_COMMAND_TYPE_QUERY { t.Fatalf("unmarshaled command has wrong type: %s", nc.Type) } if !nc.Compressed { t.Fatal("Unmarshaled QueryRequest incorrectly marked as uncompressed") } - var nr QueryRequest + var nr proto.QueryRequest if err := UnmarshalSubCommand(&nc, &nr); err != nil { t.Fatalf("failed to unmarshal sub command: %s", err) } - if !proto.Equal(&nr, r) { + if !pb.Equal(&nr, r) { t.Fatal("Original and unmarshaled Query Request are not equal") } } @@ -137,9 +138,9 @@ func Test_MarshalCompressedSize(t *testing.T) { rm.SizeThreshold = 1 rm.ForceCompression = true - r := &QueryRequest{ - Request: &Request{ - Statements: []*Statement{ + r := &proto.QueryRequest{ + Request: &proto.Request{ + Statements: []*proto.Statement{ { Sql: `INSERT INTO "names" VALUES(1,'bob','123-45-678')`, }, @@ -157,8 +158,8 @@ func Test_MarshalCompressedSize(t *testing.T) { t.Fatal("Marshaled QueryRequest wasn't compressed") } - c := &Command{ - Type: Command_COMMAND_TYPE_QUERY, + c := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_QUERY, SubCommand: b, Compressed: comp, } @@ -168,22 +169,22 @@ func Test_MarshalCompressedSize(t *testing.T) { t.Fatalf("failed to marshal Command: %s", err) } - var nc Command + var nc proto.Command if err := Unmarshal(b, &nc); err != nil { t.Fatalf("failed to unmarshal Command: %s", err) } - if nc.Type != Command_COMMAND_TYPE_QUERY { + if nc.Type != proto.Command_COMMAND_TYPE_QUERY { t.Fatalf("unmarshaled command has wrong type: %s", nc.Type) } if !nc.Compressed { t.Fatal("Unmarshaled QueryRequest incorrectly marked as uncompressed") } - var nr QueryRequest + var nr proto.QueryRequest if err := UnmarshalSubCommand(&nc, &nr); err != nil { t.Fatalf("failed to unmarshal sub command: %s", err) } - if !proto.Equal(&nr, r) { + if !pb.Equal(&nr, r) { t.Fatal("Original and unmarshaled Query Request are not equal") } } @@ -192,9 +193,9 @@ func Test_MarshalWontCompressBatch(t *testing.T) { rm := NewRequestMarshaler() rm.BatchThreshold = 1 - r := &QueryRequest{ - Request: &Request{ - Statements: []*Statement{ + r := &proto.QueryRequest{ + Request: &proto.Request{ + Statements: []*proto.Statement{ { Sql: `INSERT INTO "names" VALUES(1,'bob','123-45-678')`, }, @@ -218,9 +219,9 @@ func Test_MarshalCompressedConcurrent(t *testing.T) { rm.SizeThreshold = 1 rm.ForceCompression = true - r := &QueryRequest{ - Request: &Request{ - Statements: []*Statement{ + r := &proto.QueryRequest{ + Request: &proto.Request{ + Statements: []*proto.Statement{ { Sql: `INSERT INTO "names" VALUES(1,'bob','123-45-678')`, }, @@ -251,9 +252,9 @@ func Test_MarshalWontCompressSize(t *testing.T) { rm := NewRequestMarshaler() rm.SizeThreshold = 1 - r := &QueryRequest{ - Request: &Request{ - Statements: []*Statement{ + r := &proto.QueryRequest{ + Request: &proto.Request{ + Statements: []*proto.Statement{ { Sql: `INSERT INTO "names" VALUES(1,'bob','123-45-678')`, }, diff --git a/command/command.proto b/command/proto/command.proto similarity index 96% rename from command/command.proto rename to command/proto/command.proto index 3a504504..63a84425 100644 --- a/command/command.proto +++ b/command/proto/command.proto @@ -1,7 +1,6 @@ syntax = "proto3"; -package command; -option go_package = "github.com/rqlite/rqlite/v8/command"; +option go_package = "github.com/rqlite/rqlite/command/proto"; message Parameter { oneof value { diff --git a/command/rewrite.go b/command/rewrite.go index a635eb68..e4f31c02 100644 --- a/command/rewrite.go +++ b/command/rewrite.go @@ -3,12 +3,13 @@ package command import ( "strings" + "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/sql" ) // Rewrite rewrites the statements such that RANDOM is rewritten, // if r is true. -func Rewrite(stmts []*Statement, r bool) error { +func Rewrite(stmts []*proto.Statement, r bool) error { if !r { return nil } diff --git a/command/rewrite_test.go b/command/rewrite_test.go index 5f1bd167..24c653aa 100644 --- a/command/rewrite_test.go +++ b/command/rewrite_test.go @@ -3,6 +3,8 @@ package command import ( "regexp" "testing" + + "github.com/rqlite/rqlite/v8/command/proto" ) func Test_NoRewrites(t *testing.T) { @@ -13,7 +15,7 @@ func Test_NoRewrites(t *testing.T) { `INSERT INTO foo(name, age) VALUES(?, ?)`, } { - stmts := []*Statement{ + stmts := []*proto.Statement{ { Sql: str, }, @@ -28,7 +30,7 @@ func Test_NoRewrites(t *testing.T) { } func Test_NoRewritesMulti(t *testing.T) { - stmts := []*Statement{ + stmts := []*proto.Statement{ { Sql: `INSERT INTO "names" VALUES (1, 'bob', '123-45-678')`, }, @@ -65,7 +67,7 @@ func Test_Rewrites(t *testing.T) { `CREATE TABLE tbl (col1 TEXT, ts DATETIME DEFAULT CURRENT_TIMESTAMP)`, `CREATE TABLE tbl \(col1 TEXT, ts DATETIME DEFAULT CURRENT_TIMESTAMP\)`, } for i := 0; i < len(testSQLs)-1; i += 2 { - stmts := []*Statement{ + stmts := []*proto.Statement{ { Sql: testSQLs[i], }, diff --git a/db/db.go b/db/db.go index 5a02efaa..1769ea08 100644 --- a/db/db.go +++ b/db/db.go @@ -18,7 +18,7 @@ import ( "time" "github.com/rqlite/go-sqlite3" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/db/humanize" ) diff --git a/db/db_common_test.go b/db/db_common_test.go index df0ee10b..50d4466d 100644 --- a/db/db_common_test.go +++ b/db/db_common_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/testdata/chinook" ) diff --git a/db/db_test.go b/db/db_test.go index a329bdfe..95941ef6 100644 --- a/db/db_test.go +++ b/db/db_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/rqlite/rqlite/v8/command" "github.com/rqlite/rqlite/v8/command/encoding" + command "github.com/rqlite/rqlite/v8/command/proto" ) // Test_OpenNonExistentDatabase tests that opening a non-existent database diff --git a/http/query_params.go b/http/query_params.go index 08bb8be0..1d60b7b1 100644 --- a/http/query_params.go +++ b/http/query_params.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" ) // QueryParams represents the query parameters passed in an HTTP request. diff --git a/http/request_parser.go b/http/request_parser.go index 20880d25..07651afb 100644 --- a/http/request_parser.go +++ b/http/request_parser.go @@ -6,7 +6,7 @@ import ( "errors" "fmt" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" ) var ( diff --git a/http/service.go b/http/service.go index 4a5d4161..22501f3d 100644 --- a/http/service.go +++ b/http/service.go @@ -24,6 +24,7 @@ import ( "github.com/rqlite/rqlite/v8/cluster" "github.com/rqlite/rqlite/v8/command" "github.com/rqlite/rqlite/v8/command/encoding" + "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/db" "github.com/rqlite/rqlite/v8/queue" "github.com/rqlite/rqlite/v8/rtls" @@ -46,20 +47,20 @@ type Database interface { // to return rows. If timings is true, then timing information will // be return. If tx is true, then either all queries will be executed // successfully or it will as though none executed. - Execute(er *command.ExecuteRequest) ([]*command.ExecuteResult, error) + Execute(er *proto.ExecuteRequest) ([]*proto.ExecuteResult, error) // Query executes a slice of queries, each of which returns rows. If // timings is true, then timing information will be returned. If tx // is true, then all queries will take place while a read transaction // is held on the database. - Query(qr *command.QueryRequest) ([]*command.QueryRows, error) + Query(qr *proto.QueryRequest) ([]*proto.QueryRows, error) // Request processes a slice of requests, each of which can be either // an Execute or Query request. - Request(eqr *command.ExecuteQueryRequest) ([]*command.ExecuteQueryResponse, error) + Request(eqr *proto.ExecuteQueryRequest) ([]*proto.ExecuteQueryResponse, error) // Load loads a SQLite file into the system via Raft consensus. - Load(lr *command.LoadRequest) error + Load(lr *proto.LoadRequest) error } // Store is the interface the Raft-based database must implement. @@ -67,7 +68,7 @@ type Store interface { Database // Remove removes the node from the cluster. - Remove(rn *command.RemoveNodeRequest) error + Remove(rn *proto.RemoveNodeRequest) error // LeaderAddr returns the Raft address of the leader of the cluster. LeaderAddr() (string, error) @@ -82,7 +83,7 @@ type Store interface { Nodes() ([]*store.Server, error) // Backup writes backup of the node state to dst - Backup(br *command.BackupRequest, dst io.Writer) error + Backup(br *proto.BackupRequest, dst io.Writer) error // ReadFrom reads and loads a SQLite database into the node, initially bypassing // the Raft system. It then triggers a Raft snapshot, which will then make @@ -101,22 +102,22 @@ type Cluster interface { GetAddresser // Execute performs an Execute Request on a remote node. - Execute(er *command.ExecuteRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) ([]*command.ExecuteResult, error) + Execute(er *proto.ExecuteRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) ([]*proto.ExecuteResult, error) // Query performs an Query Request on a remote node. - Query(qr *command.QueryRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) ([]*command.QueryRows, error) + Query(qr *proto.QueryRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) ([]*proto.QueryRows, error) // Request performs an ExecuteQuery Request on a remote node. - Request(eqr *command.ExecuteQueryRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) ([]*command.ExecuteQueryResponse, error) + Request(eqr *proto.ExecuteQueryRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) ([]*proto.ExecuteQueryResponse, error) // Backup retrieves a backup from a remote node and writes to the io.Writer. - Backup(br *command.BackupRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration, w io.Writer) error + Backup(br *proto.BackupRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration, w io.Writer) error // Load loads a SQLite database into the node. - Load(lr *command.LoadRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) error + Load(lr *proto.LoadRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) error // RemoveNode removes a node from the cluster. - RemoveNode(rn *command.RemoveNodeRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) error + RemoveNode(rn *proto.RemoveNodeRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) error // Stats returns stats on the Cluster. Stats() (map[string]interface{}, error) @@ -136,9 +137,9 @@ type StatusReporter interface { // DBResults stores either an Execute result, a Query result, or // an ExecuteQuery result. type DBResults struct { - ExecuteResult []*command.ExecuteResult - QueryRows []*command.QueryRows - ExecuteQueryResponse []*command.ExecuteQueryResponse + ExecuteResult []*proto.ExecuteResult + QueryRows []*proto.QueryRows + ExecuteQueryResponse []*proto.ExecuteQueryResponse AssociativeJSON bool // Render in associative form } @@ -540,7 +541,7 @@ func (s *Service) handleRemove(w http.ResponseWriter, r *http.Request, qp QueryP return } - rn := &command.RemoveNodeRequest{ + rn := &proto.RemoveNodeRequest{ Id: remoteID, } @@ -598,7 +599,7 @@ func (s *Service) handleBackup(w http.ResponseWriter, r *http.Request, qp QueryP return } - br := &command.BackupRequest{ + br := &proto.BackupRequest{ Format: qp.BackupFormat(), Leader: !qp.NoLeader(), Vacuum: qp.Vacuum(), @@ -674,7 +675,7 @@ func (s *Service) handleLoad(w http.ResponseWriter, r *http.Request, qp QueryPar if db.IsValidSQLiteData(b) { s.logger.Printf("SQLite database file detected as load data") - lr := &command.LoadRequest{ + lr := &proto.LoadRequest{ Data: b, } @@ -1121,8 +1122,8 @@ func (s *Service) execute(w http.ResponseWriter, r *http.Request, qp QueryParams return } - er := &command.ExecuteRequest{ - Request: &command.Request{ + er := &proto.ExecuteRequest{ + Request: &proto.Request{ Transaction: qp.Tx(), Statements: stmts, }, @@ -1197,7 +1198,7 @@ func (s *Service) handleQuery(w http.ResponseWriter, r *http.Request, qp QueryPa // No point rewriting queries if they don't go through the Raft log, since they // will never be replayed from the log anyway. - if qp.Level() == command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG { + if qp.Level() == proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG { if err := command.Rewrite(queries, qp.NoRewriteRandom()); err != nil { http.Error(w, fmt.Sprintf("SQL rewrite: %s", err.Error()), http.StatusInternalServerError) return @@ -1207,8 +1208,8 @@ func (s *Service) handleQuery(w http.ResponseWriter, r *http.Request, qp QueryPa resp := NewResponse() resp.Results.AssociativeJSON = qp.Associative() - qr := &command.QueryRequest{ - Request: &command.Request{ + qr := &proto.QueryRequest{ + Request: &proto.Request{ Transaction: qp.Tx(), Statements: queries, }, @@ -1294,8 +1295,8 @@ func (s *Service) handleRequest(w http.ResponseWriter, r *http.Request, qp Query resp := NewResponse() resp.Results.AssociativeJSON = qp.Associative() - eqr := &command.ExecuteQueryRequest{ - Request: &command.Request{ + eqr := &proto.ExecuteQueryRequest{ + Request: &proto.Request{ Transaction: qp.Tx(), Statements: stmts, }, @@ -1502,8 +1503,8 @@ func (s *Service) runQueue() { case <-s.closeCh: return case req := <-s.stmtQueue.C: - er := &command.ExecuteRequest{ - Request: &command.Request{ + er := &proto.ExecuteRequest{ + Request: &proto.Request{ Statements: req.Statements, Transaction: s.DefaultQueueTx, }, @@ -1590,7 +1591,7 @@ func (s *Service) addAllowHeaders(w http.ResponseWriter) { // addBackupFormatHeader adds the Content-Type header for the backup format. func addBackupFormatHeader(w http.ResponseWriter, qp QueryParams) { w.Header().Set("Content-Type", "application/octet-stream") - if qp.BackupFormat() == command.BackupRequest_BACKUP_REQUEST_FORMAT_SQL { + if qp.BackupFormat() == proto.BackupRequest_BACKUP_REQUEST_FORMAT_SQL { w.Header().Set("Content-Type", "application/sql") } } @@ -1634,9 +1635,9 @@ func (s *Service) writeResponse(w http.ResponseWriter, r *http.Request, qp Query } } -func requestQueries(r *http.Request, qp QueryParams) ([]*command.Statement, error) { +func requestQueries(r *http.Request, qp QueryParams) ([]*proto.Statement, error) { if r.Method == "GET" { - return []*command.Statement{ + return []*proto.Statement{ { Sql: qp.Query(), }, @@ -1698,16 +1699,16 @@ func prettyEnabled(e bool) string { } // queryRequestFromStrings converts a slice of strings into a command.QueryRequest -func executeRequestFromStrings(s []string, timings, tx bool) *command.ExecuteRequest { - stmts := make([]*command.Statement, len(s)) +func executeRequestFromStrings(s []string, timings, tx bool) *proto.ExecuteRequest { + stmts := make([]*proto.Statement, len(s)) for i := range s { - stmts[i] = &command.Statement{ + stmts[i] = &proto.Statement{ Sql: s[i], } } - return &command.ExecuteRequest{ - Request: &command.Request{ + return &proto.ExecuteRequest{ + Request: &proto.Request{ Statements: stmts, Transaction: tx, }, diff --git a/http/service_test.go b/http/service_test.go index 64796de7..d9db4fec 100644 --- a/http/service_test.go +++ b/http/service_test.go @@ -14,7 +14,7 @@ import ( "time" "github.com/rqlite/rqlite/v8/cluster" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/store" ) diff --git a/queue/queue.go b/queue/queue.go index 09ffcc06..7839c26a 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" ) // stats captures stats for the Queue. diff --git a/queue/queue_test.go b/queue/queue_test.go index c811988b..8147de7c 100644 --- a/queue/queue_test.go +++ b/queue/queue_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" ) var ( diff --git a/store/command_processor.go b/store/command_processor.go index 4f90d73a..4e8352c0 100644 --- a/store/command_processor.go +++ b/store/command_processor.go @@ -7,6 +7,7 @@ import ( "github.com/rqlite/rqlite/v8/command" "github.com/rqlite/rqlite/v8/command/chunking" + "github.com/rqlite/rqlite/v8/command/proto" sql "github.com/rqlite/rqlite/v8/db" ) @@ -24,37 +25,37 @@ func NewCommandProcessor(logger *log.Logger, dm *chunking.DechunkerManager) *Com } // Process processes the given command against the given database. -func (c *CommandProcessor) Process(data []byte, pDB **sql.DB) (*command.Command, interface{}) { +func (c *CommandProcessor) Process(data []byte, pDB **sql.DB) (*proto.Command, interface{}) { db := *pDB - cmd := &command.Command{} + cmd := &proto.Command{} if err := command.Unmarshal(data, cmd); err != nil { panic(fmt.Sprintf("failed to unmarshal cluster command: %s", err.Error())) } switch cmd.Type { - case command.Command_COMMAND_TYPE_QUERY: - var qr command.QueryRequest + case proto.Command_COMMAND_TYPE_QUERY: + var qr proto.QueryRequest if err := command.UnmarshalSubCommand(cmd, &qr); err != nil { panic(fmt.Sprintf("failed to unmarshal query subcommand: %s", err.Error())) } r, err := db.Query(qr.Request, qr.Timings) return cmd, &fsmQueryResponse{rows: r, error: err} - case command.Command_COMMAND_TYPE_EXECUTE: - var er command.ExecuteRequest + case proto.Command_COMMAND_TYPE_EXECUTE: + var er proto.ExecuteRequest if err := command.UnmarshalSubCommand(cmd, &er); err != nil { panic(fmt.Sprintf("failed to unmarshal execute subcommand: %s", err.Error())) } r, err := db.Execute(er.Request, er.Timings) return cmd, &fsmExecuteResponse{results: r, error: err} - case command.Command_COMMAND_TYPE_EXECUTE_QUERY: - var eqr command.ExecuteQueryRequest + case proto.Command_COMMAND_TYPE_EXECUTE_QUERY: + var eqr proto.ExecuteQueryRequest if err := command.UnmarshalSubCommand(cmd, &eqr); err != nil { panic(fmt.Sprintf("failed to unmarshal execute-query subcommand: %s", err.Error())) } r, err := db.Request(eqr.Request, eqr.Timings) return cmd, &fsmExecuteQueryResponse{results: r, error: err} - case command.Command_COMMAND_TYPE_LOAD: - var lr command.LoadRequest + case proto.Command_COMMAND_TYPE_LOAD: + var lr proto.LoadRequest if err := command.UnmarshalLoadRequest(cmd.SubCommand, &lr); err != nil { panic(fmt.Sprintf("failed to unmarshal load subcommand: %s", err.Error())) } @@ -74,8 +75,8 @@ func (c *CommandProcessor) Process(data []byte, pDB **sql.DB) (*command.Command, *pDB = newDB return cmd, &fsmGenericResponse{} - case command.Command_COMMAND_TYPE_LOAD_CHUNK: - var lcr command.LoadChunkRequest + case proto.Command_COMMAND_TYPE_LOAD_CHUNK: + var lcr proto.LoadChunkRequest if err := command.UnmarshalLoadChunkRequest(cmd.SubCommand, &lcr); err != nil { panic(fmt.Sprintf("failed to unmarshal load-chunk subcommand: %s", err.Error())) } @@ -134,7 +135,7 @@ func (c *CommandProcessor) Process(data []byte, pDB **sql.DB) (*command.Command, } } return cmd, &fsmGenericResponse{} - case command.Command_COMMAND_TYPE_NOOP: + case proto.Command_COMMAND_TYPE_NOOP: return cmd, &fsmGenericResponse{} default: return cmd, &fsmGenericResponse{error: fmt.Errorf("unhandled command: %v", cmd.Type)} diff --git a/store/provider_test.go b/store/provider_test.go index f9fcf737..b30f409f 100644 --- a/store/provider_test.go +++ b/store/provider_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" ) // Test_SingleNodeProvide tests that the Store correctly implements diff --git a/store/store.go b/store/store.go index a133af15..af41f64e 100644 --- a/store/store.go +++ b/store/store.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/raft" "github.com/rqlite/rqlite/v8/command" "github.com/rqlite/rqlite/v8/command/chunking" + "github.com/rqlite/rqlite/v8/command/proto" sql "github.com/rqlite/rqlite/v8/db" "github.com/rqlite/rqlite/v8/db/humanize" wal "github.com/rqlite/rqlite/v8/db/wal" @@ -1002,7 +1003,7 @@ func (s *Store) Stats() (map[string]interface{}, error) { } // Execute executes queries that return no rows, but do modify the database. -func (s *Store) Execute(ex *command.ExecuteRequest) ([]*command.ExecuteResult, error) { +func (s *Store) Execute(ex *proto.ExecuteRequest) ([]*proto.ExecuteResult, error) { if !s.open { return nil, ErrNotOpen } @@ -1017,14 +1018,14 @@ func (s *Store) Execute(ex *command.ExecuteRequest) ([]*command.ExecuteResult, e return s.execute(ex) } -func (s *Store) execute(ex *command.ExecuteRequest) ([]*command.ExecuteResult, error) { +func (s *Store) execute(ex *proto.ExecuteRequest) ([]*proto.ExecuteResult, error) { b, compressed, err := s.tryCompress(ex) if err != nil { return nil, err } - c := &command.Command{ - Type: command.Command_COMMAND_TYPE_EXECUTE, + c := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_EXECUTE, SubCommand: b, Compressed: compressed, } @@ -1050,12 +1051,12 @@ func (s *Store) execute(ex *command.ExecuteRequest) ([]*command.ExecuteResult, e } // Query executes queries that return rows, and do not modify the database. -func (s *Store) Query(qr *command.QueryRequest) ([]*command.QueryRows, error) { +func (s *Store) Query(qr *proto.QueryRequest) ([]*proto.QueryRows, error) { if !s.open { return nil, ErrNotOpen } - if qr.Level == command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG { + if qr.Level == proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG { if s.raft.State() != raft.Leader { return nil, ErrNotLeader } @@ -1068,8 +1069,8 @@ func (s *Store) Query(qr *command.QueryRequest) ([]*command.QueryRows, error) { if err != nil { return nil, err } - c := &command.Command{ - Type: command.Command_COMMAND_TYPE_QUERY, + c := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_QUERY, SubCommand: b, Compressed: compressed, } @@ -1094,11 +1095,11 @@ func (s *Store) Query(qr *command.QueryRequest) ([]*command.QueryRows, error) { return r.rows, r.error } - if qr.Level == command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK && s.raft.State() != raft.Leader { + if qr.Level == proto.QueryRequest_QUERY_REQUEST_LEVEL_WEAK && s.raft.State() != raft.Leader { return nil, ErrNotLeader } - if s.raft.State() != raft.Leader && qr.Level == command.QueryRequest_QUERY_REQUEST_LEVEL_NONE && + if s.raft.State() != raft.Leader && qr.Level == proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE && qr.Freshness > 0 && time.Since(s.raft.LastContact()).Nanoseconds() > qr.Freshness { return nil, ErrStaleRead } @@ -1114,13 +1115,13 @@ func (s *Store) Query(qr *command.QueryRequest) ([]*command.QueryRows, error) { } // Request processes a request that may contain both Executes and Queries. -func (s *Store) Request(eqr *command.ExecuteQueryRequest) ([]*command.ExecuteQueryResponse, error) { +func (s *Store) Request(eqr *proto.ExecuteQueryRequest) ([]*proto.ExecuteQueryResponse, error) { if !s.open { return nil, ErrNotOpen } if !s.RequiresLeader(eqr) { - if eqr.Level == command.QueryRequest_QUERY_REQUEST_LEVEL_NONE && eqr.Freshness > 0 && + if eqr.Level == proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE && eqr.Freshness > 0 && time.Since(s.raft.LastContact()).Nanoseconds() > eqr.Freshness { return nil, ErrStaleRead } @@ -1146,8 +1147,8 @@ func (s *Store) Request(eqr *command.ExecuteQueryRequest) ([]*command.ExecuteQue return nil, err } - c := &command.Command{ - Type: command.Command_COMMAND_TYPE_EXECUTE_QUERY, + c := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_EXECUTE_QUERY, SubCommand: b, Compressed: compressed, } @@ -1173,12 +1174,12 @@ func (s *Store) Request(eqr *command.ExecuteQueryRequest) ([]*command.ExecuteQue } // Backup writes a consistent snapshot of the underlying database to dst. -func (s *Store) Backup(br *command.BackupRequest, dst io.Writer) (retErr error) { +func (s *Store) Backup(br *proto.BackupRequest, dst io.Writer) (retErr error) { if !s.open { return ErrNotOpen } - if br.Vacuum && br.Format != command.BackupRequest_BACKUP_REQUEST_FORMAT_BINARY { + if br.Vacuum && br.Format != proto.BackupRequest_BACKUP_REQUEST_FORMAT_BINARY { return ErrInvalidBackupFormat } @@ -1194,7 +1195,7 @@ func (s *Store) Backup(br *command.BackupRequest, dst io.Writer) (retErr error) return ErrNotLeader } - if br.Format == command.BackupRequest_BACKUP_REQUEST_FORMAT_BINARY { + if br.Format == proto.BackupRequest_BACKUP_REQUEST_FORMAT_BINARY { f, err := os.CreateTemp(s.dbDir, backupScatchPattern) if err != nil { return err @@ -1216,7 +1217,7 @@ func (s *Store) Backup(br *command.BackupRequest, dst io.Writer) (retErr error) _, err = io.Copy(dst, of) return err - } else if br.Format == command.BackupRequest_BACKUP_REQUEST_FORMAT_SQL { + } else if br.Format == proto.BackupRequest_BACKUP_REQUEST_FORMAT_SQL { return s.db.Dump(dst) } return ErrInvalidBackupFormat @@ -1224,7 +1225,7 @@ func (s *Store) Backup(br *command.BackupRequest, dst io.Writer) (retErr error) // Loads an entire SQLite file into the database, sending the request // through the Raft log. -func (s *Store) Load(lr *command.LoadRequest) error { +func (s *Store) Load(lr *proto.LoadRequest) error { if !s.open { return ErrNotOpen } @@ -1242,7 +1243,7 @@ func (s *Store) Load(lr *command.LoadRequest) error { // load loads an entire SQLite file into the database, and is for internal use // only. It does not check for readiness, and does not update statistics. -func (s *Store) load(lr *command.LoadRequest) error { +func (s *Store) load(lr *proto.LoadRequest) error { startT := time.Now() b, err := command.MarshalLoadRequest(lr) @@ -1251,8 +1252,8 @@ func (s *Store) load(lr *command.LoadRequest) error { return err } - c := &command.Command{ - Type: command.Command_COMMAND_TYPE_LOAD, + c := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_LOAD, SubCommand: b, } @@ -1364,7 +1365,7 @@ func (s *Store) ReadFrom(r io.Reader) (int64, error) { // with the *advertised Raft address* which the Store doesn't know about. // // Notifying is idempotent. A node may repeatedly notify the Store without issue. -func (s *Store) Notify(nr *command.NotifyRequest) error { +func (s *Store) Notify(nr *proto.NotifyRequest) error { if !s.open { return ErrNotOpen } @@ -1423,7 +1424,7 @@ func (s *Store) Notify(nr *command.NotifyRequest) error { // Join joins a node, identified by id and located at addr, to this store. // The node must be ready to respond to Raft communications at that address. -func (s *Store) Join(jr *command.JoinRequest) error { +func (s *Store) Join(jr *proto.JoinRequest) error { if !s.open { return ErrNotOpen } @@ -1491,7 +1492,7 @@ func (s *Store) Join(jr *command.JoinRequest) error { } // Remove removes a node from the store. -func (s *Store) Remove(rn *command.RemoveNodeRequest) error { +func (s *Store) Remove(rn *proto.RemoveNodeRequest) error { if !s.open { return ErrNotOpen } @@ -1510,7 +1511,7 @@ func (s *Store) Remove(rn *command.RemoveNodeRequest) error { // consumes a slot in the Raft log, but has no other effect on the // system. func (s *Store) Noop(id string) (raft.ApplyFuture, error) { - n := &command.Noop{ + n := &proto.Noop{ Id: id, } b, err := command.MarshalNoop(n) @@ -1518,8 +1519,8 @@ func (s *Store) Noop(id string) (raft.ApplyFuture, error) { return nil, err } - c := &command.Command{ - Type: command.Command_COMMAND_TYPE_NOOP, + c := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_NOOP, SubCommand: b, } bc, err := command.Marshal(c) @@ -1532,8 +1533,8 @@ func (s *Store) Noop(id string) (raft.ApplyFuture, error) { // RequiresLeader returns whether the given ExecuteQueryRequest must be // processed on the cluster Leader. -func (s *Store) RequiresLeader(eqr *command.ExecuteQueryRequest) bool { - if eqr.Level != command.QueryRequest_QUERY_REQUEST_LEVEL_NONE { +func (s *Store) RequiresLeader(eqr *proto.ExecuteQueryRequest) bool { + if eqr.Level != proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE { return true } @@ -1631,17 +1632,17 @@ func (s *Store) updateAppliedIndex() chan struct{} { } type fsmExecuteResponse struct { - results []*command.ExecuteResult + results []*proto.ExecuteResult error error } type fsmQueryResponse struct { - rows []*command.QueryRows + rows []*proto.QueryRows error error } type fsmExecuteQueryResponse struct { - results []*command.ExecuteQueryResponse + results []*proto.ExecuteQueryResponse error error } @@ -1673,7 +1674,7 @@ func (s *Store) fsmApply(l *raft.Log) (e interface{}) { } cmd, r := s.cmdProc.Process(l.Data, &s.db) - if cmd.Type == command.Command_COMMAND_TYPE_NOOP { + if cmd.Type == proto.Command_COMMAND_TYPE_NOOP { s.numNoops++ } return r @@ -2039,7 +2040,7 @@ func (s *Store) installRestore() error { if err != nil { return err } - lr := &command.LoadRequest{ + lr := &proto.LoadRequest{ Data: b, } return s.load(lr) diff --git a/store/store_restart_test.go b/store/store_restart_test.go index aa6edac2..c1a1b2d2 100644 --- a/store/store_restart_test.go +++ b/store/store_restart_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/rqlite/rqlite/v8/command" + command "github.com/rqlite/rqlite/v8/command/proto" ) func test_OpenStoreCloseStartup(t *testing.T, s *Store) { diff --git a/store/store_test.go b/store/store_test.go index a77136e8..aca5e7d0 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -13,8 +13,8 @@ import ( "testing" "time" - "github.com/rqlite/rqlite/v8/command" "github.com/rqlite/rqlite/v8/command/encoding" + "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/db" "github.com/rqlite/rqlite/v8/random" "github.com/rqlite/rqlite/v8/testdata/chinook" @@ -77,7 +77,7 @@ func Test_SingleNodeOnDiskSQLitePath(t *testing.T) { } qr := queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -367,7 +367,7 @@ func Test_OpenStoreCloseSingleNode(t *testing.T) { } qr := queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -496,7 +496,7 @@ func Test_SingleNodeExecuteQuery(t *testing.T) { } qr := queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -564,21 +564,21 @@ func Test_SingleNodeExecuteQueryTx(t *testing.T) { } qr := queryRequestFromString("SELECT * FROM foo", false, true) - var r []*command.QueryRows + var r []*proto.QueryRows - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE _, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) } - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_WEAK _, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) } - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -660,7 +660,7 @@ func Test_SingleNodeRequest(t *testing.T) { } for _, tt := range tests { - eqr := executeQueryRequestFromStrings(tt.stmts, command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, false, false) + eqr := executeQueryRequestFromStrings(tt.stmts, proto.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, false, false) r, err := s.Request(eqr) if err != nil { t.Fatalf("failed to execute request on single node: %s", err.Error()) @@ -740,7 +740,7 @@ func Test_SingleNodeRequestTx(t *testing.T) { } for _, tt := range tests { - eqr := executeQueryRequestFromStrings(tt.stmts, command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, false, tt.tx) + eqr := executeQueryRequestFromStrings(tt.stmts, proto.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, false, tt.tx) r, err := s.Request(eqr) if err != nil { t.Fatalf("failed to execute request on single node: %s", err.Error()) @@ -780,18 +780,18 @@ func Test_SingleNodeRequestParameters(t *testing.T) { } tests := []struct { - request *command.ExecuteQueryRequest + request *proto.ExecuteQueryRequest expected string }{ { - request: &command.ExecuteQueryRequest{ - Request: &command.Request{ - Statements: []*command.Statement{ + request: &proto.ExecuteQueryRequest{ + Request: &proto.Request{ + Statements: []*proto.Statement{ { Sql: "SELECT * FROM foo WHERE id = ?", - Parameters: []*command.Parameter{ + Parameters: []*proto.Parameter{ { - Value: &command.Parameter_I{ + Value: &proto.Parameter_I{ I: 1, }, }, @@ -803,14 +803,14 @@ func Test_SingleNodeRequestParameters(t *testing.T) { expected: `[{"columns":["id","name"],"types":["integer","text"],"values":[[1,"fiona"]]}]`, }, { - request: &command.ExecuteQueryRequest{ - Request: &command.Request{ - Statements: []*command.Statement{ + request: &proto.ExecuteQueryRequest{ + Request: &proto.Request{ + Statements: []*proto.Statement{ { Sql: "SELECT id FROM foo WHERE name = :qux", - Parameters: []*command.Parameter{ + Parameters: []*proto.Parameter{ { - Value: &command.Parameter_S{ + Value: &proto.Parameter_S{ S: "fiona", }, Name: "qux", @@ -894,7 +894,7 @@ func Test_SingleNodeOnDiskFileExecuteQuery(t *testing.T) { } // Every query should return the same results, so use a function for the check. - check := func(r []*command.QueryRows) { + check := func(r []*proto.QueryRows) { if exp, got := `["id","name"]`, asJSON(r[0].Columns); exp != got { t.Fatalf("unexpected results for query\nexp: %s\ngot: %s", exp, got) } @@ -904,7 +904,7 @@ func Test_SingleNodeOnDiskFileExecuteQuery(t *testing.T) { } qr := queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -912,7 +912,7 @@ func Test_SingleNodeOnDiskFileExecuteQuery(t *testing.T) { check(r) qr = queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_WEAK r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -920,7 +920,7 @@ func Test_SingleNodeOnDiskFileExecuteQuery(t *testing.T) { check(r) qr = queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -929,7 +929,7 @@ func Test_SingleNodeOnDiskFileExecuteQuery(t *testing.T) { qr = queryRequestFromString("SELECT * FROM foo", false, true) qr.Timings = true - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -938,7 +938,7 @@ func Test_SingleNodeOnDiskFileExecuteQuery(t *testing.T) { qr = queryRequestFromString("SELECT * FROM foo", true, false) qr.Request.Transaction = true - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1071,7 +1071,7 @@ COMMIT; // Check that data were loaded correctly. qr := queryRequestFromString("SELECT * FROM foo", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1159,7 +1159,7 @@ func Test_SingleNodeLoadTextChinook(t *testing.T) { // Check that data were loaded correctly. qr := queryRequestFromString("SELECT count(*) FROM track", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1172,7 +1172,7 @@ func Test_SingleNodeLoadTextChinook(t *testing.T) { } qr = queryRequestFromString("SELECT count(*) FROM album", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1185,7 +1185,7 @@ func Test_SingleNodeLoadTextChinook(t *testing.T) { } qr = queryRequestFromString("SELECT count(*) FROM artist", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1229,7 +1229,7 @@ COMMIT; // Check that data were loaded correctly. qr := queryRequestFromString("SELECT * FROM bar", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1248,7 +1248,7 @@ COMMIT; // Check that data were loaded correctly. qr = queryRequestFromString("SELECT * FROM foo WHERE id=2", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1260,7 +1260,7 @@ COMMIT; t.Fatalf("unexpected results for query\nexp: %s\ngot: %s", exp, got) } qr = queryRequestFromString("SELECT count(*) FROM foo", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1274,7 +1274,7 @@ COMMIT; // Check pre-existing data is gone. qr = queryRequestFromString("SELECT * FROM bar", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1379,7 +1379,7 @@ COMMIT; // Check that data were loaded correctly. qr := queryRequestFromString("SELECT * FROM bar", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1415,7 +1415,7 @@ COMMIT; // Check that data were loaded correctly. qr = queryRequestFromString("SELECT * FROM foo WHERE id=2", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1427,7 +1427,7 @@ COMMIT; t.Fatalf("unexpected results for query\nexp: %s\ngot: %s", exp, got) } qr = queryRequestFromString("SELECT count(*) FROM foo", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1441,7 +1441,7 @@ COMMIT; // Check pre-existing data is gone. qr = queryRequestFromString("SELECT * FROM bar", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG r, err = s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1503,7 +1503,7 @@ func Test_SingleNodeRecoverNoChange(t *testing.T) { queryTest := func() { t.Helper() qr := queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1571,7 +1571,7 @@ func Test_SingleNodeRecoverNetworkChange(t *testing.T) { queryTest := func(s *Store) { qr := queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -1652,7 +1652,7 @@ func Test_SingleNodeRecoverNetworkChangeSnapshot(t *testing.T) { queryTest := func(s *Store, c int) { qr := queryRequestFromString("SELECT COUNT(*) FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err := s.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -2238,7 +2238,7 @@ func Test_MultiNodeExecuteQuery(t *testing.T) { } qr := queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err := s0.Query(qr) if err != nil { t.Fatalf("failed to query leader node: %s", err.Error()) @@ -2256,17 +2256,17 @@ func Test_MultiNodeExecuteQuery(t *testing.T) { t.Fatalf("error waiting for follower to apply index: %s:", err.Error()) } - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_WEAK _, err = s1.Query(qr) if err == nil { t.Fatalf("successfully queried non-leader node") } - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG _, err = s1.Query(qr) if err == nil { t.Fatalf("successfully queried non-leader node") } - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err = s1.Query(qr) if err != nil { t.Fatalf("failed to query follower node: %s", err.Error()) @@ -2284,17 +2284,17 @@ func Test_MultiNodeExecuteQuery(t *testing.T) { t.Fatalf("error waiting for follower to apply index: %s:", err.Error()) } - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_WEAK _, err = s1.Query(qr) if err == nil { t.Fatalf("successfully queried non-voting node with Weak") } - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG _, err = s1.Query(qr) if err == nil { t.Fatalf("successfully queried non-voting node with Strong") } - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err = s1.Query(qr) if err != nil { t.Fatalf("failed to query non-voting node: %s", err.Error()) @@ -2336,7 +2336,7 @@ func Test_SingleNodeExecuteQueryFreshness(t *testing.T) { t.Fatalf("failed to wait for fsmIndex: %s", err.Error()) } qr := queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE qr.Freshness = mustParseDuration("1ns").Nanoseconds() r, err := s0.Query(qr) if err != nil { @@ -2386,7 +2386,7 @@ func Test_MultiNodeExecuteQueryFreshness(t *testing.T) { } qr := queryRequestFromString("SELECT * FROM foo", false, false) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err := s0.Query(qr) if err != nil { t.Fatalf("failed to query leader node: %s", err.Error()) @@ -2406,13 +2406,13 @@ func Test_MultiNodeExecuteQueryFreshness(t *testing.T) { // "Weak" consistency queries with 1 nanosecond freshness should pass, because freshness // is ignored in this case. - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_WEAK qr.Freshness = mustParseDuration("1ns").Nanoseconds() _, err = s0.Query(qr) if err != nil { t.Fatalf("Failed to ignore freshness if level is Weak: %s", err.Error()) } - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG // "Strong" consistency queries with 1 nanosecond freshness should pass, because freshness // is ignored in this case. _, err = s0.Query(qr) @@ -2424,7 +2424,7 @@ func Test_MultiNodeExecuteQueryFreshness(t *testing.T) { s0.Close(true) // "None" consistency queries should still work. - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE qr.Freshness = 0 r, err = s1.Query(qr) if err != nil { @@ -2442,7 +2442,7 @@ func Test_MultiNodeExecuteQueryFreshness(t *testing.T) { // "None" consistency queries with 1 nanosecond freshness should fail, because at least // one nanosecond *should* have passed since leader died (surely!). - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE qr.Freshness = mustParseDuration("1ns").Nanoseconds() _, err = s1.Query(qr) if err == nil { @@ -2480,7 +2480,7 @@ func Test_MultiNodeExecuteQueryFreshness(t *testing.T) { } // Check Stale-read detection works with Requests too. - eqr := executeQueryRequestFromString("SELECT * FROM foo", command.QueryRequest_QUERY_REQUEST_LEVEL_NONE, + eqr := executeQueryRequestFromString("SELECT * FROM foo", proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE, false, false) eqr.Freshness = mustParseDuration("1ns").Nanoseconds() _, err = s1.Request(eqr) @@ -2570,7 +2570,7 @@ func Test_StoreLogTruncationMultinode(t *testing.T) { t.Fatalf("error waiting for follower to apply index: %s:", err.Error()) } qr := queryRequestFromString("SELECT count(*) FROM foo", false, true) - qr.Level = command.QueryRequest_QUERY_REQUEST_LEVEL_NONE + qr.Level = proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE r, err := s1.Query(qr) if err != nil { t.Fatalf("failed to query single node: %s", err.Error()) @@ -2767,7 +2767,7 @@ func Test_RequiresLeader(t *testing.T) { tests := []struct { name string stmts []string - lvl command.QueryRequest_Level + lvl proto.QueryRequest_Level requires bool }{ { @@ -2808,43 +2808,43 @@ func Test_RequiresLeader(t *testing.T) { { name: "Single SELECT with NONE", stmts: []string{"SELECT * FROM foo"}, - lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_NONE, + lvl: proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE, requires: false, }, { name: "Single SELECT from non-existent table with NONE", stmts: []string{"SELECT * FROM qux"}, - lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_NONE, + lvl: proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE, requires: true, }, { name: "Double SELECT with NONE", stmts: []string{"SELECT * FROM foo", "SELECT * FROM foo WHERE id = 1"}, - lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_NONE, + lvl: proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE, requires: false, }, { name: "Single SELECT with STRONG", stmts: []string{"SELECT * FROM foo"}, - lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG, + lvl: proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG, requires: true, }, { name: "Single SELECT with WEAK", stmts: []string{"SELECT * FROM foo"}, - lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, + lvl: proto.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, requires: true, }, { name: "Mix queries and executes with NONE", stmts: []string{"SELECT * FROM foo", "INSERT INTO foo(id, name) VALUES(1, 'fiona')"}, - lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_NONE, + lvl: proto.QueryRequest_QUERY_REQUEST_LEVEL_NONE, requires: true, }, { name: "Mix queries and executes with WEAK", stmts: []string{"SELECT * FROM foo", "INSERT INTO foo(id, name) VALUES(1, 'fiona')"}, - lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, + lvl: proto.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, requires: true, }, } @@ -3001,20 +3001,20 @@ func mustFileSize(path string) int64 { return n } -func executeRequestFromString(s string, timings, tx bool) *command.ExecuteRequest { +func executeRequestFromString(s string, timings, tx bool) *proto.ExecuteRequest { return executeRequestFromStrings([]string{s}, timings, tx) } -// executeRequestFromStrings converts a slice of strings into a command.ExecuteRequest -func executeRequestFromStrings(s []string, timings, tx bool) *command.ExecuteRequest { - stmts := make([]*command.Statement, len(s)) +// executeRequestFromStrings converts a slice of strings into a proto.ExecuteRequest +func executeRequestFromStrings(s []string, timings, tx bool) *proto.ExecuteRequest { + stmts := make([]*proto.Statement, len(s)) for i := range s { - stmts[i] = &command.Statement{ + stmts[i] = &proto.Statement{ Sql: s[i], } } - return &command.ExecuteRequest{ - Request: &command.Request{ + return &proto.ExecuteRequest{ + Request: &proto.Request{ Statements: stmts, Transaction: tx, }, @@ -3022,20 +3022,20 @@ func executeRequestFromStrings(s []string, timings, tx bool) *command.ExecuteReq } } -func queryRequestFromString(s string, timings, tx bool) *command.QueryRequest { +func queryRequestFromString(s string, timings, tx bool) *proto.QueryRequest { return queryRequestFromStrings([]string{s}, timings, tx) } -// queryRequestFromStrings converts a slice of strings into a command.QueryRequest -func queryRequestFromStrings(s []string, timings, tx bool) *command.QueryRequest { - stmts := make([]*command.Statement, len(s)) +// queryRequestFromStrings converts a slice of strings into a proto.QueryRequest +func queryRequestFromStrings(s []string, timings, tx bool) *proto.QueryRequest { + stmts := make([]*proto.Statement, len(s)) for i := range s { - stmts[i] = &command.Statement{ + stmts[i] = &proto.Statement{ Sql: s[i], } } - return &command.QueryRequest{ - Request: &command.Request{ + return &proto.QueryRequest{ + Request: &proto.Request{ Statements: stmts, Transaction: tx, }, @@ -3043,19 +3043,19 @@ func queryRequestFromStrings(s []string, timings, tx bool) *command.QueryRequest } } -func executeQueryRequestFromString(s string, lvl command.QueryRequest_Level, timings, tx bool) *command.ExecuteQueryRequest { +func executeQueryRequestFromString(s string, lvl proto.QueryRequest_Level, timings, tx bool) *proto.ExecuteQueryRequest { return executeQueryRequestFromStrings([]string{s}, lvl, timings, tx) } -func executeQueryRequestFromStrings(s []string, lvl command.QueryRequest_Level, timings, tx bool) *command.ExecuteQueryRequest { - stmts := make([]*command.Statement, len(s)) +func executeQueryRequestFromStrings(s []string, lvl proto.QueryRequest_Level, timings, tx bool) *proto.ExecuteQueryRequest { + stmts := make([]*proto.Statement, len(s)) for i := range s { - stmts[i] = &command.Statement{ + stmts[i] = &proto.Statement{ Sql: s[i], } } - return &command.ExecuteQueryRequest{ - Request: &command.Request{ + return &proto.ExecuteQueryRequest{ + Request: &proto.Request{ Statements: stmts, Transaction: tx, }, @@ -3064,43 +3064,43 @@ func executeQueryRequestFromStrings(s []string, lvl command.QueryRequest_Level, } } -func backupRequestSQL(leader bool) *command.BackupRequest { - return &command.BackupRequest{ - Format: command.BackupRequest_BACKUP_REQUEST_FORMAT_SQL, +func backupRequestSQL(leader bool) *proto.BackupRequest { + return &proto.BackupRequest{ + Format: proto.BackupRequest_BACKUP_REQUEST_FORMAT_SQL, Leader: leader, } } -func backupRequestBinary(leader bool) *command.BackupRequest { - return &command.BackupRequest{ - Format: command.BackupRequest_BACKUP_REQUEST_FORMAT_BINARY, +func backupRequestBinary(leader bool) *proto.BackupRequest { + return &proto.BackupRequest{ + Format: proto.BackupRequest_BACKUP_REQUEST_FORMAT_BINARY, Leader: leader, } } -func loadRequestFromFile(path string) *command.LoadRequest { - return &command.LoadRequest{ +func loadRequestFromFile(path string) *proto.LoadRequest { + return &proto.LoadRequest{ Data: mustReadFile(path), } } -func joinRequest(id, addr string, voter bool) *command.JoinRequest { - return &command.JoinRequest{ +func joinRequest(id, addr string, voter bool) *proto.JoinRequest { + return &proto.JoinRequest{ Id: id, Address: addr, Voter: voter, } } -func notifyRequest(id, addr string) *command.NotifyRequest { - return &command.NotifyRequest{ +func notifyRequest(id, addr string) *proto.NotifyRequest { + return &proto.NotifyRequest{ Id: id, Address: addr, } } -func removeNodeRequest(id string) *command.RemoveNodeRequest { - return &command.RemoveNodeRequest{ +func removeNodeRequest(id string) *proto.RemoveNodeRequest { + return &proto.RemoveNodeRequest{ Id: id, } } diff --git a/system_test/helpers.go b/system_test/helpers.go index 771ee595..42df908b 100644 --- a/system_test/helpers.go +++ b/system_test/helpers.go @@ -19,8 +19,8 @@ import ( "time" "github.com/rqlite/rqlite/v8/cluster" - "github.com/rqlite/rqlite/v8/command" "github.com/rqlite/rqlite/v8/command/encoding" + "github.com/rqlite/rqlite/v8/command/proto" httpd "github.com/rqlite/rqlite/v8/http" "github.com/rqlite/rqlite/v8/store" "github.com/rqlite/rqlite/v8/tcp" @@ -235,7 +235,7 @@ func (n *Node) JoinAsNonVoter(leader *Node) error { // Notify notifies this node of the existence of another node func (n *Node) Notify(id, raftAddr string) error { - nr := &command.NotifyRequest{ + nr := &proto.NotifyRequest{ Id: n.Store.ID(), Address: n.RaftAddr, } diff --git a/system_test/request_forwarding_test.go b/system_test/request_forwarding_test.go index 4c410e27..a52e7e14 100644 --- a/system_test/request_forwarding_test.go +++ b/system_test/request_forwarding_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/rqlite/rqlite/v8/cluster" - "github.com/rqlite/rqlite/v8/command" + "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/rtls" "github.com/rqlite/rqlite/v8/tcp" ) @@ -314,20 +314,20 @@ func Test_MultiNodeClusterQueuedRequestForwardOK(t *testing.T) { } } -func executeRequestFromString(s string) *command.ExecuteRequest { +func executeRequestFromString(s string) *proto.ExecuteRequest { return executeRequestFromStrings([]string{s}) } // queryRequestFromStrings converts a slice of strings into a command.ExecuteRequest -func executeRequestFromStrings(s []string) *command.ExecuteRequest { - stmts := make([]*command.Statement, len(s)) +func executeRequestFromStrings(s []string) *proto.ExecuteRequest { + stmts := make([]*proto.Statement, len(s)) for i := range s { - stmts[i] = &command.Statement{ + stmts[i] = &proto.Statement{ Sql: s[i], } } - return &command.ExecuteRequest{ - Request: &command.Request{ + return &proto.ExecuteRequest{ + Request: &proto.Request{ Statements: stmts, Transaction: false, }, @@ -335,20 +335,20 @@ func executeRequestFromStrings(s []string) *command.ExecuteRequest { } } -func queryRequestFromString(s string) *command.QueryRequest { +func queryRequestFromString(s string) *proto.QueryRequest { return queryRequestFromStrings([]string{s}) } // queryRequestFromStrings converts a slice of strings into a command.QueryRequest -func queryRequestFromStrings(s []string) *command.QueryRequest { - stmts := make([]*command.Statement, len(s)) +func queryRequestFromStrings(s []string) *proto.QueryRequest { + stmts := make([]*proto.Statement, len(s)) for i := range s { - stmts[i] = &command.Statement{ + stmts[i] = &proto.Statement{ Sql: s[i], } } - return &command.QueryRequest{ - Request: &command.Request{ + return &proto.QueryRequest{ + Request: &proto.Request{ Statements: stmts, Transaction: false, }, @@ -356,20 +356,20 @@ func queryRequestFromStrings(s []string) *command.QueryRequest { } } -func executeQueryRequestFromString(s string) *command.ExecuteQueryRequest { +func executeQueryRequestFromString(s string) *proto.ExecuteQueryRequest { return executeQueryRequestFromStrings([]string{s}) } // executeQueryRequestFromStrings converts a slice of strings into a command.ExecuteQueryRequest -func executeQueryRequestFromStrings(s []string) *command.ExecuteQueryRequest { - stmts := make([]*command.Statement, len(s)) +func executeQueryRequestFromStrings(s []string) *proto.ExecuteQueryRequest { + stmts := make([]*proto.Statement, len(s)) for i := range s { - stmts[i] = &command.Statement{ + stmts[i] = &proto.Statement{ Sql: s[i], } } - return &command.ExecuteQueryRequest{ - Request: &command.Request{ + return &proto.ExecuteQueryRequest{ + Request: &proto.Request{ Statements: stmts, Transaction: false, }, diff --git a/v8/cluster/message.pb.go b/v8/cluster/message.pb.go deleted file mode 100644 index ea75cf09..00000000 --- a/v8/cluster/message.pb.go +++ /dev/null @@ -1,1223 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.32.0 -// protoc v3.6.1 -// source: cluster/message.proto - -package cluster - -import ( - command "github.com/rqlite/rqlite/v8/command" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Command_Type int32 - -const ( - Command_COMMAND_TYPE_UNKNOWN Command_Type = 0 - Command_COMMAND_TYPE_GET_NODE_API_URL Command_Type = 1 - Command_COMMAND_TYPE_EXECUTE Command_Type = 2 - Command_COMMAND_TYPE_QUERY Command_Type = 3 - Command_COMMAND_TYPE_BACKUP Command_Type = 4 - Command_COMMAND_TYPE_LOAD Command_Type = 5 - Command_COMMAND_TYPE_REMOVE_NODE Command_Type = 6 - Command_COMMAND_TYPE_NOTIFY Command_Type = 7 - Command_COMMAND_TYPE_JOIN Command_Type = 8 - Command_COMMAND_TYPE_REQUEST Command_Type = 9 - Command_COMMAND_TYPE_LOAD_CHUNK Command_Type = 10 -) - -// Enum value maps for Command_Type. -var ( - Command_Type_name = map[int32]string{ - 0: "COMMAND_TYPE_UNKNOWN", - 1: "COMMAND_TYPE_GET_NODE_API_URL", - 2: "COMMAND_TYPE_EXECUTE", - 3: "COMMAND_TYPE_QUERY", - 4: "COMMAND_TYPE_BACKUP", - 5: "COMMAND_TYPE_LOAD", - 6: "COMMAND_TYPE_REMOVE_NODE", - 7: "COMMAND_TYPE_NOTIFY", - 8: "COMMAND_TYPE_JOIN", - 9: "COMMAND_TYPE_REQUEST", - 10: "COMMAND_TYPE_LOAD_CHUNK", - } - Command_Type_value = map[string]int32{ - "COMMAND_TYPE_UNKNOWN": 0, - "COMMAND_TYPE_GET_NODE_API_URL": 1, - "COMMAND_TYPE_EXECUTE": 2, - "COMMAND_TYPE_QUERY": 3, - "COMMAND_TYPE_BACKUP": 4, - "COMMAND_TYPE_LOAD": 5, - "COMMAND_TYPE_REMOVE_NODE": 6, - "COMMAND_TYPE_NOTIFY": 7, - "COMMAND_TYPE_JOIN": 8, - "COMMAND_TYPE_REQUEST": 9, - "COMMAND_TYPE_LOAD_CHUNK": 10, - } -) - -func (x Command_Type) Enum() *Command_Type { - p := new(Command_Type) - *p = x - return p -} - -func (x Command_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Command_Type) Descriptor() protoreflect.EnumDescriptor { - return file_cluster_message_proto_enumTypes[0].Descriptor() -} - -func (Command_Type) Type() protoreflect.EnumType { - return &file_cluster_message_proto_enumTypes[0] -} - -func (x Command_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Command_Type.Descriptor instead. -func (Command_Type) EnumDescriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{2, 0} -} - -type Credentials struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` -} - -func (x *Credentials) Reset() { - *x = Credentials{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Credentials) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Credentials) ProtoMessage() {} - -func (x *Credentials) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Credentials.ProtoReflect.Descriptor instead. -func (*Credentials) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{0} -} - -func (x *Credentials) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *Credentials) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -type Address struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` -} - -func (x *Address) Reset() { - *x = Address{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Address) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Address) ProtoMessage() {} - -func (x *Address) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Address.ProtoReflect.Descriptor instead. -func (*Address) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{1} -} - -func (x *Address) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -type Command struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type Command_Type `protobuf:"varint,1,opt,name=type,proto3,enum=cluster.Command_Type" json:"type,omitempty"` - // Types that are assignable to Request: - // - // *Command_ExecuteRequest - // *Command_QueryRequest - // *Command_BackupRequest - // *Command_LoadRequest - // *Command_RemoveNodeRequest - // *Command_NotifyRequest - // *Command_JoinRequest - // *Command_ExecuteQueryRequest - // *Command_LoadChunkRequest - Request isCommand_Request `protobuf_oneof:"request"` - Credentials *Credentials `protobuf:"bytes,4,opt,name=credentials,proto3" json:"credentials,omitempty"` -} - -func (x *Command) Reset() { - *x = Command{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Command) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Command) ProtoMessage() {} - -func (x *Command) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Command.ProtoReflect.Descriptor instead. -func (*Command) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{2} -} - -func (x *Command) GetType() Command_Type { - if x != nil { - return x.Type - } - return Command_COMMAND_TYPE_UNKNOWN -} - -func (m *Command) GetRequest() isCommand_Request { - if m != nil { - return m.Request - } - return nil -} - -func (x *Command) GetExecuteRequest() *command.ExecuteRequest { - if x, ok := x.GetRequest().(*Command_ExecuteRequest); ok { - return x.ExecuteRequest - } - return nil -} - -func (x *Command) GetQueryRequest() *command.QueryRequest { - if x, ok := x.GetRequest().(*Command_QueryRequest); ok { - return x.QueryRequest - } - return nil -} - -func (x *Command) GetBackupRequest() *command.BackupRequest { - if x, ok := x.GetRequest().(*Command_BackupRequest); ok { - return x.BackupRequest - } - return nil -} - -func (x *Command) GetLoadRequest() *command.LoadRequest { - if x, ok := x.GetRequest().(*Command_LoadRequest); ok { - return x.LoadRequest - } - return nil -} - -func (x *Command) GetRemoveNodeRequest() *command.RemoveNodeRequest { - if x, ok := x.GetRequest().(*Command_RemoveNodeRequest); ok { - return x.RemoveNodeRequest - } - return nil -} - -func (x *Command) GetNotifyRequest() *command.NotifyRequest { - if x, ok := x.GetRequest().(*Command_NotifyRequest); ok { - return x.NotifyRequest - } - return nil -} - -func (x *Command) GetJoinRequest() *command.JoinRequest { - if x, ok := x.GetRequest().(*Command_JoinRequest); ok { - return x.JoinRequest - } - return nil -} - -func (x *Command) GetExecuteQueryRequest() *command.ExecuteQueryRequest { - if x, ok := x.GetRequest().(*Command_ExecuteQueryRequest); ok { - return x.ExecuteQueryRequest - } - return nil -} - -func (x *Command) GetLoadChunkRequest() *command.LoadChunkRequest { - if x, ok := x.GetRequest().(*Command_LoadChunkRequest); ok { - return x.LoadChunkRequest - } - return nil -} - -func (x *Command) GetCredentials() *Credentials { - if x != nil { - return x.Credentials - } - return nil -} - -type isCommand_Request interface { - isCommand_Request() -} - -type Command_ExecuteRequest struct { - ExecuteRequest *command.ExecuteRequest `protobuf:"bytes,2,opt,name=execute_request,json=executeRequest,proto3,oneof"` -} - -type Command_QueryRequest struct { - QueryRequest *command.QueryRequest `protobuf:"bytes,3,opt,name=query_request,json=queryRequest,proto3,oneof"` -} - -type Command_BackupRequest struct { - BackupRequest *command.BackupRequest `protobuf:"bytes,5,opt,name=backup_request,json=backupRequest,proto3,oneof"` -} - -type Command_LoadRequest struct { - LoadRequest *command.LoadRequest `protobuf:"bytes,6,opt,name=load_request,json=loadRequest,proto3,oneof"` -} - -type Command_RemoveNodeRequest struct { - RemoveNodeRequest *command.RemoveNodeRequest `protobuf:"bytes,7,opt,name=remove_node_request,json=removeNodeRequest,proto3,oneof"` -} - -type Command_NotifyRequest struct { - NotifyRequest *command.NotifyRequest `protobuf:"bytes,8,opt,name=notify_request,json=notifyRequest,proto3,oneof"` -} - -type Command_JoinRequest struct { - JoinRequest *command.JoinRequest `protobuf:"bytes,9,opt,name=join_request,json=joinRequest,proto3,oneof"` -} - -type Command_ExecuteQueryRequest struct { - ExecuteQueryRequest *command.ExecuteQueryRequest `protobuf:"bytes,10,opt,name=execute_query_request,json=executeQueryRequest,proto3,oneof"` -} - -type Command_LoadChunkRequest struct { - LoadChunkRequest *command.LoadChunkRequest `protobuf:"bytes,11,opt,name=load_chunk_request,json=loadChunkRequest,proto3,oneof"` -} - -func (*Command_ExecuteRequest) isCommand_Request() {} - -func (*Command_QueryRequest) isCommand_Request() {} - -func (*Command_BackupRequest) isCommand_Request() {} - -func (*Command_LoadRequest) isCommand_Request() {} - -func (*Command_RemoveNodeRequest) isCommand_Request() {} - -func (*Command_NotifyRequest) isCommand_Request() {} - -func (*Command_JoinRequest) isCommand_Request() {} - -func (*Command_ExecuteQueryRequest) isCommand_Request() {} - -func (*Command_LoadChunkRequest) isCommand_Request() {} - -type CommandExecuteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Results []*command.ExecuteResult `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *CommandExecuteResponse) Reset() { - *x = CommandExecuteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandExecuteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandExecuteResponse) ProtoMessage() {} - -func (x *CommandExecuteResponse) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommandExecuteResponse.ProtoReflect.Descriptor instead. -func (*CommandExecuteResponse) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{3} -} - -func (x *CommandExecuteResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *CommandExecuteResponse) GetResults() []*command.ExecuteResult { - if x != nil { - return x.Results - } - return nil -} - -type CommandQueryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Rows []*command.QueryRows `protobuf:"bytes,2,rep,name=rows,proto3" json:"rows,omitempty"` -} - -func (x *CommandQueryResponse) Reset() { - *x = CommandQueryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandQueryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandQueryResponse) ProtoMessage() {} - -func (x *CommandQueryResponse) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommandQueryResponse.ProtoReflect.Descriptor instead. -func (*CommandQueryResponse) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{4} -} - -func (x *CommandQueryResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *CommandQueryResponse) GetRows() []*command.QueryRows { - if x != nil { - return x.Rows - } - return nil -} - -type CommandRequestResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Response []*command.ExecuteQueryResponse `protobuf:"bytes,2,rep,name=response,proto3" json:"response,omitempty"` -} - -func (x *CommandRequestResponse) Reset() { - *x = CommandRequestResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandRequestResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandRequestResponse) ProtoMessage() {} - -func (x *CommandRequestResponse) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommandRequestResponse.ProtoReflect.Descriptor instead. -func (*CommandRequestResponse) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{5} -} - -func (x *CommandRequestResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *CommandRequestResponse) GetResponse() []*command.ExecuteQueryResponse { - if x != nil { - return x.Response - } - return nil -} - -type CommandBackupResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *CommandBackupResponse) Reset() { - *x = CommandBackupResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandBackupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandBackupResponse) ProtoMessage() {} - -func (x *CommandBackupResponse) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommandBackupResponse.ProtoReflect.Descriptor instead. -func (*CommandBackupResponse) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{6} -} - -func (x *CommandBackupResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *CommandBackupResponse) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type CommandLoadResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` -} - -func (x *CommandLoadResponse) Reset() { - *x = CommandLoadResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandLoadResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandLoadResponse) ProtoMessage() {} - -func (x *CommandLoadResponse) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommandLoadResponse.ProtoReflect.Descriptor instead. -func (*CommandLoadResponse) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{7} -} - -func (x *CommandLoadResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -type CommandLoadChunkResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` -} - -func (x *CommandLoadChunkResponse) Reset() { - *x = CommandLoadChunkResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandLoadChunkResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandLoadChunkResponse) ProtoMessage() {} - -func (x *CommandLoadChunkResponse) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommandLoadChunkResponse.ProtoReflect.Descriptor instead. -func (*CommandLoadChunkResponse) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{8} -} - -func (x *CommandLoadChunkResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -type CommandRemoveNodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` -} - -func (x *CommandRemoveNodeResponse) Reset() { - *x = CommandRemoveNodeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandRemoveNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandRemoveNodeResponse) ProtoMessage() {} - -func (x *CommandRemoveNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommandRemoveNodeResponse.ProtoReflect.Descriptor instead. -func (*CommandRemoveNodeResponse) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{9} -} - -func (x *CommandRemoveNodeResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -type CommandNotifyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` -} - -func (x *CommandNotifyResponse) Reset() { - *x = CommandNotifyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandNotifyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandNotifyResponse) ProtoMessage() {} - -func (x *CommandNotifyResponse) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommandNotifyResponse.ProtoReflect.Descriptor instead. -func (*CommandNotifyResponse) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{10} -} - -func (x *CommandNotifyResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -type CommandJoinResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Leader string `protobuf:"bytes,2,opt,name=leader,proto3" json:"leader,omitempty"` -} - -func (x *CommandJoinResponse) Reset() { - *x = CommandJoinResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cluster_message_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandJoinResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandJoinResponse) ProtoMessage() {} - -func (x *CommandJoinResponse) ProtoReflect() protoreflect.Message { - mi := &file_cluster_message_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommandJoinResponse.ProtoReflect.Descriptor instead. -func (*CommandJoinResponse) Descriptor() ([]byte, []int) { - return file_cluster_message_proto_rawDescGZIP(), []int{11} -} - -func (x *CommandJoinResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *CommandJoinResponse) GetLeader() string { - if x != nil { - return x.Leader - } - return "" -} - -var File_cluster_message_proto protoreflect.FileDescriptor - -var file_cluster_message_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x1b, - 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x8b, 0x08, 0x0a, 0x07, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0d, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0c, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x4c, 0x0a, 0x13, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x11, 0x72, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, - 0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x0d, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x39, 0x0a, 0x0c, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, - 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6a, - 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x52, 0x0a, 0x15, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, - 0x0a, 0x12, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, - 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0b, 0x63, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x73, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x73, 0x22, 0xaa, 0x02, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, - 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, - 0x57, 0x4e, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x50, - 0x49, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, - 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x10, - 0x02, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, - 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, - 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0x05, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x4f, 0x4d, - 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, - 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, 0x4d, 0x41, - 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x59, 0x10, 0x07, - 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x4a, 0x4f, 0x49, 0x4e, 0x10, 0x08, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, - 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, - 0x09, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x43, 0x48, 0x55, 0x4e, 0x4b, 0x10, 0x0a, 0x42, 0x09, - 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x60, 0x0a, 0x16, 0x43, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x54, 0x0a, 0x14, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x26, 0x0a, 0x04, 0x72, 0x6f, 0x77, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x6f, 0x77, 0x73, 0x52, 0x04, 0x72, 0x6f, 0x77, - 0x73, 0x22, 0x69, 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x0a, 0x15, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, - 0x2b, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x30, 0x0a, 0x18, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x31, - 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x22, 0x2d, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x69, - 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x22, 0x43, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4a, 0x6f, 0x69, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x16, 0x0a, - 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x25, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, - 0x65, 0x2f, 0x76, 0x38, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_cluster_message_proto_rawDescOnce sync.Once - file_cluster_message_proto_rawDescData = file_cluster_message_proto_rawDesc -) - -func file_cluster_message_proto_rawDescGZIP() []byte { - file_cluster_message_proto_rawDescOnce.Do(func() { - file_cluster_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_cluster_message_proto_rawDescData) - }) - return file_cluster_message_proto_rawDescData -} - -var file_cluster_message_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_cluster_message_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_cluster_message_proto_goTypes = []interface{}{ - (Command_Type)(0), // 0: cluster.Command.Type - (*Credentials)(nil), // 1: cluster.Credentials - (*Address)(nil), // 2: cluster.Address - (*Command)(nil), // 3: cluster.Command - (*CommandExecuteResponse)(nil), // 4: cluster.CommandExecuteResponse - (*CommandQueryResponse)(nil), // 5: cluster.CommandQueryResponse - (*CommandRequestResponse)(nil), // 6: cluster.CommandRequestResponse - (*CommandBackupResponse)(nil), // 7: cluster.CommandBackupResponse - (*CommandLoadResponse)(nil), // 8: cluster.CommandLoadResponse - (*CommandLoadChunkResponse)(nil), // 9: cluster.CommandLoadChunkResponse - (*CommandRemoveNodeResponse)(nil), // 10: cluster.CommandRemoveNodeResponse - (*CommandNotifyResponse)(nil), // 11: cluster.CommandNotifyResponse - (*CommandJoinResponse)(nil), // 12: cluster.CommandJoinResponse - (*command.ExecuteRequest)(nil), // 13: command.ExecuteRequest - (*command.QueryRequest)(nil), // 14: command.QueryRequest - (*command.BackupRequest)(nil), // 15: command.BackupRequest - (*command.LoadRequest)(nil), // 16: command.LoadRequest - (*command.RemoveNodeRequest)(nil), // 17: command.RemoveNodeRequest - (*command.NotifyRequest)(nil), // 18: command.NotifyRequest - (*command.JoinRequest)(nil), // 19: command.JoinRequest - (*command.ExecuteQueryRequest)(nil), // 20: command.ExecuteQueryRequest - (*command.LoadChunkRequest)(nil), // 21: command.LoadChunkRequest - (*command.ExecuteResult)(nil), // 22: command.ExecuteResult - (*command.QueryRows)(nil), // 23: command.QueryRows - (*command.ExecuteQueryResponse)(nil), // 24: command.ExecuteQueryResponse -} -var file_cluster_message_proto_depIdxs = []int32{ - 0, // 0: cluster.Command.type:type_name -> cluster.Command.Type - 13, // 1: cluster.Command.execute_request:type_name -> command.ExecuteRequest - 14, // 2: cluster.Command.query_request:type_name -> command.QueryRequest - 15, // 3: cluster.Command.backup_request:type_name -> command.BackupRequest - 16, // 4: cluster.Command.load_request:type_name -> command.LoadRequest - 17, // 5: cluster.Command.remove_node_request:type_name -> command.RemoveNodeRequest - 18, // 6: cluster.Command.notify_request:type_name -> command.NotifyRequest - 19, // 7: cluster.Command.join_request:type_name -> command.JoinRequest - 20, // 8: cluster.Command.execute_query_request:type_name -> command.ExecuteQueryRequest - 21, // 9: cluster.Command.load_chunk_request:type_name -> command.LoadChunkRequest - 1, // 10: cluster.Command.credentials:type_name -> cluster.Credentials - 22, // 11: cluster.CommandExecuteResponse.results:type_name -> command.ExecuteResult - 23, // 12: cluster.CommandQueryResponse.rows:type_name -> command.QueryRows - 24, // 13: cluster.CommandRequestResponse.response:type_name -> command.ExecuteQueryResponse - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name -} - -func init() { file_cluster_message_proto_init() } -func file_cluster_message_proto_init() { - if File_cluster_message_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_cluster_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Credentials); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Address); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Command); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandExecuteResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandQueryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandRequestResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandBackupResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandLoadResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandLoadChunkResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandRemoveNodeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandNotifyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cluster_message_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandJoinResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_cluster_message_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*Command_ExecuteRequest)(nil), - (*Command_QueryRequest)(nil), - (*Command_BackupRequest)(nil), - (*Command_LoadRequest)(nil), - (*Command_RemoveNodeRequest)(nil), - (*Command_NotifyRequest)(nil), - (*Command_JoinRequest)(nil), - (*Command_ExecuteQueryRequest)(nil), - (*Command_LoadChunkRequest)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cluster_message_proto_rawDesc, - NumEnums: 1, - NumMessages: 12, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cluster_message_proto_goTypes, - DependencyIndexes: file_cluster_message_proto_depIdxs, - EnumInfos: file_cluster_message_proto_enumTypes, - MessageInfos: file_cluster_message_proto_msgTypes, - }.Build() - File_cluster_message_proto = out.File - file_cluster_message_proto_rawDesc = nil - file_cluster_message_proto_goTypes = nil - file_cluster_message_proto_depIdxs = nil -} diff --git a/v8/command/command.pb.go b/v8/command/command.pb.go deleted file mode 100644 index 1eb8421b..00000000 --- a/v8/command/command.pb.go +++ /dev/null @@ -1,1843 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.32.0 -// protoc v3.6.1 -// source: command/command.proto - -package command - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type QueryRequest_Level int32 - -const ( - QueryRequest_QUERY_REQUEST_LEVEL_NONE QueryRequest_Level = 0 - QueryRequest_QUERY_REQUEST_LEVEL_WEAK QueryRequest_Level = 1 - QueryRequest_QUERY_REQUEST_LEVEL_STRONG QueryRequest_Level = 2 -) - -// Enum value maps for QueryRequest_Level. -var ( - QueryRequest_Level_name = map[int32]string{ - 0: "QUERY_REQUEST_LEVEL_NONE", - 1: "QUERY_REQUEST_LEVEL_WEAK", - 2: "QUERY_REQUEST_LEVEL_STRONG", - } - QueryRequest_Level_value = map[string]int32{ - "QUERY_REQUEST_LEVEL_NONE": 0, - "QUERY_REQUEST_LEVEL_WEAK": 1, - "QUERY_REQUEST_LEVEL_STRONG": 2, - } -) - -func (x QueryRequest_Level) Enum() *QueryRequest_Level { - p := new(QueryRequest_Level) - *p = x - return p -} - -func (x QueryRequest_Level) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (QueryRequest_Level) Descriptor() protoreflect.EnumDescriptor { - return file_command_command_proto_enumTypes[0].Descriptor() -} - -func (QueryRequest_Level) Type() protoreflect.EnumType { - return &file_command_command_proto_enumTypes[0] -} - -func (x QueryRequest_Level) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use QueryRequest_Level.Descriptor instead. -func (QueryRequest_Level) EnumDescriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{3, 0} -} - -type BackupRequest_Format int32 - -const ( - BackupRequest_BACKUP_REQUEST_FORMAT_NONE BackupRequest_Format = 0 - BackupRequest_BACKUP_REQUEST_FORMAT_SQL BackupRequest_Format = 1 - BackupRequest_BACKUP_REQUEST_FORMAT_BINARY BackupRequest_Format = 2 -) - -// Enum value maps for BackupRequest_Format. -var ( - BackupRequest_Format_name = map[int32]string{ - 0: "BACKUP_REQUEST_FORMAT_NONE", - 1: "BACKUP_REQUEST_FORMAT_SQL", - 2: "BACKUP_REQUEST_FORMAT_BINARY", - } - BackupRequest_Format_value = map[string]int32{ - "BACKUP_REQUEST_FORMAT_NONE": 0, - "BACKUP_REQUEST_FORMAT_SQL": 1, - "BACKUP_REQUEST_FORMAT_BINARY": 2, - } -) - -func (x BackupRequest_Format) Enum() *BackupRequest_Format { - p := new(BackupRequest_Format) - *p = x - return p -} - -func (x BackupRequest_Format) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BackupRequest_Format) Descriptor() protoreflect.EnumDescriptor { - return file_command_command_proto_enumTypes[1].Descriptor() -} - -func (BackupRequest_Format) Type() protoreflect.EnumType { - return &file_command_command_proto_enumTypes[1] -} - -func (x BackupRequest_Format) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use BackupRequest_Format.Descriptor instead. -func (BackupRequest_Format) EnumDescriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{10, 0} -} - -type Command_Type int32 - -const ( - Command_COMMAND_TYPE_UNKNOWN Command_Type = 0 - Command_COMMAND_TYPE_QUERY Command_Type = 1 - Command_COMMAND_TYPE_EXECUTE Command_Type = 2 - Command_COMMAND_TYPE_NOOP Command_Type = 3 - Command_COMMAND_TYPE_LOAD Command_Type = 4 - Command_COMMAND_TYPE_JOIN Command_Type = 5 - Command_COMMAND_TYPE_EXECUTE_QUERY Command_Type = 6 - Command_COMMAND_TYPE_LOAD_CHUNK Command_Type = 7 -) - -// Enum value maps for Command_Type. -var ( - Command_Type_name = map[int32]string{ - 0: "COMMAND_TYPE_UNKNOWN", - 1: "COMMAND_TYPE_QUERY", - 2: "COMMAND_TYPE_EXECUTE", - 3: "COMMAND_TYPE_NOOP", - 4: "COMMAND_TYPE_LOAD", - 5: "COMMAND_TYPE_JOIN", - 6: "COMMAND_TYPE_EXECUTE_QUERY", - 7: "COMMAND_TYPE_LOAD_CHUNK", - } - Command_Type_value = map[string]int32{ - "COMMAND_TYPE_UNKNOWN": 0, - "COMMAND_TYPE_QUERY": 1, - "COMMAND_TYPE_EXECUTE": 2, - "COMMAND_TYPE_NOOP": 3, - "COMMAND_TYPE_LOAD": 4, - "COMMAND_TYPE_JOIN": 5, - "COMMAND_TYPE_EXECUTE_QUERY": 6, - "COMMAND_TYPE_LOAD_CHUNK": 7, - } -) - -func (x Command_Type) Enum() *Command_Type { - p := new(Command_Type) - *p = x - return p -} - -func (x Command_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Command_Type) Descriptor() protoreflect.EnumDescriptor { - return file_command_command_proto_enumTypes[2].Descriptor() -} - -func (Command_Type) Type() protoreflect.EnumType { - return &file_command_command_proto_enumTypes[2] -} - -func (x Command_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Command_Type.Descriptor instead. -func (Command_Type) EnumDescriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{17, 0} -} - -type Parameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Value: - // - // *Parameter_I - // *Parameter_D - // *Parameter_B - // *Parameter_Y - // *Parameter_S - Value isParameter_Value `protobuf_oneof:"value"` - Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *Parameter) Reset() { - *x = Parameter{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Parameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Parameter) ProtoMessage() {} - -func (x *Parameter) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Parameter.ProtoReflect.Descriptor instead. -func (*Parameter) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{0} -} - -func (m *Parameter) GetValue() isParameter_Value { - if m != nil { - return m.Value - } - return nil -} - -func (x *Parameter) GetI() int64 { - if x, ok := x.GetValue().(*Parameter_I); ok { - return x.I - } - return 0 -} - -func (x *Parameter) GetD() float64 { - if x, ok := x.GetValue().(*Parameter_D); ok { - return x.D - } - return 0 -} - -func (x *Parameter) GetB() bool { - if x, ok := x.GetValue().(*Parameter_B); ok { - return x.B - } - return false -} - -func (x *Parameter) GetY() []byte { - if x, ok := x.GetValue().(*Parameter_Y); ok { - return x.Y - } - return nil -} - -func (x *Parameter) GetS() string { - if x, ok := x.GetValue().(*Parameter_S); ok { - return x.S - } - return "" -} - -func (x *Parameter) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type isParameter_Value interface { - isParameter_Value() -} - -type Parameter_I struct { - I int64 `protobuf:"zigzag64,1,opt,name=i,proto3,oneof"` -} - -type Parameter_D struct { - D float64 `protobuf:"fixed64,2,opt,name=d,proto3,oneof"` -} - -type Parameter_B struct { - B bool `protobuf:"varint,3,opt,name=b,proto3,oneof"` -} - -type Parameter_Y struct { - Y []byte `protobuf:"bytes,4,opt,name=y,proto3,oneof"` -} - -type Parameter_S struct { - S string `protobuf:"bytes,5,opt,name=s,proto3,oneof"` -} - -func (*Parameter_I) isParameter_Value() {} - -func (*Parameter_D) isParameter_Value() {} - -func (*Parameter_B) isParameter_Value() {} - -func (*Parameter_Y) isParameter_Value() {} - -func (*Parameter_S) isParameter_Value() {} - -type Statement struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sql string `protobuf:"bytes,1,opt,name=sql,proto3" json:"sql,omitempty"` - Parameters []*Parameter `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty"` -} - -func (x *Statement) Reset() { - *x = Statement{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Statement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Statement) ProtoMessage() {} - -func (x *Statement) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Statement.ProtoReflect.Descriptor instead. -func (*Statement) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{1} -} - -func (x *Statement) GetSql() string { - if x != nil { - return x.Sql - } - return "" -} - -func (x *Statement) GetParameters() []*Parameter { - if x != nil { - return x.Parameters - } - return nil -} - -type Request struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Transaction bool `protobuf:"varint,1,opt,name=transaction,proto3" json:"transaction,omitempty"` - Statements []*Statement `protobuf:"bytes,2,rep,name=statements,proto3" json:"statements,omitempty"` -} - -func (x *Request) Reset() { - *x = Request{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Request) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Request) ProtoMessage() {} - -func (x *Request) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Request.ProtoReflect.Descriptor instead. -func (*Request) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{2} -} - -func (x *Request) GetTransaction() bool { - if x != nil { - return x.Transaction - } - return false -} - -func (x *Request) GetStatements() []*Statement { - if x != nil { - return x.Statements - } - return nil -} - -type QueryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - Timings bool `protobuf:"varint,2,opt,name=timings,proto3" json:"timings,omitempty"` - Level QueryRequest_Level `protobuf:"varint,3,opt,name=level,proto3,enum=command.QueryRequest_Level" json:"level,omitempty"` - Freshness int64 `protobuf:"varint,4,opt,name=freshness,proto3" json:"freshness,omitempty"` -} - -func (x *QueryRequest) Reset() { - *x = QueryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryRequest) ProtoMessage() {} - -func (x *QueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. -func (*QueryRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{3} -} - -func (x *QueryRequest) GetRequest() *Request { - if x != nil { - return x.Request - } - return nil -} - -func (x *QueryRequest) GetTimings() bool { - if x != nil { - return x.Timings - } - return false -} - -func (x *QueryRequest) GetLevel() QueryRequest_Level { - if x != nil { - return x.Level - } - return QueryRequest_QUERY_REQUEST_LEVEL_NONE -} - -func (x *QueryRequest) GetFreshness() int64 { - if x != nil { - return x.Freshness - } - return 0 -} - -type Values struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Parameters []*Parameter `protobuf:"bytes,1,rep,name=parameters,proto3" json:"parameters,omitempty"` -} - -func (x *Values) Reset() { - *x = Values{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Values) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Values) ProtoMessage() {} - -func (x *Values) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Values.ProtoReflect.Descriptor instead. -func (*Values) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{4} -} - -func (x *Values) GetParameters() []*Parameter { - if x != nil { - return x.Parameters - } - return nil -} - -type QueryRows struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Columns []string `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"` - Types []string `protobuf:"bytes,2,rep,name=types,proto3" json:"types,omitempty"` - Values []*Values `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` - Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` - Time float64 `protobuf:"fixed64,5,opt,name=time,proto3" json:"time,omitempty"` -} - -func (x *QueryRows) Reset() { - *x = QueryRows{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryRows) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryRows) ProtoMessage() {} - -func (x *QueryRows) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryRows.ProtoReflect.Descriptor instead. -func (*QueryRows) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{5} -} - -func (x *QueryRows) GetColumns() []string { - if x != nil { - return x.Columns - } - return nil -} - -func (x *QueryRows) GetTypes() []string { - if x != nil { - return x.Types - } - return nil -} - -func (x *QueryRows) GetValues() []*Values { - if x != nil { - return x.Values - } - return nil -} - -func (x *QueryRows) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *QueryRows) GetTime() float64 { - if x != nil { - return x.Time - } - return 0 -} - -type ExecuteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - Timings bool `protobuf:"varint,2,opt,name=timings,proto3" json:"timings,omitempty"` -} - -func (x *ExecuteRequest) Reset() { - *x = ExecuteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecuteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecuteRequest) ProtoMessage() {} - -func (x *ExecuteRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead. -func (*ExecuteRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{6} -} - -func (x *ExecuteRequest) GetRequest() *Request { - if x != nil { - return x.Request - } - return nil -} - -func (x *ExecuteRequest) GetTimings() bool { - if x != nil { - return x.Timings - } - return false -} - -type ExecuteResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LastInsertId int64 `protobuf:"varint,1,opt,name=last_insert_id,json=lastInsertId,proto3" json:"last_insert_id,omitempty"` - RowsAffected int64 `protobuf:"varint,2,opt,name=rows_affected,json=rowsAffected,proto3" json:"rows_affected,omitempty"` - Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` - Time float64 `protobuf:"fixed64,4,opt,name=time,proto3" json:"time,omitempty"` -} - -func (x *ExecuteResult) Reset() { - *x = ExecuteResult{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecuteResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecuteResult) ProtoMessage() {} - -func (x *ExecuteResult) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecuteResult.ProtoReflect.Descriptor instead. -func (*ExecuteResult) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{7} -} - -func (x *ExecuteResult) GetLastInsertId() int64 { - if x != nil { - return x.LastInsertId - } - return 0 -} - -func (x *ExecuteResult) GetRowsAffected() int64 { - if x != nil { - return x.RowsAffected - } - return 0 -} - -func (x *ExecuteResult) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *ExecuteResult) GetTime() float64 { - if x != nil { - return x.Time - } - return 0 -} - -type ExecuteQueryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - Timings bool `protobuf:"varint,2,opt,name=timings,proto3" json:"timings,omitempty"` - Level QueryRequest_Level `protobuf:"varint,3,opt,name=level,proto3,enum=command.QueryRequest_Level" json:"level,omitempty"` - Freshness int64 `protobuf:"varint,4,opt,name=freshness,proto3" json:"freshness,omitempty"` -} - -func (x *ExecuteQueryRequest) Reset() { - *x = ExecuteQueryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecuteQueryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecuteQueryRequest) ProtoMessage() {} - -func (x *ExecuteQueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecuteQueryRequest.ProtoReflect.Descriptor instead. -func (*ExecuteQueryRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{8} -} - -func (x *ExecuteQueryRequest) GetRequest() *Request { - if x != nil { - return x.Request - } - return nil -} - -func (x *ExecuteQueryRequest) GetTimings() bool { - if x != nil { - return x.Timings - } - return false -} - -func (x *ExecuteQueryRequest) GetLevel() QueryRequest_Level { - if x != nil { - return x.Level - } - return QueryRequest_QUERY_REQUEST_LEVEL_NONE -} - -func (x *ExecuteQueryRequest) GetFreshness() int64 { - if x != nil { - return x.Freshness - } - return 0 -} - -type ExecuteQueryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Result: - // - // *ExecuteQueryResponse_Q - // *ExecuteQueryResponse_E - // *ExecuteQueryResponse_Error - Result isExecuteQueryResponse_Result `protobuf_oneof:"result"` -} - -func (x *ExecuteQueryResponse) Reset() { - *x = ExecuteQueryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecuteQueryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecuteQueryResponse) ProtoMessage() {} - -func (x *ExecuteQueryResponse) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecuteQueryResponse.ProtoReflect.Descriptor instead. -func (*ExecuteQueryResponse) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{9} -} - -func (m *ExecuteQueryResponse) GetResult() isExecuteQueryResponse_Result { - if m != nil { - return m.Result - } - return nil -} - -func (x *ExecuteQueryResponse) GetQ() *QueryRows { - if x, ok := x.GetResult().(*ExecuteQueryResponse_Q); ok { - return x.Q - } - return nil -} - -func (x *ExecuteQueryResponse) GetE() *ExecuteResult { - if x, ok := x.GetResult().(*ExecuteQueryResponse_E); ok { - return x.E - } - return nil -} - -func (x *ExecuteQueryResponse) GetError() string { - if x, ok := x.GetResult().(*ExecuteQueryResponse_Error); ok { - return x.Error - } - return "" -} - -type isExecuteQueryResponse_Result interface { - isExecuteQueryResponse_Result() -} - -type ExecuteQueryResponse_Q struct { - Q *QueryRows `protobuf:"bytes,1,opt,name=q,proto3,oneof"` -} - -type ExecuteQueryResponse_E struct { - E *ExecuteResult `protobuf:"bytes,2,opt,name=e,proto3,oneof"` -} - -type ExecuteQueryResponse_Error struct { - Error string `protobuf:"bytes,3,opt,name=error,proto3,oneof"` -} - -func (*ExecuteQueryResponse_Q) isExecuteQueryResponse_Result() {} - -func (*ExecuteQueryResponse_E) isExecuteQueryResponse_Result() {} - -func (*ExecuteQueryResponse_Error) isExecuteQueryResponse_Result() {} - -type BackupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Format BackupRequest_Format `protobuf:"varint,1,opt,name=format,proto3,enum=command.BackupRequest_Format" json:"format,omitempty"` - Leader bool `protobuf:"varint,2,opt,name=Leader,proto3" json:"Leader,omitempty"` - Vacuum bool `protobuf:"varint,3,opt,name=Vacuum,proto3" json:"Vacuum,omitempty"` -} - -func (x *BackupRequest) Reset() { - *x = BackupRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BackupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupRequest) ProtoMessage() {} - -func (x *BackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BackupRequest.ProtoReflect.Descriptor instead. -func (*BackupRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{10} -} - -func (x *BackupRequest) GetFormat() BackupRequest_Format { - if x != nil { - return x.Format - } - return BackupRequest_BACKUP_REQUEST_FORMAT_NONE -} - -func (x *BackupRequest) GetLeader() bool { - if x != nil { - return x.Leader - } - return false -} - -func (x *BackupRequest) GetVacuum() bool { - if x != nil { - return x.Vacuum - } - return false -} - -type LoadRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *LoadRequest) Reset() { - *x = LoadRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadRequest) ProtoMessage() {} - -func (x *LoadRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoadRequest.ProtoReflect.Descriptor instead. -func (*LoadRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{11} -} - -func (x *LoadRequest) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type LoadChunkRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StreamId string `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` - SequenceNum int64 `protobuf:"varint,2,opt,name=sequence_num,json=sequenceNum,proto3" json:"sequence_num,omitempty"` - IsLast bool `protobuf:"varint,3,opt,name=is_last,json=isLast,proto3" json:"is_last,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` - Abort bool `protobuf:"varint,5,opt,name=abort,proto3" json:"abort,omitempty"` -} - -func (x *LoadChunkRequest) Reset() { - *x = LoadChunkRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadChunkRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadChunkRequest) ProtoMessage() {} - -func (x *LoadChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoadChunkRequest.ProtoReflect.Descriptor instead. -func (*LoadChunkRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{12} -} - -func (x *LoadChunkRequest) GetStreamId() string { - if x != nil { - return x.StreamId - } - return "" -} - -func (x *LoadChunkRequest) GetSequenceNum() int64 { - if x != nil { - return x.SequenceNum - } - return 0 -} - -func (x *LoadChunkRequest) GetIsLast() bool { - if x != nil { - return x.IsLast - } - return false -} - -func (x *LoadChunkRequest) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *LoadChunkRequest) GetAbort() bool { - if x != nil { - return x.Abort - } - return false -} - -type JoinRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Voter bool `protobuf:"varint,3,opt,name=voter,proto3" json:"voter,omitempty"` -} - -func (x *JoinRequest) Reset() { - *x = JoinRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JoinRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JoinRequest) ProtoMessage() {} - -func (x *JoinRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use JoinRequest.ProtoReflect.Descriptor instead. -func (*JoinRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{13} -} - -func (x *JoinRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *JoinRequest) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *JoinRequest) GetVoter() bool { - if x != nil { - return x.Voter - } - return false -} - -type NotifyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` -} - -func (x *NotifyRequest) Reset() { - *x = NotifyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NotifyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NotifyRequest) ProtoMessage() {} - -func (x *NotifyRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NotifyRequest.ProtoReflect.Descriptor instead. -func (*NotifyRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{14} -} - -func (x *NotifyRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *NotifyRequest) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -type RemoveNodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *RemoveNodeRequest) Reset() { - *x = RemoveNodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveNodeRequest) ProtoMessage() {} - -func (x *RemoveNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveNodeRequest.ProtoReflect.Descriptor instead. -func (*RemoveNodeRequest) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{15} -} - -func (x *RemoveNodeRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type Noop struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *Noop) Reset() { - *x = Noop{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Noop) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Noop) ProtoMessage() {} - -func (x *Noop) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Noop.ProtoReflect.Descriptor instead. -func (*Noop) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{16} -} - -func (x *Noop) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type Command struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type Command_Type `protobuf:"varint,1,opt,name=type,proto3,enum=command.Command_Type" json:"type,omitempty"` - SubCommand []byte `protobuf:"bytes,2,opt,name=sub_command,json=subCommand,proto3" json:"sub_command,omitempty"` - Compressed bool `protobuf:"varint,3,opt,name=compressed,proto3" json:"compressed,omitempty"` -} - -func (x *Command) Reset() { - *x = Command{} - if protoimpl.UnsafeEnabled { - mi := &file_command_command_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Command) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Command) ProtoMessage() {} - -func (x *Command) ProtoReflect() protoreflect.Message { - mi := &file_command_command_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Command.ProtoReflect.Descriptor instead. -func (*Command) Descriptor() ([]byte, []int) { - return file_command_command_proto_rawDescGZIP(), []int{17} -} - -func (x *Command) GetType() Command_Type { - if x != nil { - return x.Type - } - return Command_COMMAND_TYPE_UNKNOWN -} - -func (x *Command) GetSubCommand() []byte { - if x != nil { - return x.SubCommand - } - return nil -} - -func (x *Command) GetCompressed() bool { - if x != nil { - return x.Compressed - } - return false -} - -var File_command_command_proto protoreflect.FileDescriptor - -var file_command_command_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x22, 0x78, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, - 0x01, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x48, 0x00, 0x52, 0x01, 0x69, 0x12, 0x0e, 0x0a, - 0x01, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x01, 0x64, 0x12, 0x0e, 0x0a, - 0x01, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x01, 0x62, 0x12, 0x0e, 0x0a, - 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x01, 0x79, 0x12, 0x0e, 0x0a, - 0x01, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x01, 0x73, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x51, 0x0a, 0x09, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x71, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x71, 0x6c, 0x12, 0x32, 0x0a, 0x0a, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x5f, 0x0a, - 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x0a, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x8a, - 0x02, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x2a, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, - 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x69, - 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x6e, 0x65, 0x73, 0x73, 0x22, 0x63, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, - 0x1c, 0x0a, 0x18, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, - 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1c, 0x0a, - 0x18, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x4c, - 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x45, 0x41, 0x4b, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x51, - 0x55, 0x45, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x4c, 0x45, 0x56, - 0x45, 0x4c, 0x5f, 0x53, 0x54, 0x52, 0x4f, 0x4e, 0x47, 0x10, 0x02, 0x22, 0x3c, 0x0a, 0x06, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x8e, 0x01, 0x0a, 0x09, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x56, 0x0a, 0x0e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x69, - 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x69, 0x6e, - 0x67, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x0d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x73, - 0x65, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, - 0x73, 0x74, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x6f, - 0x77, 0x73, 0x5f, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0c, 0x72, 0x6f, 0x77, 0x73, 0x41, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xac, 0x01, 0x0a, 0x13, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, - 0x07, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x65, - 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, - 0x65, 0x73, 0x68, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, - 0x72, 0x65, 0x73, 0x68, 0x6e, 0x65, 0x73, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x14, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x22, 0x0a, 0x01, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x6f, 0x77, 0x73, - 0x48, 0x00, 0x52, 0x01, 0x71, 0x12, 0x26, 0x0a, 0x01, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x01, 0x65, 0x12, 0x16, 0x0a, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, - 0xe1, 0x01, 0x0a, 0x0d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x35, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x16, 0x0a, 0x06, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x22, 0x69, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x12, 0x1e, 0x0a, 0x1a, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51, - 0x55, 0x45, 0x53, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, - 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51, - 0x55, 0x45, 0x53, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x53, 0x51, 0x4c, 0x10, - 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51, 0x55, - 0x45, 0x53, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x42, 0x49, 0x4e, 0x41, 0x52, - 0x59, 0x10, 0x02, 0x22, 0x21, 0x0a, 0x0b, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x95, 0x01, 0x0a, 0x10, 0x4c, 0x6f, 0x61, 0x64, 0x43, - 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x71, 0x75, - 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, - 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x69, - 0x73, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, - 0x4c, 0x61, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x62, 0x6f, 0x72, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x22, 0x4d, - 0x0a, 0x0b, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x22, 0x39, 0x0a, - 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x23, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x16, 0x0a, - 0x04, 0x4e, 0x6f, 0x6f, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xcc, 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x73, 0x75, 0x62, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1e, 0x0a, - 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0xd4, 0x01, - 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, - 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, - 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, - 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x4f, 0x50, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, - 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0x04, - 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x4a, 0x4f, 0x49, 0x4e, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x4d, 0x4d, 0x41, - 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x5f, - 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x06, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4d, 0x4d, 0x41, - 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x43, 0x48, 0x55, - 0x4e, 0x4b, 0x10, 0x07, 0x42, 0x25, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, - 0x2f, 0x76, 0x38, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_command_command_proto_rawDescOnce sync.Once - file_command_command_proto_rawDescData = file_command_command_proto_rawDesc -) - -func file_command_command_proto_rawDescGZIP() []byte { - file_command_command_proto_rawDescOnce.Do(func() { - file_command_command_proto_rawDescData = protoimpl.X.CompressGZIP(file_command_command_proto_rawDescData) - }) - return file_command_command_proto_rawDescData -} - -var file_command_command_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 18) -var file_command_command_proto_goTypes = []interface{}{ - (QueryRequest_Level)(0), // 0: command.QueryRequest.Level - (BackupRequest_Format)(0), // 1: command.BackupRequest.Format - (Command_Type)(0), // 2: command.Command.Type - (*Parameter)(nil), // 3: command.Parameter - (*Statement)(nil), // 4: command.Statement - (*Request)(nil), // 5: command.Request - (*QueryRequest)(nil), // 6: command.QueryRequest - (*Values)(nil), // 7: command.Values - (*QueryRows)(nil), // 8: command.QueryRows - (*ExecuteRequest)(nil), // 9: command.ExecuteRequest - (*ExecuteResult)(nil), // 10: command.ExecuteResult - (*ExecuteQueryRequest)(nil), // 11: command.ExecuteQueryRequest - (*ExecuteQueryResponse)(nil), // 12: command.ExecuteQueryResponse - (*BackupRequest)(nil), // 13: command.BackupRequest - (*LoadRequest)(nil), // 14: command.LoadRequest - (*LoadChunkRequest)(nil), // 15: command.LoadChunkRequest - (*JoinRequest)(nil), // 16: command.JoinRequest - (*NotifyRequest)(nil), // 17: command.NotifyRequest - (*RemoveNodeRequest)(nil), // 18: command.RemoveNodeRequest - (*Noop)(nil), // 19: command.Noop - (*Command)(nil), // 20: command.Command -} -var file_command_command_proto_depIdxs = []int32{ - 3, // 0: command.Statement.parameters:type_name -> command.Parameter - 4, // 1: command.Request.statements:type_name -> command.Statement - 5, // 2: command.QueryRequest.request:type_name -> command.Request - 0, // 3: command.QueryRequest.level:type_name -> command.QueryRequest.Level - 3, // 4: command.Values.parameters:type_name -> command.Parameter - 7, // 5: command.QueryRows.values:type_name -> command.Values - 5, // 6: command.ExecuteRequest.request:type_name -> command.Request - 5, // 7: command.ExecuteQueryRequest.request:type_name -> command.Request - 0, // 8: command.ExecuteQueryRequest.level:type_name -> command.QueryRequest.Level - 8, // 9: command.ExecuteQueryResponse.q:type_name -> command.QueryRows - 10, // 10: command.ExecuteQueryResponse.e:type_name -> command.ExecuteResult - 1, // 11: command.BackupRequest.format:type_name -> command.BackupRequest.Format - 2, // 12: command.Command.type:type_name -> command.Command.Type - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_command_command_proto_init() } -func file_command_command_proto_init() { - if File_command_command_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Parameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Statement); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Values); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRows); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteQueryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteQueryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BackupRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadChunkRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JoinRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotifyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveNodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Noop); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_command_command_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Command); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_command_command_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Parameter_I)(nil), - (*Parameter_D)(nil), - (*Parameter_B)(nil), - (*Parameter_Y)(nil), - (*Parameter_S)(nil), - } - file_command_command_proto_msgTypes[9].OneofWrappers = []interface{}{ - (*ExecuteQueryResponse_Q)(nil), - (*ExecuteQueryResponse_E)(nil), - (*ExecuteQueryResponse_Error)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_command_command_proto_rawDesc, - NumEnums: 3, - NumMessages: 18, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_command_command_proto_goTypes, - DependencyIndexes: file_command_command_proto_depIdxs, - EnumInfos: file_command_command_proto_enumTypes, - MessageInfos: file_command_command_proto_msgTypes, - }.Build() - File_command_command_proto = out.File - file_command_command_proto_rawDesc = nil - file_command_command_proto_goTypes = nil - file_command_command_proto_depIdxs = nil -}