config

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2015 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseGooseYAML

func ParseGooseYAML(path string) (conf map[string]Database, err error)

ParseGooseYAML will parse the entire goose database configuration file.

Types

type Database

type Database struct {
	Driver   string `json:"driver"`
	Host     string `json:"host"`
	Port     int64  `json:"port"`
	Name     string `json:"name"`
	User     string `json:"user"`
	Password string `json:"password"`
	SSLMode  string `json:"ssl_mode"`
}

Database contains the fields needed to connect to a database.

func ParseConfig

func ParseConfig(filename string) (Database, error)

Parse will create a Database using the file at the given path.

func ParseGooseDatabase

func ParseGooseDatabase(path, name string) (c Database, err error)

ParseGooseDatabase will parse a specific database name in the goose configuration file.

func ParseTestConfig

func ParseTestConfig(filename string) (Database, error)

ParseTestConfig varies from the default ParseConfig by defaulting to the Travis CI credentials if the given config returned nothing.

func (Database) Credentials

func (db Database) Credentials() string

Credentials with return a string of credentials appropriate for Go's sql.Open function

type GooseConfig

type GooseConfig map[string]struct {
	Driver string
	Open   string
}

GooseConfig is a representation of database configurations for the goose migration tool: https://bitbucket.org/liamstask/goose

Jump to

Keyboard shortcuts

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