Documentation ¶
Overview ¶
Package vtctlclient contains the generic client side of the remote vtctl protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var VtctlClientProtocol = flag.String("vtctl_client_protocol", "gorpc", "the protocol to use to talk to the vtctl server")
VtctlClientProtocol specifices which RPC client implementation should be used.
Functions ¶
func RegisterFactory ¶
RegisterFactory allows a client implementation to register itself
func RunCommandAndWait ¶
func RunCommandAndWait(ctx context.Context, server string, args []string, dialTimeout, actionTimeout, lockWaitTimeout time.Duration, recv func(*logutil.LoggerEvent)) 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 logutil.LoggerEvent messages which have to be consumed by the caller who has to specify a "recv" function.
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 // NOTE: ErrFunc should only be checked after the returned channel was closed to avoid races. ExecuteVtctlCommand(ctx context.Context, args []string, actionTimeout, lockTimeout time.Duration) (<-chan *logutil.LoggerEvent, ErrFunc, 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
Click to show internal directories.
Click to hide internal directories.