postgres

package
v0.0.0-...-d55fa79 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresConn

type PostgresConn struct {
	ConnectString string
	SqlClient     *sql.DB
}

func NewPostgresConnection

func NewPostgresConnection(c models.PostgresConfig, l *zerolog.Logger) (db *PostgresConn, err error)

NewPostgresConnection - returns a PostgresConn connection and its conenct string for reference. This can then be passed down through the service so that multiple connections do need to be made unncessarily.

type Postgreser

type Postgreser interface {
	AllTasks() ([]models.Task, error)
	EmployeeByID(ID string) (models.Employee, error)
	EmployeeByNickname(nickname string) (models.Employee, error)
	AllEmployees() ([]models.Employee, error)
}

func New

func New(
	conn *PostgresConn,
	l *zerolog.Logger,
) Postgreser

Jump to

Keyboard shortcuts

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