Documentation
¶
Index ¶
- func CurrentRedisPort(ctx context.Context) (port int)
- func CurrentRedisServer(ctx context.Context) *miniredis.Miniredis
- func Redis(opts ...RedisOptions) suitetest.PackageOptions
- func RedisWithPort(port int) suitetest.PackageOptions
- func ServerTLSWithCerts(opts ...func(src *TLSCerts)) (*tls.Config, error)
- func WithRedis(opts ...RedisOptions) test.Options
- type RedisConfig
- type RedisOptions
- type TLSCerts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentRedisPort ¶
CurrentRedisPort getter to return embedded redis port. returns -1 if it's not initialized or started
func CurrentRedisServer ¶ added in v0.14.0
CurrentRedisServer getter to return embedded redis. returns nil if it's not initialized or started
func Redis ¶
func Redis(opts ...RedisOptions) suitetest.PackageOptions
Redis start redis at random port (32768-65535) on test package level. The actual port get be get using CurrentRedisPort
func RedisWithPort ¶
func RedisWithPort(port int) suitetest.PackageOptions
RedisWithPort start redis at given port (must between 32768 and 65535) on test package level. Deprecated, use Redis(...) to set RedisConfig.Port
func ServerTLSWithCerts ¶
ServerTLSWithCerts construct a tls.Config with certificates in a given filesystem. The setup Server TLS, following config are required: - filesystem to load files from. Default to "." - path of certificate file in PEM format, default to "testdata/server.crt" - path of certificate private key file in unencrypted PEM format, default to "testdata/server.key" - path of at least one CA certificate in PEM format, default to "testdata/ca.crt" Note: if any file is missing or not readable, the result tls.Config might not works as expected
func WithRedis ¶
func WithRedis(opts ...RedisOptions) test.Options
WithRedis start redis at random port (32768-65535) on per test basis The actual port get be get using CurrentRedisPort
Types ¶
type RedisConfig ¶
type RedisOptions ¶
type RedisOptions func(cfg *RedisConfig)
func EnableTLS ¶
func EnableTLS(certs ...func(src *TLSCerts)) RedisOptions