Documentation ¶
Overview ¶
Package vtctlclient contains the generic client side of the remote vtctl protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFactory ¶
RegisterFactory allows a client implementation to register itself.
func RunCommandAndWait ¶
func RunCommandAndWait(ctx context.Context, server string, args []string, dialTimeout, actionTimeout time.Duration, recv func(*logutilpb.Event)) error
RunCommandAndWait executes a single command on a given vtctld and blocks until the command did return or timed out. Output from vtctld is streamed as logutilpb.Event messages which have to be consumed by the caller who has to specify a "recv" function.
func UnregisterFactoryForTest ¶
func UnregisterFactoryForTest(name string)
UnregisterFactoryForTest allows to unregister a client implementation from the static map. This function is used by unit tests to cleanly unregister any fake implementations. This way, a test package can use the same name for different fakes and no dangling fakes are left behind in the static factories map after the test.
Types ¶
type Factory ¶
type Factory func(addr string, connectTimeout time.Duration) (VtctlClient, error)
Factory functions are registered by client implementations
type VtctlClient ¶
type VtctlClient interface { // ExecuteVtctlCommand will execute the command remotely ExecuteVtctlCommand(ctx context.Context, args []string, actionTimeout time.Duration) (logutil.EventStream, error) // Close will terminate the connection. This object won't be // used after this. Close() }
VtctlClient defines the interface used to send remote vtctl commands