database

package
v0.0.0-...-5cf9733 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAlias = "default"

Functions

This section is empty.

Types

type Database

type Database struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func New

func New(drive DriverInterface, config *gorm.Config, options ...Options) (*Database, error)

func (Database) WithSlaveDB

func (d Database) WithSlaveDB(sources, replicas []gorm.Dialector) error

WithSlaveDB ...

type DriverInterface

type DriverInterface interface {
	Instance() gorm.Dialector
}

type Options

type Options interface {
	// contains filtered or unexported methods
}

func WithConnMaxIdleTime

func WithConnMaxIdleTime(connMaxIdleTime time.Duration) Options

func WithConnMaxLifetime

func WithConnMaxLifetime(connMaxLifetime time.Duration) Options

func WithMaxIdleConn

func WithMaxIdleConn(maxIdleConn int) Options

func WithMaxOpenConn

func WithMaxOpenConn(maxOpenConn int) Options

type OptionsFunc

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

Directories

Path Synopsis
driver

Jump to

Keyboard shortcuts

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