Documentation
¶
Index ¶
- func NewConsulClient(addr string) (*api.Client, error)
- func NewPostgresClient(ctx context.Context, url string, options *PostgresOptions) (*pgxpool.Pool, error)
- func NewRedisClient(url string, options *RedisOptions) (*redis.Client, error)
- type PostgresOptions
- func (o *PostgresOptions) WithConnMaxLifetime(time time.Duration) *PostgresOptions
- func (o *PostgresOptions) WithConnectTimeout(time time.Duration) *PostgresOptions
- func (o *PostgresOptions) WithDatabase(database string) *PostgresOptions
- func (o *PostgresOptions) WithDialFunc(fn func(ctx context.Context, network, addr string) (net.Conn, error)) *PostgresOptions
- func (o *PostgresOptions) WithHealthCheckPeriod(time time.Duration) *PostgresOptions
- func (o *PostgresOptions) WithHost(host string) *PostgresOptions
- func (o *PostgresOptions) WithMaxCons(amount int32) *PostgresOptions
- func (o *PostgresOptions) WithMinCons(amount int32) *PostgresOptions
- func (o *PostgresOptions) WithPassword(password string) *PostgresOptions
- func (o *PostgresOptions) WithUsername(username string) *PostgresOptions
- type RedisOptions
- func (o *RedisOptions) WithAddr(addr string) *RedisOptions
- func (o *RedisOptions) WithDealer(fn func(ctx context.Context, network, addr string) (net.Conn, error)) *RedisOptions
- func (o *RedisOptions) WithDialTimeout(timeout time.Duration) *RedisOptions
- func (o *RedisOptions) WithLimiter(limiter redis.Limiter) *RedisOptions
- func (o *RedisOptions) WithMaxRetries(maxRetries int) *RedisOptions
- func (o *RedisOptions) WithMaxRetryBackoff(time time.Duration) *RedisOptions
- func (o *RedisOptions) WithMinRetryBackoff(time time.Duration) *RedisOptions
- func (o *RedisOptions) WithOnConnect(fn func(ctx context.Context, conn *redis.Conn) error) *RedisOptions
- func (o *RedisOptions) WithPassword(pw string) *RedisOptions
- func (o *RedisOptions) WithTLSConfig(tlsConfig *tls.Config) *RedisOptions
- func (o *RedisOptions) WithUsername(username string) *RedisOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostgresClient ¶
func NewRedisClient ¶
func NewRedisClient(url string, options *RedisOptions) (*redis.Client, error)
Types ¶
type PostgresOptions ¶
func NewPostgresOptions ¶
func NewPostgresOptions(url string) *PostgresOptions
func (*PostgresOptions) WithConnMaxLifetime ¶
func (o *PostgresOptions) WithConnMaxLifetime(time time.Duration) *PostgresOptions
func (*PostgresOptions) WithConnectTimeout ¶
func (o *PostgresOptions) WithConnectTimeout(time time.Duration) *PostgresOptions
func (*PostgresOptions) WithDatabase ¶
func (o *PostgresOptions) WithDatabase(database string) *PostgresOptions
func (*PostgresOptions) WithDialFunc ¶
func (o *PostgresOptions) WithDialFunc(fn func(ctx context.Context, network, addr string) (net.Conn, error)) *PostgresOptions
func (*PostgresOptions) WithHealthCheckPeriod ¶
func (o *PostgresOptions) WithHealthCheckPeriod(time time.Duration) *PostgresOptions
func (*PostgresOptions) WithHost ¶
func (o *PostgresOptions) WithHost(host string) *PostgresOptions
func (*PostgresOptions) WithMaxCons ¶
func (o *PostgresOptions) WithMaxCons(amount int32) *PostgresOptions
func (*PostgresOptions) WithMinCons ¶
func (o *PostgresOptions) WithMinCons(amount int32) *PostgresOptions
func (*PostgresOptions) WithPassword ¶
func (o *PostgresOptions) WithPassword(password string) *PostgresOptions
func (*PostgresOptions) WithUsername ¶
func (o *PostgresOptions) WithUsername(username string) *PostgresOptions
type RedisOptions ¶
type RedisOptions struct {
*redis.Options
}
func NewRedisOptions ¶
func NewRedisOptions(url string) *RedisOptions
func (*RedisOptions) WithAddr ¶
func (o *RedisOptions) WithAddr(addr string) *RedisOptions
func (*RedisOptions) WithDealer ¶
func (o *RedisOptions) WithDealer(fn func(ctx context.Context, network, addr string) (net.Conn, error)) *RedisOptions
func (*RedisOptions) WithDialTimeout ¶
func (o *RedisOptions) WithDialTimeout(timeout time.Duration) *RedisOptions
func (*RedisOptions) WithLimiter ¶
func (o *RedisOptions) WithLimiter(limiter redis.Limiter) *RedisOptions
func (*RedisOptions) WithMaxRetries ¶
func (o *RedisOptions) WithMaxRetries(maxRetries int) *RedisOptions
func (*RedisOptions) WithMaxRetryBackoff ¶
func (o *RedisOptions) WithMaxRetryBackoff(time time.Duration) *RedisOptions
func (*RedisOptions) WithMinRetryBackoff ¶
func (o *RedisOptions) WithMinRetryBackoff(time time.Duration) *RedisOptions
func (*RedisOptions) WithOnConnect ¶
func (o *RedisOptions) WithOnConnect(fn func(ctx context.Context, conn *redis.Conn) error) *RedisOptions
func (*RedisOptions) WithPassword ¶
func (o *RedisOptions) WithPassword(pw string) *RedisOptions
func (*RedisOptions) WithTLSConfig ¶
func (o *RedisOptions) WithTLSConfig(tlsConfig *tls.Config) *RedisOptions
func (*RedisOptions) WithUsername ¶
func (o *RedisOptions) WithUsername(username string) *RedisOptions
Click to show internal directories.
Click to hide internal directories.