postgres

package
v0.0.0-...-9e48597 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 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

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

Types

type PostgresConfig

type PostgresConfig struct {
	Addr     string `env:"KOZMO_PG_ADDR" envDefault:"localhost"`
	Port     string `env:"KOZMO_PG_PORT" envDefault:"5433"`
	User     string `env:"KOZMO_PG_USER" envDefault:"kozmo_cloud"`
	Password string `env:"KOZMO_PG_PASSWORD" envDefault:"kozmo2022"`
	Database string `env:"KOZMO_PG_DATABASE" envDefault:"kozmo_cloud"`
}

Jump to

Keyboard shortcuts

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