postgres

package module
v0.0.0-...-798bc02 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	PostgresHost       string `required:"true"`
	PostgresUser       string `required:"true"`
	PostgresPassword   string `required:"true"`
	PostgresPort       int    `default:"5432"`
	PostgresDb         string `required:"true"`
	PostgresRequireSSL string `default:"require"`

	Connection *sql.DB
}

Database : The configuration for Postgres

func (Database) CheckConnection

func (db Database) CheckConnection() (result string, err error)

CheckConnection : Check if the connection to the database is succesfull

func (Database) CloseConnection

func (db Database) CloseConnection()

CloseConnection : Disconnect the connector from the database

func (Database) Connect

func (db Database) Connect() (err error)

Connect : Connect to the remote database

Jump to

Keyboard shortcuts

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