db

package
v0.0.0-...-035dfa4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package db provides utilities to configure and connect to a database

Package db provides utilities to configure and connect to a database

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	ConnStr() string
	DbName() string
}

Config interface defines methods for retreiving config information

func NewConfig

func NewConfig() Config

NewConfig constructs and returns a new Config

type Connection

type Connection interface {
	DB() *gorm.DB
}

Connection interface defines a method for retrieving the *gorm.DB

func NewConnection

func NewConnection(cfg Config) (Connection, error)

NewConnection takes a db.Config and returns a Connection and an error

type ConnectionError

type ConnectionError struct{}

ConnectionError custom error type

func (*ConnectionError) Error

func (ce *ConnectionError) Error() string

Error implements the error interface

Jump to

Keyboard shortcuts

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