postgres

package module
v0.0.0-...-472bd46 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli

type Cli struct {
	*gorm.DB
}

func Connect

func Connect(options ...Option) (*Cli, error)

type LogLevel

type LogLevel int

LogLevel log level

const (
	// Silent silent log level
	Silent LogLevel = iota + 1
	// Error error log level
	Error
	// Warn warn log level
	Warn
	// Info info log level
	Info
)

type Option

type Option func(*option)

func WithAuth

func WithAuth(user, password string) Option

func WithDatabase

func WithDatabase(database string) Option

func WithHost

func WithHost(host string) Option

func WithLogLevel

func WithLogLevel(lv LogLevel) Option

func WithMaxIdleConns

func WithMaxIdleConns(num int) Option

The default max idle connections is currently 2.

func WithMaxOpenConns

func WithMaxOpenConns(num int) Option

func WithPort

func WithPort(port int) Option

func WithSSLMode

func WithSSLMode(sslmode bool) Option

Jump to

Keyboard shortcuts

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