Documentation
¶
Index ¶
- Variables
- func CreateDSN(opts PoolOptions) (*tls.Config, string, error)
- func NewDBEngine(pool *pgxpool.Pool, env string, log logger.Logger) pgsqlstorage.DBEngine
- type Client
- type OptPoolOptionsSetter
- func WithCheck(check bool) OptPoolOptionsSetter
- func WithDebug(debug bool) OptPoolOptionsSetter
- func WithEnvironment(env string) OptPoolOptionsSetter
- func WithLogger(logger logger.Logger) OptPoolOptionsSetter
- func WithMaxConnIdleTime(maxConnIdleTime time.Duration) OptPoolOptionsSetter
- func WithMaxConnLifeTime(maxConnLifeTime time.Duration) OptPoolOptionsSetter
- func WithMaxConnectionsCount(maxConnections int32) OptPoolOptionsSetter
- func WithMinConnectionsCount(minConnections int32) OptPoolOptionsSetter
- func WithSSLMode(sslMode string) OptPoolOptionsSetter
- func WithTLSConfig(cfg *tls.Config) OptPoolOptionsSetter
- func WithTLSPath(cert string, key string) OptPoolOptionsSetter
- type PoolOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOption = errors.New("pgsql client invalid option")
Functions ¶
func NewDBEngine ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client - postgres connection pool.
type OptPoolOptionsSetter ¶
type OptPoolOptionsSetter func(o *PoolOptions)
func WithCheck ¶
func WithCheck(check bool) OptPoolOptionsSetter
func WithDebug ¶
func WithDebug(debug bool) OptPoolOptionsSetter
func WithEnvironment ¶
func WithEnvironment(env string) OptPoolOptionsSetter
func WithLogger ¶
func WithLogger(logger logger.Logger) OptPoolOptionsSetter
func WithMaxConnIdleTime ¶
func WithMaxConnIdleTime(maxConnIdleTime time.Duration) OptPoolOptionsSetter
func WithMaxConnLifeTime ¶
func WithMaxConnLifeTime(maxConnLifeTime time.Duration) OptPoolOptionsSetter
func WithMaxConnectionsCount ¶
func WithMaxConnectionsCount(maxConnections int32) OptPoolOptionsSetter
func WithMinConnectionsCount ¶
func WithMinConnectionsCount(minConnections int32) OptPoolOptionsSetter
func WithSSLMode ¶
func WithSSLMode(sslMode string) OptPoolOptionsSetter
func WithTLSConfig ¶
func WithTLSConfig(cfg *tls.Config) OptPoolOptionsSetter
func WithTLSPath ¶
func WithTLSPath(cert string, key string) OptPoolOptionsSetter
type PoolOptions ¶
type PoolOptions struct {
// contains filtered or unexported fields
}
func NewOptions ¶
func NewOptions( address string, username string, password string, database string, options ...OptPoolOptionsSetter, ) PoolOptions
func (*PoolOptions) Validate ¶
func (o *PoolOptions) Validate() error
Click to show internal directories.
Click to hide internal directories.