go-vitess.v1: gopkg.in/src-d/go-vitess.v1/vt/vttablet/tabletconn Index | Files

package tabletconn

import "gopkg.in/src-d/go-vitess.v1/vt/vttablet/tabletconn"

Index

Package Files

grpc_error.go tablet_conn.go

Variables

var (
    // ConnClosed is returned when the underlying connection was closed.
    ConnClosed = vterrors.New(vtrpcpb.Code_UNAVAILABLE, "vttablet: Connection Closed")
)
var (
    // TabletProtocol is exported for unit tests
    TabletProtocol = flag.String("tablet_protocol", "grpc", "how to talk to the vttablets")
)

func ErrorFromGRPC Uses

func ErrorFromGRPC(err error) error

ErrorFromGRPC converts a GRPC error to vtError for tabletserver calls.

func ErrorFromVTRPC Uses

func ErrorFromVTRPC(err *vtrpcpb.RPCError) error

ErrorFromVTRPC converts a *vtrpcpb.RPCError to vtError for tabletserver calls.

func RegisterDialer Uses

func RegisterDialer(name string, dialer TabletDialer)

RegisterDialer is meant to be used by TabletDialer implementations to self register.

type TabletDialer Uses

type TabletDialer func(tablet *topodatapb.Tablet, failFast grpcclient.FailFast) (queryservice.QueryService, error)

TabletDialer represents a function that will return a QueryService object that can communicate with a tablet. Only the tablet's HostName and PortMap should be used (and maybe the alias for debug messages).

When using this TabletDialer to talk to a l2vtgate, only the Hostname will be set to the full address to dial. Implementations should detect this use case as the portmap will then be empty.

timeout represents the connection timeout. If set to 0, this connection should be established in the background and the TabletDialer should return right away.

func GetDialer Uses

func GetDialer() TabletDialer

GetDialer returns the dialer to use, described by the command line flag

Package tabletconn imports 10 packages (graph) and is imported by 19 packages. Updated 2019-06-13. Refresh now. Tools for package owners.