Documentation
¶
Overview ¶
Package dialkit is what the dial packages of the kinds of segment store share: the TLS configuration of a connection, the class of a failed dial, and the bounds and timeouts of a connection. It names no client library, so that every kind (redisdial, valkeydial) uses the same code and no kind imports another.
Index ¶
- Constants
- Variables
- func Bound(d *bootstrap.Duration, def time.Duration) time.Duration
- func DialClass(err, unavailable error) error
- func Duration(d *bootstrap.Duration) time.Duration
- func LookupTimeout(d *bootstrap.Duration) time.Duration
- func TLSConfig(cfg *bootstrap.StoreTLS, secrets bootstrap.LoadOptions) (*tls.Config, error)
- func TLSEnabled(cfg *bootstrap.StoreTLS) bool
Constants ¶
const ( // DefaultDialBound is the bound of one dial when timeouts.connect is unset: the default dial timeout of go-redis and // valkey-go. DefaultDialBound = 5 * time.Second // DefaultReadBound is the default read timeout of go-redis. DefaultReadBound = 3 * time.Second )
Variables ¶
var ( // ErrCertificate is the class of a dial that failed because the certificate of the store was not verified (a CA that // did not sign it, a name that does not match, an expired certificate). ErrCertificate = errors.New("tls: the certificate of the store was not verified") // ErrNoCertificate is returned for a CA bundle file that holds no certificate. ErrNoCertificate = errors.New("no certificate in the file") )
Functions ¶
func DialClass ¶
DialClass reduces the error of a dial to its class, so that no address or certificate text reaches a log line: a certificate that was not verified is ErrCertificate, anything else is unavailable, the sentinel that the provider of the kind uses for a store that cannot be reached.
func LookupTimeout ¶
LookupTimeout is the timeout of one lookup call: the setting of the connection, 100ms when unset.
func TLSConfig ¶
TLSConfig is the TLS configuration of a connection that asks for TLS (see TLSEnabled). Its error is about the CA bundle file (a file that cannot be read, or ErrNoCertificate): the caller says so ("tls.caBundleFile: ...").
func TLSEnabled ¶
TLSEnabled reports whether the connection asks for TLS.
Types ¶
This section is empty.