docs: pkg inline

This commit is contained in:
2023-02-17 11:43:20 +03:00
parent 4d13a14dc2
commit fb5ab81be5
6 changed files with 8 additions and 59 deletions

View File

@@ -9,23 +9,15 @@ import (
type PostgresPoolOpts struct {
DSN string
// Debug bool
// Logg tracelog.Logger
}
// NewPostgresPool creates a reusbale connection pool across the cic-custodial component.
func NewPostgresPool(o PostgresPoolOpts) (*pgxpool.Pool, error) {
parsedConfig, err := pgxpool.ParseConfig(o.DSN)
if err != nil {
return nil, err
}
// if o.Debug {
// parsedConfig.ConnConfig.Tracer = &tracelog.TraceLog{
// Logger: o.Logg,
// LogLevel: tracelog.LogLevelDebug,
// }
// }
dbPool, err := pgxpool.NewWithConfig(context.Background(), parsedConfig)
if err != nil {
return nil, err