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

package grpcclient

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

Package grpcclient contains utility methods for gRPC client implementations to use. It also supports plug-in authentication.


Package Files

client.go client_auth_static.go glogger.go snappy.go

func AppendStaticAuth Uses

func AppendStaticAuth(opts []grpc.DialOption) ([]grpc.DialOption, error)

AppendStaticAuth optionally appends static auth credentials if provided.

func Dial Uses

func Dial(target string, failFast FailFast, opts ...grpc.DialOption) (*grpc.ClientConn, error)

Dial creates a grpc connection to the given target. failFast is a non-optional parameter because callers are required to specify what that should be.

func RegisterGRPCDialOptions Uses

func RegisterGRPCDialOptions(grpcDialOptionsFunc func(opts []grpc.DialOption) ([]grpc.DialOption, error))

RegisterGRPCDialOptions registers an implementation of AuthServer.

func SecureDialOption Uses

func SecureDialOption(cert, key, ca, name string) (grpc.DialOption, error)

SecureDialOption returns the gRPC dial option to use for the given client connection. It is either using TLS, or Insecure if nothing is set.

type FailFast Uses

type FailFast bool

FailFast is a self-documenting type for the grpc.FailFast.

type SnappyCompressor Uses

type SnappyCompressor struct{}

SnappyCompressor is a gRPC compressor using the Snappy algorithm.

func (SnappyCompressor) Compress Uses

func (s SnappyCompressor) Compress(w io.Writer) (io.WriteCloser, error)

Compress wraps with a SnappyReader

func (SnappyCompressor) Decompress Uses

func (s SnappyCompressor) Decompress(r io.Reader) (io.Reader, error)

Decompress wraps with a SnappyReader

func (SnappyCompressor) Name Uses

func (s SnappyCompressor) Name() string

Name is "snappy"

type StaticAuthClientCreds Uses

type StaticAuthClientCreds struct {
    Username string
    Password string

StaticAuthClientCreds holder for client credentials

func (*StaticAuthClientCreds) GetRequestMetadata Uses

func (c *StaticAuthClientCreds) GetRequestMetadata(context.Context, ...string) (map[string]string, error)

GetRequestMetadata gets the request metadata as a map from StaticAuthClientCreds

func (*StaticAuthClientCreds) RequireTransportSecurity Uses

func (c *StaticAuthClientCreds) RequireTransportSecurity() bool

RequireTransportSecurity indicates whether the credentials requires transport security. Given that people can use this with or without TLS, at the moment we are not enforcing transport security

Package grpcclient imports 18 packages (graph) and is imported by 31 packages. Updated 2019-06-24. Refresh now. Tools for package owners.