Documentation ¶
Overview ¶
Package transport provides transport related functions to other kwil-db packages to help configure and use TLS clients and services.
Index ¶
- Constants
- func DefaultClientTLSConfig() *tls.Config
- func Dial(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func GenTLSKeyPair(certFile, keyFile string, org string, altDNSNames []string) error
- func NewClientTLSConfig(pemCerts []byte) (*tls.Config, error)
- func NewClientTLSConfigFromFile(certFile string) (*tls.Config, error)
- type GrpcTransport
- type GrpcTransporter
- type TimeOutOption
- type TlsOption
Constants ¶
const ( // @yaiba TODO: make this configurable // DefaultDialTimeout is the default dial timeout. DefaultDialTimeout = 3 * time.Second // DefaultRequestTimeout is the default request timeout. DefaultRequestTimeout = 3 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func DefaultClientTLSConfig ¶
DefaultClientTLSConfig returns a client tls config using just the system's CA pool, if present, otherwise an empty certificate pool.
func Dial ¶
func Dial(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func GenTLSKeyPair ¶
GenTLSKeyPair generates a key/cert pair to the paths provided.
func NewClientTLSConfig ¶
NewClientTLSConfig creates a new basic tls.Config for a TLS client. This is not appropriate for a server's config. Provide the server's certificate or it's root certificate authority.
func NewClientTLSConfigFromFile ¶
NewClientTLSConfigFromFile creates a new basic tls.Config for a TLS client given the path to a PEM encoded certificate file to include in the root CAs. Provide the server's certificate or it's root certificate authority. Use DefaultClientTLSConfig to use just the system's CA pool.
Types ¶
type GrpcTransport ¶
type GrpcTransport struct {
// contains filtered or unexported fields
}
func (*GrpcTransport) Dial ¶
func (t *GrpcTransport) Dial(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
type GrpcTransporter ¶
type GrpcTransporter interface { // Dial connects to the given address. Dial(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error) }