vtctldclient

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package vtctldclient contains the generic client side of the remote vtctld protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, factory Factory)

Register adds a VtctldClient factory for the given name (protocol). Attempting to register mulitple factories for the same protocol is a fatal error.

Types

type Factory

type Factory func(addr string) (VtctldClient, error)

Factory is a function that creates new VtctldClients.

type VtctldClient

type VtctldClient interface {
	vtctlservicepb.VtctldClient
	Close() error
}

VtctldClient augments the vtctlservicepb.VtctlClient interface with io.Closer.

func New

func New(protocol string, addr string) (VtctldClient, error)

New returns a VtctldClient for the given protocol, connected to a VtctldServer on the given addr. This function returns an error if no client factory was registered for the given protocol.

This is a departure from vtctlclient's New, which relies on a flag in the global namespace to determine the protocol to use. Instead, we require users to specify their own flag in their own (hopefully not global) namespace to determine the protocol to pass into here.

Jump to

Keyboard shortcuts

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