vtctlclient

package
v0.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 14

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

func RegisterFactory(name string, factory Factory)

RegisterFactory allows a client implementation to register itself.

func RegisterFlags added in v0.15.0

func RegisterFlags(fs *pflag.FlagSet)

func RunCommandAndWait

func RunCommandAndWait(ctx context.Context, server string, args []string, 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.

Types

type Factory

type Factory func(ctx context.Context, addr string) (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

func New

func New(ctx context.Context, addr string) (VtctlClient, error)

New allows a user of the client library to get its implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL