postgresrepo

package
v0.0.0-...-db5c5b6 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(config Config) (*sql.DB, error)

func NewFromConfig

func NewFromConfig(config Config) (*postgresRepository, error)

func NewFromDB

func NewFromDB(db *sql.DB) (*postgresRepository, error)

Types

type Config

type Config struct {
	Host       string
	Port       string
	User       string
	Password   string
	DBName     string
	SearchPath string
}

Config holds the state for a PostgreSQL DB config.

func NewConfigFromEnvironment

func NewConfigFromEnvironment() (Config, error)

NewConfigFromEnvironment loads a Postgres config from environment variables.

func (Config) DataSourceName

func (c Config) DataSourceName() string

DataSourceName returns the DSN for a PostgreSQL DB.

Jump to

Keyboard shortcuts

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