postgres

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const RETRY_TIMES = 6

Variables

This section is empty.

Functions

func NewPostgresConnection

func NewPostgresConnection(config *PostgresConfig, logger *zap.SugaredLogger) (*gorm.DB, error)

func NewPostgresConnectionByGlobalConfig added in v0.0.8

func NewPostgresConnectionByGlobalConfig(config *config.Config, logger *zap.SugaredLogger) (*gorm.DB, error)

Types

type PostgresConfig

type PostgresConfig struct {
	Addr     string `env:"ILLA_SUPERVISOR_PG_ADDR" envDefault:"localhost"`
	Port     string `env:"ILLA_SUPERVISOR_PG_PORT" envDefault:"5432"`
	User     string `env:"ILLA_SUPERVISOR_PG_USER" envDefault:"illa_supervisor"`
	Password string `env:"ILLA_SUPERVISOR_PG_PASSWORD" envDefault:"illa2022"`
	Database string `env:"ILLA_SUPERVISOR_PG_DATABASE" envDefault:"illa_supervisor"`
}

Jump to

Keyboard shortcuts

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