Documentation ¶
Index ¶
- Constants
- type Client
- type Option
- func WithCertPool(p *x509.CertPool) Option
- func WithCertificate(c ...tls.Certificate) Option
- func WithClientAuth(a tls.ClientAuthType) Option
- func WithDialopts(uc ...grpc.DialOption) Option
- func WithDisableTLS() Option
- func WithInsecureSkipVerify() Option
- func WithLogger(l log.Logger) Option
- func WithStreamClientInterceptors(sc ...grpc.StreamClientInterceptor) Option
- func WithTarget(t string) Option
- func WithUnaryClientInterceptors(uc ...grpc.UnaryClientInterceptor) Option
- func WithViper(args ...string) Option
Constants ¶
const ( // EnvironmentPrefix sets the prefix to strip from environment variables when resolving keys. Default: "DDL_RPC". EnvironmentPrefix = "env-prefix" // EnvironmentReplace takes a comma separated list of old,new. Default: .,_,-,_ EnvironmentReplace = "env-replace" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an rpc connection
func (*Client) Close ¶
Close closes the connection. Calling close on an empty connection yells at you.
func (*Client) Conn ¶
func (c *Client) Conn() *grpc.ClientConn
Conn returns the connection established to the grpc host. This connection is concurrent safe and should be used when constructing grpc clients.
type Option ¶
type Option func(*options)
Option provides a function definition to set options
func WithCertPool ¶
WithCertPool overrides the system CA pool
func WithCertificate ¶
func WithCertificate(c ...tls.Certificate) Option
WithCertificate adds certs for authentication.
func WithClientAuth ¶
func WithClientAuth(a tls.ClientAuthType) Option
WithClientAuth sets the tls ClientAuthType to control auth behavior.
func WithInsecureSkipVerify ¶
func WithInsecureSkipVerify() Option
WithInsecureSkipVerify makes connections not that safe to use.
func WithLogger ¶
WithLogger set the log instance for client and server instances.
func WithStreamClientInterceptors ¶
func WithStreamClientInterceptors(sc ...grpc.StreamClientInterceptor) Option
WithStreamClientInterceptors sets the streaming client middleware.
func WithUnaryClientInterceptors ¶
func WithUnaryClientInterceptors(uc ...grpc.UnaryClientInterceptor) Option
WithUnaryClientInterceptors sets the unary client middleware.