db

package
v0.0.0-...-f1dd9c7 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

database implementations

db package contains all database implementations this application will need sc-db defines interaction with the SoulCycle central database

Index

Constants

View Source
const (
	// Database "types"
	DBTypeFC = "fc-db"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	// Close is used to call a `Close` method of the underlying database driver
	Close() error
	// GetInstance returns an internal sqlx.DB instance to allow
	// for direct access to the database
	GetInstance() *sqlx.DB
	// SetInstance sets an internal sqlx.DB instance to allow
	// for direct access to the database
	SetInstance(*sqlx.DB) DB
	// String returns the "type" of database as a string - used in health checks
	String() string
	// Ready checks if the DB is "ready" - used in health checks
	Ready() error
}

Interface that all database implementations must fulfill

func NewFCDB

func NewFCDB() DB

NewSCDB creates and returns a new instance of a SoulCycle DB

type DSNConfig

type DSNConfig struct {
	Username     string       // The username to use when connecting to the DB server
	Password     string       // The password to use when connecting to the DB server
	DatabaseName string       // The name of the database to use
	TCP          DSNConfigTCP // Struct containing information for TCP connections
	Timeout      int          // The max time (in seconds) to wait for operations to complete
	Dialect      string       // The database dialect to use
}

Struct representing configuration settings that should be used to create a database DSN string

type DSNConfigTCP

type DSNConfigTCP struct {
	Host string
	Port int
}

Struct containing information for TCP connections

Jump to

Keyboard shortcuts

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