postgresql

package
v0.0.0-...-80164ef Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigIsRequired = errors.NewError("SYS", "PostgreSQL config is required")
	ErrLoggerIsRequired = errors.NewError("SYS", "Logger is required")
)

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Build

func (b *Builder) Build() (*PostgreSQL, error)

func (*Builder) Config

func (b *Builder) Config(config *Config) *Builder

func (*Builder) Logger

func (b *Builder) Logger(logger Logger) *Builder

type Config

type Config struct {
	Url             string
	MaxConnIdleTime time.Duration
	MaxConns        int32
	MinConns        int32
}

type Logger

type Logger interface {
	LogError(ctx context.Context, errs ...error)
	LogInfo(ctx context.Context, messages ...string)
}

type PostgreSQL

type PostgreSQL struct {
	// contains filtered or unexported fields
}

func (*PostgreSQL) ConnPool

func (pg *PostgreSQL) ConnPool() *pgxpool.Pool

func (*PostgreSQL) Start

func (pg *PostgreSQL) Start(ctx context.Context) error

func (*PostgreSQL) Stop

func (pg *PostgreSQL) Stop(ctx context.Context) error

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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