Categorygithub.com/indece-official/go-gousu-postgres
modulepackage
1.4.0
Repository: https://github.com/indece-official/go-gousu-postgres.git
Documentation: pkg.go.dev

# README

PostgreSQL-Integration for Go Universal Service Utilities

Full docu for go-gousu on https://github.com/indece-official/go-gousu

GoDoc

Usage

Config flags

FlagEnv-VarTypeDefaultDescription
postgres_hostPOSTGRES_HOSTstring"127.0.0.1"DB-Server hostname or ip
postgres_portPOSTGRES_PORTint5432DB-Server port
postgres_userPOSTGRES_USERstring""User for authentication against db server
postgres_passwordPOSTGRES_PASSWORDstring""Password for authentication against db server
postgres_databasePOSTGRES_DATABASEstring""Database to use on db server
postgres_max_retriesPOSTGRES_MAX_RETRIESint10Max number of retries before connecting to db fails
postgres_retry_intervalPOSTGRES_RETRY_INTERVALint6Interval in seconds between retrying to connect to db
postgres_max_idle_connsPOSTGRES_MAX_IDLE_CONNSint0Maximum number of idle connections (0 is unlimited)
postgres_max_open_connsPOSTGRES_MAX_OPEN_CONNSint0Maximum number of open connections (0 is unlimited)

# Functions

NewMockService creates a new initialized instance of MockService.
NewServiceBase creates a new instance of postgres-service, should be used instead of generating it manually.

# Constants

ServiceName defines the name of postgres service used for dependency injection.

# Structs

MockService for simply mocking IService.
Options can contain parameters passed to the postgres service.
Service provides the interaction with the postgresql database.

# Interfaces

IService defined the interface of the postgresql database service.