database

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func ConnMaxLifetime

func ConnMaxLifetime(d time.Duration) Option

func Driver

func Driver(name string) Option

func DriverOption

func DriverOption(opts ...interface{}) Option

func Logger

func Logger(logger log.Logger) Option

func Logging

func Logging(enabled bool) Option

func MaxIdleConns

func MaxIdleConns(n int) Option

func MaxOpenConns

func MaxOpenConns(n int) Option

func Retry

func Retry(delay time.Duration, timeout time.Duration) Option

func Table

func Table(name string) Option

type Options

type Options struct {
	Driver        string
	TableName     string
	Logging       bool
	Logger        log.Logger
	RetryDelay    time.Duration
	RetryTimeout  time.Duration
	DriverOptions []interface{}

	// options to connection pool
	MaxIdleConns    int
	MaxOpenConns    int
	ConnMaxLifetime time.Duration
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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