Base générale d'UI
This commit is contained in:
@ -11,6 +11,7 @@ type Config struct {
|
||||
Debug bool
|
||||
HTTP HTTPConfig
|
||||
Gitea GiteaConfig
|
||||
Data DataConfig
|
||||
}
|
||||
|
||||
type HTTPConfig struct {
|
||||
@ -29,6 +30,10 @@ type GiteaConfig struct {
|
||||
APIBaseURL string
|
||||
}
|
||||
|
||||
type DataConfig struct {
|
||||
DBPath string
|
||||
}
|
||||
|
||||
// NewFromFile retrieves the configuration from the given file
|
||||
func NewFromFile(filepath string) (*Config, error) {
|
||||
config := NewDefault()
|
||||
@ -52,9 +57,12 @@ func NewDefault() *Config {
|
||||
Debug: false,
|
||||
HTTP: HTTPConfig{
|
||||
Address: ":3000",
|
||||
PublicDir: "${GITEA_APP_PUBDIR}",
|
||||
PublicDir: "${GITEAKAN_HTTP_PUBDIR}",
|
||||
},
|
||||
Gitea: GiteaConfig{},
|
||||
Data: DataConfig{
|
||||
DBPath: "${GITEAKAN_DATA_DBPATH}",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user