database

package
v0.1.4-alpha-deployment1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(conf Config) (*sqlx.DB, error)

NewConnection creates a new database connection

func StatusCheck

func StatusCheck(ctx context.Context, db *sqlx.DB) error

StatusCheck returns nil if it can successfully talk to the database. It returns a non-nil error otherwise.

Types

type Config

type Config struct {
	Host       string
	Port       int
	Database   string
	Username   string
	Password   string
	DisableTLS bool
	CertPath   string
	Logger     sqldblogger.Logger
}

func (Config) URL

func (c Config) URL() *url.URL

URL returns database config in URL presentation

Jump to

Keyboard shortcuts

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