database

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(o *Options) (db *gorm.DB, err error)

NewDatabase 初始化数据库

func Provide

func Provide() fx.Option

Types

type Options

type Options struct {
	Type               string
	DSN                string `yaml:"dsn"`
	Debug              bool
	SetMaxIdleConns    int
	SetMaxOpenConns    int
	SetConnMaxLifetime int
}

Options is configuration of database

func NewOptions

func NewOptions(v *viper.Viper, logger *zap.Logger) (*Options, error)

Jump to

Keyboard shortcuts

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