database

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	KeyPsqlHost        = "UBIQUITY_DB_PSQL_HOST"
	KeyPsqlUser        = "UBIQUITY_DB_USERNAME"
	KeyPsqlPassword    = "UBIQUITY_DB_PASSWORD"
	KeyPsqlDbName      = "UBIQUITY_DB_NAME"
	KeyPsqlPort        = "UBIQUITY_DB_PSQL_PORT"
	KeyPsqlTimeout     = "UBIQUITY_DB_CONNECT_TIMEOUT"
	KeyPsqlSslMode     = "UBIQUITY_DB_SSL_MODE"
	KeyPsqlSslRootCert = "UBIQUITY_DB_SSL_ROOT_CERT"
)
View Source
const DBVolumeNameSuffix = "ibm-ubiquity-db"

Variables

View Source
var VolumeNameSuffix = utils.GetEnv(keyPsqlDbPVName, DBVolumeNameSuffix)

Functions

func GetPsqlConnectionParams

func GetPsqlConnectionParams(hostname string) string

func GetPsqlSslParams

func GetPsqlSslParams() string

func GetPsqlWithPassowrdStarred

func GetPsqlWithPassowrdStarred(psql string) string

func InitPostgres

func InitPostgres(hostname string) func()

func InitTestCorrect added in v1.2.0

func InitTestCorrect() func()

func InitTestError

func InitTestError() func()

func Initialize

func Initialize() func()

func IsDatabaseVolume

func IsDatabaseVolume(volName string) bool

func RegisterMigration

func RegisterMigration(obj interface{})

func UnregisterAllMigrations

func UnregisterAllMigrations()

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection() Connection

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) GetDb

func (c *Connection) GetDb() *gorm.DB

func (*Connection) Open

func (c *Connection) Open() error

type ConnectionFactory

type ConnectionFactory interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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