Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DBConfigFilename is the filename for the database config file DBConfigFilename = "database.toml" // AppConfigFilename is the filename for the app config file AppConfigFilename = "config.toml" )
Variables ¶
View Source
var AppFS = afero.NewOsFs()
AppFS is a handle to the filesystem in use
Functions ¶
func GetBasePath ¶ added in v1.0.0
GetBasePath returns the full path to the custom sqlboiler template files folder used with the sqlboiler --replace flag.
Types ¶
type AppConfig ¶
type AppConfig struct {
DefaultEnv string `toml:"env"`
}
AppConfig holds the relevant generated app config.toml file variables
type Configuration ¶
type Configuration struct {
// AppPath is the path to the project, set using the init function
AppPath string
// AppName is the name of the application, derived from the path
AppName string
// AppEnvName is the name of the app in environment variable prefix format
// for example "MYAPP" instead of "MyApp".
AppEnvName string
// ActiveEnv is the environment mode currently set by "env" in config.toml
// or APPNAME_ENV environment variable. This mode indicates what section of
// config variables to to load into the config structs.
ActiveEnv string
// ModeViper is a *viper.Viper that has been initialized to:
// Load the active environment section of the AppPath/database.toml file
// Load environment variables with a prefix of APPNAME
// Replace "-" with "_" in environment variable names
ModeViper *viper.Viper
}
Configuration holds app state variables
func InitializeP ¶
func InitializeP() *Configuration
InitializeP the config but panic if anything goes wrong
func (*Configuration) CheckEnv ¶
func (c *Configuration) CheckEnv() error
CheckEnv outputs an error if no ActiveEnv is found
type DBConfig ¶
type DBConfig struct {
DB string
Host string
Port int
DBName string
User string
Pass string
SSLMode string
// Other SQLBoiler flags
Blacklist []string
Whitelist []string
Tag []string
Replacements []string
BaseDir string
Output string
PkgName string
Schema string
TinyintNotBool bool
NoAutoTimestamps bool
Debug bool
NoHooks bool
NoTests bool
Wipe bool
}
DBConfig holds the configuration variables contained in the database.toml file for the environment currently loaded (obtained from GetDatabaseEnv())
Click to show internal directories.
Click to hide internal directories.