diff --git a/cluster/bootstrap.go b/cluster/bootstrap.go index f47f8934..74406376 100644 --- a/cluster/bootstrap.go +++ b/cluster/bootstrap.go @@ -8,6 +8,7 @@ import ( "sync" "time" + "github.com/rqlite/rqlite/v8/cluster/proto" command "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/random" ) @@ -107,7 +108,7 @@ type Bootstrapper struct { provider AddressProvider client *Client - creds *Credentials + creds *proto.Credentials logger *log.Logger Interval time.Duration @@ -128,7 +129,7 @@ func NewBootstrapper(p AddressProvider, client *Client) *Bootstrapper { } // SetCredentials sets the credentials for the Bootstrapper. -func (b *Bootstrapper) SetCredentials(creds *Credentials) { +func (b *Bootstrapper) SetCredentials(creds *proto.Credentials) { b.creds = creds } diff --git a/cluster/bootstrap_test.go b/cluster/bootstrap_test.go index 258eb53e..1ec26a97 100644 --- a/cluster/bootstrap_test.go +++ b/cluster/bootstrap_test.go @@ -8,9 +8,10 @@ import ( "testing" "time" + "github.com/rqlite/rqlite/v8/cluster/proto" "github.com/rqlite/rqlite/v8/cluster/servicetest" - "github.com/rqlite/rqlite/v8/command" - "google.golang.org/protobuf/proto" + command "github.com/rqlite/rqlite/v8/command/proto" + pb "google.golang.org/protobuf/proto" ) func Test_AddressProviderString(t *testing.T) { @@ -91,7 +92,7 @@ func Test_BootstrapperBootSingleJoin(t *testing.T) { // Connection error handling return } - if c.Type != Command_COMMAND_TYPE_JOIN { + if c.Type != proto.Command_COMMAND_TYPE_JOIN { t.Fatalf("unexpected command type: %d", c.Type) } jnr := c.GetJoinRequest() @@ -102,7 +103,7 @@ func Test_BootstrapperBootSingleJoin(t *testing.T) { t.Fatalf("unexpected node address, got %s", jnr.Address) } - p, err = proto.Marshal(&CommandJoinResponse{}) + p, err = pb.Marshal(&proto.CommandJoinResponse{}) if err != nil { conn.Close() return @@ -139,7 +140,7 @@ func Test_BootstrapperBootNonVoter(t *testing.T) { // Connection error handling return } - if c.Type != Command_COMMAND_TYPE_JOIN { + if c.Type != proto.Command_COMMAND_TYPE_JOIN { t.Fatalf("unexpected command type: %d", c.Type) } jnr := c.GetJoinRequest() @@ -183,12 +184,12 @@ func Test_BootstrapperBootSingleNotify(t *testing.T) { return } - if c.Type != Command_COMMAND_TYPE_NOTIFY { + if c.Type != proto.Command_COMMAND_TYPE_NOTIFY { return } gotNR = c.GetNotifyRequest() - p, err = proto.Marshal(&CommandNotifyResponse{}) + p, err = pb.Marshal(&proto.CommandNotifyResponse{}) if err != nil { conn.Close() return @@ -237,16 +238,16 @@ func Test_BootstrapperBootMultiJoinNotify(t *testing.T) { return } - if c.Type == Command_COMMAND_TYPE_JOIN { + if c.Type == proto.Command_COMMAND_TYPE_JOIN { atomic.AddInt32(&srv1JoinC, 1) } - if c.Type != Command_COMMAND_TYPE_NOTIFY { + if c.Type != proto.Command_COMMAND_TYPE_NOTIFY { return } atomic.AddInt32(&srv1NotifiedC, 1) - p, err = proto.Marshal(&CommandNotifyResponse{}) + p, err = pb.Marshal(&proto.CommandNotifyResponse{}) if err != nil { conn.Close() return @@ -268,16 +269,16 @@ func Test_BootstrapperBootMultiJoinNotify(t *testing.T) { return } - if c.Type == Command_COMMAND_TYPE_JOIN { + if c.Type == proto.Command_COMMAND_TYPE_JOIN { atomic.AddInt32(&srv2JoinC, 1) } - if c.Type != Command_COMMAND_TYPE_NOTIFY { + if c.Type != proto.Command_COMMAND_TYPE_NOTIFY { return } atomic.AddInt32(&srv2NotifiedC, 1) - p, err = proto.Marshal(&CommandNotifyResponse{}) + p, err = pb.Marshal(&proto.CommandNotifyResponse{}) if err != nil { conn.Close() return diff --git a/cluster/client.go b/cluster/client.go index d25dc66d..d53bc464 100644 --- a/cluster/client.go +++ b/cluster/client.go @@ -13,11 +13,12 @@ import ( "time" "github.com/rqlite/rqlite/v8/auth" + "github.com/rqlite/rqlite/v8/cluster/proto" 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" - "google.golang.org/protobuf/proto" + pb "google.golang.org/protobuf/proto" ) const ( @@ -44,7 +45,7 @@ func CreateRaftDialer(cert, key, caCert, serverName string, Insecure bool) (*tcp // CredentialsFor returns a Credentials instance for the given username, or nil if // the given CredentialsStore is nil, or the username is not found. -func CredentialsFor(credStr *auth.CredentialsStore, username string) *Credentials { +func CredentialsFor(credStr *auth.CredentialsStore, username string) *proto.Credentials { if credStr == nil { return nil } @@ -52,7 +53,7 @@ func CredentialsFor(credStr *auth.CredentialsStore, username string) *Credential if !ok { return nil } - return &Credentials{ + return &proto.Credentials{ Username: username, Password: pw, } @@ -108,16 +109,16 @@ func (c *Client) GetNodeAPIAddr(nodeAddr string, timeout time.Duration) (string, return c.localServ.GetNodeAPIURL(), nil } - command := &Command{ - Type: Command_COMMAND_TYPE_GET_NODE_API_URL, + command := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_GET_NODE_API_URL, } p, err := c.retry(command, nodeAddr, timeout) if err != nil { return "", err } - a := &Address{} - err = proto.Unmarshal(p, a) + a := &proto.Address{} + err = pb.Unmarshal(p, a) if err != nil { return "", fmt.Errorf("protobuf unmarshal: %w", err) } @@ -128,10 +129,10 @@ func (c *Client) GetNodeAPIAddr(nodeAddr string, timeout time.Duration) (string, // Execute performs an Execute on a remote node. If username is an empty string // no credential information will be included in the Execute request to the // remote node. -func (c *Client) Execute(er *command.ExecuteRequest, nodeAddr string, creds *Credentials, timeout time.Duration) ([]*command.ExecuteResult, error) { - command := &Command{ - Type: Command_COMMAND_TYPE_EXECUTE, - Request: &Command_ExecuteRequest{ +func (c *Client) Execute(er *command.ExecuteRequest, nodeAddr string, creds *proto.Credentials, timeout time.Duration) ([]*command.ExecuteResult, error) { + command := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_EXECUTE, + Request: &proto.Command_ExecuteRequest{ ExecuteRequest: er, }, Credentials: creds, @@ -141,8 +142,8 @@ func (c *Client) Execute(er *command.ExecuteRequest, nodeAddr string, creds *Cre return nil, err } - a := &CommandExecuteResponse{} - err = proto.Unmarshal(p, a) + a := &proto.CommandExecuteResponse{} + err = pb.Unmarshal(p, a) if err != nil { return nil, err } @@ -154,10 +155,10 @@ func (c *Client) Execute(er *command.ExecuteRequest, nodeAddr string, creds *Cre } // Query performs a Query on a remote node. -func (c *Client) Query(qr *command.QueryRequest, nodeAddr string, creds *Credentials, timeout time.Duration) ([]*command.QueryRows, error) { - command := &Command{ - Type: Command_COMMAND_TYPE_QUERY, - Request: &Command_QueryRequest{ +func (c *Client) Query(qr *command.QueryRequest, nodeAddr string, creds *proto.Credentials, timeout time.Duration) ([]*command.QueryRows, error) { + command := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_QUERY, + Request: &proto.Command_QueryRequest{ QueryRequest: qr, }, Credentials: creds, @@ -167,8 +168,8 @@ func (c *Client) Query(qr *command.QueryRequest, nodeAddr string, creds *Credent return nil, err } - a := &CommandQueryResponse{} - err = proto.Unmarshal(p, a) + a := &proto.CommandQueryResponse{} + err = pb.Unmarshal(p, a) if err != nil { return nil, err } @@ -180,10 +181,10 @@ func (c *Client) Query(qr *command.QueryRequest, nodeAddr string, creds *Credent } // Request performs an ExecuteQuery on a remote node. -func (c *Client) Request(r *command.ExecuteQueryRequest, nodeAddr string, creds *Credentials, timeout time.Duration) ([]*command.ExecuteQueryResponse, error) { - command := &Command{ - Type: Command_COMMAND_TYPE_REQUEST, - Request: &Command_ExecuteQueryRequest{ +func (c *Client) Request(r *command.ExecuteQueryRequest, nodeAddr string, creds *proto.Credentials, timeout time.Duration) ([]*command.ExecuteQueryResponse, error) { + command := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_REQUEST, + Request: &proto.Command_ExecuteQueryRequest{ ExecuteQueryRequest: r, }, Credentials: creds, @@ -193,8 +194,8 @@ func (c *Client) Request(r *command.ExecuteQueryRequest, nodeAddr string, creds return nil, err } - a := &CommandRequestResponse{} - err = proto.Unmarshal(p, a) + a := &proto.CommandRequestResponse{} + err = pb.Unmarshal(p, a) if err != nil { return nil, err } @@ -206,10 +207,10 @@ func (c *Client) Request(r *command.ExecuteQueryRequest, nodeAddr string, creds } // Backup retrieves a backup from a remote node and writes to the io.Writer -func (c *Client) Backup(br *command.BackupRequest, nodeAddr string, creds *Credentials, timeout time.Duration, w io.Writer) error { - command := &Command{ - Type: Command_COMMAND_TYPE_BACKUP, - Request: &Command_BackupRequest{ +func (c *Client) Backup(br *command.BackupRequest, nodeAddr string, creds *proto.Credentials, timeout time.Duration, w io.Writer) error { + command := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_BACKUP, + Request: &proto.Command_BackupRequest{ BackupRequest: br, }, Credentials: creds, @@ -225,8 +226,8 @@ func (c *Client) Backup(br *command.BackupRequest, nodeAddr string, creds *Crede return fmt.Errorf("backup decompress: %w", err) } - resp := &CommandBackupResponse{} - err = proto.Unmarshal(p, resp) + resp := &proto.CommandBackupResponse{} + err = pb.Unmarshal(p, resp) if err != nil { return fmt.Errorf("backup unmarshal: %w", err) } @@ -242,10 +243,10 @@ func (c *Client) Backup(br *command.BackupRequest, nodeAddr string, creds *Crede } // Load loads a SQLite file into the database. -func (c *Client) Load(lr *command.LoadRequest, nodeAddr string, creds *Credentials, timeout time.Duration) error { - command := &Command{ - Type: Command_COMMAND_TYPE_LOAD, - Request: &Command_LoadRequest{ +func (c *Client) Load(lr *command.LoadRequest, nodeAddr string, creds *proto.Credentials, timeout time.Duration) error { + command := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_LOAD, + Request: &proto.Command_LoadRequest{ LoadRequest: lr, }, Credentials: creds, @@ -255,8 +256,8 @@ func (c *Client) Load(lr *command.LoadRequest, nodeAddr string, creds *Credentia return err } - a := &CommandLoadResponse{} - err = proto.Unmarshal(p, a) + a := &proto.CommandLoadResponse{} + err = pb.Unmarshal(p, a) if err != nil { return err } @@ -268,7 +269,7 @@ func (c *Client) Load(lr *command.LoadRequest, nodeAddr string, creds *Credentia } // RemoveNode removes a node from the cluster -func (c *Client) RemoveNode(rn *command.RemoveNodeRequest, nodeAddr string, creds *Credentials, timeout time.Duration) error { +func (c *Client) RemoveNode(rn *command.RemoveNodeRequest, nodeAddr string, creds *proto.Credentials, timeout time.Duration) error { conn, err := c.dial(nodeAddr, c.timeout) if err != nil { return err @@ -276,9 +277,9 @@ func (c *Client) RemoveNode(rn *command.RemoveNodeRequest, nodeAddr string, cred defer conn.Close() // Create the request. - command := &Command{ - Type: Command_COMMAND_TYPE_REMOVE_NODE, - Request: &Command_RemoveNodeRequest{ + command := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_REMOVE_NODE, + Request: &proto.Command_RemoveNodeRequest{ RemoveNodeRequest: rn, }, Credentials: creds, @@ -294,8 +295,8 @@ func (c *Client) RemoveNode(rn *command.RemoveNodeRequest, nodeAddr string, cred return err } - a := &CommandRemoveNodeResponse{} - err = proto.Unmarshal(p, a) + a := &proto.CommandRemoveNodeResponse{} + err = pb.Unmarshal(p, a) if err != nil { return err } @@ -307,7 +308,7 @@ func (c *Client) RemoveNode(rn *command.RemoveNodeRequest, nodeAddr string, cred } // Notify notifies a remote node that this node is ready to bootstrap. -func (c *Client) Notify(nr *command.NotifyRequest, nodeAddr string, creds *Credentials, timeout time.Duration) error { +func (c *Client) Notify(nr *command.NotifyRequest, nodeAddr string, creds *proto.Credentials, timeout time.Duration) error { conn, err := c.dial(nodeAddr, c.timeout) if err != nil { return err @@ -315,9 +316,9 @@ func (c *Client) Notify(nr *command.NotifyRequest, nodeAddr string, creds *Crede defer conn.Close() // Create the request. - command := &Command{ - Type: Command_COMMAND_TYPE_NOTIFY, - Request: &Command_NotifyRequest{ + command := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_NOTIFY, + Request: &proto.Command_NotifyRequest{ NotifyRequest: nr, }, Credentials: creds, @@ -333,8 +334,8 @@ func (c *Client) Notify(nr *command.NotifyRequest, nodeAddr string, creds *Crede return err } - a := &CommandNotifyResponse{} - err = proto.Unmarshal(p, a) + a := &proto.CommandNotifyResponse{} + err = pb.Unmarshal(p, a) if err != nil { return err } @@ -346,7 +347,7 @@ func (c *Client) Notify(nr *command.NotifyRequest, nodeAddr string, creds *Crede } // Join joins this node to a cluster at the remote address nodeAddr. -func (c *Client) Join(jr *command.JoinRequest, nodeAddr string, creds *Credentials, timeout time.Duration) error { +func (c *Client) Join(jr *command.JoinRequest, nodeAddr string, creds *proto.Credentials, timeout time.Duration) error { for { conn, err := c.dial(nodeAddr, c.timeout) if err != nil { @@ -355,9 +356,9 @@ func (c *Client) Join(jr *command.JoinRequest, nodeAddr string, creds *Credentia defer conn.Close() // Create the request. - command := &Command{ - Type: Command_COMMAND_TYPE_JOIN, - Request: &Command_JoinRequest{ + command := &proto.Command{ + Type: proto.Command_COMMAND_TYPE_JOIN, + Request: &proto.Command_JoinRequest{ JoinRequest: jr, }, Credentials: creds, @@ -374,8 +375,8 @@ func (c *Client) Join(jr *command.JoinRequest, nodeAddr string, creds *Credentia return err } - a := &CommandJoinResponse{} - err = proto.Unmarshal(p, a) + a := &proto.CommandJoinResponse{} + err = pb.Unmarshal(p, a) if err != nil { return err } @@ -463,7 +464,7 @@ func (c *Client) dial(nodeAddr string, timeout time.Duration) (net.Conn, error) // retry retries a command on a remote node. It does this so we churn through connections // in the pool if we hit an error, as the remote node may have restarted and the pool's // connections are now stale. -func (c *Client) retry(command *Command, nodeAddr string, timeout time.Duration) ([]byte, error) { +func (c *Client) retry(command *proto.Command, nodeAddr string, timeout time.Duration) ([]byte, error) { var p []byte var errOuter error var nRetries int @@ -499,8 +500,8 @@ func (c *Client) retry(command *Command, nodeAddr string, timeout time.Duration) return p, nil } -func writeCommand(conn net.Conn, c *Command, timeout time.Duration) error { - p, err := proto.Marshal(c) +func writeCommand(conn net.Conn, c *proto.Command, timeout time.Duration) error { + p, err := pb.Marshal(c) if err != nil { return fmt.Errorf("command marshal: %w", err) } diff --git a/cluster/client_test.go b/cluster/client_test.go index dbf9398f..eaff6cbb 100644 --- a/cluster/client_test.go +++ b/cluster/client_test.go @@ -8,9 +8,10 @@ import ( "testing" "time" + "github.com/rqlite/rqlite/v8/cluster/proto" "github.com/rqlite/rqlite/v8/cluster/servicetest" command "github.com/rqlite/rqlite/v8/command/proto" - "google.golang.org/protobuf/proto" + pb "google.golang.org/protobuf/proto" ) func Test_NewClient(t *testing.T) { @@ -31,10 +32,10 @@ func Test_ClientGetNodeAPIAddr(t *testing.T) { // test exit can cause that too. return } - if c.Type != Command_COMMAND_TYPE_GET_NODE_API_URL { + if c.Type != proto.Command_COMMAND_TYPE_GET_NODE_API_URL { t.Fatalf("unexpected command type: %d", c.Type) } - p, err = proto.Marshal(&Address{ + p, err = pb.Marshal(&proto.Address{ Url: "http://localhost:1234", }) if err != nil { @@ -67,7 +68,7 @@ func Test_ClientExecute(t *testing.T) { // test exit can cause that too. return } - if c.Type != Command_COMMAND_TYPE_EXECUTE { + if c.Type != proto.Command_COMMAND_TYPE_EXECUTE { t.Fatalf("unexpected command type: %d", c.Type) } er := c.GetExecuteRequest() @@ -78,7 +79,7 @@ func Test_ClientExecute(t *testing.T) { t.Fatalf("unexpected statement, got %s", er.Request.Statements[0]) } - p, err = proto.Marshal(&CommandExecuteResponse{}) + p, err = pb.Marshal(&proto.CommandExecuteResponse{}) if err != nil { conn.Close() } @@ -106,7 +107,7 @@ func Test_ClientQuery(t *testing.T) { // test exit can cause that too. return } - if c.Type != Command_COMMAND_TYPE_QUERY { + if c.Type != proto.Command_COMMAND_TYPE_QUERY { t.Fatalf("unexpected command type: %d", c.Type) } qr := c.GetQueryRequest() @@ -117,7 +118,7 @@ func Test_ClientQuery(t *testing.T) { t.Fatalf("unexpected statement, got %s", qr.Request.Statements[0]) } - p, err = proto.Marshal(&CommandQueryResponse{}) + p, err = pb.Marshal(&proto.CommandQueryResponse{}) if err != nil { conn.Close() } @@ -145,7 +146,7 @@ func Test_ClientRequest(t *testing.T) { // test exit can cause that too. return } - if c.Type != Command_COMMAND_TYPE_REQUEST { + if c.Type != proto.Command_COMMAND_TYPE_REQUEST { t.Fatalf("unexpected command type: %d", c.Type) } er := c.GetExecuteQueryRequest() @@ -156,7 +157,7 @@ func Test_ClientRequest(t *testing.T) { t.Fatalf("unexpected statement, got %s", er.Request.Statements[0]) } - p, err = proto.Marshal(&CommandRequestResponse{}) + p, err = pb.Marshal(&proto.CommandRequestResponse{}) if err != nil { conn.Close() } @@ -184,7 +185,7 @@ func Test_ClientRemoveNode(t *testing.T) { // test exit can cause that too. return } - if c.Type != Command_COMMAND_TYPE_REMOVE_NODE { + if c.Type != proto.Command_COMMAND_TYPE_REMOVE_NODE { t.Fatalf("unexpected command type: %d", c.Type) } rnr := c.GetRemoveNodeRequest() @@ -195,7 +196,7 @@ func Test_ClientRemoveNode(t *testing.T) { t.Fatalf("unexpected node id, got %s", rnr.Id) } - p, err = proto.Marshal(&CommandRemoveNodeResponse{}) + p, err = pb.Marshal(&proto.CommandRemoveNodeResponse{}) if err != nil { conn.Close() } @@ -223,7 +224,7 @@ func Test_ClientRemoveNodeTimeout(t *testing.T) { // test exit can cause that too. return } - if c.Type != Command_COMMAND_TYPE_REMOVE_NODE { + if c.Type != proto.Command_COMMAND_TYPE_REMOVE_NODE { t.Fatalf("unexpected command type: %d", c.Type) } rnr := c.GetRemoveNodeRequest() @@ -260,7 +261,7 @@ func Test_ClientJoinNode(t *testing.T) { // Connection error handling return } - if c.Type != Command_COMMAND_TYPE_JOIN { + if c.Type != proto.Command_COMMAND_TYPE_JOIN { t.Fatalf("unexpected command type: %d", c.Type) } jnr := c.GetJoinRequest() @@ -271,7 +272,7 @@ func Test_ClientJoinNode(t *testing.T) { t.Fatalf("unexpected node address, got %s", jnr.Address) } - p, err = proto.Marshal(&CommandJoinResponse{}) + p, err = pb.Marshal(&proto.CommandJoinResponse{}) if err != nil { conn.Close() return @@ -291,7 +292,7 @@ func Test_ClientJoinNode(t *testing.T) { } } -func readCommand(conn net.Conn) *Command { +func readCommand(conn net.Conn) *proto.Command { b := make([]byte, protoBufferLengthSize) _, err := io.ReadFull(conn, b) if err != nil { @@ -303,8 +304,8 @@ func readCommand(conn net.Conn) *Command { if err != nil { return nil } - c := &Command{} - err = proto.Unmarshal(p, c) + c := &proto.Command{} + err = pb.Unmarshal(p, c) if err != nil { return nil } diff --git a/cluster/join.go b/cluster/join.go index 47cfc7ad..ebd9b7e1 100644 --- a/cluster/join.go +++ b/cluster/join.go @@ -6,6 +6,7 @@ import ( "os" "time" + "github.com/rqlite/rqlite/v8/cluster/proto" command "github.com/rqlite/rqlite/v8/command/proto" ) @@ -26,7 +27,7 @@ type Joiner struct { attemptInterval time.Duration client *Client - creds *Credentials + creds *proto.Credentials logger *log.Logger } @@ -41,7 +42,7 @@ func NewJoiner(client *Client, numAttempts int, attemptInterval time.Duration) * } // SetCredentials sets the credentials for the Joiner. -func (j *Joiner) SetCredentials(creds *Credentials) { +func (j *Joiner) SetCredentials(creds *proto.Credentials) { j.creds = creds } diff --git a/cluster/join_test.go b/cluster/join_test.go index 68f0dceb..62d81fe4 100644 --- a/cluster/join_test.go +++ b/cluster/join_test.go @@ -5,8 +5,9 @@ import ( "testing" "time" + "github.com/rqlite/rqlite/v8/cluster/proto" "github.com/rqlite/rqlite/v8/cluster/servicetest" - "google.golang.org/protobuf/proto" + pb "google.golang.org/protobuf/proto" ) const numAttempts int = 3 @@ -23,7 +24,7 @@ func Test_SingleJoinOK(t *testing.T) { // test exit can cause that too. return } - if c.Type != Command_COMMAND_TYPE_JOIN { + if c.Type != proto.Command_COMMAND_TYPE_JOIN { t.Fatalf("unexpected command type: %d", c.Type) } jr := c.GetJoinRequest() @@ -37,8 +38,8 @@ func Test_SingleJoinOK(t *testing.T) { t.Fatalf("unexpected addr, got %s, exp: %s", got, exp) } - resp := &CommandJoinResponse{} - p, err = proto.Marshal(resp) + resp := &proto.CommandJoinResponse{} + p, err = pb.Marshal(resp) if err != nil { conn.Close() } @@ -85,10 +86,10 @@ func Test_SingleJoinFail(t *testing.T) { // test exit can cause that too. return } - resp := &CommandJoinResponse{ + resp := &proto.CommandJoinResponse{ Error: "bad request", } - p, err = proto.Marshal(resp) + p, err = pb.Marshal(resp) if err != nil { conn.Close() } @@ -116,10 +117,10 @@ func Test_DoubleJoinOKSecondNode(t *testing.T) { // test exit can cause that too. return } - resp := &CommandJoinResponse{ + resp := &proto.CommandJoinResponse{ Error: "bad request", } - p, err = proto.Marshal(resp) + p, err = pb.Marshal(resp) if err != nil { conn.Close() } @@ -138,11 +139,11 @@ func Test_DoubleJoinOKSecondNode(t *testing.T) { // test exit can cause that too. return } - if c.Type != Command_COMMAND_TYPE_JOIN { + if c.Type != proto.Command_COMMAND_TYPE_JOIN { t.Fatalf("unexpected command type: %d", c.Type) } - resp := &CommandJoinResponse{} - p, err = proto.Marshal(resp) + resp := &proto.CommandJoinResponse{} + p, err = pb.Marshal(resp) if err != nil { conn.Close() } diff --git a/cluster/proto/message.pb.go b/cluster/proto/message.pb.go index 209bb902..4734f0de 100644 --- a/cluster/proto/message.pb.go +++ b/cluster/proto/message.pb.go @@ -7,7 +7,7 @@ package proto import ( - proto "github.com/rqlite/rqlite/command/proto" + proto "github.com/rqlite/rqlite/v8/command/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" diff --git a/cluster/proto/message.proto b/cluster/proto/message.proto index 0b35522d..80172227 100644 --- a/cluster/proto/message.proto +++ b/cluster/proto/message.proto @@ -3,7 +3,7 @@ package cluster; import "command/proto/command.proto"; -option go_package = "github.com/rqlite/rqlite/v8/cluster"; +option go_package = "github.com/rqlite/rqlite/v8/cluster/proto"; message Credentials { string username = 1; diff --git a/cluster/remove.go b/cluster/remove.go index 5952107a..a9c225f3 100644 --- a/cluster/remove.go +++ b/cluster/remove.go @@ -5,6 +5,7 @@ import ( "os" "time" + "github.com/rqlite/rqlite/v8/cluster/proto" command "github.com/rqlite/rqlite/v8/command/proto" ) @@ -24,7 +25,7 @@ type Remover struct { timeout time.Duration control Control client *Client - creds *Credentials + creds *proto.Credentials log *log.Logger } @@ -40,7 +41,7 @@ func NewRemover(client *Client, timeout time.Duration, control Control) *Remover } // SetCredentials sets the credentials for the Remover. -func (r *Remover) SetCredentials(creds *Credentials) { +func (r *Remover) SetCredentials(creds *proto.Credentials) { r.creds = creds } diff --git a/cluster/remove_test.go b/cluster/remove_test.go index 2fb59b45..f5262505 100644 --- a/cluster/remove_test.go +++ b/cluster/remove_test.go @@ -6,8 +6,9 @@ import ( "testing" "time" + "github.com/rqlite/rqlite/v8/cluster/proto" "github.com/rqlite/rqlite/v8/cluster/servicetest" - "google.golang.org/protobuf/proto" + pb "google.golang.org/protobuf/proto" ) func Test_NewRemover(t *testing.T) { @@ -101,7 +102,7 @@ func makeServiceRemoveOK(t *testing.T, ch chan struct{}) *servicetest.Service { var p []byte var err error _ = readCommand(conn) - p, err = proto.Marshal(&CommandRemoveNodeResponse{}) + p, err = pb.Marshal(&proto.CommandRemoveNodeResponse{}) if err != nil { t.Fatalf("failed to marshal response: %s", err.Error()) } diff --git a/cluster/service.go b/cluster/service.go index c1556907..dfa2fa3d 100644 --- a/cluster/service.go +++ b/cluster/service.go @@ -15,8 +15,9 @@ import ( "time" "github.com/rqlite/rqlite/v8/auth" + "github.com/rqlite/rqlite/v8/cluster/proto" command "github.com/rqlite/rqlite/v8/command/proto" - "google.golang.org/protobuf/proto" + pb "google.golang.org/protobuf/proto" ) // stats captures stats for the Cluster service. @@ -214,7 +215,7 @@ func (s *Service) serve() error { } } -func (s *Service) checkCommandPerm(c *Command, perm string) bool { +func (s *Service) checkCommandPerm(c *proto.Command, perm string) bool { if s.credentialStore == nil { return true } @@ -228,7 +229,7 @@ func (s *Service) checkCommandPerm(c *Command, perm string) bool { return s.credentialStore.AA(username, password, perm) } -func (s *Service) checkCommandPermAll(c *Command, perms ...string) bool { +func (s *Service) checkCommandPermAll(c *proto.Command, perms ...string) bool { if s.credentialStore == nil { return true } @@ -264,16 +265,16 @@ func (s *Service) handleConn(conn net.Conn) { return } - c := &Command{} - err = proto.Unmarshal(p, c) + c := &proto.Command{} + err = pb.Unmarshal(p, c) if err != nil { conn.Close() } switch c.Type { - case Command_COMMAND_TYPE_GET_NODE_API_URL: + case proto.Command_COMMAND_TYPE_GET_NODE_API_URL: stats.Add(numGetNodeAPIRequest, 1) - p, err = proto.Marshal(&Address{ + p, err = pb.Marshal(&proto.Address{ Url: s.GetNodeAPIURL(), }) if err != nil { @@ -282,9 +283,9 @@ func (s *Service) handleConn(conn net.Conn) { writeBytesWithLength(conn, p) stats.Add(numGetNodeAPIResponse, 1) - case Command_COMMAND_TYPE_EXECUTE: + case proto.Command_COMMAND_TYPE_EXECUTE: stats.Add(numExecuteRequest, 1) - resp := &CommandExecuteResponse{} + resp := &proto.CommandExecuteResponse{} er := c.GetExecuteRequest() if er == nil { @@ -302,9 +303,9 @@ func (s *Service) handleConn(conn net.Conn) { } marshalAndWrite(conn, resp) - case Command_COMMAND_TYPE_QUERY: + case proto.Command_COMMAND_TYPE_QUERY: stats.Add(numQueryRequest, 1) - resp := &CommandQueryResponse{} + resp := &proto.CommandQueryResponse{} qr := c.GetQueryRequest() if qr == nil { @@ -322,9 +323,9 @@ func (s *Service) handleConn(conn net.Conn) { } marshalAndWrite(conn, resp) - case Command_COMMAND_TYPE_REQUEST: + case proto.Command_COMMAND_TYPE_REQUEST: stats.Add(numRequestRequest, 1) - resp := &CommandRequestResponse{} + resp := &proto.CommandRequestResponse{} rr := c.GetExecuteQueryRequest() if rr == nil { @@ -342,9 +343,9 @@ func (s *Service) handleConn(conn net.Conn) { } marshalAndWrite(conn, resp) - case Command_COMMAND_TYPE_BACKUP: + case proto.Command_COMMAND_TYPE_BACKUP: stats.Add(numBackupRequest, 1) - resp := &CommandBackupResponse{} + resp := &proto.CommandBackupResponse{} br := c.GetBackupRequest() if br == nil { @@ -359,7 +360,7 @@ func (s *Service) handleConn(conn net.Conn) { resp.Data = buf.Bytes() } } - p, err = proto.Marshal(resp) + p, err = pb.Marshal(resp) if err != nil { conn.Close() return @@ -373,9 +374,9 @@ func (s *Service) handleConn(conn net.Conn) { } writeBytesWithLength(conn, p) - case Command_COMMAND_TYPE_LOAD: + case proto.Command_COMMAND_TYPE_LOAD: stats.Add(numLoadRequest, 1) - resp := &CommandLoadResponse{} + resp := &proto.CommandLoadResponse{} lr := c.GetLoadRequest() if lr == nil { @@ -389,15 +390,15 @@ func (s *Service) handleConn(conn net.Conn) { } marshalAndWrite(conn, resp) - case Command_COMMAND_TYPE_LOAD_CHUNK: - resp := &CommandLoadChunkResponse{ + case proto.Command_COMMAND_TYPE_LOAD_CHUNK: + resp := &proto.CommandLoadChunkResponse{ Error: "unsupported", } marshalAndWrite(conn, resp) - case Command_COMMAND_TYPE_REMOVE_NODE: + case proto.Command_COMMAND_TYPE_REMOVE_NODE: stats.Add(numRemoveNodeRequest, 1) - resp := &CommandRemoveNodeResponse{} + resp := &proto.CommandRemoveNodeResponse{} rn := c.GetRemoveNodeRequest() if rn == nil { @@ -411,9 +412,9 @@ func (s *Service) handleConn(conn net.Conn) { } marshalAndWrite(conn, resp) - case Command_COMMAND_TYPE_NOTIFY: + case proto.Command_COMMAND_TYPE_NOTIFY: stats.Add(numNotifyRequest, 1) - resp := &CommandNotifyResponse{} + resp := &proto.CommandNotifyResponse{} nr := c.GetNotifyRequest() if nr == nil { @@ -427,9 +428,9 @@ func (s *Service) handleConn(conn net.Conn) { } marshalAndWrite(conn, resp) - case Command_COMMAND_TYPE_JOIN: + case proto.Command_COMMAND_TYPE_JOIN: stats.Add(numJoinRequest, 1) - resp := &CommandJoinResponse{} + resp := &proto.CommandJoinResponse{} jr := c.GetJoinRequest() if jr == nil { @@ -457,8 +458,8 @@ func (s *Service) handleConn(conn net.Conn) { } } -func marshalAndWrite(conn net.Conn, m proto.Message) { - p, err := proto.Marshal(m) +func marshalAndWrite(conn net.Conn, m pb.Message) { + p, err := pb.Marshal(m) if err != nil { conn.Close() } diff --git a/cluster/service_db_clstr_test.go b/cluster/service_db_clstr_test.go index 8a064046..4daaefd9 100644 --- a/cluster/service_db_clstr_test.go +++ b/cluster/service_db_clstr_test.go @@ -10,6 +10,7 @@ import ( "testing" "time" + "github.com/rqlite/rqlite/v8/cluster/proto" "github.com/rqlite/rqlite/v8/command/encoding" command "github.com/rqlite/rqlite/v8/command/proto" ) @@ -18,7 +19,7 @@ const shortWait = 1 * time.Second const longWait = 5 * time.Second var ( - NO_CREDS = (*Credentials)(nil) + NO_CREDS = (*proto.Credentials)(nil) ) func Test_ServiceExecute(t *testing.T) { diff --git a/cluster/service_test.go b/cluster/service_test.go index 2a628c4c..6cccf615 100644 --- a/cluster/service_test.go +++ b/cluster/service_test.go @@ -10,6 +10,7 @@ import ( "testing" "time" + "github.com/rqlite/rqlite/v8/cluster/proto" command "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/testdata/x509" ) @@ -557,8 +558,8 @@ func mustNewMockCredentialStore() *mockCredentialStore { return &mockCredentialStore{HasPermOK: true} } -func makeCredentials(username, password string) *Credentials { - return &Credentials{ +func makeCredentials(username, password string) *proto.Credentials { + return &proto.Credentials{ Username: username, Password: password, } diff --git a/command/proto/command.pb.go b/command/proto/command.pb.go index 5453688f..343fbad1 100644 --- a/command/proto/command.pb.go +++ b/command/proto/command.pb.go @@ -430,7 +430,7 @@ type QueryRequest struct { 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=QueryRequest_Level" json:"level,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"` } @@ -753,7 +753,7 @@ type ExecuteQueryRequest struct { 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=QueryRequest_Level" json:"level,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"` } @@ -917,7 +917,7 @@ type BackupRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Format BackupRequest_Format `protobuf:"varint,1,opt,name=format,proto3,enum=BackupRequest_Format" json:"format,omitempty"` + 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"` } @@ -1318,7 +1318,7 @@ type Command struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type Command_Type `protobuf:"varint,1,opt,name=type,proto3,enum=Command_Type" json:"type,omitempty"` + 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"` } @@ -1380,145 +1380,152 @@ var File_command_proto_command_proto protoreflect.FileDescriptor var file_command_proto_command_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x49, 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, 0x2a, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x73, 0x22, 0x57, 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, - 0x2a, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xfa, 0x01, 0x0a, 0x0c, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x07, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 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, 0x29, 0x0a, 0x05, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 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, 0x34, 0x0a, 0x06, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x86, - 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, 0x1f, 0x0a, 0x06, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 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, 0x4e, 0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 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, 0x9c, - 0x01, 0x0a, 0x13, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 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, 0x29, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x13, 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, 0x74, 0x0a, - 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x01, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0a, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x6f, 0x77, 0x73, 0x48, 0x00, 0x52, 0x01, - 0x71, 0x12, 0x1e, 0x0a, 0x01, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 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, 0xd9, 0x01, 0x0a, 0x0d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 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, 0xc4, 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x21, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 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, 0x28, 0x5a, 0x26, 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, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 0x28, 0x5a, 0x26, 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, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1536,42 +1543,42 @@ func file_command_proto_command_proto_rawDescGZIP() []byte { var file_command_proto_command_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_command_proto_command_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_command_proto_command_proto_goTypes = []interface{}{ - (QueryRequest_Level)(0), // 0: QueryRequest.Level - (BackupRequest_Format)(0), // 1: BackupRequest.Format - (Command_Type)(0), // 2: Command.Type - (*Parameter)(nil), // 3: Parameter - (*Statement)(nil), // 4: Statement - (*Request)(nil), // 5: Request - (*QueryRequest)(nil), // 6: QueryRequest - (*Values)(nil), // 7: Values - (*QueryRows)(nil), // 8: QueryRows - (*ExecuteRequest)(nil), // 9: ExecuteRequest - (*ExecuteResult)(nil), // 10: ExecuteResult - (*ExecuteQueryRequest)(nil), // 11: ExecuteQueryRequest - (*ExecuteQueryResponse)(nil), // 12: ExecuteQueryResponse - (*BackupRequest)(nil), // 13: BackupRequest - (*LoadRequest)(nil), // 14: LoadRequest - (*LoadChunkRequest)(nil), // 15: LoadChunkRequest - (*JoinRequest)(nil), // 16: JoinRequest - (*NotifyRequest)(nil), // 17: NotifyRequest - (*RemoveNodeRequest)(nil), // 18: RemoveNodeRequest - (*Noop)(nil), // 19: Noop - (*Command)(nil), // 20: Command + (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_proto_command_proto_depIdxs = []int32{ - 3, // 0: Statement.parameters:type_name -> Parameter - 4, // 1: Request.statements:type_name -> Statement - 5, // 2: QueryRequest.request:type_name -> Request - 0, // 3: QueryRequest.level:type_name -> QueryRequest.Level - 3, // 4: Values.parameters:type_name -> Parameter - 7, // 5: QueryRows.values:type_name -> Values - 5, // 6: ExecuteRequest.request:type_name -> Request - 5, // 7: ExecuteQueryRequest.request:type_name -> Request - 0, // 8: ExecuteQueryRequest.level:type_name -> QueryRequest.Level - 8, // 9: ExecuteQueryResponse.q:type_name -> QueryRows - 10, // 10: ExecuteQueryResponse.e:type_name -> ExecuteResult - 1, // 11: BackupRequest.format:type_name -> BackupRequest.Format - 2, // 12: Command.type:type_name -> Command.Type + 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 diff --git a/command/proto/command.proto b/command/proto/command.proto index 63a84425..d5fce21f 100644 --- a/command/proto/command.proto +++ b/command/proto/command.proto @@ -1,6 +1,8 @@ syntax = "proto3"; -option go_package = "github.com/rqlite/rqlite/command/proto"; +package command; + +option go_package = "github.com/rqlite/rqlite/v8/command/proto"; message Parameter { oneof value { diff --git a/http/service.go b/http/service.go index 22501f3d..fa67f355 100644 --- a/http/service.go +++ b/http/service.go @@ -21,7 +21,7 @@ import ( "time" "github.com/rqlite/rqlite/v8/auth" - "github.com/rqlite/rqlite/v8/cluster" + clstrPB "github.com/rqlite/rqlite/v8/cluster/proto" "github.com/rqlite/rqlite/v8/command" "github.com/rqlite/rqlite/v8/command/encoding" "github.com/rqlite/rqlite/v8/command/proto" @@ -102,22 +102,22 @@ type Cluster interface { GetAddresser // Execute performs an Execute Request on a remote node. - Execute(er *proto.ExecuteRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) ([]*proto.ExecuteResult, error) + Execute(er *proto.ExecuteRequest, nodeAddr string, creds *clstrPB.Credentials, timeout time.Duration) ([]*proto.ExecuteResult, error) // Query performs an Query Request on a remote node. - Query(qr *proto.QueryRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) ([]*proto.QueryRows, error) + Query(qr *proto.QueryRequest, nodeAddr string, creds *clstrPB.Credentials, timeout time.Duration) ([]*proto.QueryRows, error) // Request performs an ExecuteQuery Request on a remote node. - Request(eqr *proto.ExecuteQueryRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) ([]*proto.ExecuteQueryResponse, error) + Request(eqr *proto.ExecuteQueryRequest, nodeAddr string, creds *clstrPB.Credentials, timeout time.Duration) ([]*proto.ExecuteQueryResponse, error) // Backup retrieves a backup from a remote node and writes to the io.Writer. - Backup(br *proto.BackupRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration, w io.Writer) error + Backup(br *proto.BackupRequest, nodeAddr string, creds *clstrPB.Credentials, timeout time.Duration, w io.Writer) error // Load loads a SQLite database into the node. - Load(lr *proto.LoadRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) error + Load(lr *proto.LoadRequest, nodeAddr string, creds *clstrPB.Credentials, timeout time.Duration) error // RemoveNode removes a node from the cluster. - RemoveNode(rn *proto.RemoveNodeRequest, nodeAddr string, creds *cluster.Credentials, timeout time.Duration) error + RemoveNode(rn *proto.RemoveNodeRequest, nodeAddr string, creds *clstrPB.Credentials, timeout time.Duration) error // Stats returns stats on the Cluster. Stats() (map[string]interface{}, error) @@ -1716,8 +1716,8 @@ func executeRequestFromStrings(s []string, timings, tx bool) *proto.ExecuteReque } } -func makeCredentials(username, password string) *cluster.Credentials { - return &cluster.Credentials{ +func makeCredentials(username, password string) *clstrPB.Credentials { + return &clstrPB.Credentials{ Username: username, Password: password, } diff --git a/http/service_test.go b/http/service_test.go index d9db4fec..277ffc21 100644 --- a/http/service_test.go +++ b/http/service_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - "github.com/rqlite/rqlite/v8/cluster" + cluster "github.com/rqlite/rqlite/v8/cluster/proto" command "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/store" ) diff --git a/system_test/request_forwarding_test.go b/system_test/request_forwarding_test.go index a52e7e14..6a16c3b0 100644 --- a/system_test/request_forwarding_test.go +++ b/system_test/request_forwarding_test.go @@ -7,6 +7,7 @@ import ( "time" "github.com/rqlite/rqlite/v8/cluster" + clstrPB "github.com/rqlite/rqlite/v8/cluster/proto" "github.com/rqlite/rqlite/v8/command/proto" "github.com/rqlite/rqlite/v8/rtls" "github.com/rqlite/rqlite/v8/tcp" @@ -17,7 +18,7 @@ const ( ) var ( - NO_CREDS = (*cluster.Credentials)(nil) + NO_CREDS = (*clstrPB.Credentials)(nil) ) // Test_StoreClientSideBySide operates on the same store directly, and via