postgres_db

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHost        = "0.0.0.0"
	DefaultPort        = 5432
	DefaultDbName      = "postgres"
	DefaultUser        = "postgres"
	DefaultPassword    = "password"
	DefaultSSLMode     = "allow"
	DefaultLogLevel    = gorm_logger.Error
	DefaultAutoMigrate = false
)

Variables

This section is empty.

Functions

func InitiateModule

func InitiateModule(scope string) fx.Option

Types

type Config

type Config struct {
	Host        string
	Port        int
	DBName      string
	User        string
	Password    string
	SSLMode     string
	LogLevel    gorm_logger.LogLevel
	AutoMigrate bool
}

type Database

type Database struct {
	// contains filtered or unexported fields
}

func (*Database) AutoMigrate

func (d *Database) AutoMigrate(models []interface{})

func (*Database) GetDB

func (d *Database) GetDB() *gorm.DB

type Params

type Params struct {
	fx.In

	Lifecycle fx.Lifecycle
	Logger    *zap.Logger
}

Jump to

Keyboard shortcuts

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