pg

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvAddress is the OS env key for PG address
	EnvAddress = "ENV_PG_ADDRESS"

	// EnvUsername is the OS env key for PG username
	EnvUsername = "ENV_PG_USERNAME"

	// EnvPassword is the OS env key for PG password
	EnvPassword = "ENV_PG_PASSWORD"

	// EnvName is the OS env key for PG DB name
	EnvName = "ENV_PG_NAME"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

type Postgres struct {
	Db *pg.DB
}

Postgres type.

func New

func New(i Spec) *Postgres

New creates Postgres instance.

func (*Postgres) CheckConn

func (p *Postgres) CheckConn() error

CheckConn checks connectivity to Postgres.

type Spec

type Spec struct {
	Address  string
	Username string
	Password string
	Name     string
}

Spec represents PG connection details.

Jump to

Keyboard shortcuts

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