Add transport options comments

This commit is contained in:
Asim Aslam 2019-07-07 12:23:03 +01:00
parent d2d6841f02
commit 5f664faeba

View File

@ -9,9 +9,17 @@ import (
)
type Options struct {
Addrs []string
Codec codec.Marshaler
Secure bool
// Addrs is the list of intermediary addresses to connect to
Addrs []string
// Codec is the codec interface to use where headers are not supported
// by the transport and the entire payload must be encoded
Codec codec.Marshaler
// Secure tells the transport to secure the connection.
// In the case TLSConfig is not specified best effort self-signed
// certs should be used
Secure bool
// TLSConfig to secure the connection. The assumption is that this
// is mTLS keypair
TLSConfig *tls.Config
// Timeout sets the timeout for Send/Recv
Timeout time.Duration
@ -21,7 +29,10 @@ type Options struct {
}
type DialOptions struct {
Stream bool
// Tells the transport this is a streaming connection with
// multiple calls to send/recv and that send may not even be called
Stream bool
// Timeout for dialing
Timeout time.Duration
// TODO: add tls options when dialling