config

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init added in v0.7.0

func Init() (command.Options, error)

Init reads in config file and returns a commands/Options instance.

Types

type Config

type Config struct {
	Database struct {
		Host     string `default:"127.0.0.1"`
		Port     string `validate:"required"`
		DB       string `validate:"required"`
		User     string `validate:"required"`
		Password string `validate:"required"`
		Driver   string `validate:"required"`
		SSL      string `default:"disable"`
	}
	// contains filtered or unexported fields
}

Config struct is used to store the db connection data.

func Get

func Get() *Config

Get returns a config object with the db connection data already in place.

func (*Config) Driver

func (c *Config) Driver() string

Driver returns the db driver from config.

func (*Config) GetDBConnStr

func (c *Config) GetDBConnStr() string

GetDBConnStr returns the connection string.

func (*Config) GetMigration

func (c *Config) GetMigration() string

GetMigration return up or down string to instruct the program if it should migrate database up or down.

func (*Config) GetSQLXDBConnStr added in v0.2.0

func (c *Config) GetSQLXDBConnStr() string

GetSQLXDBConnStr returns the connection string.

func (*Config) GetTestDBConnStr

func (c *Config) GetTestDBConnStr() string

GetTestDBConnStr returns the test connection string.

Jump to

Keyboard shortcuts

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