db

package
v0.0.0-...-0fda810 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) (*sql.DB, error)

New instantiates a new DB instance based on the configuration

Types

type Config

type Config struct {
	Address     string      `json:"address"`
	Connections Connections `json:"connections"`
}

Config represents the DB coonection information

func (Config) Validate

func (c Config) Validate() error

Validate that the config object is correct

type Connections

type Connections struct {
	MaxLifetime int `json:"maxLifetime"`
	MaxOpen     int `json:"maxOpen"`
	MaxIdle     int `json:"maxIdle"`
}

Connections stores the DB connection information

Jump to

Keyboard shortcuts

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