Documentation ¶
Overview ¶
Package grpcclient contains utility methods for gRPC client implementations to use. It also supports plug-in authentication.
Index ¶
- func AppendStaticAuth(opts []grpc.DialOption) ([]grpc.DialOption, error)
- func Dial(target string, failFast FailFast, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func RegisterGRPCDialOptions(grpcDialOptionsFunc func(opts []grpc.DialOption) ([]grpc.DialOption, error))
- func SecureDialOption(cert, key, ca, name string) (grpc.DialOption, error)
- type FailFast
- type SnappyCompressor
- type StaticAuthClientCreds
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendStaticAuth ¶
func AppendStaticAuth(opts []grpc.DialOption) ([]grpc.DialOption, error)
AppendStaticAuth optionally appends static auth credentials if provided.
func Dial ¶
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 ¶
func RegisterGRPCDialOptions(grpcDialOptionsFunc func(opts []grpc.DialOption) ([]grpc.DialOption, error))
RegisterGRPCDialOptions registers an implementation of AuthServer.
func SecureDialOption ¶
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.
Types ¶
type SnappyCompressor ¶
type SnappyCompressor struct{}
SnappyCompressor is a gRPC compressor using the Snappy algorithm.
func (SnappyCompressor) Compress ¶
func (s SnappyCompressor) Compress(w io.Writer) (io.WriteCloser, error)
Compress wraps with a SnappyReader
func (SnappyCompressor) Decompress ¶
Decompress wraps with a SnappyReader
type StaticAuthClientCreds ¶
StaticAuthClientCreds holder for client credentials
func (*StaticAuthClientCreds) GetRequestMetadata ¶
func (c *StaticAuthClientCreds) GetRequestMetadata(context.Context, ...string) (map[string]string, error)
GetRequestMetadata gets the request metadata as a map from StaticAuthClientCreds
func (*StaticAuthClientCreds) RequireTransportSecurity ¶
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