clients

package
v0.0.0-...-f4dd3ec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsulClient

func NewConsulClient(addr string) (*api.Client, error)

func NewPostgresClient

func NewPostgresClient(ctx context.Context, url string, options *PostgresOptions) (*pgxpool.Pool, error)

func NewRedisClient

func NewRedisClient(url string, options *RedisOptions) (*redis.Client, error)

Types

type PostgresOptions

type PostgresOptions struct {
	*pgxpool.Config
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL