db

package
v1.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromConfiguration

func FromConfiguration(configuration *Configuration) (*sqlx.DB, error)

func Module

func Module(c *di.Container)

func Setup

func Setup(dbSourceURL string) (*sqlx.DB, error)

func SetupWithTimeout

func SetupWithTimeout(dbSourceURL string, timeout time.Duration) (*sqlx.DB, error)

Types

type Configuration

type Configuration struct {
	URL            flags.URL     `long:"url" description:"Database URL" required:"true" default:"postgres://mash:mash@127.0.0.1:5432/mash?sslmode=disable"`
	ConnectTimeout time.Duration `long:"connect-timeout" description:"Maximum time to wait for a connection to the database" default:"5s"`
}

Jump to

Keyboard shortcuts

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