repo

package
v0.0.0-...-b26f218 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host          string
	Port          int
	Name          string
	User          string
	Pass          string
	MaxIdleConns  int
	MaxOpenConns  int
	MigrationPath string
}

func (*Config) FormatDSN

func (c *Config) FormatDSN() string

type Ctx

type Ctx = context.Context

type Repo

type Repo struct {
	DB       *sqlx.DB
	ReformDB *reform.DB
	// contains filtered or unexported fields
}

func New

func New(cfg *Config, logger *structlog.Logger) (*Repo, error)

func (*Repo) Close

func (r *Repo) Close()

Close closes connection to DB.

func (*Repo) Tx

func (r *Repo) Tx(ctx Ctx, opts *sql.TxOptions, f func(*sqlx.Tx) error) (err error)

Jump to

Keyboard shortcuts

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