# README
PostgreSQL-Integration for Go Universal Service Utilities
Full docu for go-gousu on https://github.com/indece-official/go-gousu
Usage
Config flags
Flag | Env-Var | Type | Default | Description |
---|---|---|---|---|
postgres_host | POSTGRES_HOST | string | "127.0.0.1" | DB-Server hostname or ip |
postgres_port | POSTGRES_PORT | int | 5432 | DB-Server port |
postgres_user | POSTGRES_USER | string | "" | User for authentication against db server |
postgres_password | POSTGRES_PASSWORD | string | "" | Password for authentication against db server |
postgres_database | POSTGRES_DATABASE | string | "" | Database to use on db server |
postgres_max_retries | POSTGRES_MAX_RETRIES | int | 10 | Max number of retries before connecting to db fails |
postgres_retry_interval | POSTGRES_RETRY_INTERVAL | int | 6 | Interval in seconds between retrying to connect to db |
postgres_max_idle_conns | POSTGRES_MAX_IDLE_CONNS | int | 0 | Maximum number of idle connections (0 is unlimited) |
postgres_max_open_conns | POSTGRES_MAX_OPEN_CONNS | int | 0 | Maximum 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.