Have got site creation working
This commit is contained in:
parent
4ecc12f035
commit
f8e7ea482b
15 changed files with 281 additions and 11 deletions
22
config/config.go
Normal file
22
config/config.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package config
|
||||
|
||||
import "path/filepath"
|
||||
|
||||
type Config struct {
|
||||
DatabaseURL string `env:"DATABASE_URL"`
|
||||
|
||||
DataDir string `env:"DATA_DIR"`
|
||||
DataStagingDir string `env:"DATA_STAGING_DIR,default=staging"`
|
||||
}
|
||||
|
||||
func Load() (Config, error) {
|
||||
return Config{
|
||||
DatabaseURL: "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable",
|
||||
DataDir: "build/data",
|
||||
DataStagingDir: "staging",
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c Config) StagingDir() string {
|
||||
return filepath.Join(c.DataDir, c.DataStagingDir)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue